texlive[48328] Master: bin/tl-makeself-from-tlnet: new -- --debug

commits+karl at tug.org commits+karl at tug.org
Wed Aug 1 04:04:28 CEST 2018


Revision: 48328
          http://tug.org/svn/texlive?view=revision&revision=48328
Author:   karl
Date:     2018-08-01 04:04:28 +0200 (Wed, 01 Aug 2018)
Log Message:
-----------
bin/tl-makeself-from-tlnet: new -- --debug option for embedded script;
  copy Windows support files into archive;
  special case installation of xz.exe, wget.exe, tar.exe if we are
  updating the win32 platform.
  https://github.com/amaxwell/tlutility/issues/65

bin/tl-try-makeself: allow args to override, default to /tmp/krit and
  /tmp/ki.

bin/tl-try-install: allow arg to specify profile; doc.

dev/profiles/TLinfra+exe.pro: new test profile with multiple platforms,
  including Windows. Doc updates to other *.pro.

install-tl: do not output Perl warning if binary_* is specified without
  a value; doc. (Not yet implemented: should give our own warning.)

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/tlpkg/bin/tl-makeself-from-tlnet
    trunk/Master/tlpkg/bin/tl-try-install
    trunk/Master/tlpkg/bin/tl-try-makeself
    trunk/Master/tlpkg/dev/profiles/README
    trunk/Master/tlpkg/dev/profiles/TLroot.pro

Added Paths:
-----------
    trunk/Master/tlpkg/dev/profiles/TLinfra+exe.pro

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/install-tl	2018-08-01 02:04:28 UTC (rev 48328)
@@ -617,7 +617,8 @@
 
 my $varsdump = "";
 foreach my $key (sort keys %vars) {
-  $varsdump .= "  $key: \"" . $vars{$key} . "\"\n";
+  my $val = $vars{$key} || "";
+  $varsdump .= "  $key: \"$val\"\n";
 }
 log("Settings:\n" . $varsdump);
 
@@ -1956,9 +1957,9 @@
   # if there are still keys in the %pro array, some unknown keys have
   # been written in the profile, bail out
   if (my @foo = keys(%pro)) {
-    tlwarn("Unknown key in profile $profilepath: @foo\n");
+    tlwarn("Unknown key(s) in profile $profilepath: @foo\n");
     tlwarn("Stopping here.\n");
-    exit(1);
+    exit 1;
   }
 
   # if a profile contains *only* the selected_scheme setting without
@@ -2919,11 +2920,11 @@
 B<platform options> (prefix C<binary_>)
 
 For each supported platform in TeX Live (directories under C<bin/>), the
-variable C<binary_>I<PLATFORM> can be set.  For example:
+variable C<binary_>I<PLATFORM> can be set with value 1.  For example:
 
-  binary_x86_64-linux
+  binary_x86_64-linux 1
 
-If no C<binary_> variable is specified, the default is whatever the
+If no C<binary_> settings are made, the default is whatever the
 current machine is running.
 
 In releases before 2017, many profile variables had different

Modified: trunk/Master/tlpkg/bin/tl-makeself-from-tlnet
===================================================================
--- trunk/Master/tlpkg/bin/tl-makeself-from-tlnet	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/tlpkg/bin/tl-makeself-from-tlnet	2018-08-01 02:04:28 UTC (rev 48328)
@@ -13,6 +13,19 @@
 # The resulting update-tlmgr-*.sh is run (by the user) in the TL
 # installation directory to be updated; it uses kpsewhich from PATH to
 # determine what to do update.
+# 
+# Debugging/development/testing:
+# - create test hierarchy; either run install-tl as you like, or:
+#  tl-try-install Master/tlpkg/dev/profiles/TLinfra+exe.pro # or whatever
+#   This creates /tmp/ki with various platforms.
+# - then see tl-try-makeself:
+#   running that will copy tlcritical to /tmp/krit,
+#   run this script (tl-makeself-from-tlnet) there,
+#   then update /tmp/ki from /tmp/krit, that is,
+#   doing an update as a user would do in their installed hierarchy.
+#
+# update-tlmgr-r*.sh --list     # list files included in archive
+# update-tlmgr-r*.sh -- --debug # run embedded script with -vx and more
 
 mydir=`cd \`dirname "$0"\` && pwd`  # Master/tlpkg/bin
 PATH=$mydir:$PATH # for tlpkginfo
