summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-containers
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-containers48
1 files changed, 25 insertions, 23 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers
index 72d11d1ace7..273f9b8519b 100755
--- a/Master/tlpkg/bin/tl-update-containers
+++ b/Master/tlpkg/bin/tl-update-containers
@@ -59,13 +59,15 @@ GetOptions(
pod2usage("-exitstatus" => 0, "-verbose" => 2) if $opt_help;
if ($opt_version) { print "$vc_id\n"; exit 0; }
+my $prg = TeXLive::TLUtils::basename($0);
+
exit (&main());
sub main {
# check that we have a target db.
if (! $opt_recreate && ! -r "$opt_location/tlpkg/texlive.tlpdb") {
- die "$0: Cannot load tlpdb from output directory $opt_location;\n"
+ die "$prg: Cannot load tlpdb from output directory $opt_location;\n"
. " specify --recreate if you need to populate anew.\n";
}
@@ -94,7 +96,7 @@ sub main {
if ($format eq "xz") {
$type = $format;
} else {
- tlwarn("$0: unknown container format $format in 00texlive.config; ",
+ tlwarn("$prg: unknown container format $format in 00texlive.config; ",
"ignoring and continuing with $type");
}
debug("$Master: format=$type srcsplit=$srcsplit docsplit=$docsplit\n");
@@ -109,7 +111,7 @@ sub main {
my @disabled_pkgs = TeXLive::TLUtils::tlnet_disabled_packages($Master);
if (@disabled_pkgs) {
- info("$0: additional tlnet disabled packages: @disabled_pkgs\n");
+ info("$prg: additional tlnet disabled packages: @disabled_pkgs\n");
}
if ($opt_recreate) {
@@ -151,9 +153,9 @@ sub main {
$shortpkg =~ s/\..*$//;
if (TeXLive::TLUtils::member($shortpkg, @disabled_pkgs)) {
if ($opt_all || $opt_recreate) {
- tlwarn("$0: Updating tlnet disabled $pkg due to -all\n");
+ tlwarn("$prg: Updating tlnet disabled $pkg due to -all\n");
} else {
- tlwarn("$0: $pkg disabled for tlnet updates\n");
+ tlwarn("$prg: $pkg disabled for tlnet updates\n");
next;
}
}
@@ -162,7 +164,7 @@ sub main {
&& defined($archiverevs{$pkg})) {
$oldrev = $archiverevs{$pkg};
} else {
- info("$0: $pkg is new\n");
+ info("$prg: $pkg is new\n");
$count{"new"}++;
}
@@ -183,7 +185,7 @@ sub main {
&& ! -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");
+ info("$prg: container(s) for $pkg disappeared, recreating them.\n");
push @todopacks, $pkg;
$count{"updated"}++;
} else {
@@ -195,7 +197,7 @@ sub main {
} else {
# This can happen when packages get renamed or files get
# shuffled from one package to another.
- tlwarn("$0: $pkg in source tree is OLDER ($newrev) than in ",
+ tlwarn("$prg: $pkg in source tree is OLDER ($newrev) than in ",
"$opt_location/tlpkg/texlive.tlpdb ($oldrev); continuing.\n");
push @todopacks, $pkg;
}
@@ -218,7 +220,7 @@ sub main {
$nettlpdb->add_tlpobj($tlp00);
} else {
if ($name eq "config" || $name eq "installation") {
- tlwarn("$0: essential package 00texlive.$name seems to be missing!\n");
+ tlwarn("$prg: essential package 00texlive.$name seems to be missing!\n");
}
}
}
@@ -233,7 +235,7 @@ sub main {
my $ret
= &TeXLive::TLUtils::setup_programs("$script_master/tlpkg/installer");
if (!$ret) {
- tlwarn("$0: binaries could not be set up, aborting.\n");
+ tlwarn("$prg: binaries could not be set up, aborting.\n");
exit 1;
}
}
@@ -250,13 +252,13 @@ sub main {
# .arch packages are skipped, too
if ($pkg =~ m/^$manualpkgre/) {
if ($opt_all || $opt_recreate) {
- tlwarn("$0: Updating critical $pkg due to -all\n");
+ tlwarn("$prg: Updating critical $pkg due to -all\n");
# in general, we want links for everything, but for testing maybe:
#$copy_instead_of_link = 1;
last; # of the manualpkgre checks
} else {
- tlwarn("$0: Skipping critical $pkg\n");
+ tlwarn("$prg: Skipping critical $pkg\n");
# we assume that the critical packages always exist, so reduce
# the number of updated packages.
$count{'updated'}--;
@@ -380,7 +382,7 @@ sub main {
# remove source/doc containers that have become obsolete.
for my $op (@removecontainers) {
if (-r "$opt_containerdir/$op.tar.xz") {
- info("$0: $op container is old, removing it\n");
+ info("$prg: $op container is old, removing it\n");
`rm $opt_containerdir/$op.*` unless $opt_dry;
}
}
@@ -391,11 +393,11 @@ sub main {
# .arch packages are skipped, too
if ($op =~ m/^$manualpkgre/) {
if ($opt_all || $opt_recreate) {
- tlwarn("$0: Removing critical $op due to -all\n");
+ tlwarn("$prg: Removing critical $op due to -all\n");
last; # of the manualpkgre checks
} else {
- tlwarn("$0: Skipping removal of critical $op\n");
+ tlwarn("$prg: Skipping removal of critical $op\n");
# the following line skips all other regexp checks on critical
# packages and skips everything below this (the part which
# actually builds the containers) and continues with the next
@@ -404,7 +406,7 @@ sub main {
}
}
}
- info("$0: $op has disappeared, removing its containers\n");
+ info("$prg: $op has disappeared, removing its containers\n");
`rm $opt_containerdir/$op.*` unless $opt_dry;
$nettlpdb->remove_package($op) unless $opt_dry;
$count{"removed"}++;
@@ -414,14 +416,14 @@ sub main {
&rcheck_containerdir ($opt_containerdir);
if ($opt_recreate) {
- info("$0: all packages recreated.\n");
+ info("$prg: all packages recreated.\n");
} else {
if (@todopacks) {
# we updated something
- info("$0: $count{new} new, $count{removed} removed, " .
+ info("$prg: $count{new} new, $count{removed} removed, " .
"$count{updated} updated, $count{unchanged} unchanged.\n");
} else {
- info("$0: no containers to be updated.\n");
+ info("$prg: no containers to be updated.\n");
}
}
@@ -451,7 +453,7 @@ sub main {
foreach my $p ($nettlpdb->list_packages) {
next if $p =~ /00texlive/;
if (! -r "$opt_containerdir/$p.tar.xz") {
- tlwarn("$0: container for $p is missing, should not happen!\n");
+ tlwarn("$prg: container for $p is missing, should not happen!\n");
}
}
}
@@ -490,12 +492,12 @@ sub rcheck_containerdir {
} else {
debug("unlinking $dir/$fname [because have $linktarget]\n");
unlink("$dir/$fname")
- || tlwarn("$0: non-symlinked unlink($dir/$fname) failed: $!");
+ || tlwarn("$prg: non-symlinked unlink($dir/$fname) failed: $!");
}
} # (else it's the current version, do nothing.)
} else {
# this can happen if we accidentally created unlinked containers.
- tlwarn("$0: have file $fname, but no link $linkname!\n");
+ tlwarn("$prg: have file $fname, but no link $linkname!\n");
}
} elsif ($fname =~ /^([^.]+(\.[^.]+)*\.tar\.xz|\.\.?)$/) {
; # unversioned name, ok. Either . or .. or
@@ -503,7 +505,7 @@ sub rcheck_containerdir {
# be .doc, .source, .x86_64-linux, etc., or
# .infra.x86_64-linux (for texlive.infra), win32.doc (for wintools).
} else {
- tlwarn("$0: unexpected file: $fname (in $dir)\n");
+ tlwarn("$prg: unexpected file: $fname (in $dir)\n");
}
}
closedir ($dh) || warn "closedir($dir) failed: $!";