From 397a5db9160c45b5843a10d33d1770ced03a1d48 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 15 Jul 2017 13:01:11 +0000 Subject: more work on tlcontrib ctan2tl git-svn-id: svn://tug.org/texlive/trunk@44808 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/ctan2tl | 4 ++-- Master/tlpkg/libexec/ctan2tds | 4 ++-- Master/tlpkg/libexec/place | 54 ++++++++++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 23 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/bin/ctan2tl b/Master/tlpkg/bin/ctan2tl index 3289723e0cb..0bc0e1ae42c 100755 --- a/Master/tlpkg/bin/ctan2tl +++ b/Master/tlpkg/bin/ctan2tl @@ -31,7 +31,7 @@ if test "x$1" = x--help; then exit 0 fi -place_chicken= +place_chicken=-n copy_from_ctan=true contrib_ctan2tds_arg= contrib_place_arg= @@ -50,7 +50,7 @@ while true; do '--contrib') do_contrib=true contrib_ctan2tds_arg=--contrib - contrib_place_arg=--contrib + contrib_place_arg="--contrib=/home/norbert/Development/TeX/tlcontrib --mode=git" shift continue ;; diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index e7b7773c851..b184a782714 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -77,7 +77,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'adforn', "&MAKEcopy", 'adfsymbols', "&MAKEcopy", 'adobe-euro', "die 'skipping, support for nonfree fonts'", - 'adobecaslon', "die 'skipping, support for nonfree fonts'", + 'adobecaslon', "nonfree_die('skipping, support for nonfree fonts', '&MAKEflatten')", 'adrlist', "die 'skipping, noinfo license'", 'ae', "&MAKEae", 'aeb_mlink', "die 'skipping, per author (dps) request'", @@ -128,7 +128,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'asana-math', "die 'skipping, use Asana-Math'", 'ascii', "die 'skipping, use ascii-font'", 'ascii-font', "&MAKEflatten", - 'astron', "die 'skipping, nonfree license'", + 'astron', "nonfree_die('skipping, nonfree license', '&MAKEflatten')", 'atqolive', "die 'skipping, nonfree font'", 'augie', "&MAKEaugie", 'aurical', "&MAKEaurical", diff --git a/Master/tlpkg/libexec/place b/Master/tlpkg/libexec/place index dda37b0d2c8..0693e13f7c3 100755 --- a/Master/tlpkg/libexec/place +++ b/Master/tlpkg/libexec/place @@ -21,21 +21,18 @@ use TeXLive::TLPSRC; use TeXLive::TLPOBJ; use TeXLive::TLPDB; use TeXLive::TLTREE; +use Getopt::Long; -if ($ARGV[0] eq "-n") { - $chicken = 1; - shift; -} else { - $chicken = 0; -} -print "place: chicken mode = $chicken\n"; - -my $do_contrib = 0; -if ($ARGV[0] eq "--contrib") { - $do_contrib = 1; - shift; -} +my $chicken = 0; +my $opt_contrib; +my $opt_mode = "svn"; +exit 2 unless Getopt::Long::GetOptions ( + "n" => \$chicken, + "contrib=s" => \$opt_contrib, + "mode=s" => \$opt_mode, +); +print "place: chicken mode = $chicken\n"; die "usage: $0 PKGNAME\n" unless @ARGV == 1; $package = $ARGV[0]; @@ -63,6 +60,9 @@ $cooked_top = getcwd (); # ctan2tl invokes us in the top-level cooked dir &xchdir ("$mydir/../.."); my $M = $DEST = getcwd (); # svn Master, ordinarily where we write + +$M = $DEST = $opt_contrib if (defined($opt_contrib)); + # &xchdir (".."); @@ -101,8 +101,6 @@ for my $dot (@trailingdots) { # 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"); @@ -175,7 +173,11 @@ foreach $file (sort keys %Old) { # remove no longer existing files. if (! $New{$file}) { - &xsystem ("svn remove \"$M/$file\""); + if ($opt_mode eq "svn") { + &xsystem ("svn remove \"$M/$file\""); + } else { + &xsystem ("git rm \"$M/$file\""); + } (my $old_dir = "$M/$file") =~ s,/[^/]*$,,; $dirs_with_removals{$old_dir}++; } @@ -216,7 +218,11 @@ $dirs{"$M/tlpkg/tlpsrc/$package.tlpsrc"}++; # the directories will not be empty. if (! $chicken) { for my $empty_dir (&empty_dirs (keys %dirs_with_removals)) { - &xsystem ("cd $M && svn remove $empty_dir # empty dir"); + if ($opt_mode eq "svn") { + &xsystem ("cd $M && svn remove $empty_dir # empty dir"); + } else { + &xsystem ("cd $M && rmdir $empty_dir") + } # already in %dirs, so don't need to add. } } @@ -257,8 +263,11 @@ close (DIRLIST) || warn "close($DIRLIST) failed: $!"; # Always run svn update, even without --place. This will let a worker # detect that a particular package update has already been done by # someone else. -print ("\nsvn update of those directories:\n"); -system ("svn update `cat $dirlist_file`"); +if ($opt_mode eq "svn") { + print ("\nsvn update of those directories:\n"); + system ("svn update `cat $dirlist_file`"); +} +# do nothing in git mode exit (0); @@ -307,6 +316,13 @@ sub add_file { # when it's needed, (grand*)parents must come first, else have svn # "not working copy" error. my $newdir = $dir = dirname ($newfile); + + if ($opt_mode eq "git") { + &xsystem ("cd $M && git add $newfile"); + $dirs{$newdir}++; + return; + } + my $needed_dirs = ""; #until (-d "$dir/.svn") { until (&is_svn_dir($dir)) { -- cgit v1.2.3