@@ -56,11 +69,8 @@
 fi
 #
 for i in "$ARCHIVE"/$infrapkg*.tar.xz; do
-  case "$i" in 
-    *win32*) ;;
-    *) : "uncompressing $i" # for debugging
-       xz -d <"$i" | tar -xf - || exit 1;;
-  esac
+  : "uncompressing $i" # for debugging
+  xz -d <"$i" | tar -xf - || exit 1
 done
 
 cd .. # back to the (temp) dir where we building things up
@@ -75,6 +85,7 @@
 # Runs in unpacked archive directory.
 # Created by `basename $0` at `date`.
 
+creation_date="`date`"
 NETRELEASE=$NETRELEASE
 MINRELEASE=$MINRELEASE
 infrapkg=$infrapkg
@@ -94,19 +105,33 @@
   if test -z "$tlmgrversion"; then
     echo "$0: tlmgr version did not include version, goodbye." >&2
     tlmgr version >&2
+    echo "($0: makeself creation date = $creation_date.)" >&2
     exit 1
   fi
   #
   echo "$0: tlmgr version says this is TeX Live $tlmgrversion"
+  #
+  # Extra-verbose debugging option.
+  if test "x$1" = "x--debug"; then
+    shift
+    opt_debug=1
+    set -vx
+    : "$0: makeself creation date = $creation_date."
+  else
+    opt_debug=
+  fi
+  #
   if test "x$1" = "x--upgrade"; then
     if test "x$NETRELEASE" = "x$tlmgrversion"; then
       echo "$0: have TL $tlmgrversion, new version also $NETRELEASE;">&2
       echo "$0: using --upgrade doesn't make sense; terminating." >&2
+      echo "($0: makeself creation date = $creation_date.)" >&2
       exit 1
     elif test "$tlmgrversion" -lt "$MINRELEASE"; then
       echo "$0: upgrading from $tlmgrversion not supported;" >&2
       echo "$0:   can only upgrade from $MINRELEASE to $NETRELEASE." >&2
       echo "$0: terminating." >&2
+      echo "($0: makeself creation date = $creation_date.)" >&2
       exit 1
     else
       echo "$0: ok, doing full release upgrade " \
@@ -120,9 +145,10 @@
   # them all. The loop below and tlmgr invocation at the end will update.
   mv ./master/bin .
   mkdir ./installer
-  mv ./master/tlpkg/installer/xz ./installer
+  mv ./master/tlpkg/installer/tar.exe ./installer
+  mv ./master/tlpkg/installer/xz   ./installer
   mv ./master/tlpkg/installer/wget ./installer
-  mv ./master/tlpkg/installer/lz4 ./installer # could be anywhere
+  mv ./master/tlpkg/installer/lz4  ./installer # could be anywhere
 
   # install the architecture-independent files.
   (cd master && tar cf - *) | (cd "$ROOT" && tar xf -) || exit 1
@@ -144,26 +170,39 @@
   src_tlpobj=master/tlpkg/tlpobj
   tlpobjs=$src_tlpobj/$infrapkg.tlpobj
 
