summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-11-06 19:01:41 +0000
committerKarl Berry <karl@freefriends.org>2008-11-06 19:01:41 +0000
commit6605faacc55560cf86a983edfe6a22fb7d23981a (patch)
tree3e78b06559c866d1666a9846c1634e988e404def /Master
parentfc99781ba9486ea53ff9202969cbbb36be3daea1 (diff)
formatting, msgs if cmdline has typo.
git-svn-id: svn://tug.org/texlive/trunk@11206 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-containers62
1 files changed, 32 insertions, 30 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers
index 9c5f5d53b39..6ff5743e470 100755
--- a/Master/tlpkg/bin/tl-update-containers
+++ b/Master/tlpkg/bin/tl-update-containers
@@ -69,14 +69,15 @@ sub main
if ($format eq "lzma" || $format eq "zip") {
$type = $format;
} else {
- warn "$0: unknown container format specified in 00texlive.config: $format"
- . "; ignoring and continuing with $type";
+ tlwarn("$0: unknown container format specified in 00texlive.config: ",
+ "$format; ignoring and continuing with $type");
}
debug("format=$type srcsplit=$srcsplit docsplit=$docsplit\n");
if (! $opt_recreate) {
if (! -r "$opt_location/tlpkg/texlive.tlpdb") {
- tlwarn("$0: Cannot load tlpdb from $opt_location, continuing in recreate mode.\n");
+ tlwarn("$0: Cannot load tlpdb from $opt_location, ",
+ "continuing in recreate mode.\n");
$opt_recreate = 1;
}
}
@@ -93,7 +94,7 @@ sub main
if (@ARGV) {
@todopacks = @packs;
$nettlpdb = TeXLive::TLPDB->new;
- die "Cannot create new tlpdb" unless defined($nettlpdb);
+ die "cannot create new tlpdb" unless defined($nettlpdb);
# we have to copy 00texlive.config to the new tlpdb otherwise
# the configuration gets lost ...
my $tlpconfig = $tlpdb->get_package("00texlive.config");
@@ -106,10 +107,10 @@ sub main
} else {
$nettlpdb = TeXLive::TLPDB->new("root" => $opt_location);
if (!defined($nettlpdb)) {
- die "Cannot init tlpdb from $opt_location ...";
+ die "cannot init tlpdb from $opt_location";
}
my %archiverevs;
- foreach my $pkg ($nettlpdb->list_packages()) {
+ for my $pkg ($nettlpdb->list_packages()) {
$archiverevs{$pkg} = $nettlpdb->get_package($pkg)->revision();
if (!defined($tlpdb->get_package($pkg))) {
# $pkg has disappeared, removing it
@@ -138,19 +139,19 @@ sub main
if (defined($tlp)) {
$newrev = $tlp->revision;
} else {
- # that cannot happen!!! we are looping over the packages of
- # $tlpdb so the above ->get_package will succeed (or something
- # stranged happened!
- die ("failed to get package $pkg, that should not happen!");
+ # this can happen with typos on the command line.
+ die "no package $pkg in location $opt_location, goodbye";
}
if ($oldrev == $newrev) {
debug("$pkg up to date\n");
- # check for the existence of all containers, might got missing
- if (($tlp->runfiles && ! -r "$opt_containerdir/$pkg.tar.$type") ||
- ($srcsplit && $tlp->srcfiles && ! -r "$opt_containerdir/$pkg.source.tar.$type") ||
- ($docsplit && $tlp->docfiles && ! -r "$opt_containerdir/$pkg.doc.tar.$type")) {
- info("$0: container(s) for $pkg have disappeared, recreating them.\n");
+ # check for the existence of all containers in case they go missing
+ if (($tlp->runfiles && ! -r "$opt_containerdir/$pkg.tar.$type")
+ || ($srcsplit && $tlp->srcfiles
+ && ! -r "$opt_containerdir/$pkg.source.tar.$type")
+ || ($docsplit && $tlp->docfiles
+ && ! -r "$opt_containerdir/$pkg.doc.tar.$type")) {
+ info("$0: container(s) for $pkg disappeared, recreating them.\n");
push @todopacks, $pkg;
$count{"updated"}++;
} else {
@@ -162,15 +163,15 @@ sub main
} else {
# This can happen when packages get renamed or files get
# shuffled from one package to another.
- warn "The revision of $pkg in texlive.tlpdb"
- . "($newrev) is OLDER than the one in"
- . "$opt_location/tlpkg/texlive.tlpdb ($oldrev)";
+ tlwarn("The revision of $pkg in texlive.tlpdb ",
+ "($newrev) is OLDER than the one in ",
+ "$opt_location/tlpkg/texlive.tlpdb ($oldrev)\n");
push @todopacks, $pkg;
}
}
}
- # set up the programs ...
+ # set up the programs.
if ($opt_nosetup) {
# do a minimal setup
$::progs{'lzma'} = "lzma";
@@ -179,7 +180,7 @@ sub main
# do a full setup
my $ret = &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer");
if ($ret == -1) {
- tlwarn("$0: no binary of lzmadec for $::_platform_ detected, aborting.\n");
+ tlwarn("$0: no lzmadec for $::_platform_, aborting.\n");
exit 1;
}
if (!$ret) {
@@ -215,7 +216,9 @@ sub main
}
}
my $obj = $tlpdb->get_package ($pkg);
- die "$0: no TL package named $pkg in $Master" if ! $obj;
+ die "no package $pkg in master $Master, goodbye"
+ if ! $obj;
+
debug("updating $pkg containers ...\n");
# we have to make a copy otherwise the src/doc files in the original
# tlpobj are removed, and thus also in the tlpdb to be saved!!!
@@ -249,8 +252,8 @@ sub main
my $objdoc = $obj->docfiles_package;
$objcopy->clear_docfiles;
if ($objdoc) {
- my ($s,$m) = $objdoc->make_container($type, $Master, $opt_containerdir,
- "$pkg.doc", $opt_relative);
+ my ($s,$m) = $objdoc->make_container($type, $Master,
+ $opt_containerdir, "$pkg.doc", $opt_relative);
if ($s > 0) {
# something was created
$obj->doccontainersize($s);
@@ -320,15 +323,14 @@ sub main
} else {
if (@todopacks) {
# we updated something
- print "$0: $count{new} new, $count{removed} removed, "
- . "$count{updated} updated, $count{unchanged} unchanged.\n";
+ info("$0: $count{new} new, $count{removed} removed, ",
+ "$count{updated} updated, $count{unchanged} unchanged.\n");
} else {
- print "$0: nothing to be done.\n";
+ info("$0: nothing to be done.\n");
}
}
-
- return(0) if $opt_dry;
+ return 0 if $opt_dry;
# STRANGE: It seems that calling -recreate did not save the
# docfiles into the texlive.tlpdb, no idea why. So update should now
@@ -375,12 +377,12 @@ Does a full rebuild of all packages.
Include packages deemed critical in the update, currently
C<texlive.infra> and C<bin-texlive>. (That is, C<tlmgr> itself needs
-testing before updating.)
+testing before updating, so we don't do it by default.)
=item B<-no-setup>
Does not try to setup the various programs, but uses I<lzma> and I<tar>
-from path.
+from the current path.
=item B<-help>