diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-17 21:54:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-17 21:54:02 +0000 |
commit | a79da32935834f42057e258d22bb90e8ed7e65aa (patch) | |
tree | 5a572359444a579b30b73e8a3844b01afe47ff22 /Master/tlpkg/bin | |
parent | 5698059f8aa4109c8f98d166ef398f04c515b022 (diff) |
webquiz deref/remove symlinks
git-svn-id: svn://tug.org/texlive/trunk@50431 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/ctan2tl | 3 | ||||
-rwxr-xr-x | Master/tlpkg/bin/deref-symlinks | 22 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tl-update-messages | 8 |
3 files changed, 32 insertions, 1 deletions
diff --git a/Master/tlpkg/bin/ctan2tl b/Master/tlpkg/bin/ctan2tl index d14e079eec1..3b274800162 100755 --- a/Master/tlpkg/bin/ctan2tl +++ b/Master/tlpkg/bin/ctan2tl @@ -158,6 +158,9 @@ fi # check for file names differing in case only. find $pkg \( -name .svn \) -prune -o -print | sort -f | uniq -i -d >&2 +# check for symlinks +find $pkg -type l -ls | grep -v /Master/bin | sort >&2 + # show list of files (and tee to tmp). find $pkg \! -type d -printf "%TY%Tm%Td.%TH%TM %p\n" | sort -k2 \ | tee ${TMPDIR-/tmp}/ctan2tl.files diff --git a/Master/tlpkg/bin/deref-symlinks b/Master/tlpkg/bin/deref-symlinks new file mode 100755 index 00000000000..3b1dbd6202f --- /dev/null +++ b/Master/tlpkg/bin/deref-symlinks @@ -0,0 +1,22 @@ +#!/bin/sh +# $Id$ +# Originally written by Karl Berry. Public domain. +# +# Replace symlinks to files with the actual files. +# Symlinks to anything else are not touched. + +if test "x$1" = --save-links; then + savelinks=true +else + savelinks=false +fi + +for f in "$@"; do + test -h "$f" || continue # skip non-symlinks + test -f "$f" || continue # skip links to anything but regular files + + cp --dereference "$f" "$f".file # expand link + mv "$f" "$f".link # move link out of the way + mv -v "$f".file "$f" # replace with regular file + $savelinks || rm "$f".link # remove link unless keeping +done diff --git a/Master/tlpkg/bin/tl-update-messages b/Master/tlpkg/bin/tl-update-messages index 6649b8c0cf1..c44779e1c41 100755 --- a/Master/tlpkg/bin/tl-update-messages +++ b/Master/tlpkg/bin/tl-update-messages @@ -58,6 +58,12 @@ else done fi -rm -f $tmpfile $tmpa $tmpb messages.prev +pwd +ls -l $tmpfile $tmpa $tmpb messages.prev +rm -v $tmpfile $tmpa $tmpb messages.prev + +if test "$failed" != 0; then + echo "$0: exiting with bad status $failed." >&2 +fi exit $failed |