summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-05-11 12:11:41 +0000
committerNorbert Preining <preining@logic.at>2008-05-11 12:11:41 +0000
commit9735077b1c5a56b7ba25ae8c9ea1e6ae60e36856 (patch)
tree5135750086f49171ecd6a8d6829ee07f778c42d3 /Master/tlpkg/bin
parent90e8f6b15731588952d485b86e7b72efd8e5a119 (diff)
really fix tl-update-containers for removal of containers
git-svn-id: svn://tug.org/texlive/trunk@8054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-containers27
1 files changed, 24 insertions, 3 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers
index bc028332367..bb48c217d8d 100755
--- a/Master/tlpkg/bin/tl-update-containers
+++ b/Master/tlpkg/bin/tl-update-containers
@@ -68,6 +68,7 @@ sub main
tllog($::LOG_DEBUG, "format=$type srcsplit=$srcsplit docsplit=$docsplit\n");
my @todopacks = ();
+ my @removepacks = ();
my $opt_containerdir = "$opt_location/$TeXLive::TLConfig::NetArchive";
my %count;
if ($opt_recreate) {
@@ -80,6 +81,10 @@ sub main
my %archiverevs;
foreach my $pkg ($nettlpdb->list_packages()) {
$archiverevs{$pkg} = $nettlpdb->get_package($pkg)->revision();
+ if (!defined($tlpdb->get_package($pkg))) {
+ # $pkg has disappeared, removing it
+ push @removepacks, $pkg;
+ }
}
# collect packages to be updated.
@@ -103,9 +108,10 @@ sub main
if (defined($tlp)) {
$newrev = $tlp->revision;
} else {
- tllog($::LOG_NORMAL, "$pkg has disappeared, removing its containers\n");
- `rm $opt_containerdir/$pkg.*`;
- $count{"removed"}++;
+ # that cannot happen!!! we are looping over the packages of
+ # $tlpdb so the above ->get_package will succeed (or something
+ # stranged happened!
+ die ("Huu, that should not happen ...");
}
if ($oldrev == $newrev) {
@@ -152,6 +158,12 @@ sub main
$pkg, $opt_relative);
}
+ # next we remove those containers which have been gone!
+ foreach my $op (@removepacks) {
+ tllog($::LOG_NORMAL, "$op has disappeared, removing its containers\n");
+ `rm $opt_containerdir/$op.*`;
+ $count{"removed"}++;
+ }
if (@todopacks) {
# we updated something
print "$0: $count{new} new, $count{removed} removed, "
@@ -166,6 +178,15 @@ sub main
$tlpdb->root($opt_location);
$tlpdb->save;
system("lzma --force -k -z $opt_location/tlpkg/texlive.tlpdb");
+ #
+ # do a last check that all the containers are actually present
+ foreach my $p ($tlpdb->list_packages) {
+ next if ($p eq "00texlive.config");
+ next if ($p eq "00texlive.installer");
+ if (! -r "$opt_containerdir/$p.tar.lzma") {
+ tllog($::LOG_NORMAL, "container for $p is missing, strange!\n");
+ }
+ }
}