From 4b04dbdaf4dc4a33b34dfb1381cc7fd2c8c39d42 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 30 Sep 2008 12:31:50 +0000 Subject: tl-update-containers: - make recreate use a new TLPDB if @ARGV is given, otherwise a copy - make the info messages more logical git-svn-id: svn://tug.org/texlive/trunk@10800 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-update-containers | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index c3ca0a7d97e..1d3c8c43098 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -86,10 +86,15 @@ sub main if ($opt_recreate) { # remake everything. - @todopacks = @ARGV ? @ARGV : $tlpdb->list_packages; - $nettlpdb = $tlpdb->copy; + if (@ARGV) { + @todopacks = @ARGV; + $nettlpdb = TeXLive::TLPDB->new; + die "Cannot create new tlpdb" unless defined($nettlpdb); + } else { + @todopacks = $tlpdb->list_packages; + $nettlpdb = $tlpdb->copy; + } $nettlpdb->root($opt_location); - } else { $nettlpdb = TeXLive::TLPDB->new("root" => $opt_location); if (!defined($nettlpdb)) { @@ -251,12 +256,16 @@ sub main $count{"removed"}++; } - if (@todopacks && ! $opt_recreate) { - # we updated something - print "$0: $count{new} new, $count{removed} removed, " - . "$count{updated} updated, $count{unchanged} unchanged.\n"; + if ($opt_recreate) { + info("$0: all packages recreated!\n"); } else { - print "$0: nothing to be done.\n"; + if (@todopacks) { + # we updated something + print "$0: $count{new} new, $count{removed} removed, " + . "$count{updated} updated, $count{unchanged} unchanged.\n"; + } else { + print "$0: nothing to be done.\n"; + } } # STRANGE: It seems that calling -recreate did not save the @@ -266,7 +275,7 @@ sub main 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) { + foreach my $p ($nettlpdb->list_packages) { next if $p =~ /00texlive.*\./; if (! -r "$opt_containerdir/$p.tar.lzma") { tlwarn ("container for $p is missing, strange!\n"); -- cgit v1.2.3