2012-04-23 13:24:05 +00:00
committed by Git OBS Bridge
parent 9fe2414e64
commit 730439ad02
4 changed files with 363 additions and 366 deletions

View File

@@ -178,18 +178,30 @@
# The supporting scripts:
: ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`}
--- texk/kpathsea/mktexlsr
+++ texk/kpathsea/mktexlsr 2011-09-14 10:37:28.867925384 +0000
@@ -15,6 +15,9 @@ version='$Id: mktexlsr 23151 2011-06-27
+++ texk/kpathsea/mktexlsr 2012-04-23 09:29:20.382064991 +0000
@@ -15,6 +15,21 @@ version='$Id: mktexlsr 23151 2011-06-27
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname [OPTION]... [DIR]...
+nobody="$(id -un nobody)"
+if test -n "$nobody" -a "$(id -urn 2> /dev/null)" != "$nobody" && type -p nobody > /dev/null 2>&1 ; then
+ grep -qE 'nobody:[^:]*:[0-9]+:0:0::::' /etc/shadow
+ if test $? -eq 0 ; then
+ echo "$progname: Warning the password of the user nobody has expired." >&2
+ echo " Please use program \`chage' to set maxdays to 99999." >&2
+ echo ""
+ exit 1
+ fi
+ exec nobody $0 ${1+"$@"}
+fi
+
+MKTEXLSR=true; export MKTEXLSR
+set -o noclobber
+
Rebuild ls-R filename databases used by TeX. If one or more arguments
DIRS are given, these are used as the directories in which to build
ls-R. Else all directories in the search path for ls-R files
@@ -51,6 +54,9 @@ if test "$DOSISH" = "no"; then SEP=':';
@@ -51,6 +66,9 @@ if test "$DOSISH" = "no"; then SEP=':';
# be done before kpsewhich can be called, and thus cannot be put into
# mktex.opt.
dirname=`echo $0 | sed 's%/*[^/][^/]*$%%'`
@@ -199,58 +211,15 @@
case $dirname in
"") # Do nothing
;;
@@ -62,6 +68,28 @@ case $dirname in
export PATH ;;
esac
+# Sometimes the scripts and binaries are located elsewhere check this
+# by following the links and extend the path with appropiate dirnames.
+ link=`readlink -f $0`
+dirname=`echo $link | sed 's%/*[^/][^/]*$%%'`
+ cpu=`uname -i|tr '[:upper:]' '[:lower:]' | sed 's/ppc64/ppc/;s/i386/i?86/'`
+ os=`uname -s|tr '[:upper:]' '[:lower:]'`
+ binary=`echo $dirname | sed "s%share%lib%;s%noarch%${cpu}-${os}%"`
+ binary=`echo $binary`
+case "$SEP$PATH$SEP" in
+ *$SEP$dirname$SEP*) dirname="" ;;
+esac
+case $dirname in
+ "") # Do nothing
+ ;;
+ /* | [A-z]:/*) # Absolute name
+ PATH="$dirname$SEP$binary$SEP$PATH"
+ export PATH ;;
+ *) # Relative name
+ PATH="`pwd`/$dirname$SEP`pwd`/$binary$SEP$PATH"
+ export PATH ;;
+esac
+
if tty -s; then verbose=true; else verbose=false; fi
dry_run=false
trees=
@@ -134,6 +162,21 @@ old_ls_R_magic='% ls-R -- maintained by
@@ -134,6 +152,7 @@ old_ls_R_magic='% ls-R -- maintained by
shift
}
+nobody="$(id -un nobody)"
+if test "$(id -ur 2> /dev/null)" = "0" -a -n "$nobody" && type -p nobody > /dev/null 2>&1 ; then
+ grep -qE 'nobody:[^:]*:[0-9]+:0:0::::' /etc/shadow
+ if test $? -eq 0 ; then
+ echo "$progname: Warning the password of the user nobody has expired." >&2
+ echo " Please use program \`chage' to set maxdays to 99999." >&2
+ echo ""
+ exit 1
+ fi
+ runls () { nobody ls -LRa 2>/dev/null; }
+else
+ runls () { ls -LRa 2>/dev/null; }
+fi
+
+cache="`kpsewhich --expand-var='$VARTEXFONTS'`"
for TEXMFLS_R in "$@"; do
# Prepend cwd if the directory was relative.
case "$TEXMFLS_R" in
@@ -163,12 +206,23 @@ for TEXMFLS_R in "$@"; do
@@ -163,12 +182,23 @@ for TEXMFLS_R in "$@"; do
# want to be silent if the directory doesn't exist, since the ls-R
# path ordinarily contains many nonexistent directories.
test -d "$db_dir" || continue
@@ -276,7 +245,7 @@
elif test -s "$db_file" \
&& test "x`sed '1s/
$//;1q' \"$db_file\"`" != "x$ls_R_magic" \
&& test "x`sed '1s/
&& test "x`sed '1s/
$//;1q' \"$db_file\"`" != "x$old_ls_R_magic"; then
@@ -179,16 +209,23 @@ for TEXMFLS_R in "$@"; do
# Skip if we cannot write the file:
@@ -304,12 +273,9 @@
+ echo "$ls_R_magic" >"$db_file_tmp" \
+ || { echo "$progname: could not create file '$db_file_tmp'. Skipping..." >&2; continue; }
# The main task. We put ./: in the output, so top-level files can be
# found via ls-R. Probably irrelevant in practice. The sed command
@@ -200,17 +261,25 @@ for TEXMFLS_R in "$@"; do
# The main task. We put ./: in the output, so top-level files can be
# found via ls-R. Probably irrelevant in practice. The sed command
echo "./:" >>"$db_file_tmp"
vc_dirs='\.\(bzr\|git\|hg\|svn\)\|_darcs'
@@ -202,15 +239,23 @@ for TEXMFLS_R in "$@"; do
vc_dirs='\.\(bzr\|git\|hg\|svn\)\|_darcs'
(cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) \
| sed -e '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^'$vc_dirs'$/d;' \