diff options
author | Robert Alessi <alessi@robertalessi.net> | 2024-03-24 08:16:05 +0100 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2024-03-24 08:16:05 +0100 |
commit | 6ac720c04e7755a63d3639f9c907a4ee8123c828 (patch) | |
tree | 5adbbbb981827068abf257e000ffa47f3270b0b6 /mkobsdsymlinks | |
parent | cdcc54462ee6812e40322b3d442b9a6395c8f28b (diff) | |
download | texlive-openbsd-6ac720c04e7755a63d3639f9c907a4ee8123c828.tar.gz |
mksymlinks -> mkobsdsymlinks
Diffstat (limited to 'mkobsdsymlinks')
-rw-r--r-- | mkobsdsymlinks | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/mkobsdsymlinks b/mkobsdsymlinks new file mode 100644 index 0000000..efcb780 --- /dev/null +++ b/mkobsdsymlinks | |||
@@ -0,0 +1,59 @@ | |||
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 | which svn 2>&- > /dev/null | ||
16 | if [[ $? -ne 0 ]];then | ||
17 | echo "Please install the subversion package." | ||
18 | exit 1 | ||
19 | fi | ||
20 | |||
21 | svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/scripts.lst \ | ||
22 | ${LSTFILE} || exit 1 | ||
23 | |||
24 | svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/Makefile.am \ | ||
25 | ${AMFILE} || exit 1 | ||
26 | bin_links=$(awk '/bin_links = \\/,/^$/' ${AMFILE} | awk NF | grep -v bin_links | sed 's,\\,,') | ||
27 | |||
28 | cd ${TLBINDIR} && \ | ||
29 | for s in $(cat ${LSTFILE} | grep -v \') | ||
30 | do | ||
31 | target=`basename $s | tr '[A-Z]' '[a-z]'` | ||
32 | echo "$s" | grep 'memoize-.*\.' >/dev/null \ | ||
33 | || echo "$s" | grep 'listings-ext.sh' >/dev/null \ | ||
34 | || target=`echo $target | sed 's,\.[^/]*$,,'`; \ | ||
35 | if [[ $1 == "remove" ]];then | ||
36 | rm -f $target | ||
37 | else | ||
38 | rm -f $target | ||
39 | echo "creating link '$target' -> '$REL/texmf-dist/scripts/$s'" | ||
40 | ln -s $REL/texmf-dist/scripts/$s $target || exit 1 | ||
41 | fi | ||
42 | done && \ | ||
43 | for s in ${bin_links} | ||
44 | do | ||
45 | link=`echo $s | sed 's,.*:,,'` | ||
46 | file=`echo $s | sed 's,:.*,,'` | ||
47 | if [[ $1 == "remove" ]];then | ||
48 | rm -f $link | ||
49 | else | ||
50 | rm -f $link | ||
51 | echo "creating link '$link' -> '$file'" | ||
52 | ln -s $file $link || exit 1 | ||
53 | fi | ||
54 | done | ||
55 | |||
56 | if [[ $1 == "remove" ]] | ||
57 | then | ||
58 | echo "all symlinks have been removed. why did you do this?" | ||
59 | fi | ||