From 4a64475651906e3a3d408960dbfb189e333bc3f3 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 21 Mar 2024 19:39:38 +0100 Subject: added mksymlinks --- mksymlinks | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 mksymlinks (limited to 'mksymlinks') diff --git a/mksymlinks b/mksymlinks new file mode 100644 index 0000000..6817fbd --- /dev/null +++ b/mksymlinks @@ -0,0 +1,53 @@ +#!/bin/sh +# +# $TeX Live for OpenBSD, 2024/03/21 $ + +TLBINDIR=$(dirname $0) +REL=../.. +LSTFILE=$(mktemp) +AMFILE=$(mktemp) + +if [[ ! -w ${TLBINDIR} ]]; then + echo "You do not have write permissions to ${TLBINDIR}" + exit 1 +fi + +svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/scripts.lst \ + ${LSTFILE} || exit 1 + +svn --force export svn://tug.org/texlive/trunk/Build/source/texk/texlive/linked_scripts/Makefile.am \ + ${AMFILE} || exit 1 +bin_links=$(awk '/bin_links = \\/,/^$/' ${AMFILE} | awk NF | grep -v bin_links | sed 's,\\,,') + +cd ${TLBINDIR} && \ + for s in $(cat ${LSTFILE} | grep -v \') + do + target=`basename $s | tr '[A-Z]' '[a-z]'` + echo "$s" | grep 'memoize-.*\.' >/dev/null \ + || echo "$s" | grep 'listings-ext.sh' >/dev/null \ + || target=`echo $target | sed 's,\.[^/]*$,,'`; \ + if [[ $1 == "remove" ]];then + rm -f $target + else + rm -f $target + echo "creating link '$target' -> '$REL/texmf-dist/scripts/$s'" + ln -s $REL/texmf-dist/scripts/$s $target || exit 1 + fi + done && \ + for s in ${bin_links} + do + link=`echo $s | sed 's,.*:,,'` + file=`echo $s | sed 's,:.*,,'` + if [[ $1 == "remove" ]];then + rm -f $link + else + rm -f $link + echo "creating link '$link' -> '$file'" + ln -s $file $link || exit 1 + fi + done + +if [[ $1 == "remove" ]] +then + echo "all symlinks have been removed. why did you do this?" +fi -- cgit v1.2.3