summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2015-05-04 02:30:21 +0000
committerNorbert Preining <preining@logic.at>2015-05-04 02:30:21 +0000
commitf89dfb615f2d5b039f3071822b3849ab92e8aa87 (patch)
treeb725896b1e2a9aa59f78dfdb8081faa8915e2757
parentcbbf64df762709a3cebb24bee6fc3c1622bf98af (diff)
add tlpkg-revision script, and use it it tl-makeself-from-tlnet
git-svn-id: svn://tug.org/texlive/trunk@37177 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/tlpkg/bin/tl-makeself-from-tlnet8
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-revision57
2 files changed, 64 insertions, 1 deletions
diff --git a/Master/tlpkg/bin/tl-makeself-from-tlnet b/Master/tlpkg/bin/tl-makeself-from-tlnet
index 60239fa7774..c4dc26bbd96 100755
--- a/Master/tlpkg/bin/tl-makeself-from-tlnet
+++ b/Master/tlpkg/bin/tl-makeself-from-tlnet
@@ -30,8 +30,14 @@ cd $TMP
mkdir master
cd master
+maxrev=0
+
# unpack texlive.infra archives for all platforms, except w32.
for pkg in texlive.infra; do
+ pkgrev=`tlpkg-revision $pkg $TLNET`
+ if [ $pkgrev -gt $maxrev ] ; then
+ maxrev=$pkgrev
+ fi
for i in $ARCHIVE/$pkg*.tar.xz; do
case "$i" in
*win32*) ;;
@@ -139,7 +145,7 @@ chmod ugo+x runme.sh
# were invoked.
cd $CWD
mydir=`cd \`dirname $0\` && pwd` # Master/tlpkg/bin
-rev=`svnversion $mydir | sed s/[^0-9].*//` # just the number, no status
+rev=$maxrev
makeself $TMP update-tlmgr-r$rev.sh "TeX Live Manager Updater" ./runme.sh
rm -rf $TMP
diff --git a/Master/tlpkg/bin/tlpkg-revision b/Master/tlpkg/bin/tlpkg-revision
new file mode 100755
index 00000000000..3c075743b9d
--- /dev/null
+++ b/Master/tlpkg/bin/tlpkg-revision
@@ -0,0 +1,57 @@
+#!/usr/bin/env perl
+# $Id$
+# Public domain. Originally written 2015, Norbert Preining.
+# Return the revision number of a package in a TL structure
+# (can be a tlnet archive, installation, or svn)
+#
+# output and exit codes:
+# repository not found or no modules available there
+# output: -1 exit code: 1
+# stderr warning
+# package not found:
+# output: 0 exit code: 1
+# stderr warning
+# both found
+# output: rev exit code: 0
+#
+# usage
+# tlpkg-revision <pkg> [ <tltree> ]
+
+$^W = 1;
+
+BEGIN {
+ chomp ($mydir = `dirname $0`); # we are in Master/tlpkg/bin
+ die "need at least pkg name as argument!" if ($#ARGV < 0);
+ if ($#ARGV == 1) {
+ # we got a tltree as second argument, use the modules from there
+ if (! -d "$ARGV[1]/tlpkg/TeXLive") {
+ printf STDERR "Cannot find tlpdb in $ARGV[1]\n";
+ print "-1";
+ exit(1);
+ }
+ unshift (@INC, "$ARGV[1]/tlpkg");
+ $root = $ARGV[1];
+ } else {
+ unshift (@INC, "$mydir/..");
+ $root = "$mydir/../..";
+ }
+}
+
+use TeXLive::TLPOBJ;
+use TeXLive::TLPDB;
+
+my $tlpdb = TeXLive::TLPDB->new ("root" => $root);
+if (!defined($tlpdb)) {
+ printf STDERR "Cannot find tlpdb in $root\n";
+ print "-1";
+ exit(1);
+}
+my $pkg = $tlpdb->get_package($ARGV[0]);
+if (!defined($pkg)) {
+ printf STDERR "Cannot find $ARGV[0] package\n";
+ print "0";
+ exit(1);
+}
+print $pkg->revision;
+exit(0);
+