Re: [urgent] update-fontlang new checks
(CC'ing you because of the urgency)
Norbert Preining <firstname.lastname@example.org> wrote:
> As discussen in the IRC meeting today we want to have another check in
> user-mode of update-* scripts. Rational: Therespective file is normally
> generated in TEXMFVAR, which is in usermode normally .texmf-var. Now
> there could be the same file in TEXMFCONFIG, .texmf-config which will
> shadow the former one, the one in TEXMFVAR.
I didn't check whether it would effectively shadow the one in TEXMFVAR
(I don't remember the proper kpse incantation!), but trusting that, I
agree there is a usability problem.
> We decided that the update-* scripts should still continue, but give a
> The first change defines an additional PATH_COMPONENT:
Looks correct, but you can factor out the:
since it's the same setting in all three cases.
> NOTE NOTE NOTE: I believe this was also a bug in the current version: It
> which for update-language was wrong, as it put the language.dat into
> texmfvar/web2c/language.dat, and I don't believe it would be found
> there. So I changed this, too.
I agree. In system-wide mode, it would go to
TEXMFSYSVAR/tex/generic/config/, whereas in user-specific mode, it would
go to TEXMFVAR/web2c/. That is not consistent, at best.
> @@ -409,7 +415,26 @@
> texmfvar=$(kpsewhich --expand-path '$TEXMFVAR')
> if ! echo "$texmfvar" | grep -e ':'; then
> - output_file="$texmfvar/web2c/$DEFAULT_OUTPUTFILE_BASENAME"
> + output_file="$texmfvar/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME"
> + # it could be that there is a DEFAULT_OUTPUTFILE_BASENAME file
> + # in TEXMFCONFIG, which would be found instead of the
> + # output_file. So we check for this and give a warning in case
> + # the created file would be shadowed.
> + OLDIFS="$IFS"
> + IFS=:
> + for d in "$texmfconfig"; do
> + if [ -r "$d/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME" ]; then
> + printf "\
> +You are about to generate the file
> + $output_file
> +but at the same time you have a file
> + $d/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME
> +which will shadow the former one. We will continue generating the first
> +file, but to make TeX and friends find it, you have to remove the later one.\n"
Not a native english speaker, but I would rather write:
> +which will shadow the former. We'll continue generating the first
> +file, but to let TeX and friends find it, you'll have to remove the
> +second one.\n"
(make or let, don't really like either one here...)
I see no good reason for using printf instead of echo here---except if
you generally dislike echo for its non-portability---but it's correct.
> + fi
> + break
Achtung! If I'm not mistaken, you should put the 'break' *before* the
Oh, wait. I think I would even get rid of the break, because you want to
warn the user for *any* $DEFAULT_OUTPUTFILE_BASENAME file found in
TEXMFCONFIG, since *any* of them would shadow the one in TEXMFVAR that
we are going to create.
> + done
> + IFS="$OLDIFS"
> # We don't know what to do in this case, therefore: do nothing unless
> # the output file is specified with the correponding option.