diff options
author | Karl Berry <karl@freefriends.org> | 2008-09-28 18:20:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-09-28 18:20:23 +0000 |
commit | f8e98266dff62c63db19793ccc6f22fef0ca04ad (patch) | |
tree | 821ce16214adb84ee8231e14ebcd80879cff22ba /Master/tlpkg/bin/tl-update-containers | |
parent | f11b3137a67e1dd2486a9865eecacb31f2e44d43 (diff) |
doc tweaks
git-svn-id: svn://tug.org/texlive/trunk@10773 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-containers | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index dc389b45eb3..134661e22f4 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -4,7 +4,8 @@ # or any later version. # # Generate archive file(s) for the packages specified on the cmdline -# (doesn't really work, not documented), or all if none specified. +# (doesn't really work, not documented), or all (except some critical +# packages) if none specified. BEGIN { $vc_id = '$Id$'; @@ -26,33 +27,33 @@ use File::Path; my @critical_pkg_list = qw/bin-texlive texlive\.infra texlive-en/; our ($mydir, $vc_id); +my $opt_all = 0; my $opt_location = "."; -my $opt_relative = 0; +my $opt_nosetup = 0; my $opt_recreate = 0; -my $opt_help = 0; +my $opt_relative = 0; my $opt_version = 0; -my $opt_all = 0; -my $opt_nosetup = 0; +my $opt_help = 0; TeXLive::TLUtils::process_logging_options(); GetOptions( - "location=s" => \$opt_location, - "recreate" => \$opt_recreate, "all|a" => \$opt_all, + "location=s" => \$opt_location, "no-setup" => \$opt_nosetup, + "recreate" => \$opt_recreate, "version" => \$opt_version, "help|?" => \$opt_help) or pod2usage(1); -pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help; +pod2usage("-exitstatus" => 0, "-verbose" => 2) if $opt_help; if ($opt_version) { print "$vc_id\n"; exit 0; } exit (&main()); -# the real work + sub main { - # get the db. - chomp(my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default + # get our db, same hierarchy from which we are being run. + chomp(my $Master = `cd $mydir/../.. && pwd`); my $tlpdb = TeXLive::TLPDB->new("root" => $Master); die "cannot find tlpdb in $Master" unless defined($tlpdb); my @packs = @ARGV ? @ARGV : $tlpdb->list_packages; @@ -68,29 +69,29 @@ sub main warn "$0: unknown container format specified in 00texlive.config: $format" . "; ignoring and continuing with $type"; } - debug("format=$type srcsplit=$srcsplit docsplit=$docsplit\n"); - my @todopacks = (); - my @removepacks = (); - my $opt_containerdir = "$opt_location/$TeXLive::TLConfig::Archive"; - my %count; - my $nettlpdb; - - if (!$opt_recreate) { + if (! $opt_recreate) { if (! -r "$opt_location/tlpkg/texlive.tlpdb") { - warn ("Cannot load tlpdb from $opt_location, going into recreate mode!"); + warn "Cannot load tlpdb from $opt_location, going into recreate mode!"; $opt_recreate = 1; } } + my @todopacks = (); + my @removepacks = (); + my $opt_containerdir = "$opt_location/$TeXLive::TLConfig::Archive"; + my $nettlpdb; + my %count; + if ($opt_recreate) { # remake everything. @todopacks = $tlpdb->list_packages(); $nettlpdb = $tlpdb->copy; $nettlpdb->root($opt_location); + } else { - $nettlpdb = TeXLive::TLPDB->new(root => $opt_location); + $nettlpdb = TeXLive::TLPDB->new("root" => $opt_location); if (!defined($nettlpdb)) { die "Cannot init tlpdb from $opt_location ..."; } @@ -157,7 +158,7 @@ sub main } # set up the programs ... - if ($opt_nosetup) { + if ($opt_nosetup) { # do a minimal setup $::progs{'lzma'} = "lzma"; $::progs{'tar'} = "tar"; @@ -168,8 +169,7 @@ sub main # get list of packages. PACKS: for my $pkg (sort @todopacks) { - next if ($pkg eq "00texlive.config"); - next if ($pkg eq "00texlive.installer"); + next if $pkg =~ /^00texlive\.(config|installer)$/; foreach my $manualpkgre (@critical_pkg_list) { # we match the initial string of the package name, so that all the # .arch packages are skipped, too @@ -177,16 +177,18 @@ sub main if ($opt_all || $opt_recreate) { tlwarn ("$0: updating critical $pkg due to -all\n"); last; # of the manualpkgre checks + } else { tlwarn ("$0: skipping critical $pkg\n"); # we assume that the packages in @critical_pkg_list always # exist, so if they are there then the number of updated packages # should be reduced. $count{'updated'}--; + # the following line skips all other regexp checks on critical - # packages and skips everything below this big for list (the - # part which actually builds the containers) and continues with - # the next package (the PACKS: for my $pkg (sort @todopacks) line + # packages and skips everything below this (the part which + # actually builds the containers) and continues with the next + # package (the PACKS: label above). next PACKS; } } @@ -267,7 +269,7 @@ sub main foreach my $p ($tlpdb->list_packages) { next if $p =~ /00texlive.*\./; if (! -r "$opt_containerdir/$p.tar.lzma") { - info ("container for $p is missing, strange!\n"); + tlwarn ("container for $p is missing, strange!\n"); } } } @@ -299,10 +301,12 @@ Does a full rebuild of all packages. =item B<-all|-a> Will update also packages which are exempted due to possible breakage -(currently texlive.infra and bin-texlive). +(currently C<texlive.infra>, C<bin-texlive>, and C<texlive-en>). =item B<-no-setup> -Does not try to setup the various programs, but uses I<lzma> and I<tar>. + +Does not try to setup the various programs, but uses I<lzma> and I<tar> +from path. =item B<-help> @@ -321,12 +325,11 @@ pseudo-package C<00texlive.config>. See the documentation for TLPDB. =head1 DESCRIPTION -The B<tl-update-containers> program compares the revision of each -package found in C<containerdir> with the revision of the same package -in C<texlive.tlpdb>, found relative to this script. Where the latter is -newer (i.e., a higher number), the container(s) for the package are -updated. Where the container(s) do not exist, they are created. When -the package no longer exists in tlpdb, the container(s) are removed. +This program compares C<texlive.tlpdb> (found relative to this script) +with the specified I<containerdir>. If a tlpdb package is newer (i.e., +a higher revision number), the container(s) for the package are updated. +When the package exists in tlpdb only, it is created in I<containerdir>. +When the package exists in I<containerdir> only, it is removed from there. =head1 AUTHORS AND COPYRIGHT |