2012-04-27 15:49:04 +00:00
committed by Git OBS Bridge
parent 515c8b107e
commit e332fee402
5 changed files with 314 additions and 847 deletions

View File

@@ -178,30 +178,18 @@
# The supporting scripts:
: ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`}
--- texk/kpathsea/mktexlsr
+++ 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]...
+++ texk/kpathsea/mktexlsr 2012-04-27 14:06:45.670065918 +0000
@@ -36,6 +36,9 @@ Kpathsea manual available at http://tug.
Report bugs to tex-k@tug.org.
"
+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 +66,9 @@ if test "$DOSISH" = "no"; then SEP=':';
# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
# directories in path lists whereas Unix uses `:'. Make an exception for
# Cygwin, which pretends to be UNIX.
@@ -51,6 +54,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%/*[^/][^/]*$%%'`
@@ -211,7 +199,7 @@
case $dirname in
"") # Do nothing
;;
@@ -134,6 +152,7 @@ old_ls_R_magic='% ls-R -- maintained by
@@ -134,6 +140,7 @@ old_ls_R_magic='% ls-R -- maintained by
shift
}
@@ -219,7 +207,7 @@
for TEXMFLS_R in "$@"; do
# Prepend cwd if the directory was relative.
case "$TEXMFLS_R" in
@@ -163,12 +182,23 @@ for TEXMFLS_R in "$@"; do
@@ -163,12 +170,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
@@ -245,7 +233,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 +197,23 @@ for TEXMFLS_R in "$@"; do
# Skip if we cannot write the file:
@@ -273,7 +261,7 @@
+ 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
# 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
@@ -202,15 +227,20 @@ for TEXMFLS_R in "$@"; do
vc_dirs='\.\(bzr\|git\|hg\|svn\)\|_darcs'
@@ -287,12 +275,9 @@
# To be really safe, a loop.
until PERMS=`kpsestat = "$db_file"`; do sleep 1; done
chmod $PERMS "$db_file_tmp"
- rm -f "$db_file"
- mv "$db_file_tmp" "$db_file"
+ if test -O "$db_file" ; then
+ # We're the owner of the $db_file
+ mv "$db_file_tmp" "$db_file"
+ else
- rm -f "$db_file"
- mv "$db_file_tmp" "$db_file"
+ if test -w "$db_file" ; then
+ # Sticky bit is set see line 200
+ # Temporary unset the noclobber option at line 40
+ set +o noclobber