diff options
author | Norbert Preining <preining@logic.at> | 2008-05-01 21:09:37 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-05-01 21:09:37 +0000 |
commit | 9fc6b592467e5490e4e6d09c6742fa308a91cbaa (patch) | |
tree | e0d4ad44581fe28417bfaa8b442f9a38cefb8295 /Master/tlpkg/bin/tl-update-containers | |
parent | 7b5d6090b560327fb73f8ac9d3a6abae0373c120 (diff) |
use .bat wrappers instead of .texlua
- replace many wrappers with a default .bat file
- change the check-wrapper script
- do not make the PATHEXT and association magic in windows
git-svn-id: svn://tug.org/texlive/trunk@7785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-containers | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index 99bf1c30f43..c051e58feec 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -27,11 +27,13 @@ our $mydir; my $opt_debug = 0; my $opt_location = "."; my $opt_relative = 0; +my $opt_recreate = 0; my $help = 0; GetOptions( "location=s" => \$opt_location, "debug!" => \$opt_debug, + "recreate" => \$opt_recreate, "help|?" => \$help) or pod2usage(1); pod2usage(-exitstatus => 0, -verbose => 2) if $help; @@ -65,54 +67,58 @@ sub main tllog($::LOG_DEBUG, "format=$type srcsplit=$srcsplit docsplit=$docsplit\n"); - my $nettlpdb = TeXLive::TLPDB->new(root => $opt_location); - if (!defined($nettlpdb)) { - die "Cannot init tlpdb from $opt_location ..."; - } - my %archiverevs; - 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"); - next if ($pkg eq "00texlive.installer"); - my $oldrev = 0; - if (-r "$opt_containerdir/$pkg.tar.$type" - && defined($archiverevs{$pkg})) { - $oldrev = $archiverevs{$pkg}; - } else { - tllog($::LOG_NORMAL, "$pkg is new, found no containers\n"); - $count{"new"}++; + my $opt_containerdir = "$opt_location/$TeXLive::TLConfig::NetArchive"; + my %count; + if ($opt_recreate) { + @todopacks = $tlpdb->list_packages(); + } else { + my $nettlpdb = TeXLive::TLPDB->new(root => $opt_location); + if (!defined($nettlpdb)) { + die "Cannot init tlpdb from $opt_location ..."; } - - my $tlp = $tlpdb->get_package($pkg); - my $newrev = 0; - if (defined($tlp)) { - $newrev = $tlp->revision; - } else { - tllog($::LOG_NORMAL, "$pkg has disappeared, removing its containers\n"); - `rm $opt_containerdir/$pkg.*`; - $count{"removed"}++; + my %archiverevs; + foreach my $pkg ($nettlpdb->list_packages()) { + $archiverevs{$pkg} = $nettlpdb->get_package($pkg)->revision(); } - if ($oldrev == $newrev) { - tllog($::LOG_DEBUG, "$pkg up to date\n"); - $count{"unchanged"}++; - } elsif ($oldrev < $newrev) { - push @todopacks, $pkg; - $count{"updated"}++ if $oldrev; - } else { - die "This shouldn't happen! The revision of $pkg in texlive.tlpdb" - . "($newrev) is OLDER than the one in" - . "$opt_location/tlpkg/texlive.tlpdb ($oldrev), goodbye"; + # collect packages to be updated. + $count{"new"} = $count{"removed"} = $count{"updated"} = $count{"unchanged"} + = 0; + + for my $pkg (@packs) { + next if ($pkg eq "00texlive.config"); + next if ($pkg eq "00texlive.installer"); + my $oldrev = 0; + if (-r "$opt_containerdir/$pkg.tar.$type" + && defined($archiverevs{$pkg})) { + $oldrev = $archiverevs{$pkg}; + } else { + tllog($::LOG_NORMAL, "$pkg is new, found no containers\n"); + $count{"new"}++; + } + + my $tlp = $tlpdb->get_package($pkg); + my $newrev = 0; + if (defined($tlp)) { + $newrev = $tlp->revision; + } else { + tllog($::LOG_NORMAL, "$pkg has disappeared, removing its containers\n"); + `rm $opt_containerdir/$pkg.*`; + $count{"removed"}++; + } + + if ($oldrev == $newrev) { + tllog($::LOG_DEBUG, "$pkg up to date\n"); + $count{"unchanged"}++; + } elsif ($oldrev < $newrev) { + push @todopacks, $pkg; + $count{"updated"}++ if $oldrev; + } else { + die "This shouldn't happen! The revision of $pkg in texlive.tlpdb" + . "($newrev) is OLDER than the one in" + . "$opt_location/tlpkg/texlive.tlpdb ($oldrev), goodbye"; + } } } |