diff options
author | Karl Berry <karl@freefriends.org> | 2009-10-06 00:23:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-10-06 00:23:51 +0000 |
commit | ba17b2ea7260e7c0f859347a24ddc83f0e5e697f (patch) | |
tree | ead00cccf337348096a7bc85c5233b1bee673177 /Master/tlpkg/bin/tl-update-tlpdb | |
parent | 00a724a948c9a799534430982a732a5b27ccacba (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
Diffstat (limited to 'Master/tlpkg/bin/tl-update-tlpdb')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-tlpdb | 180 |
1 files changed, 90 insertions, 90 deletions
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 |