summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-09-14 17:33:33 +0000
committerNorbert Preining <preining@logic.at>2009-09-14 17:33:33 +0000
commitd84191e98fd66a54ba3c71d1819ce77c0902745b (patch)
tree1b47509008fee91cecae64c8ec639ec8e28f6418
parentececb0d2057ee69e51a5f9c5b76f46bf20ee655f (diff)
implement tl-update-tlpdb --fix-reverse-revisions
git-svn-id: svn://tug.org/texlive/trunk@15283 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb51
1 files changed, 40 insertions, 11 deletions
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index 3f0dcafe992..7c60b113c3c 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -34,6 +34,7 @@ my $opt_noautopatterns = 0;
my $opt_norevisioncheck = 0;
my $opt_tlpsrc_from_cmdline = 0;
my $opt_output;
+my $opt_fix_reverse_revisions = 1;
TeXLive::TLUtils::process_logging_options();
GetOptions(
@@ -43,6 +44,7 @@ GetOptions(
"no-autopatterns" => \$opt_noautopatterns,
"no-revision-check" => \$opt_norevisioncheck,
"from-files" => \$opt_fromfiles,
+ "fix-reverse-revisions" => \$opt_fix_reverse_revisions,
"tlpsrc-from-cmdline" => \$opt_tlpsrc_from_cmdline,
"with-win-pattern-warning" => \$opt_winwarning,
"output=s" => \$opt_output,
@@ -101,16 +103,23 @@ sub main
info("No checking on increasing revisions due to --no-revision-check\n");
finish($newtlpdb, $pkgcount);
}
- # if compare_tlpdbs returns true then some reversed revisions have been
- # found. Only if we are starting from svn we can check in new changes
- # so do not recreate the tlpdb if $opt_fromfiles is unset
- if (compare_tlpdbs($oldtlpdb, $newtlpdb) && !$opt_fromfiles) {
- # compare_tlpdbs checks in dummy changes to the tlpsrc files
- # now we check again and that should not give any changes!
- ($newtlpdb, $pkgcount) = create_tlpdb($tlc);
- if (compare_tlpdbs($oldtlpdb, $newtlpdb)) {
- tlwarn("$0: 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");
- exit(1);
+ # 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.
+ if (compare_tlpdbs($oldtlpdb, $newtlpdb)) {
+ # 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) {
+ ($newtlpdb, $pkgcount) = create_tlpdb($tlc);
+ if (compare_tlpdbs($oldtlpdb, $newtlpdb)) {
+ tlwarn("$0: 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");
+ exit(1);
+ }
}
}
# new $newtlpdb points to the right one
@@ -122,6 +131,7 @@ sub compare_tlpdbs {
#
# check that revisions are actually going forward
my $recheck = 0;
+ my $commitit = 0;
for my $p ($newtlpdb->list_packages) {
my $newrev = $newtlpdb->get_package($p)->revision;
my $oldtlp = $oldtlpdb->get_package($p);
@@ -133,10 +143,24 @@ sub compare_tlpdbs {
# here we should do a change to
# $opt_master/tlpkg/tlpsrc/$p.tlpsrc
# and commit it!
- tlwarn("$0: revision going backwards in $p!\n");
+ tlwarn("$0: revision going backwards in $p.\n");
+ if ($opt_fix_reverse_revisions) {
+ tlwarn("$0: trying to fix it, running:\n");
+ my $time = time();
+ my $cmd = "svn propset texlive:force_incr_after_delete $time $opt_master/tlpkg/tlpsrc/$p.tlpsrc";
+ $commitit = 1;
+ tlwarn(" $cmd\n");
+ system($cmd);
+ }
}
}
}
+ if ($commitit) {
+ tlwarn("$0: committing changes on tlpsrc files:\n");
+ system("svn commit -m'force increased revision after removal of files' $opt_master/tlpkg/tlpsrc/");
+ # we do not check the outcome, we expect to see a positive result
+ # after rebuilding the tlpdb
+ }
return($recheck);
}
@@ -283,6 +307,11 @@ By default, B<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>
+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.
+
=back
The standard options B<-q>, B<-v>, and B<-logfile>=I<file> are also