diff options
Diffstat (limited to 'Master/tlpkg/bin/place')
-rwxr-xr-x | Master/tlpkg/bin/place | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Master/tlpkg/bin/place b/Master/tlpkg/bin/place index 86ae3d0dc76..7b872d454d8 100755 --- a/Master/tlpkg/bin/place +++ b/Master/tlpkg/bin/place @@ -2,15 +2,15 @@ # $Id$ # License: public domain. Originally written by Sebastian Rahtz. # -# Process a tree in the Build/cdbuild/cooked directory (probably created -# by ctan2tds.pl) and integrate into the main texmf trees. +# Process a "cooked" tree directory (probably created by ctan2tds in +# Build/tmp.cooked), and integrate into the main texmf trees. # # Basic usage: place PKG -# to process Build/cdbuild/cooked/PKG. +# to process ./PKG. BEGIN { - chomp ($mydir = `dirname $0`); - unshift (@INC, "$mydir/../../Master/tlpkg"); + chomp ($mydir = `dirname $0`); # we are in Master/tlpkg/bin + unshift (@INC, "$mydir/.."); } use File::Basename; @@ -36,14 +36,13 @@ $newpackage = 0; %dirs = (); # dirs we make changes in $TMP = $ENV{"TMPDIR"} || "/tmp"; -xchdir (dirname($0) . "/cooked"); -$mydir = getcwd(); --d "$mydir/$package" || die "$0: No such package in $mydir: $package\n"; +$cooked = getcwd(); # ctan2tl invokes us in the cooked dire +-d "$cooked/$package" || die "$0: No such package in $cooked: $package\n"; -xchdir ("../../../Master"); +&xchdir ("$mydir/../.."); $M = getcwd(); -xchdir ("$mydir/$package"); +xchdir ("$cooked/$package"); if (-d "texmf-dist") {$Root="texmf-dist"; } elsif (-d "texmf-doc") {$Root="texmf-doc"; } elsif (-d "texmf") {$Root="texmf"; } @@ -63,7 +62,7 @@ if ($Root eq 'texmf-doc') { # initialize TLPDB my $tlpdb = new TeXLive::TLPDB ( location => "$M/texlive.tlpdb" ); # create TLTREE from stuff in cooked/$pkg -my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$mydir/$package" ); +my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$cooked/$package" ); $tltree->init_from_files; # get package from TLPDB; @@ -124,7 +123,7 @@ if (!defined($tlpold)) { unlink ($diff_file); my $diff_cmd = "diff --text --ignore-all-space -U 0 -s"; foreach (@difffiles) { - my @foo = `$diff_cmd $M/$_ $mydir/$package/$_ | tee -a $diff_file`; + my @foo = `$diff_cmd $M/$_ $cooked/$package/$_ | tee -a $diff_file`; $sum += $#foo; # zero-based, so first line doesn't count. } my $nrcommfiles = @difffiles; @@ -134,7 +133,7 @@ if (!defined($tlpold)) { } -&xchdir ("$mydir/$package"); +&xchdir ("$cooked/$package"); find (\&files,"."); foreach $file (sort keys %Old) { print "* $file: [retained=$New{$file}]\n"; @@ -158,12 +157,10 @@ foreach $file (sort keys %New) { } } -xchdir ($mydir); +xchdir ($cooked); &my_system ("mv $package $package.done"); -chomp (my $tools = `cd $mydir/../../tools && pwd`); - if ($newpackage) { &add_file ("$M/tlpkg/tlpsrc/$package.tlpsrc"); } @@ -181,6 +178,7 @@ $dirs{"$M/tlpkg/tlpsrc/$package.tlpsrc"}++; $DIRLIST = ">$TMP/tlplace.dirs"; open (DIRLIST) || die "open($DIRLIST) failed: $!"; # +print "\nplace: directories are\n"; for my $dir (sort keys %dirs) { print "$dir\n"; print DIRLIST "$dir\n"; @@ -255,7 +253,8 @@ sub add_file sub xchdir { my ($dir) = @_; - chdir ($dir) || die "chdir($dir) failed: $!"; + chomp (my $pwd = `pwd`); + chdir ($dir) || die "chdir($dir) failed: $!\n(cwd=$pwd)"; print "place: chdir($dir)\n"; } |