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

Bug#298315: fmtutil writes into /root/.texmf-var instead of /var/lib/texmf



Frank Küster <frank@debian.org> schrieb:

> reopen 298315
> retitle 298315 tetex-bin: change from fmtutil to fmtutil-sys breaks depending packages' maintainer scripts
> thanks
[...]
> The reason is in the new title.

So, longer version:  

In order to allow users to easily create their own formats, fmtutil now
puts its output into subdirectories of $HOME, unless it is called as
fmtutil-sys.  The problem with this is that all packages that call
fmtutil in their postinst scripts will create format files in
/root/.texmf-var/web2c instead of /var/lib/texmf/web2c.  By the way, the
unsetting of $HOME in postinst scripts, as I did to address #294197 does
not help - if $HOME is unset, it simply would write into /.texmf-var/,
which is even more ugly.

Even if we do not plan to bring teTeX-3.0 into sarge, I fear it would be
a hard piece of work to make all depending packages use fmtutil-sys.

Therefore I think we should use a Debian-specific patch to the effect
that if fmtutil is run by root, it automatically behaves as if
fmtutil-sys was called (unless instructed otherwise).

I hope it is safe to use something like "test `id -u` = 0".  In this
case we could simply apply such a patch:

--- texk/tetex/fmtutil.orig	2005-03-11 17:19:52.000000000 +0100
+++ texk/tetex/fmtutil	2005-03-11 17:19:52.000000000 +0100
@@ -25,7 +25,13 @@
 #  --cnffile file             set configfile for fmtutil
 #  --fmtdir directory         set destination directory for format files
 ###############################################################################
-
+###############################################################################
+#
+# Debian-specific options:
+# --root-home                Don't use TEXMFSYSVAR, TEXMFSYSCONFIG even when 
+#                            called by root
+#
+###############################################################################
 ###############################################################################
 # program history:
 #   Sa Jan 15 18:13:46 CET 2005 avoid multiple variable assignments in one statement
@@ -83,6 +89,19 @@
 
 cnf=fmtutil.cnf   # name of the config file
 
+if [ `id -u` = 0 ]; then
+  if [ "$1" = "--root-home" ]; then
+    echo
+    echo "$progname: Option --root-home given,"
+    echo "generating formats in /root/.texmf-var."
+    echo
+  else
+    TEXMFVAR="`kpsewhich -var-value TEXMFSYSVAR`"
+    TEXMFCONFIG="`kpsewhich -var-value TEXMFSYSCONFIG`"
+    export TEXMFVAR TEXMFCONFIG
+  fi
+fi
+
 ###############################################################################
 # cleanup()
 #   clean up the temp area and exit with proper exit status
--- texk/tetex/fmtutil.man.orig	2005-03-11 17:19:52.000000000 +0100
+++ texk/tetex/fmtutil.man	2005-03-11 17:23:22.000000000 +0100
@@ -53,6 +53,15 @@
 (not implemented, just for compatibility)
 .IP "\fB--test\fP" 
 (not implemented, just for compatibility)
+.PP
+.SH "DEBIAN-SPECIFIC CHANGES"
+.PP
+In Debian. \fBfmtutil\fP acts on the system-wide format files if it is
+called by root (actually, by numerical UID 0).  If you want to create
+user-specific formats for root, use
+.PP
+.IP "\fB\-\-root\-home\fP"
+Don't use TEXMFSYSVAR, TEXMFSYSCONFIG even when called by root.
 .PP 
 .SH "FILES" 
 .PP 

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer




Reply to: