summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-12-01 18:34:04 +0000
committerKarl Berry <karl@freefriends.org>2014-12-01 18:34:04 +0000
commit9be7603a9d9b17519eaa56496d97cebc8a8749c3 (patch)
tree7138d08de6c74f679a6b5060babbe10fd223714f /Master
parent43594bec3b1e513ecb5bb1d1a8e74f79935672cb (diff)
bail out earlier if --upgrade is given but can't
be done. git-svn-id: svn://tug.org/texlive/trunk@35708 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/tlpkg/bin/tl-makeself-from-tlnet43
1 files changed, 25 insertions, 18 deletions
diff --git a/Master/tlpkg/bin/tl-makeself-from-tlnet b/Master/tlpkg/bin/tl-makeself-from-tlnet
index fa50b4fc9bf..4c7e2ffbf76 100755
--- a/Master/tlpkg/bin/tl-makeself-from-tlnet
+++ b/Master/tlpkg/bin/tl-makeself-from-tlnet
@@ -1,6 +1,6 @@
#!/bin/sh -e
# $Id$
-# Copyright 2008, 2009, 2010, 2011 Norbert Preining
+# Copyright 2008-2014 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
@@ -8,11 +8,7 @@
# packages on Unix, similar to the .exe we create for Windows. Both are
# created in the nightly cron from tl-update-tlcritical.
-TMP=`mktemp -d`
-CWD=`pwd`
-
TLNET=$1
-
if test ! -d "$TLNET"; then
echo "$0: No tlnet directory given as argument, aborting." >&2
exit 1
@@ -24,8 +20,12 @@ if test ! -d "$ARCHIVE"; then
exit 1
fi
-TLRELEASE=`sed -n 's!^depend release/!!p' $TLNET/tlpkg/texlive.tlpdb`
+# extract some version values from the tlnet tlpdb.
+NETRELEASE=`sed -n 's!^depend release/!!p' $TLNET/tlpkg/texlive.tlpdb`
+MINRELEASE=`sed -n 's!^depend minrelease/!!p' $TLNET/tlpkg/texlive.tlpdb`
+CWD=`pwd` # save original dir
+TMP=`mktemp -d`
cd $TMP
mkdir master
cd master
@@ -49,25 +49,35 @@ cat >runme.sh <<END_RUNME
# Updater for tlmgr and infrastructure on Unix.
# Runs in unpacked archive directory.
-WORKINGRELEASE=$TLRELEASE
+NETRELEASE=$NETRELEASE
+MINRELEASE=$MINRELEASE
END_RUNME
# append to runme literally now.
cat >>runme.sh <<'END_RUNME'
+
+# see if we can determine where the TL to be upgraded lives.
+# need tlpdb and a tlpobj dir (i.e., not the svn Master tree) at least.
ROOT=`kpsewhich --var-value=SELFAUTOPARENT`
-if test -r "$ROOT/tlpkg/texlive.tlpdb"; then
+if test -r "$ROOT/tlpkg/texlive.tlpdb" && test -d "$ROOT/tlpobj/"; then
echo "$0: updating in $ROOT..."
tlmgrversion=`tlmgr version | grep '^TeX Live.*version' | awk '{print $NF}'`
echo "$0: tlmgr version says this is TeX Live $tlmgrversion"
- if test "x$WORKINGRELEASE" != "x$tlmgrversion"; then
- if test "x$1" = "x--upgrade"; then
- echo "$0: upgrading from $tlmgrversion to $WORKINGRELEASE."
- else
- echo "$0: upgrading from $tlmgrversion not supported:" >&2
- echo "$0: can only upgrade (cautiously) from $WORKINGRELEASE." >&2
+ 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
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
+ exit 1
+ else
+ echo "$0: ok, doing full release upgrade " \
+ "from $tlmgrversion to $NETRELEASE."
fi
else
echo "$0: proceeding with tlmgr update."
@@ -112,10 +122,7 @@ if test -r "$ROOT/tlpkg/texlive.tlpdb"; then
else
cat <<END_ABORT_NODIR >&2
$0: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT.
-$0: Please call update-tlmgr-latest.sh --noexec --keep
-$0: and then call the runme.sh script in the unpacked directory
-$0: with the directory root as the first argument, something like:
-$0: sh runme.sh /path/to/your/texlive/installation/2010
+$0: Please set your PATH as needed, otherwise it's hopeless.
END_ABORT_NODIR
exit 1
fi