diff options
author | Norbert Preining <preining@logic.at> | 2008-04-17 07:10:38 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-04-17 07:10:38 +0000 |
commit | 4138cce94dafad3e60fc79ca2452ebc3dc98ab7f (patch) | |
tree | 985673cd59e9611b82f3e25d57369d4d28eabc74 /Master/tlpkg/bin/tl-update-containers | |
parent | 6814ab14be67c0030628aa4c274bb2c26c144440 (diff) |
remove any trace of texlive.pkgver
git-svn-id: svn://tug.org/texlive/trunk@7462 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-containers | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index f886c226f89..99bf1c30f43 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -25,12 +25,12 @@ use File::Path; our $mydir; my $opt_debug = 0; -my $opt_containerdir = "./tlpkg"; +my $opt_location = "."; my $opt_relative = 0; my $help = 0; GetOptions( - "containerdir=s" => \$opt_containerdir, + "location=s" => \$opt_location, "debug!" => \$opt_debug, "help|?" => \$help) or pod2usage(1); @@ -65,24 +65,21 @@ sub main tllog($::LOG_DEBUG, "format=$type srcsplit=$srcsplit docsplit=$docsplit\n"); - # read in the old texlive.pkgver and save the revisions. - # If it's not present, we'll update everything, i.e., populating a - # directory for the first time. + my $nettlpdb = TeXLive::TLPDB->new(root => $opt_location); + if (!defined($nettlpdb)) { + die "Cannot init tlpdb from $opt_location ..."; + } my %archiverevs; - local *TMP; - if (open(TMP, "<$opt_containerdir/texlive.pkgver")) { - while (<TMP>) { - my ($pkg,$rev) = split; - $archiverevs{$pkg} = $rev; - } - close(TMP); + foreach my $pkg ($nettlpdb->list_packages()) { + $archiverevs{$pkg} = $nettlpdb->get_package($pkg)->revision(); } # collect packages to be updated. my %count; $count{"new"} = $count{"removed"} = $count{"updated"} = $count{"unchanged"} = 0; - + + my $opt_containerdir = "$opt_location/$TeXLive::TLConfig::NetArchive"; my @todopacks = (); for my $pkg (@packs) { next if ($pkg eq "00texlive.config"); @@ -115,7 +112,7 @@ sub main } else { die "This shouldn't happen! The revision of $pkg in texlive.tlpdb" . "($newrev) is OLDER than the one in" - . "$opt_containerdir/texlive.pkgver ($oldrev), goodbye"; + . "$opt_location/tlpkg/texlive.tlpdb ($oldrev), goodbye"; } } @@ -146,16 +143,15 @@ sub main if (@todopacks) { # we updated something - print "$0: updating $opt_containerdir/texlive.pkgver ...\n"; - my $PKGVER = ">$opt_containerdir/texlive.pkgver"; - open (TMP, $PKGVER) || die "open($PKGVER) failed: $!"; - $tlpdb->generate_packagelist (\*TMP); - close (TMP) || warn "close($PKGVER) failed: $!"; print "$0: $count{new} new, $count{removed} removed, " . "$count{updated} updated, $count{unchanged} unchanged.\n"; + # Finally we copy the source tlpdb over to the destination tlpdb + $tlpdb->root($opt_location); + $tlpdb->save; } else { print "$0: nothing to be done.\n"; } + } |