summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-10-06 00:23:51 +0000
committerKarl Berry <karl@freefriends.org>2009-10-06 00:23:51 +0000
commitba17b2ea7260e7c0f859347a24ddc83f0e5e697f (patch)
treeead00cccf337348096a7bc85c5233b1bee673177
parent00a724a948c9a799534430982a732a5b27ccacba (diff)
TeXCatalogue: less debugging
TLPSRC, TLPOBJ: set format_lines_per_page on the right file handle tl-update-tlpdb: rename a couple options, mess with doc tl-update-bindir: cygwin location git-svn-id: svn://tug.org/texlive/trunk@15651 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm4
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm14
-rw-r--r--Master/tlpkg/TeXLive/TeXCatalogue.pm6
-rwxr-xr-xMaster/tlpkg/bin/tl-update-bindir2
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb180
5 files changed, 104 insertions, 102 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index c0c2dcb5066..0a2eae5bcfa 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -331,10 +331,10 @@ sub writeout {
# ugly hack to get rid of use FileHandle; see man perlform
#format_name $fd "multilineformat";
select((select($fd),$~ = "multilineformat")[0]);
- $= = 99999; # no pages in this format
+ $fd->format_lines_per_page (99999); # no pages in this format
if (defined($self->{'longdesc'})) {
$_tmp = "$self->{'longdesc'}";
- write $fd;
+ write $fd; # use that multilineformat
}
if (defined($self->{'depends'})) {
foreach (@{$self->{'depends'}}) {
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index da7d1861f68..622362653cb 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -183,14 +183,14 @@ sub writeout
my $self = shift;
my $fd = (@_ ? $_[0] : STDOUT);
format_name $fd "multilineformat";
- $= = 99999; # no pages in this format
+ $fd->format_lines_per_page (99999); # no pages in this format
print $fd "name ", $self->name, "\n";
print $fd "category ", $self->category, "\n";
defined($self->{'catalogue'}) && print $fd "catalogue $self->{'catalogue'}\n";
defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n";
if (defined($self->{'longdesc'})) {
$_tmp = "$self->{'longdesc'}";
- write $fd;
+ write $fd; # use that multilineformat
}
if (defined($self->{'depends'})) {
foreach (@{$self->{'depends'}}) {
@@ -491,18 +491,18 @@ sub find_default_patterns
}
for my $cat (keys %autopatterns) {
- debug ("Category $cat\n");
+ ddebug ("Category $cat\n");
for my $d (@{$autopatterns{$cat}{"bin"}}) {
- debug ("Found auto bin pattern $d\n");
+ ddebug ("auto bin pattern $d\n");
}
for my $d (@{$autopatterns{$cat}{"src"}}) {
- debug ("Found auto src pattern $d\n");
+ ddebug ("auto src pattern $d\n");
}
for my $d (@{$autopatterns{$cat}{"doc"}}) {
- debug ("Found auto doc pattern $d\n");
+ ddebug ("auto doc pattern $d\n");
}
for my $d (@{$autopatterns{$cat}{"run"}}) {
- debug ("Found auto run pattern $d\n");
+ ddebug ("auto run pattern $d\n");
}
}
diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm
index 10ca161ff83..8ff06b08040 100644
--- a/Master/tlpkg/TeXLive/TeXCatalogue.pm
+++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm
@@ -88,7 +88,8 @@ sub initialize {
}
}
-sub beautify{
+sub beautify
+{
my ($txt) = @_;
$txt =~ s/\n/ /g;
$txt =~ s/^[[:space:]]*//g;
@@ -181,7 +182,8 @@ sub initialize {
# the catalogue.dtd is searched in a/catalogue.dtd etc, see above
my $cwd = `pwd`;
chomp($cwd);
- chdir($self->{'location'} . "/entries") || die ("Cannot chdir to TeX Catalogue entries: $!");
+ chdir($self->{'location'} . "/entries")
+ || die "chdir($self->{location}/entries failed: $!";
# parse all the files
foreach (glob("?/*.xml")) {
open(my $io,"<$_") or die "Cannot read $_: $!";
diff --git a/Master/tlpkg/bin/tl-update-bindir b/Master/tlpkg/bin/tl-update-bindir
index 7bcef7d29bb..cdfd68fae1b 100755
--- a/Master/tlpkg/bin/tl-update-bindir
+++ b/Master/tlpkg/bin/tl-update-bindir
@@ -107,7 +107,7 @@ for tlname in $tlnames; do
$grab http://www.jtartlabs.com/test/hppa2.0-hp-hpux10.20.tar.gz;;
i386-cygwin)
default_bin_loc=$download_loc
- $grab http://www.math.cornell.edu/~kbrown/cygwin_r15328.tgz;;
+ $grab http://www.math.cornell.edu/~kbrown/cygwin_r15587.tgz;;
i386-freebsd)
default_bin_loc=/home/manfred/tl2008.bin.tar.lzma;;
i386-linux)
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index b7707a15b0c..15e12c1f831 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -28,9 +28,8 @@ my $opt_catalogue = "";
chomp (my $opt_master = `cd $::mydir/../.. && pwd`);
my $help = 0;
my $opt_nobinsplit = 0;
-my $opt_winwarning;
+my $opt_w32warning;
my $opt_fromfiles = 0;
-my $opt_noautopatterns = 0;
my $opt_norevisioncheck = 0;
my $opt_tlpsrc_from_cmdline = 0;
my $opt_output;
@@ -40,18 +39,17 @@ my $opt_save_anyway = 0;
TeXLive::TLUtils::process_logging_options();
GetOptions(
- "master=s" => \$opt_master, # location of the TL tree
- "catalogue=s" => \$opt_catalogue, # location of the TeX Catalogue
- "no-bin-split!" => \$opt_nobinsplit,
- "no-autopatterns" => \$opt_noautopatterns,
- "no-revision-check" => \$opt_norevisioncheck,
- "from-files" => \$opt_fromfiles,
- "fix-reverse-revisions" => \$opt_fix_reverse_revisions,
- "no-commit" => \$opt_no_commit,
- "save-anyway" => \$opt_save_anyway,
- "tlpsrc-from-cmdline" => \$opt_tlpsrc_from_cmdline,
- "with-win-pattern-warning" => \$opt_winwarning,
- "output=s" => \$opt_output,
+ "catalogue=s" => \$opt_catalogue,
+ "fix-reverse-revisions!" => \$opt_fix_reverse_revisions,
+ "from-files" => \$opt_fromfiles,
+ "master=s" => \$opt_master,
+ "no-bin-split!" => \$opt_nobinsplit,
+ "no-commit!" => \$opt_no_commit,
+ "no-reverse-revision-check!" => \$opt_norevisioncheck,
+ "output=s" => \$opt_output,
+ "save-anyway!" => \$opt_save_anyway,
+ "tlpsrc-from-cmdline" => \$opt_tlpsrc_from_cmdline,
+ "with-w32-pattern-warning" => \$opt_w32warning,
"help|?" => \$help) or pod2usage(1);
pod2usage(-exitstatus => 0, -verbose => 2) if $help;
@@ -59,29 +57,7 @@ my $progname = TeXLive::TLUtils::basename($0);
exit (&main ());
-
-
-
-
-sub finish
-{
- my ($tlpdb, $pkgcount) = @_;
- if ($opt_output) {
- if (open(OUT, ">$opt_output")) {
- $tlpdb->writeout(\*OUT);
- info ("$progname: wrote $pkgcount packages to $opt_output.\n");
- } else {
- warn ("Cannot open $opt_output for writing");
- exit 1;
- }
- } else {
- $tlpdb->save;
- info ("$progname: wrote $pkgcount packages to ". $tlpdb->root . ".\n");
- }
- exit(0);
-}
-
sub main
{
if (! -d $opt_master) {
@@ -102,12 +78,12 @@ sub main
}
my ($newtlpdb, $pkgcount) = create_tlpdb($tlc);
if (!defined($oldtlpdb)) {
- info("No checking on increasing revisions, no old tlpdb found\n");
- finish($newtlpdb, $pkgcount);
+ info ("$progname: No checking on increasing revisions, no old tlpdb found\n");
+ finish ($newtlpdb, $pkgcount);
}
if ($opt_norevisioncheck) {
- info("No checking on increasing revisions due to --no-revision-check\n");
- finish($newtlpdb, $pkgcount);
+ info ("$progname: No checking on increasing revisions due to --no-reverse-revision-check\n");
+ finish ($newtlpdb, $pkgcount);
}
# compare_tlpdbs returns true if some reversed revisions have been found.
# If in addition the option --fix-reverse-revisions is given it tries
@@ -151,7 +127,9 @@ sub main
finish ($newtlpdb, $pkgcount) if (!$buggy_tlpdb);
}
-sub compare_and_fix_tlpdbs {
+
+sub compare_and_fix_tlpdbs
+{
my ($oldtlpdb, $newtlpdb) = @_;
my %ret = TeXLive::TLUtils::compare_tlpdbs($oldtlpdb, $newtlpdb);
@@ -236,12 +214,11 @@ sub compare_and_fix_tlpdbs {
}
}
-
-
+
sub create_tlpdb
{
my $tlc = shift;
- if (defined($opt_winwarning)) {
+ if (defined($opt_w32warning)) {
$::tlpsrc_pattern_warn_win = 1;
}
my $tlpsrc_dir = "$opt_master/tlpkg/tlpsrc";
@@ -326,6 +303,25 @@ sub create_tlpdb
return($tldb, $src_count);
}
+
+
+sub finish
+{
+ my ($tlpdb,$pkgcount) = @_;
+ if ($opt_output) {
+ if (open(OUT, ">$opt_output")) {
+ $tlpdb->writeout(\*OUT);
+ info ("$progname: wrote $pkgcount packages to $opt_output.\n");
+ } else {
+ tldie ("$progname: open(>$opt_output) failed: $!");
+ }
+ } else {
+ $tlpdb->save;
+ info ("$progname: wrote $pkgcount packages to " . $tlpdb->root . ".\n");
+ }
+ exit (0);
+}
+
__END__
=head1 NAME
@@ -342,9 +338,20 @@ tl-update-tlpdb [OPTION]... [TLPSRC]...
=item B<-catalogue> I<Catalogue_dir>
-The location given by B<-catalogue> must point to a valid TeX Catalogue.
-No default value. If given, the generated tlpobj files will contain
-information gathered from the TeX Catalogue.
+The location given by B<-catalogue> must point to a valid TeX Catalogue
+directory (with subdirectory C<entries>). No default value. If given,
+the generated tlpobj files will contain information gathered from the
+TeX Catalogue.
+
+=item B<-fix-reverse-revisions>
+
+If a package with revisions going backward is found, this option makes
+C<tl-update-tlpdb> try to check in some dummy changes to the package's
+tlpsrc file to artificially increase the version number.
+
+=item B<-from-files>
+
+Use C<find> instead of C<svn -status> to create the list of files.
=item B<-master> I<Master/dir>
@@ -357,70 +364,63 @@ Do NOT split files with binaries into several packages (one for the arch
independent and one for each of the architectures with only the respective
binaries). There is no reason to use this option.
-=item B<-tlpsrc-from-cmdline>
-
-by default, B<tl-update-tlpdb> recreates the tlpdb from all the tlpsrc
-files present in the current tree. If this option is given the tlpsrc
-have to be given on the command line.
-
-=item B<-output=filename>
-
-by default, B<tl-update-tlpdb> saves/updates the tlpdb in the default
-place. This option specifies the place where the output should go to.
-
-=item B<-with-win-pattern-warning>
-
-Normally, this program issues a warning for all patterns without a matching
-file, but does I<not> warn for binpatterns when working on the win32
-architecture. Giving this option makes it issues all warnings, i.e., also
-those where a binpattern on win32 does not hit.
-
-=item B<-from-files>
+=item B<-no-commit>
-Use find instead of svn -status to create the list of files.
+If changes have been made to the tlpsrc files (because reversed
+revisions have been found and C<-fix-reverse-revisions> was given) these
+changes will by default committed using C<svn commit> on the tlpsrc
+directory. With this option the commit step is skipped.
-=item B<-no-revision-check>
+=item B<-no-reverse-revision-check>
-By default, B<tl-update-tlpdb> checks that in the generated tlpdb the
+By default, C<tl-update-tlpdb> checks that in the generated tlpdb the
revision numbers of packages are not going backward compared to the
previous version. This option disables this check.
-=item B<-fix-reverse-revisions>
+=item B<-output=filename>
-If a package with revisions going backward is found, this option makes
-tl-update-tlpdb try to check in some dummy changes to the package's tlpsrc
-file to artificially increase the version number.
+By default, B<tl-update-tlpdb> saves/updates the tlpdb in the default
+place. This option specifies the place where the output should go to.
-=item B<-no-commit>
+=item B<-save-anyway>
-If changes have been made to the tlpsrc files (because reversed revisions
-have been found and B<-fix-reverse-revisions> was given) these changes
-will by default committed using C<svn commit> on the tlpsrc directory. Giving
-this option the commit step is skipped.
+If the newly created tlpdb is in considered buggy due to reversed
+revisions it will normally not be saved. This switch allows saving it
+anyway. It can be useful in combination with the C<-from-files> option
+where the revision numbers will be adjusted afterwards by an external
+program.
-=item B<-save-anyway>
+=item B<-tlpsrc-from-cmdline>
+
+By default, B<tl-update-tlpdb> recreates the tlpdb from all the tlpsrc
+files present in the current tree. If this option is given, the tlpsrc
+have to be given on the command line. If you're trying to debug the
+conversion of one particular package, this is the option to use.
+
+=item B<-with-w32-pattern-warning>
-If the newly created tlpdb is in considered buggy due to reversed revisions
-it will normally not be saved. This switch allows saving it anyway. It can
-be useful in combination with the B<-from-files> option where the revision
-numbers will be adjusted afterwards by an external program.
+Normally, this program issues a warning for patterns without a matching
+file, with the exception that it does I<not> warn for binpatterns when
+working on the win32 architecture. Giving this option makes it issue
+all warnings, i.e., also those where a binpattern on win32 does not hit.
=back
-The standard options B<-q>, B<-v>, and B<-logfile>=I<file> are also
+The standard options C<-q>, C<-v>, and C<-logfile>=I<file> are also
accepted; see the C<process_logging_options> function in
L<TeXLive::TLUtils> for details.
=head1 DESCRIPTION
-B<tl-update-tlpdb> converts TeX Live source package files (tlpsrc) files
+C<tl-update-tlpdb> converts TeX Live source package files (tlpsrc) files
into a TeX Live package database (tlpdb).
-In addition if at the same location there is already a TLPDB, it compares
-the revision number of packages and checks if a package is going back
-in time (i.e., having a smaller revision number in the new tlpdb). In
-this case it commits a dummy change to the package's tlpsrc file to make
-sure that revisions are always increasing.
+In addition if at the same location there is already a TLPDB, it
+compares the revision number of packages and checks if a package is
+going back in time (i.e., having a smaller revision number in the new
+tlpdb). This can happen when a file is removed and no other changes
+made. In this case it commits a dummy change to the package's tlpsrc
+file to make sure that revisions are always increasing.
If a TeX Catalogue hierarchy is specified, additional information from
the catalogue are merged into the database (see L<TeXLive::TLPOBJ> for