texlive[44807] Master/tlpkg: work on supporting tlcontrib in ctan2tl

commits+preining at tug.org commits+preining at tug.org
Sat Jul 15 15:00:55 CEST 2017


Revision: 44807
          http://tug.org/svn/texlive?view=revision&revision=44807
Author:   preining
Date:     2017-07-15 15:00:54 +0200 (Sat, 15 Jul 2017)
Log Message:
-----------
work on supporting tlcontrib in ctan2tl

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/ctan2tl
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/libexec/place

Modified: trunk/Master/tlpkg/bin/ctan2tl
===================================================================
--- trunk/Master/tlpkg/bin/ctan2tl	2017-07-15 13:00:39 UTC (rev 44806)
+++ trunk/Master/tlpkg/bin/ctan2tl	2017-07-15 13:00:54 UTC (rev 44807)
@@ -11,11 +11,6 @@
 libexec=`cd $mydir/../libexec && pwd`	# Master/tlpkg/libexec
 PATH=$mydir:$libexec:$PATH  # we call lots of our other tools
 
-Build=`cd $mydir/../../../Build && pwd`
-raw=$Build/tmp.raw
-test -d $raw || mkdir $raw
-cd $raw || exit 1
-
 if test "x$1" = x--help; then
   echo "Usage: $0 [--place] [--no-ctan] TLPKGNAME"
   echo
@@ -36,20 +31,50 @@
   exit 0
 fi
 
-if test "x$1" = x--place ||  test "x$1" = x-p; then
-  place_chicken=
-  shift
-else
-  place_chicken=-n
-fi
+place_chicken=
+copy_from_ctan=true
+contrib_ctan2tds_arg=
+contrib_place_arg=
+while true; do
+  case "$1" in
+    '-p'|'--place')
+      place_chicken=
+      shift
+      continue
+      ;;
+    '--no-ctan')
+      copy_from_ctan=false
+      shift
+      continue
+      ;;
+    '--contrib')
+      do_contrib=true
+      contrib_ctan2tds_arg=--contrib
+      contrib_place_arg=--contrib
+      shift
+      continue
+      ;;
+    '--buildplace')
+      shift
+      Build=$1
+      shift
+      continue
+      ;;
+    *)
+      break
+      ;;
+  esac
+done
 
-if test "x$1" = x--no-ctan; then
-  copy_from_ctan=false
-  shift
-else
-  copy_from_ctan=true
+if [ "x$Build" = "x" ] ; then
+  Build=`cd $mydir/../../../Build && pwd`
 fi
 
+raw=$Build/tmp.raw
+test -d $raw || mkdir $raw
+cd $raw || exit 1
+
+
 pkg=$1
 if test -z "$pkg"; then
   echo "$0: no TL package name specified." >&2
@@ -77,13 +102,13 @@
   echo
   echo "*** $0: $pkg not in $mydir/tlpkg-ctan-check, add?"
 fi
-  
+
 if grep "^depend  *$pkg\$" $mydir/../tlpsrc/collection-* >/dev/null; then :
 else
   echo
   echo "*** $0: $pkg not in any collection, add?"
 fi
-  
+
 # 

 if $copy_from_ctan; then
 
@@ -123,7 +148,7 @@
 cooked=$Build/tmp.cooked
 rm -rf $cooked/$pkg
 test -d $cooked || mkdir $cooked
-ctan2tds --ctan-dir=$ctan_dir $pkg || exit 1
+ctan2tds --ctan-dir=$ctan_dir $contrib_ctan2tds_arg $pkg || exit 1
 
 cd $cooked || exit 1
 printf "\n\f cooked\n"
@@ -145,9 +170,9 @@
 find $pkg \! -type d -printf "%TY%Tm%Td.%TH%TM %p\n" | sort -k2 \
 | tee ${TMPDIR-/tmp}/ctan2tl.files
 
-printf "\n$0: calling place $place_chicken $pkg\n"
+printf "\n$0: calling place $place_chicken $contrib_place_arg $pkg\n"
 rm -rf $pkg.done
-place $place_chicken $pkg
+place $place_chicken $contrib_place_arg $pkg
 status=$?
 
 $copy_from_ctan && rm -rf $raw/$pkg

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2017-07-15 13:00:39 UTC (rev 44806)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2017-07-15 13:00:54 UTC (rev 44807)
@@ -3038,6 +3038,7 @@
   "debug!",
   "help",
   "test|n!",
+  "contrib",
   "version",
 );
 
@@ -6404,7 +6405,7 @@
 
 sub nonfree_die {
   my ($diestr, $cmd) = @_;
-  if ($ENV{'CTAN2TDS_NONFREE'}) {
+  if ($opt_contrib) {
     eval $cmd;
   } else {
     die $diestr;

Modified: trunk/Master/tlpkg/libexec/place
===================================================================
--- trunk/Master/tlpkg/libexec/place	2017-07-15 13:00:39 UTC (rev 44806)
+++ trunk/Master/tlpkg/libexec/place	2017-07-15 13:00:54 UTC (rev 44807)
@@ -30,6 +30,13 @@
 }
 print "place: chicken mode = $chicken\n";
 
+my $do_contrib = 0;
+if ($ARGV[0] eq "--contrib") {
+  $do_contrib = 1;
+  shift;
+}
+
+
 die "usage: $0 PKGNAME\n" unless @ARGV == 1;
 $package = $ARGV[0];
 # $::opt_verbosity = 3;  # debug tlpdb reading
@@ -94,6 +101,8 @@
 # we do those checks (and possible removals) before making the new TL
 # package, so the "README."  file doesn't get into the data structures.
 
+die("contrib mode not implemented, move packages manually!\n") if ($do_contrib);
+
 

 if (-d "Master") {  # maybe have both Build and Master
   &xchdir ("Master");



More information about the tex-live-commits mailing list