From 4ba50564aefec9c8756f9314baf84bbfd147a8fa Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Fri, 26 Apr 2024 17:20:03 +0200 Subject: tlobsd: new action 'version' --- tlobsd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tlobsd') diff --git a/tlobsd b/tlobsd index 3342be5..5f226c5 100644 --- a/tlobsd +++ b/tlobsd @@ -1,10 +1,14 @@ #!/bin/sh # -# $TeX Live for OpenBSD, 2024/03/28 $ +# $TeX Live for OpenBSD, 2024/04/26 $ cmd=$@ export tlobsd=1 +TL_RELEASE=$(tlmgr version | awk 'FNR == 3 { print $0 }') +TLOBSD_DATE=$(stat -t '%F' $(which tlobsd) | awk '{ gsub("\"", "", $10) }; { print $10 }') +OPENBSD_VERSION=$(sysctl -n kern.version | awk 'FNR == 1 { print $2 }') + # no $cmd if [[ -z ${cmd} ]];then echo "$(basename $0): unknown action" @@ -16,6 +20,9 @@ elif [[ $1 == "tlmgr" ]];then # symlinks elif [[ $1 == "mksymlinks" ]];then tlobsd-mksymlinks $2 +# version +elif [[ $1 == "version" ]];then + echo "${TL_RELEASE} for OpenBSD ${OPENBSD_VERSION} (Compiled ${TLOBSD_DATE})" # something that is unknown to tlobsd else echo "$1 is not known to $(basename $0). Try: ${cmd} --help if you need it." -- cgit v1.2.3