texlive[69998] Master/tlpkg/bin/tl-update-bindir: (do_download): use

commits+karl at tug.org commits+karl at tug.org
Mon Feb 19 23:30:07 CET 2024


Revision: 69998
          https://tug.org/svn/texlive?view=revision&revision=69998
Author:   karl
Date:     2024-02-19 23:30:07 +0100 (Mon, 19 Feb 2024)
Log Message:
-----------
(do_download): use jq from Norbert to extract git prerelease assets.
remove cases for unused platforms.

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tl-update-bindir

Modified: trunk/Master/tlpkg/bin/tl-update-bindir
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-bindir	2024-02-19 22:09:41 UTC (rev 69997)
+++ trunk/Master/tlpkg/bin/tl-update-bindir	2024-02-19 22:30:07 UTC (rev 69998)
@@ -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 @@
 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 @@
                            [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,12 +64,11 @@
   --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/
+  --master) shift; Master=$1;;
+  --no-download|-N) download=true;;
 
-  --no-download|-N) download=true;; # secret option for karl
-
   --*) echo "$0: unrecognized option \`$1'; try --help if you need it." >&2
        exit 1;;
 
@@ -88,6 +92,12 @@
 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 @@
 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 @@
     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 @@
     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 @@
    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 @@
     #   "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`;;
 



More information about the tex-live-commits mailing list.