From 341dc984c3f73f91d8144ea046e296ab0c57c3f2 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sat, 8 Jun 2024 21:27:10 +0200 Subject: TLObsd now provides biber --- tlobsd-getbiber | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tlobsd-getbiber (limited to 'tlobsd-getbiber') diff --git a/tlobsd-getbiber b/tlobsd-getbiber new file mode 100644 index 0000000..e5a7944 --- /dev/null +++ b/tlobsd-getbiber @@ -0,0 +1,77 @@ +#!/bin/sh +# +# $TeX Live for OpenBSD, 2024/06/08 $ + +TLBINDIR=$(dirname $0) +BINREPO=https://www.ekdosis.org/texlive +TMPDIR=$(mktemp -d) +OPENBSD_VERSION=$(sysctl -n kern.version | awk 'FNR == 1 { print $2 }' | sed 's/\.//') +UPDATING=$(curl -s ${BINREPO}/status.txt | grep updating= | sed 's/.*=//') + +if [[ ! -w ${TLBINDIR} ]]; then + echo "You do not have write permissions to ${TLBINDIR}" + exit 1 +fi + +if [[ ${tlobsd} -ne 1 ]];then + echo "Please use 'tlobsd getbiber' instead of this command." + exit 1 +fi + + +if [[ ${UPDATING} == "yes" ]];then + echo "The binaries are being updated. Please re-run this command later." +else + curl ${BINREPO}/biber-openbsd${OPENBSD_VERSION}.xz \ + -o ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz + curl ${BINREPO}/biber-openbsd${OPENBSD_VERSION}.xz.asc \ + -o ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz.asc + gpg --verify ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz.asc + if [[ $? -eq 0 ]];then + unxz ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz + cp ${TMPDIR}/biber-openbsd${OPENBSD_VERSION} ${TLBINDIR}/biber + chmod +x ${TLBINDIR}/biber + echo "Installation complete." + else + echo "" + echo "The signature could not be verified." + echo " Please import the public key used to sign biber-openbsd${OPENBSD_VERSION}.xz" + echo " as described on the TeX Live for OpenBSD web page, or verify this file from" + echo " the user account that was used to install TeX Live for OpenBSD. (Assumably," + echo " this user has already imported the public key into his keyring. Any user" + echo " whose keyring contains the public key of TeX Live for OpenBSD can be used.)" + echo "" + echo " The file to be verified can be found here: ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz." + echo "" + echo " Would you like me to attempt to verify the file from an account that has" + echo " the public key in its keyring?" + echo "" + read whattodo?"[Y]es/[C]ontinue without verifying/[A]bort installation) [Y]: " + [[ "${whattodo}" == '' ]] && whattodo=y + case $whattodo in + [yY] ) + read username?"Enter any user name whose keyring contains the public key of TeX Live for OpenBSD: " + chmod 755 ${TMPDIR} + doas -u ${username} gpg --verify ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz.asc + if [[ $? -eq 0 ]];then + unxz ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz + cp ${TMPDIR}/biber-openbsd${OPENBSD_VERSION} ${TLBINDIR}/biber + chmod +x ${TLBINDIR}/biber + echo "Installation complete." + else + exit 1 + fi + ;; + [cC] ) + unxz ${TMPDIR}/biber-openbsd${OPENBSD_VERSION}.xz + cp ${TMPDIR}/biber-openbsd${OPENBSD_VERSION} ${TLBINDIR}/biber + chmod +x ${TLBINDIR}/biber + echo "Installation complete." + ;; + * ) + echo "Aborting..." + exit 1 + ;; + esac + fi +fi -- cgit v1.2.3