From 94387ea2e54fa946b36805dc946385815ed3e670 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 2 Sep 2008 17:55:23 +0000 Subject: require --all to update TL infrastructure containers; avoid "done" in install when not done, cleanup takes too long git-svn-id: svn://tug.org/texlive/trunk@10415 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 1 - Master/tlpkg/TeXLive/TLUtils.pm | 3 +- Master/tlpkg/bin/tl-update-containers | 78 +++++++++++++++++++++------- Master/tlpkg/etc/tl-update-containers.diff | 81 ------------------------------ 4 files changed, 63 insertions(+), 100 deletions(-) delete mode 100644 Master/tlpkg/etc/tl-update-containers.diff diff --git a/Master/install-tl b/Master/install-tl index 40cc2103ecb..58556426397 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -457,7 +457,6 @@ if (!$finished) { do_installation(); } -info ("$0: done.\n"); do_cleanup(); # closes the log file, so we say we're done before we are exit(0); diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index afb3b99e4cd..d06457c44dc 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -116,7 +116,8 @@ BEGIN { &give_ctan_mirror &tlmd5 ); - @EXPORT = qw(setup_programs download_file info log debug ddebug tlwarn process_logging_options win32); + @EXPORT = qw(setup_programs download_file info log debug ddebug tlwarn + process_logging_options win32); } diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index 6e813478f82..08db2da064b 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -1,5 +1,4 @@ #!/usr/bin/env perl -# $Id$ # Copyright 2008 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. @@ -8,13 +7,13 @@ # (doesn't really work, not documented), or all if none specified. BEGIN { + $vc_id = '$Id$'; $^W = 1; ($mydir = $0) =~ s,/[^/]*$,,; unshift (@INC, "$mydir/.."); } use strict; - use TeXLive::TLConfig; use TeXLive::TLPOBJ; use TeXLive::TLPDB; @@ -23,22 +22,31 @@ use Getopt::Long; use Pod::Usage; use File::Path; -our $mydir; +# packages matching these re's will not be updated without --all. +my @critical_pkg_list = qw/bin-texlive texlive\.infra/; + +our ($mydir, $vc_id); my $opt_location = "."; my $opt_relative = 0; my $opt_recreate = 0; -my $help = 0; +my $opt_help = 0; +my $opt_version = 0; +my $opt_all = 0; TeXLive::TLUtils::process_logging_options(); GetOptions( - "location=s" => \$opt_location, - "recreate" => \$opt_recreate, - "help|?" => \$help) or pod2usage(1); + "location=s" => \$opt_location, + "recreate" => \$opt_recreate, + "all|a" => \$opt_all, + "version" => \$opt_version, + "help|?" => \$opt_help) or pod2usage(1); -pod2usage(-exitstatus => 0, -verbose => 2) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help; +if ($opt_version) { print "$vc_id\n"; exit 0; } -exit (&main ()); +exit (&main()); +# the real work sub main { # get the db. @@ -52,7 +60,7 @@ sub main my $docsplit = $tlpdb->config_doc_container; my $format = $tlpdb->config_container_format; my $type = "lzma"; - if (($format eq "lzma") || ($format eq "zip")) { + if ($format eq "lzma" || $format eq "zip") { $type = $format; } else { warn "$0: unknown container format specified in 00texlive.config: $format" @@ -144,9 +152,30 @@ sub main &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer"); # get list of packages. - for my $pkg (sort @todopacks) { + PACKS: for my $pkg (sort @todopacks) { next if ($pkg eq "00texlive.config"); next if ($pkg eq "00texlive.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 + if ($pkg =~ m/^$manualpkgre/) { + if ($opt_all || $opt_recreate) { + tlwarn ("updating container for $pkg due to -all option!\n"); + last; # of the manualpkgre checks + } else { + tlwarn ("not updating $pkg since it it in the manual update list!\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 + next PACKS; + } + } + } my $obj = $tlpdb->get_package ($pkg); die "$0: no TL package named $pkg in $Master" if ! $obj; debug("updating $pkg containers ...\n"); @@ -198,7 +227,7 @@ sub main } # next we remove those containers which have been gone! - foreach my $op (@removepacks) { + for my $op (@removepacks) { info("$op has disappeared, removing its containers\n"); `rm $opt_containerdir/$op.*`; $nettlpdb->remove_package($op); @@ -237,24 +266,39 @@ tl-update-containers - create, update, or remove TL containers =head1 SYNOPSIS -tl-update-containers [OPTION]... +tl-update-containers [I