summaryrefslogtreecommitdiff
path: root/Master/bin/i386-freebsd/texlinks
diff options
context:
space:
mode:
Diffstat (limited to 'Master/bin/i386-freebsd/texlinks')
-rwxr-xr-xMaster/bin/i386-freebsd/texlinks77
1 files changed, 52 insertions, 25 deletions
diff --git a/Master/bin/i386-freebsd/texlinks b/Master/bin/i386-freebsd/texlinks
index f84f55a95bd..48657905634 100755
--- a/Master/bin/i386-freebsd/texlinks
+++ b/Master/bin/i386-freebsd/texlinks
@@ -6,11 +6,15 @@
# the lines given in fmtutil.cnf.
# History:
+# (Further changes in ChangeLog.)
+# Tue Oct 9 14:23:01 BST 2007
+# Added unlink option (-u) to aid OpenBSD package uninstall
+# Edd Barrett <vext01@gmail.com>
# Sun Aug 28 21:41:06 CEST 2005
# remove special cases for csplain,cslatex,pdfcslatex,pdfcsplain
# Fr Apr 8 19:15:05 CEST 2005
# cleanup now has an argument for the return code
-# So Mär 27 18:52:06 CEST 2005
+# So Mar 27 18:52:06 CEST 2005
# honor $TMPDIR, $TEMP and $TMP, not just $TMP
# Mon May 10 20:52:48 CEST 2004
# kpseaccess instead of access
@@ -35,33 +39,30 @@ export PATH
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
cnf=fmtutil.cnf # name of the config file
-version=1169050907 # seconds since `00:00:00 1970-01-01 UTC'
- # date '+%s' (with GNU date)
+version=20080528.1847 # utc timestamp
progname=texlinks
-usage='texlinks [options] [directories]
+usage='Usage: texlinks [OPTION]... [DIRECTORY]...
Create symbolic links format -> engine according to fmtutil setup.
-Valid options:
- --help
- -h show this help text
- --version show version string
- --cnffile file
- -f file use file as config file (default: fmtutil.cnf)
- --verbose
- -v set verbose mode on (default: off)
- --multiplatform
- -m operate in all platform specific directories
+Mandatory arguments to long options are mandatory for short options too.
+ -h, --help show this help text
+ --version show version string
+ -f, --cnffile FILE use FILE as config file (default: fmtutil.cnf)
+ -v, --verbose enable verbose messages (default: off)
+ -m, --multiplatform operate in all platform specific directories
(default: operate only in directory for this platform)
- --silent
- -s silently skip over existing scripts / binaries
- instead of creating a warning
+ -s, --silent silently skip existing scripts / binaries
+ (default: issue warning)
+ -u, --unlink remove symlinks created by texlinks
-directories is an optional list of directories in which to operate.
-If no directories are specified the list of directories depends on the
---multiplatform option.
-'
+The DIRECTORY arguments are an optional list of directories in which to
+operate. If no directories are specified and --multiplatform is
+likewise not specified, the directory of this script itself is used.
+With --multiplatform, all child dirs of an upper-level bin/ dir are used.
+
+Report bugs to tex-k@tug.org.'
###############################################################################
# abort(errmsg)
@@ -140,7 +141,7 @@ install_link()
fi
if test -f $selfautoloc/mf && test -f $selfautoloc/mf-nowin; then
# have both mf and mf-nowin binaries. no link.
- verbose_echo "metafont symlink $src -> $dest skipped (special case)"
+ verbose_echo "skipped metafont symlink $src -> $dest (special case)"
return
fi
fi
@@ -149,7 +150,8 @@ install_link()
case $src in
*/cont-??|*/metafun|*/mptopdf)
- verbose_echo "symlink $src -> $dest skipped (special case)"
+ # context includes wrapper scripts that create/run these.
+ verbose_echo "skipped ConTeXtish symlink $src -> $dest (special case)"
;;
*)
test "x$src" != "x`(ls -ld $src | awk '{print $NF}') 2>/dev/null`" &&
@@ -205,6 +207,24 @@ upd_symlinkdir()
}
###############################################################################
+# rm_link()
+# Delete a previously installed link
+###############################################################################
+rm_link()
+{
+ link=$1;
+ if test -e $link; then
+ if test -h $link; then
+ verbose_do rm -Rf $link
+ else
+ verbose_echo "kept $link, since not a symlink"
+ fi
+ else
+ verbose_echo "skipped $link, non-existent"
+ fi
+}
+
+###############################################################################
# main()
# parse commandline arguments, initialize variables,
# switch into temp. direcrory, execute desired command
@@ -217,6 +237,7 @@ main()
multiplatform=false
verbose=false
+ unlink=false
silent=false
thisdir=`pwd`
: ${KPSE_DOT=$thisdir}; export KPSE_DOT
@@ -232,6 +253,7 @@ main()
--v*|-v) verbose=true;;
--s*|-s) silent=true;;
--m*|-m) multiplatform=true;;
+ --u*|-u) unlink=true;;
-*) errmsg "fmtutil: unknown option \`$1' ignored.";;
*) break;;
esac
@@ -278,9 +300,14 @@ main()
test "x$fmt" = "x$engine" && continue
if test -f "$d/$engine"; then
- install_link "$engine" "$d/$fmt"
+ case $unlink in
+ true)
+ rm_link "$d/$fmt";;
+ *)
+ install_link "$engine" "$d/$fmt";;
+ esac
else
- verbose_echo "$d/$engine: engine does not exist. Skipping..."
+ verbose_echo "skipped $d/$engine, engine does not exist"
fi
# restore positional arguments: