Re: [urgent] update-fontlang new checks
Hi all!
YOU ARE GREAT!!! Thanks for the feed back!
On Mon, 09 Okt 2006, Ralf Stubner wrote:
> Looks good. SYSPATH_BASE is common to all three cases, so one could move
Factored out.
> I am not sure this is the ideal place for this check, since it will only
see below
On Die, 10 Okt 2006, Florent Rougon wrote:
> 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.
Yes it does. Use kpsewhich ...
> Looks correct, but you can factor out the:
>
> SYSPATH_BASE=/var/lib/texmf
Done.
> > + if [ -r "$d/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME" ]; then
>
> or -f...
What would you suggest, oh my POSIX guru ;-)???
> Not a native english speaker, but I would rather write:
Thanks, I reformulated a bit, see below.
> 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.
I remotely remember that I learned this from you after having used echo
for these things ...
> Achtung! If I'm not mistaken, you should put the 'break' *before* the
> 'fi'.
>
> 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.
Very good idea.
Now for the new stuff: I have moved the whole bunch out as Ralf
suggested. It comes now after the sanity checks, so this should happen
in any case.
But there is one more problem I haven't solved, and I am not sure if we
should hurry to find the perfect solution for this: If the user sets the
output_dir to the file in .texmf_config/.... then we might warn in case
even if this is a vain warning.
Although, people calling update-* with output file set via cmd-line
should know that this might not be true, or?
I at least included a check for the most simple case, where the files
are actually the same.
Please comment:
@@ -473,6 +478,31 @@
perform_sanity_checks
+
+# 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.
+if [ $syswide_mode = 0 ]; then
+ OLDIFS="$IFS"
+ IFS=:
+ for d in "$texmfconfig"; do
+ if [ ! "$d/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME" = "$output_file" ] && [ -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'll continue generating the first
+file, but to allow TeX and friends to find it, you'll have to remove the
+second one.\n"
+ # don't break out as we want to warn the user for *every*
+ # shadowing file!
+ fi
+ done
+ IFS="$OLDIFS"
+fi
+
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at> Università di Siena
Debian Developer <preining@debian.org> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BENBURB
The sort of man who becomes a returning officer.
--- Douglas Adams, The Meaning of Liff
Reply to: