[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[urgent] update-fontlang new checks



Hi all, hi Frank!

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.

We decided that the update-* scripts should still continue, but give a
warning. I implemented some code, but want to ask you for a quick review
first, as I am not completely sure about the possible TEXMFCONFIG
settings. Here is the diff output, with some comments:

The first change defines an additional PATH_COMPONENT:

@@ -29,7 +29,9 @@
     CHECKFILE="$SYSWIDE_CONFDIR/00tex.cnf"
     EXT="cnf"
     MEMORY_DIR=/var/lib/tex-common/language-cnf
-    SYSWIDE_VARD=/var/lib/texmf/tex/generic/config
+    SYSPATH_BASE=/var/lib/texmf
+    PATH_COMPONENT=tex/generic/config
+    SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=language.dat
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
     CC="%"                      # for COMMENTCHAR
@@ -43,7 +45,9 @@
     CHECKFILE="$SYSWIDE_CONFDIR/00updmap.cfg"
     EXT="cfg"
     MEMORY_DIR=/var/lib/tex-common/fontmap-cfg
-    SYSWIDE_VARD=/var/lib/texmf/web2c
+    SYSPATH_BASE=/var/lib/texmf
+    PATH_COMPONENT=web2c
+    SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=updmap.cfg
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
     CC="#"
@@ -56,7 +60,9 @@
     CHECKFILE="$SYSWIDE_CONFDIR/00tex.cnf"
     EXT="cnf"
     MEMORY_DIR=/var/lib/tex-common/fmtutil-cnf
-    SYSWIDE_VARD=/var/lib/texmf/web2c
+    SYSPATH_BASE=/var/lib/texmf
+    PATH_COMPONENT=web2c
+    SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=fmtutil.cnf
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
     CC="#"


This is now the change: We read through all the directories in
TEXMFCONFIG and check whether a file
	$d/$PATH_COMPONENT/$DEFAULT_OUTPUTFILE_BASENAME
is present. This would shadow the default output file name.

NOTE NOTE NOTE: I believe this was also a bug in the current version: It
called:
	output_file="$texmfvar/web2c/$DEFAULT_OUTPUTFILE_BASENAME"
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.

	"$texmfvar/
@@ -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"
+            fi
+            break
+        done
+        IFS="$OLDIFS"
     else
         # We don't know what to do in this case, therefore: do nothing unless
         # the output file is specified with the correponding option.


Please comment on this AS SOON AS POSSIBLE as we want to upload a new
tex-common tomorrow! Thanks a lot!

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
-------------------------------------------------------------------------------
BALLYCUMBER
One of the six half-read books lying somewhere in your bed.
			--- Douglas Adams, The Meaning of Liff



Reply to: