aboutsummaryrefslogtreecommitdiff
path: root/mksymlinks
diff options
context:
space:
mode:
Diffstat (limited to 'mksymlinks')
-rw-r--r--mksymlinks53
1 files changed, 53 insertions, 0 deletions
diff --git a/mksymlinks b/mksymlinks
new file mode 100644
index 0000000..6817fbd
--- /dev/null
+++ b/mksymlinks
@@ -0,0 +1,53 @@
1#!/bin/sh
2#
3# $TeX Live for OpenBSD, 2024/03/21 $
4
5TLBINDIR=$(dirname $0)
6REL=../..
7LSTFILE=$(mktemp)
8AMFILE=$(mktemp)
9
10if [[ ! -w ${TLBINDIR} ]]; then
11 echo "You do not have write permissions to ${TLBINDIR}"
12 exit 1
13fi
14
15svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/scripts.lst \
16 ${LSTFILE} || exit 1
17
18svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/Makefile.am \
19 ${AMFILE} || exit 1
20bin_links=$(awk '/bin_links = \\/,/^$/' ${AMFILE} | awk NF | grep -v bin_links | sed 's,\\,,')
21
22cd ${TLBINDIR} && \
23 for s in $(cat ${LSTFILE} | grep -v \')
24 do
25 target=`basename $s | tr '[A-Z]' '[a-z]'`
26 echo "$s" | grep 'memoize-.*\.' >/dev/null \
27 || echo "$s" | grep 'listings-ext.sh' >/dev/null \
28 || target=`echo $target | sed 's,\.[^/]*$,,'`; \
29 if [[ $1 == "remove" ]];then
30 rm -f $target
31 else
32 rm -f $target
33 echo "creating link '$target' -> '$REL/texmf-dist/scripts/$s'"
34 ln -s $REL/texmf-dist/scripts/$s $target || exit 1
35 fi
36 done && \
37 for s in ${bin_links}
38 do
39 link=`echo $s | sed 's,.*:,,'`
40 file=`echo $s | sed 's,:.*,,'`
41 if [[ $1 == "remove" ]];then
42 rm -f $link
43 else
44 rm -f $link
45 echo "creating link '$link' -> '$file'"
46 ln -s $file $link || exit 1
47 fi
48 done
49
50if [[ $1 == "remove" ]]
51then
52 echo "all symlinks have been removed. why did you do this?"
53fi