summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-bindir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-02-19 22:30:07 +0000
committerKarl Berry <karl@freefriends.org>2024-02-19 22:30:07 +0000
commitf9259e0ddbab002a6e52f48bd95ae270a5e9b4d5 (patch)
tree3646c8ce8c946346f0897bee19c2dd893405b405 /Master/tlpkg/bin/tl-update-bindir
parent7e32c047743dde28feb2ca558c2b64a7b8d78c55 (diff)
(do_download): use jq from Norbert to extract git prerelease assets.
remove cases for unused platforms. git-svn-id: svn://tug.org/texlive/trunk@69998 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-bindir')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-bindir70
1 files changed, 39 insertions, 31 deletions
diff --git a/Master/tlpkg/bin/tl-update-bindir b/Master/tlpkg/bin/tl-update-bindir
index d03aadf9ed9..1bdaa27d86f 100755
--- a/Master/tlpkg/bin/tl-update-bindir
+++ b/Master/tlpkg/bin/tl-update-bindir
@@ -1,6 +1,10 @@
#!/bin/sh
# Public domain. Originally written 2008, Karl Berry.
# Update a TeX Live Master/bin/PLATFORM directory.
+# Requires jq (for github downloads).
+#
+# For info about kicking off the github autobuilds,
+# see x86_64-linux below.
vc_id='$Id$'
renice 20 $$ >/dev/null 2>&1
@@ -14,7 +18,7 @@ test -d $tmpdir || mkdir -p $tmpdir
usage="$0 [OPTION]... TLPLATFORM...
Update the TeX Live executables for each TLPLATFORM (which must be a TL
-platform name, e.g., i386-linux) from a build directory.
+platform name, e.g., x86_64-linux) from a build directory.
The new binaries are taken from the location specified by --bin-loc,
either a directory (whose contents are copied), or a tar file (which is
@@ -37,6 +41,7 @@ Options:
[default empty; example: branches/branch2023/]
--master DIR install binaries to DIR/bin/TLPLATFORM
[default is the bin dir relative to this script]
+ --no-download, -N assume already downloaded, e.g., if this script fails
--help display this help and exit
--quiet, --silent no progress reports
@@ -59,11 +64,10 @@ while test $# -gt 0; do
--version|-version|-v) echo "$vc_id"; exit 0;;
--quiet|-quiet|-q|--silent|-silent|-s) msg=true;;
- --master) shift; Master=$1;;
--bin-loc) shift; bin_loc=$1;;
--cg-branch) shift; cgbranch=$1;; # e.g., branches/branch2023/
-
- --no-download|-N) download=true;; # secret option for karl
+ --master) shift; Master=$1;;
+ --no-download|-N) download=true;;
--*) echo "$0: unrecognized option \`$1'; try --help if you need it." >&2
exit 1;;
@@ -88,6 +92,12 @@ if test ! -d "$Master/bin"; then
fi
cgurl=https://build.contextgarden.net/dl/texlive/ # base url
+#
+# We could make this an option but it's better to always mark releases
+# as "prerelease" on github, so users don't think they can just download
+# them and have a working system.
+prerelease=true
+
#
# function to return url for the "latest" build on gh;
# first argument is TL platform name,
@@ -96,21 +106,24 @@ cgurl=https://build.contextgarden.net/dl/texlive/ # base url
github_url ()
{
if test -z "$1"; then
- echo "$0:github_url: expected platform name, goodbye." >&2
+ echo "$0:github_url: expected platform name (and optional github name)," \
+ " goodbye." >&2
exit 1
fi
tlplat=$1
ghplat=${2-$tlplat}
- gh_url=https://api.github.com/repos/TeX-Live/texlive-source/releases/latest
- remurl=`curl -s $gh_url \
- | tee /tmp/gh-rel-$tlplat \
- | grep browser_download_url \
- | grep texlive-bin-$ghplat.tar.gz \
- | cut -d : -f 2,3 \
- | tr -d \"`
- # get from tag?
- #remurl=https://github.com/TeX-Live/texlive-source/releases/download/svn53987/texlive-bin-x86_64-linux.tar.gz
- echo "github_url: for $tlplat, got $remurl" >&2
+ gh_url=https://api.github.com/repos/TeX-Live/texlive-source/releases
+ if $prerelease; then
+ remurl=`curl -s $gh_url \
+ | jq -r 'map(select(.prerelease)) | first | .assets | .[] | .browser_download_url' \
+ | grep texlive-bin-$ghplat.tar.gz`
+ else
+ gh_url=$gh_url/latest
+ remurl=`curl -s $gh_url \
+ | jq -r ' .assets.[].browser_download_url' \
+ | grep texlive-bin-$ghplat.tar.gz`
+ fi
+ echo "github_url: for $tlplat, got $remurl (prerelease=$prerelease)" >&2
echo "$remurl"
}
@@ -135,7 +148,7 @@ for tlplat in $tlplats; do
exit 1
fi
- # karl update convenience
+ # updating convenience
download_loc=$tmpdir/tl.$tlplat.tar.gz
default_bin_loc=$download_loc
grab="$download -O $download_loc"
@@ -154,13 +167,11 @@ for tlplat in $tlplats; do
do_download http://www.babafou.eu.org/texlive-netbsd/x86_64-netbsd.tar.xz;;
armhf-linux)
- remurl=http://dl.contextgarden.net/build/texlive/${cgbranch}$tlplat.tar.xz
- do_download $remurl;;
+ do_download `github_url $tlplat`;;
+ #remurl=http://dl.contextgarden.net/build/texlive/${cgbranch}$tlplat.tar.xz
+ #do_download $remurl;;
#simon $grab http://getthingsfixed.co.uk/texlive/builds/2022/texlive-armhf.tar.gz
- i386-cygwin)
- do_download http://sanibeltranquility.com/cygwin/$tlplat.tgz;;
-
i386-freebsd)
do_download `github_url $tlplat`;;
@@ -180,17 +191,14 @@ for tlplat in $tlplats; do
i386-solaris)
do_download `github_url $tlplat`;;
- sparc-solaris)
- do_download http://dl.contextgarden.net/build/texlive/$tlplat.tar.xz;;
-
universal-darwin)
default_bin_loc=/home/koch/$tlplat.tar.xz;;
windows)
- ;; # updated by Akira.
+ echo "committed by builder";;
x86_64-cygwin)
- $grab http://sanibeltranquility.com/cygwin/$tlplat.tgz;;
+ echo "committed by builder";;
x86_64-darwinlegacy)
do_download ${cgurl}/${cgbranch}$tlplat.tar.xz;;
@@ -204,20 +212,20 @@ for tlplat in $tlplats; do
# "Target:trunk" should already be there,
# "rNNNNN and perhaps brief msg from commits in "title",
# and anything relevant for "description", or leave it blank;
- # then "Publish release" (not as pre-release, can't be accessed).
+ # check pre-release box (always),
+ # then "Publish release".
#
# Can check status at:
# https://github.com/TeX-Live/texlive-source/actions
#
- # After ~40min, should have new release tarballs at:
+ # After ~20min, should have some new release tarballs at:
# https://github.com/TeX-Live/texlive-source/releases
# (this is a different page than where you're put after creating
# the release)
- # Some arches will be done sooner than others (arm and aarch are slow),
- # but can't download anything until all are done.
+ # but arm and aarch are slow and will take hours to finish.
+ # Should be able to update the finished ones as they happen.
#
# If try before ready, no harm, just get error message "missing url".
- # (If you have/want a git checkout of texlive-source, see tlbuild doc.)
#
do_download `github_url $tlplat`;;