summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-02-06 00:12:54 +0000
committerKarl Berry <karl@freefriends.org>2006-02-06 00:12:54 +0000
commit535dd1c4401bbf2711e1ce0d5e9c50ffc6f9004b (patch)
treec8af3f859a53c3a34abe9855e9321ba22d50e024
parentdd789d6487e7457dc3d694ebc434af129bb3fd33 (diff)
* Master/Tools/Tpm.pm (IgnoredFiles): remove bin dirs,
add .svn. * Master/Tools/FileUtils.pm (globexpand_push): respect IgnoredFiles. (backtrace): debugging routine. * Master/Tools/tpm-factory.pl (collect_files): debugging. * Master/Tools/update-tpm: allow --debug as an option. git-svn-id: svn://tug.org/texlive/trunk@1497 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/Tools/FileUtils.pm22
-rw-r--r--Master/Tools/Tpm.pm13
-rwxr-xr-xMaster/Tools/tpm-factory.pl11
-rwxr-xr-xMaster/Tools/update-tpm5
4 files changed, 41 insertions, 10 deletions
diff --git a/Master/Tools/FileUtils.pm b/Master/Tools/FileUtils.pm
index cf17b4203e7..99e777aa17f 100644
--- a/Master/Tools/FileUtils.pm
+++ b/Master/Tools/FileUtils.pm
@@ -196,7 +196,7 @@ sub walk_dir {
my ($dir, $proc, $prune) = @_;
my (@l, $f, $done, $src, $DIR);
- warn " Walking $dir\n" if $::opt_debug;
+ print " walking $dir with $proc, $prune\n" if $::opt_debug;
if ((! $prune) || ($prune && ! &{$prune}($dir))) {
$done = 0;
@@ -588,10 +588,12 @@ sub globexpand_push {
my ($file);
$dir =~ s@\\@/@g;
foreach $file (@l) {
- next if $file =~ /^\.\.$/;
- #print " push $dir/$file\n" if $::opt_debug;
- if (-f "$dir/$file") {
- push @listglob, "$dir/$file";
+ next if $file =~ /^\.\.?$/;
+ my $path = "$dir/$file";
+ next if $path =~ m/^${Tpm::IgnoredFiles}$/;
+ if (-f $path) {
+ #print " push $dir/$file\n" if $::opt_debug;
+ push @listglob, $path;
}
}
}
@@ -974,6 +976,16 @@ sub regexpify {
return &FileUtils::tree2list($node);
}
+# Print Perl backtrace, for debugging.
+sub backtrace {
+ my $subr;
+ my $stackframe = 0;
+ while (($pkg,$filename,$line,$subr) = caller ($stackframe)) {
+ print "$filename:$line: $pkg::$subr called\n";
+ $stackframe++;
+ }
+}
+
END { }
1;
diff --git a/Master/Tools/Tpm.pm b/Master/Tools/Tpm.pm
index d1ce97403d7..9720770a47c 100644
--- a/Master/Tools/Tpm.pm
+++ b/Master/Tools/Tpm.pm
@@ -101,7 +101,18 @@ $Editor = ($^O =~ m/win32/i ? "notepad": "vi");
"TLCore/bin-windvi"
);
-$IgnoredFiles = "(bin/i386-freebsd|bin/i386-openbsd|bin/i386-solaris|bin/mips-irix|bin/powerpc-aix|bin/powerpc-darwin|bin/sparc-solaris|bin/win32/TeXLive.exe|texmf/tpm/(collection-binaries|texlive|xemtex|scheme-.*|.*-static)\.tpm|texmf(-doc|-dist)?/(ls-R|aliases|lists/.*|README|tpm/tpm.dtd)|source/.*)";
+# this list is not up to date, therefore I think it is not needed.
+# . "bin/i386-freebsd|bin/i386-openbsd|bin/i386-solaris|bin/mips-irix"
+# . "|bin/powerpc-aix|bin/powerpc-darwin|bin/sparc-solaris"
+
+# used both to ignore whole tpm's (?) and individual files?
+# must match whole path
+$IgnoredFiles = "("
+ . 'source/.*'
+ . '|texmf/tpm/(collection-binaries|texlive|xemtex|scheme-.*|.*-static)\.tpm'
+ . '|texmf(-doc|-dist)?/(ls-R|aliases|lists/.*|README|tpm/tpm.dtd)'
+ . '|.*/\.svn.*'
+ . ")";
# The so-called engines
my @engines = ("aleph", "enctex", "eomega", "metafont", "metapost", "omega", "pdftex", "pdfetex", "tex", "vtex",
diff --git a/Master/Tools/tpm-factory.pl b/Master/Tools/tpm-factory.pl
index a1995b0c4de..34172b02d0b 100755
--- a/Master/Tools/tpm-factory.pl
+++ b/Master/Tools/tpm-factory.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
# $Id: //depot/Master/Tools/tpm-factory.pl#46 $ $Date: 2005/10/05 $ $Author: staw $
# Public domain.
#
@@ -235,9 +235,12 @@ sub collect_files {
if (-f "$path") {
$path =~ s@^${opt_master_dir}/@@;
$path =~ s@\\@/@g;
- if ($path !~ m@^${Tpm::IgnoredFiles}$@
-# && $path !~ m@^bin/win32-static/@
- ) { push @texmf_files, $path; }
+ unless ($path =~ m/^${Tpm::IgnoredFiles}$/) {
+ push @texmf_files, $path;
+ #warn "accepted $path\n";
+ } else {
+ ; #warn "ignored $path\n";
+ }
}
}
}
diff --git a/Master/Tools/update-tpm b/Master/Tools/update-tpm
index 234de2dd053..e47ae77354c 100755
--- a/Master/Tools/update-tpm
+++ b/Master/Tools/update-tpm
@@ -10,6 +10,11 @@ tools=$master/Tools
verbose=${OVERRIDE_VERBOSE-}
+if test "x$1" = x--debug; then
+ verbose=--debug
+ shift
+fi
+
test $# -eq 0 && set - TLCore Package Documentation
for type in "$@"; do