From 7dcca4169af060615f07f1a139046273e3c7c63d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 17 Sep 2009 14:38:36 +0000 Subject: simplify tl-compare-tlpdbs by using the TLUtils function, docs tl-update-tlpdb git-svn-id: svn://tug.org/texlive/trunk@15337 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-update-tlpdb | 60 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) (limited to 'Master/tlpkg/bin/tl-update-tlpdb') diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb index 4984088cede..b7707a15b0c 100755 --- a/Master/tlpkg/bin/tl-update-tlpdb +++ b/Master/tlpkg/bin/tl-update-tlpdb @@ -35,6 +35,8 @@ my $opt_norevisioncheck = 0; my $opt_tlpsrc_from_cmdline = 0; my $opt_output; my $opt_fix_reverse_revisions = 0; # needs svn commit +my $opt_no_commit = 0; # do/don't commit the changes +my $opt_save_anyway = 0; TeXLive::TLUtils::process_logging_options(); GetOptions( @@ -45,6 +47,8 @@ GetOptions( "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, @@ -108,27 +112,43 @@ sub main # compare_tlpdbs returns true if some reversed revisions have been found. # If in addition the option --fix-reverse-revisions is given it tries # to fix that, by committing changes. + my $buggy_tlpdb = 0; if (compare_and_fix_tlpdbs($oldtlpdb, $newtlpdb)) { + $buggy_tlpdb = 1; # there have been reversed revision that have already been warned about # and that have been (hopefully) fixed by compared_tlpdbs if # --fix-reverse-revisions has been given # # if we are running from svn (no --from-files is given) and we try - # to fix revisions (--fix-reverse-revisions) is given, then we recreate - # the tlpdb - if (!$opt_fromfiles && $opt_fix_reverse_revisions) { + # to fix revisions (--fix-reverse-revisions) is given, and we do + # commit the changes (!$opt_no_commit), then we recreate the tlpdb + # + if (!$opt_fromfiles && $opt_fix_reverse_revisions && !$opt_no_commit) { ($newtlpdb, $pkgcount) = create_tlpdb($tlc); # # now recheck, but do NOT try to check in changes again by unsetting # $opt_fix_reverse_revisions $opt_fix_reverse_revisions = 0; if (compare_and_fix_tlpdbs($oldtlpdb, $newtlpdb)) { - tldie("$progname: That should not happen, after one iteration of compare_tlpdbs\nthe newly created tlpdb is still going backwards in time.\nPlease check output above!\n"); + tlwarn("$progname: That should not happen, after one iteration of compare_tlpdbs\nthe newly created tlpdb is still going backwards in time.\nPlease check output above!\n"); + # $buggy_tlpdb is already set to 1 + } else { + # fixing did succeed + $buggy_tlpdb = 0; } } } # new $newtlpdb points to the right one - finish ($newtlpdb, $pkgcount); + if ($buggy_tlpdb) { + tlwarn("$progname: the newly created tlpdb seems to be buggy.\n"); + if ($opt_save_anyway) { + tlwarn("$progname: saving it anyway due to --save-anyway\n"); + $buggy_tlpdb = 0; + } else { + tlwarn("$progname: not saving it, you might use --save-anyway\n"); + } + } + finish ($newtlpdb, $pkgcount) if (!$buggy_tlpdb); } sub compare_and_fix_tlpdbs { @@ -194,6 +214,15 @@ sub compare_and_fix_tlpdbs { TeXLive::TLUtils::xsystem($cmd); } } + if ($opt_no_commit) { + if ($commitit) { + tlwarn("$progname: tlpsrc files have been change but not committed.\n"); + tlwarn("$progname: svn status output follows:\n"); + my $r = `svn status $opt_master/tlpkg/tlpsrc 2>&1`; + tlwarn($r . "\n"); + } + $commitit = 0; + } if ($commitit) { tlwarn("$progname: committing changes to tlpsrc files:\n"); TeXLive::TLUtils::xsystem("svn commit " @@ -312,15 +341,18 @@ tl-update-tlpdb [OPTION]... [TLPSRC]... =over 4 =item B<-catalogue> I + 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. =item B<-master> I + The location I must point to a valid svn repository of TeX Live's Master directory. Defaults to C<../..> of C<$0>. =item B<-no-bin-split> + 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. @@ -337,24 +369,42 @@ by default, B 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 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> + Use find instead of svn -status to create the list of files. =item B<-no-revision-check> + By default, B 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> + 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. +=item B<-no-commit> + +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 on the tlpsrc directory. Giving +this option the commit step is skipped. + +=item B<-save-anyway> + +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. + =back The standard options B<-q>, B<-v>, and B<-logfile>=I are also -- cgit v1.2.3