summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/tlpkg/bin/ctan2tds46
-rwxr-xr-xMaster/tlpkg/bin/ctan2tl27
-rwxr-xr-xMaster/tlpkg/bin/place33
3 files changed, 45 insertions, 61 deletions
diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds
index 3f10db28d9a..ca930cb293b 100755
--- a/Master/tlpkg/bin/ctan2tds
+++ b/Master/tlpkg/bin/ctan2tds
@@ -1,36 +1,20 @@
#!/usr/bin/env perl
# $Id$
+# Public domain.
+# Originally written by Sebastian Rahtz. Comments to tex-live@tug.org.
#
# A script to TL-install a package from CTAN.
-# For a higher-level invocation, see ../tools/ctan2tl.
+# For a higher-level invocation, see ctan2tl.
#
-# Its actions, given a directory, are
-# 1. copy everything to texmf-dist/source/<format>/<package>
+# Its default actions, given a "raw" directory copied from CTAN (the
+# current directory on invocation), are
+# 1. copy everything to texmf-dist/doc/<format>/<package>
# 2. run any .ins files
# 3. run any .mf files through mktextfm
# 4. move .sty/.cls etc files to texmf-dist/tex/<format>/<package>
-# 5. run LaTeX on .dtx/.tex and put the .dvi files in
-# texmf-dist/doc/<format>/<package>. dtx files are run with just the
-# description if this is set up properly in the source.
-# 6. move .tex to texmf-dist/doc/<format>/<package>
+# 5. move other files to appropriate places in the hierarchy.
#
-# All the patterns for what to move or run can be overridden for each package.
-#
-# PROBLEMS
-# 1. .tex files are used for lots of different purposes, so this is flaky
-# 2. if there is no .dtx, the .sty files are *moved*, rather than copied,
-# so the source directory is not complete. is this a bug or a feature?
-# [feature --karl]
-# 3. complex packages with subdirectories are not well catered for
-#
-# ENHANCEMENTS NEEDED
-# 1. a notation for dependencies; actually surprisingly few
-# 2. cleaner way of describing the various %special... hashes, so info
-# about a given package is in one place.
-#
-# Originally written by Sebastian Rahtz. Comments to tex-live@tug.org.
-
-# License: PUBLIC DOMAIN
+# All the patterns for what to move or run can be overridden per-package.
use English;
use Getopt::Long;
@@ -38,18 +22,16 @@ use File::Basename;
use Cwd;
#
# programs used; must all be on the path
-$MV="mv";
-$CP="cp -p";
+$MV = "mv";
+$CP = "cp -p";
$| = 1;
select ((select (STDERR), $| = 1)[0]);
-# the destination destination tree
-$startdir=getcwd();
-chdir(dirname($0));
-chdir "cooked" || die "chdir(cooked) failed: $!";
-$TDS = getcwd();
-chdir $startdir || die "chdir($startdir) failed: $!";
+$startdir = getcwd(); # where we start from (raw dir)
+chdir "../tmp.cooked" || die "chdir(../tmp.cooked) failed: $!";
+$TDS = getcwd(); # locate destination dir
+chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw
#
# packages to treat entirely on their own, or not at all.
diff --git a/Master/tlpkg/bin/ctan2tl b/Master/tlpkg/bin/ctan2tl
index 5db1d382e01..1ab90ae47ed 100755
--- a/Master/tlpkg/bin/ctan2tl
+++ b/Master/tlpkg/bin/ctan2tl
@@ -7,18 +7,20 @@
#
# Basic usage: ctan2tl TLPKGNAME
# --place to include final `place' invocation (repository adds/removes).
-# --no-ctan if already have files in ../cdbuild/raw/PKG.
+# --no-ctan if already have files in Build/tmp.raw/PKG.
# Unlikely to work without GNU utilities.
#
# This does not actually commit anything to the repository. Without
# --place, it doesn't even create any files in the repository outside of
-# cdbuild/{raw,cooked}.
+# Build/tmp.{raw,cooked}.
unset CDPATH # avoid extraneous output
mydir=`cd \`dirname $0\` && pwd` # Master/tlpkg/bin
+PATH=$mydir:$PATH # we call lots of our other tools
+
Build=`cd $mydir/../../../Build && pwd`
-raw=$Build/cdbuild/raw
+raw=$Build/tmp.raw
test -d $raw || mkdir $raw
cd $raw || exit 1
@@ -52,7 +54,7 @@ echo "$0: is $ctan_dir1"
if $copy_from_ctan; then
-# remove whatever old stuff we might have.
+# remove whatever dregs in raw that might be lying around.
rm -rf $pkg
# An important special case: the latex-tds project contains tds-ready
@@ -103,19 +105,20 @@ fi # end of copying from CTAN.
#
printf "\n$0: calling ctan2tds\n"
-rm -rf ../cooked/$pkg
-test -d ../cooked || mkdir ../cooked
-../ctan2tds.pl --ctan-dir=$ctan_dir1 $pkg || exit 1
+cooked=$Build/tmp.cooked
+rm -rf $cooked/$pkg
+test -d $cooked || mkdir $cooked
+ctan2tds --ctan-dir=$ctan_dir1 $pkg || exit 1
-cd ../cooked || exit 1
+cd $cooked || exit 1
printf "\n\f cooked\n"
-find -depth -type d | xargs rmdir 2>/dev/null
+find -depth -type d | xargs rmdir 2>/dev/null # remove empty directories
find $pkg \! -type d -printf "%TY%Tm%Td.%TH%TM %p\n" | sort -r +1
-printf "\n$0: calling place $place_chicken\n"
+printf "\n$0: calling place $place_chicken $pkg\n"
rm -rf $pkg.done
-../place $place_chicken $pkg
+place $place_chicken $pkg
status=$?
-rm -rf ../raw/$pkg
+rm -rf $raw/$pkg
exit $status
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";
}