summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-makeself-from-tlnet
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin/tl-makeself-from-tlnet')
-rwxr-xr-xMaster/tlpkg/bin/tl-makeself-from-tlnet90
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/tl-makeself-from-tlnet b/Master/tlpkg/bin/tl-makeself-from-tlnet
new file mode 100755
index 00000000000..a50a5079016
--- /dev/null
+++ b/Master/tlpkg/bin/tl-makeself-from-tlnet
@@ -0,0 +1,90 @@
+#!/usr/bin/env bash
+# $Id: tl-makeself-from-tlnet 11099 2008-10-29 00:15:13Z preining $
+# Copyright 2008 Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+# Creates a .run file for updating the texlive.infra and bin-texlive packages
+# comparable to the windows .exe updater
+
+set -e
+
+TMP=`mktemp -d`
+
+CWD=`pwd`
+
+TLNET="$1"
+
+if [ ! -d "$TLNET" ] ; then
+ echo "No directory for the tlnet distribution given, aborting."
+ exit 1
+fi
+
+ARCHIVE="$TLNET/archive"
+
+if [ ! -d "$ARCHIVE" ] ; then
+ echo "archive directory in $TLNET not found, aborting."
+ exit 1
+fi
+
+cd $TMP
+mkdir master
+cd master
+
+for i in $ARCHIVE/texlive.infra*.tar.lzma ; do
+ case "$i" in
+ *win32*) ;;
+ *) lzmadec < $i | tar -xvf - ;;
+ esac
+done
+for i in $ARCHIVE/bin-texlive*.tar.lzma ; do
+ case "$i" in
+ *win32*) ;;
+ *) lzmadec < $i | tar -xvf - ;;
+ esac
+done
+
+cd ..
+
+# create the runme.sh script
+#
+cat > runme.sh <<'EOF'
+#!/bin/sh
+#
+# updater for tlmgr and infrastructure on unix
+#
+
+ROOT=`kpsewhich --var-value=SELFAUTOPARENT`
+if [ -r "$ROOT/tlpkg/texlive.tlpdb" ] ; then
+ mv ./master/bin .
+ cp -a ./master/* $ROOT/
+ # now try to get the list of installed architectures by listing the
+ # directories in $ROOT/bin
+ tlpobjs="$ROOT/tlpkg/tlpobj/bin-texlive.tlpobj $ROOT/tlpkg/tlpobj/texlive.infra.tlpobj"
+ for a in $ROOT/bin/* ; do
+ b=`basename $a`
+ cp -a bin/$b $ROOT/bin/
+ tlpobjs="$tlpobjs $ROOT/tlpkg/tlpobj/bin-texlive.$b.tlpobj $ROOT/tlpkg/tlpobj/texlive.infra.$b.tlpobj"
+ done
+else
+ # could be made more intelligent
+ echo "Cannot find root, please call the .run script with --noexec --keep and"
+ echo "then call the runme.sh script in the unpacked directory with the"
+ echo "root as the first argument, i.e., someting like"
+ echo " sh runme.sh /your/path/to/the/texlive/installaton/2008"
+ exit 1
+fi
+
+tlmgr _include_tlpobj $tlpobjs
+
+EOF
+
+chmod ugo+x runme.sh
+
+cd $CWD
+
+makeself $TMP update-texlive.run "TeX Live Manager Updater" ./runme.sh
+
+rm -rf $TMP
+
+# vim:set tabstop=2 expandtab: #