Re: NOT YET: Please unblock texlive-bin
Hi,
Norbert Preining <preining@logic.at> wrote:
>> > #402925: upgrading tetex creates ls-R in user homedir if sudo is used
>> >
>> Known (and fixed) bug in teTeX IIRC. Patch could be copied from there.
>
> Done. I just applied the patch in the bug report, test are coming soon.
If you want to be in sync with tetex, the exact patch I applied there
is:
--- etch.orig/texk/kpathsea/mktexlsr 2006-12-27 23:19:59.000000000 +0100
+++ etch/texk/kpathsea/mktexlsr 2006-12-27 23:34:26.000000000 +0100
@@ -73,6 +73,9 @@
'
set x `kpsewhich --show-path=ls-R | tr : '
' | sort | uniq`; shift
+ if test "`id -u`" -eq 0; then
+ NOROOTHOME=true
+ fi
IFS=$OIFS
}
@@ -80,6 +83,10 @@
# Prepend cwd if the directory was relative.
case "$TEXMFLS_R" in
"") continue ;; # Strictly speaking, it is an error if this case is taken.
+ $HOME/*) if test -n "$NOROOTHOME"; then
+ tty -s && echo "$progname: Skipping $TEXMFLS_R" >&2
+ continue
+ fi ;;
/* | [A-z]:/*) ;;
*) TEXMFLS_R="`pwd`/$TEXMFLS_R"
esac
(I cannot guarantee it applies as is, because I manually extracted it
from patch-deb, and the actual patch to mktexlsr contained therein is
longer than that; BTW, maybe there are things texlive should borrow from
there, too...)
It's really the same patch, with just a message telling the user when we
are skipping something. Ah, and I also patched the man page to mention
the change in behavior:
--- etch.orig/texk/kpathsea/mktexlsr.man 2006-12-27 23:19:59.000000000 +0100
+++ etch/texk/kpathsea/mktexlsr.man 2006-12-27 23:35:05.000000000 +0100
@@ -1,4 +1,4 @@
-.TH MKTEXLSR 1 "4 January 1998" "Kpathsea @VERSION@"
+.TH MKTEXLSR 1 "27 December 2006" "Kpathsea @VERSION@"
.\"=====================================================================
.if n .ds MP MetaPost
.if t .ds MP MetaPost
@@ -44,3 +44,12 @@
.B --version
.rb
Print version information and exit.
+.\"=====================================================================
+.SH NOTES
+When called by root with no arguments, \fBmktexlsr\fP in Debian ignores
+TEXMF trees under \fI$HOME\fP. This is to avoid creating undesirable files
+such as \fI/root/texmf/ls-R\fP when doing usual maintainance (it is generally
+a bad idea to work with TeX as root, therefore having a file such as
+\fI/root/texmf/ls-R\fP in the first place is rather pointless). If you really
+want to update the ls-R databases for such TEXMF trees, simply list them
+explicitely on the command-line.
Regards,
--
Florent
Reply to: