From 1b63fcabc2cb3c100c1a50136ce1e160e042b332 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 28 Mar 2024 09:23:21 +0100 Subject: new tlobsd wrapper --- README.md | 12 +++++------ mktexobsdsymlinks | 59 ------------------------------------------------------- tl-build.sh | 4 ++-- tlobsd | 16 +++++++++++++++ tlobsd-mksymlinks | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 67 deletions(-) delete mode 100644 mktexobsdsymlinks create mode 100644 tlobsd create mode 100644 tlobsd-mksymlinks diff --git a/README.md b/README.md index 39ebe0c..ac4b8dc 100644 --- a/README.md +++ b/README.md @@ -197,21 +197,21 @@ Package installation and updates To install new packages and to update already existing ones, do: ```sh -obsd-tlmgr update --all +tlobsd tlmgr update --all ``` This command requires the `subversion` package. -In TeX Live for OpenBSD, `obsd-tlmgr` replaces the standard `tlmgr` +In TeX Live for OpenBSD, `tlobsd tlmgr` replaces the standard `tlmgr` command which is the command name of TeX Live package manager. -`obsd-tlmgr` can be used with the exact same options and arguments as +`tlobsd tlmgr` can be used with the exact same options and arguments as `tlmgr`. More information can be found [on this page](https://tug.org/texlive/pkginstall.html) or in the [full `tlmgr` documentation](https://tug.org/texlive/doc/tlmgr.html). -`obsd-tlmgr` updates the links to a number of scripts that are shipped +`tlobsd tlmgr` updates the links to a number of scripts that are shipped within TeX Live and are found in the `texmf-dist/scripts/` directory. Most of them can be invoked by users from symlinks installed along with the usual TeX Live binaries. As OpenBSD is not officially @@ -224,10 +224,10 @@ to update all existing links and install new links after using `tlmgr`, like so: ```sh -mktexobsdsymlinks +tlobsd mksymlinks ``` -Just as `obsd-tlmgr`, this command requires the `subversion` package. +Just as `tlobsd tlmgr`, this command requires the `subversion` package. Building the sources -------------------- diff --git a/mktexobsdsymlinks b/mktexobsdsymlinks deleted file mode 100644 index efcb780..0000000 --- a/mktexobsdsymlinks +++ /dev/null @@ -1,59 +0,0 @@ -#!/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 - -which svn 2>&- > /dev/null -if [[ $? -ne 0 ]];then - echo "Please install the subversion package." - 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 diff --git a/tl-build.sh b/tl-build.sh index 2abd033..dcf3bfe 100755 --- a/tl-build.sh +++ b/tl-build.sh @@ -148,8 +148,8 @@ function include_asymptote { function include_extras { if [[ -d ${tl_sourcedir}/inst/bin ]];then tl_bindir=${tl_sourcedir}/inst/bin/`ls ${tl_sourcedir}/inst/bin` - install -m 0755 ${this_dir}/mktexobsdsymlinks ${tl_bindir}/mktexobsdsymlinks - install -m 0755 ${this_dir}/obsd-tlmgr ${tl_bindir}/obsd-tlmgr + install -m 0755 ${this_dir}/tlobsd-mksymlinks ${tl_bindir}/tlobsd-mksymlinks + install -m 0755 ${this_dir}/tlobsd ${tl_bindir}/tlobsd fi } diff --git a/tlobsd b/tlobsd new file mode 100644 index 0000000..50adc5a --- /dev/null +++ b/tlobsd @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $TeX Live for OpenBSD, 2024/03/28 $ + +cmd=$@ + +# tlmgr +if [[ $1 == "tlmgr" ]];then + $cmd + [[ $? -eq 0 ]] && mktexobsdsymlinks 1> /dev/null +fi + +# symlinks +if [[ $1 == "mksymlinks" ]];then + tlobsd-mksymlinks $2 +fi diff --git a/tlobsd-mksymlinks b/tlobsd-mksymlinks new file mode 100644 index 0000000..efcb780 --- /dev/null +++ b/tlobsd-mksymlinks @@ -0,0 +1,59 @@ +#!/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 + +which svn 2>&- > /dev/null +if [[ $? -ne 0 ]];then + echo "Please install the subversion package." + 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