summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-tlpdb
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-06-11 03:14:34 +0000
committerNorbert Preining <preining@logic.at>2010-06-11 03:14:34 +0000
commitf161da3297477df5528ca0aabce2c826f23547d8 (patch)
treec030f428ddacac13fa5773e2a9ceaacf12861093 /Master/tlpkg/bin/tl-update-tlpdb
parentb3d52b8c494e703f7155eef9245a6055378fcdb4 (diff)
updating tlpdb: - do not add packages with revision 0 (empty)
- make sure that we use a real file for fixing reverse revs git-svn-id: svn://tug.org/texlive/trunk@18888 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-tlpdb')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb46
1 files changed, 38 insertions, 8 deletions
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index 82ed11ccd46..7e4ee959647 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -205,27 +205,52 @@ sub compare_and_fix_tlpdbs
my $commitit = 0;
+ my @svn_changed_files = ();
+
for my $p (keys %packages_that_need_fixup) {
tlwarn("$progname: package $p has different files but same/decreasing revision number\n");
if ($opt_fix_reverse_revisions) {
- my $fixp = $p;
- if ($p =~ m/^([^.]+)\.([^.]+)$/) {
- # that is a .ARCH package, we want to fix up the original tlpsrc
- $fixp = $1;
+ my $fixfile = "$opt_master/tlpkg/tlpsrc/$p.tlpsrc";
+ # make sure that we actually fix a file of the right package
+ if (! -r $fixfile) {
+ # we re quite probably trying to fix a .ARCH package with decreasing
+ # revision number, but since we do NOT include the .tlpsrc file
+ # in the computation of the .ARCH packages, we have to find a file
+ # in the packages
+ my $tlp = $newtlpdb->get_package($p);
+ if (!defined($tlp)) {
+ tlwarn("Very strange, $p is mentioned as changed files,\n");
+ tlwarn("but it is not found in new tlppdb.\n");
+ tlwarn("Not trying to fix anything, don't know how!\n");
+ next;
+ }
+ my @allf = $tlp->all_files;
+ if ($#allf < 0) {
+ tlwarn("No files found in $p, and no tlpsrc file present.\n");
+ tlwarn("Don't know how to fix decreasing version in this case.\n");
+ next;
+ }
+ # still here, so use the first file in the list.
+ $fixfile = "$opt_master/";
+ if ($tlp->relocated) {
+ $fixfile .= "$RelocTree/";
+ }
+ $fixfile .= $allf[0];
}
tlwarn("$progname: trying to fix it by running:\n");
my $time = time();
- my $cmd = "svn propset texlive:force_incr_after_delete $time $opt_master/tlpkg/tlpsrc/$fixp.tlpsrc";
+ my $cmd = "svn propset texlive:force_incr_after_delete $time $fixfile";
$commitit = 1;
tlwarn(" $cmd\n");
TeXLive::TLUtils::xsystem($cmd);
+ push @svn_changed_files, $fixfile;
}
}
if ($opt_no_commit) {
if ($commitit) {
tlwarn("$progname: tlpsrc files have been changed but not committed.\n");
tlwarn("$progname: svn status output follows:\n");
- my $r = `svn status $opt_master/tlpkg/tlpsrc 2>&1`;
+ my $r = `svn status @svn_changed_files 2>&1`;
tlwarn($r . "\n");
}
$commitit = 0;
@@ -234,7 +259,7 @@ sub compare_and_fix_tlpdbs
tlwarn("$progname: committing changes to tlpsrc files:\n");
TeXLive::TLUtils::xsystem("svn commit "
. "-m'($progname) force increased revision after removal of files' "
- . "$opt_master/tlpkg/tlpsrc/");
+ . "@svn_changed_files");
}
if (keys %packages_that_need_fixup) {
return 1;
@@ -315,7 +340,12 @@ sub create_tlpdb
# we do NOT use the tlpsrc file for computing the file revision
# as this is actually wrong ..
$binobj->recompute_revision ($tltree);
- $tldb->add_tlpobj ($binobj);
+ if ($binobj->revision == 0) {
+ debug("Packages with revision number 0 are not added: " .
+ $binobj->name . "\n");
+ } else {
+ $tldb->add_tlpobj ($binobj);
+ }
}
# we have to recompute the revision of the package itself
# since the binfiles have been removed and that might lower the