diff options
author | Robert Alessi <alessi@robertalessi.net> | 2024-03-21 19:39:38 +0100 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2024-03-21 19:39:38 +0100 |
commit | 4a64475651906e3a3d408960dbfb189e333bc3f3 (patch) | |
tree | 7bdab26467a29ecba78f5a884509ed5dd21baa76 /mksymlinks | |
parent | 983e7d9fe51bc4245b0775bb13857ac5a2c46dc2 (diff) | |
download | texlive-openbsd-4a64475651906e3a3d408960dbfb189e333bc3f3.tar.gz |
added mksymlinks
Diffstat (limited to 'mksymlinks')
-rw-r--r-- | mksymlinks | 53 |
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 | |||
5 | TLBINDIR=$(dirname $0) | ||
6 | REL=../.. | ||
7 | LSTFILE=$(mktemp) | ||
8 | AMFILE=$(mktemp) | ||
9 | |||
10 | if [[ ! -w ${TLBINDIR} ]]; then | ||
11 | echo "You do not have write permissions to ${TLBINDIR}" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/scripts.lst \ | ||
16 | ${LSTFILE} || exit 1 | ||
17 | |||
18 | svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/Makefile.am \ | ||
19 | ${AMFILE} || exit 1 | ||
20 | bin_links=$(awk '/bin_links = \\/,/^$/' ${AMFILE} | awk NF | grep -v bin_links | sed 's,\\,,') | ||
21 | |||
22 | cd ${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 | |||
50 | if [[ $1 == "remove" ]] | ||
51 | then | ||
52 | echo "all symlinks have been removed. why did you do this?" | ||
53 | fi | ||