-  # for each installed directory of binaries
+  if test -n "$opt_debug"; then
+    (: "here (`pwd`):"; ls) >&2
+    (: "installer:"; ls installer) >&2
+    (: "installer/wget:"; ls installer/wget) >&2
+    (: "installer/xz:"; ls installer/xz) >&2
+    (: "ROOT/bin=$ROOT/bin:"; ls "$ROOT"/bin) >&2
+  fi
+
+  # for each installed directory of binaries ...
   for a in "$ROOT"/bin/*; do
     test -d "$a" || continue  # skip any cruft files
     b=`basename "$a"`         # just the architecture name
-    echo "$0: updating $a..."
+    echo "$0: updating $a ..."
 
     # add the tlpobjs for this platform to the list.
     tlpobjs="$tlpobjs $src_tlpobj/$infrapkg.$b.tlpobj"
 
     # install the bin dir for this platform.
-    (cd bin && tar cf - "$b") | (cd "$ROOT/bin" && tar xf -) || exit 1
+    (cd bin >&2 && tar cf - "$b") | (cd "$ROOT/bin" && tar xf -) || exit 1
 
-    # copy the xz binaries, sometimes with .exe, for Cygwin.
+    # copy the xz binaries:
     if test -r installer/xz/xz."$b"; then
       cp installer/xz/xz."$b" "$t_xzdir/" || exit 1
     elif test -r installer/xz/xz."$b".exe; then
+      # with .exe, for Cygwin.
       cp installer/xz/xz."$b".exe "$t_xzdir/" || exit 1
+    elif test "$b" = win32 && test -r installer/xz/xz.exe; then
+      # annoyingly, we left .win32 out of the name, special cases all around:
+      cp installer/xz/xz.exe "$t_xzdir/" || exit 1
+      cp installer/wget/wget.exe "$t_wgetdir/" || exit 1
+      cp installer/tar.exe "$t_instdir/" || exit 1
     else
-      echo "$0: no xz.$b[.exe] binary for $a in `pwd`/installer/xz." >&2
-      ls installer/xz >&2
+      echo "$0: no xz.[$b][.exe] binary for $a in `pwd`/installer/xz." >&2
       exit 1
     fi
     #

Modified: trunk/Master/tlpkg/bin/tl-try-install
===================================================================
--- trunk/Master/tlpkg/bin/tl-try-install	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/tlpkg/bin/tl-try-install	2018-08-01 02:04:28 UTC (rev 48328)
@@ -14,8 +14,9 @@
 mydir=`cd \`dirname "$0"\` && pwd`  # Master/tlpkg/bin
 Master=`cd $mydir/../.. && pwd`
 
-# don't let cwd interfere
+# don't let cwd or existing PATH interfere
 cd "$HOME" || exit 1
+PATH=/usr/local/bin:/usr/bin:/bin # /usr/local/bin for good perl on tug
 
 #Master=$tm #`cd $mydir/../.. && pwd`
 #
@@ -22,7 +23,7 @@
 thisrel=/usr/local/texlive/`date +%Y` # not necessarily, but whatever
 prevrel=/usr/local/texlive/`expr "$(date +%Y)" - 1`
 
-pro=--profile=$Master/tlpkg/dev/profiles/TLinfra.pro #infra min small ... full
+pro=--profile=${1-Master/tlpkg/dev/profiles/TLinfra.pro} #infra min ... full
 exec time $Master/install-tl $pro
 exec time $lp/install-tl $pro
 exec time $lp/install-tl $pro --repo ftp://ftp.cstug.cz/pub/tex/local/tlpretest

Modified: trunk/Master/tlpkg/bin/tl-try-makeself
===================================================================
--- trunk/Master/tlpkg/bin/tl-try-makeself	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/tlpkg/bin/tl-try-makeself	2018-08-01 02:04:28 UTC (rev 48328)
@@ -1,27 +1,30 @@
 #!/bin/sh -ex
 # $Id$
-# Test tl-makeself with spaces in filenames. Public domain.
+# Test tl-makeself, e.g., with spaces in filenames. Public domain.
+# 
 # Assumes $lc is set to the tlcritical dir; copies from there
-# to make the test directory in which we run makeself
+# to make the test directory in which we run makeself and then try the
+# update.
 # 
-# Although having the source in a spaceful directory is not really
-# needed, might as well test that too.
+# Although having the source in a spaceful directory is not
+# needed, might as well test that too unless inconvenient.
 
 # to set up:
-mkdir $crit; cp -r $lc/{archive,tlpkg} $crit
-crit="/tmp/krit sp"
-test -d "$crit" || mkdir "$crit"
-rsync -a $lc/{archive,tlpkg} "$crit"
+testdir=${2-"/tmp/krit"} # spc"
+rm -rf "$testdir"
+mkdir "$testdir"
+rsync -a "$lc"/{archive,tlpkg} "$testdir"
 
-cd "$crit"       # because makeself writes to the current directory
+cd "$testdir"    # because makeself writes to the current directory
 rm -f update*sh  # remove previous attempts
-tl-makeself-from-tlnet "$crit"
-ls -l "$crit"
+tl-makeself-from-tlnet "$testdir"
+ls -l "$testdir"
 
-# Using ../dev/profiles/TLspace.pro results in:
-tl="/tmp/ki sp"
+# Using ../dev/profiles/TLspace.pro results in "/tmp/ki sp",
+# but most of the dev/profiles just install in /tmp/ki.
+tl=${1-"/tmp/ki"} # sp"
 cd "$tl"
 
 # Now try running the updater in the installed tree.
-PATH=$tl/bin/x86_64-linux:$PATH
-"$crit"/update-tlmgr-r*.sh # --quiet causes gzip error?
+PATH=$tl/bin/x86_64-linux:/usr/local/bin:/usr/bin:/bin
+"$testdir"/update-tlmgr-r*.sh #-- --debug

Modified: trunk/Master/tlpkg/dev/profiles/README
===================================================================
--- trunk/Master/tlpkg/dev/profiles/README	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/tlpkg/dev/profiles/README	2018-08-01 02:04:28 UTC (rev 48328)
@@ -1,8 +1,9 @@
 $Id$
 This README and all profiles are public domain (and trivial).
 
-Just a collection of profile files which install in /tmp/ki*,
-testing various features. Most have not been updated for the 2017
-install-tl option name changes, and have not been minimized.
+Just a collection of profile files which (almost all) install in
+/tmp/ki*, testing various features. Most have not been updated for the
+2017 install-tl option name changes (so rely on our maintaining
+compatibility), and have not been minimized.
 
 tlpkg/bin/tl-try-install can use them.  Happy testing.

Added: trunk/Master/tlpkg/dev/profiles/TLinfra+exe.pro
===================================================================
--- trunk/Master/tlpkg/dev/profiles/TLinfra+exe.pro	                        (rev 0)
+++ trunk/Master/tlpkg/dev/profiles/TLinfra+exe.pro	2018-08-01 02:04:28 UTC (rev 48328)
@@ -0,0 +1,20 @@
+# $Id: TLinfra.pro 44249 2017-05-08 17:26:47Z karl $
+# infrastructure only, installing several binary sets, including Windows.
+selected_scheme scheme-infraonly
+TEXDIR /tmp/ki
+TEXMFHOME /tmp/ki/user/home
+TEXMFLOCAL /tmp/ki/texmf-local
+TEXMFSYSCONFIG /tmp/ki/sys/config
+TEXMFSYSVAR /tmp/ki/sys/var
+TEXMFCONFIG /tmp/ki/user/config
+TEXMFVAR /tmp/ki/user/var
+option_doc 0
+option_fmt 0
+option_src 0
+option_adjustrepo 0
+binary_armhf_linux 1
+binary_i386-cygwin 1
+binary_win32 1
+binary_x86_64-cygwin 1
+binary_x86_64-darwin 1
+binary_x86_64-linux 1


Property changes on: trunk/Master/tlpkg/dev/profiles/TLinfra+exe.pro
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/dev/profiles/TLroot.pro
===================================================================
--- trunk/Master/tlpkg/dev/profiles/TLroot.pro	2018-08-01 00:23:49 UTC (rev 48327)
+++ trunk/Master/tlpkg/dev/profiles/TLroot.pro	2018-08-01 02:04:28 UTC (rev 48328)
@@ -1,4 +1,5 @@
 # $Id$
+# Install under /, instead of /tmp/ki.
 selected_scheme scheme-minimal
 TEXDIR /tl
 TEXMFHOME /tl/user/home



More information about the tex-live-commits mailing list