summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-07-26 12:08:31 +0000
committerNorbert Preining <preining@logic.at>2012-07-26 12:08:31 +0000
commit357db233f1891e32a7d61b376aadd5335523b9a6 (patch)
treea3dfe1c6f3551c3ab97199936018db50e377c1d6 /Master
parent4a1b45ccdee63de5ba242950f42f5ed5384c02c2 (diff)
fix bugs in tl-prune-platforms
git-svn-id: svn://tug.org/texlive/trunk@27168 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/tlpkg/bin/tl-prune-platforms19
1 files changed, 14 insertions, 5 deletions
diff --git a/Master/tlpkg/bin/tl-prune-platforms b/Master/tlpkg/bin/tl-prune-platforms
index 43435d9bbd9..8c40941b853 100755
--- a/Master/tlpkg/bin/tl-prune-platforms
+++ b/Master/tlpkg/bin/tl-prune-platforms
@@ -5,6 +5,9 @@
#
# Prune (remove) platforms from a tlnet distribution tree
+my $vc_id;
+my $mydir;
+
BEGIN {
$vc_id = '$Id$';
$^W = 1;
@@ -27,7 +30,7 @@ my $opt_dry = 0;
TeXLive::TLUtils::process_logging_options();
GetOptions(
- "dry-run" => \$opt_dry,
+ "dry-run|n" => \$opt_dry,
"version" => \$opt_version,
"help|?" => \$opt_help) or pod2usage(1);
@@ -41,6 +44,8 @@ sub main
{
# prune db in the same hierarchy from which we are being run.
chomp(my $Master = `cd $mydir/../.. && pwd`);
+ # necessary for TLUtils->platform
+ $::installerdir = $Master;
my $tlpdb = TeXLive::TLPDB->new("root" => $Master);
die "cannot find tlpdb in $Master" unless defined($tlpdb);
@@ -79,10 +84,14 @@ sub main
foreach my $a (@ARGV) {
if ($tlpdb->get_package("$pkg.$a")) {
# remove entry in the tlpdb
- $tlpdb->remove_package("$pkg.$a");
+ print "removing $pkg.$a from tlpdb ... ";
+ $tlpdb->remove_tlpobj("$pkg.$a") unless $opt_dry;
+ print "done\n";
# remove the container
if (-r "$containerdir/$pkg.$a.tar.xz") {
- `rm $containerdir/$pkg.$a.tar.xz`;
+ print "removing $containerdir/$pkg.$a.tar.xz ... ";
+ `rm $containerdir/$pkg.$a.tar.xz` unless $opt_dry;
+ print "done\n";
}
}
}
@@ -92,11 +101,11 @@ sub main
my @newarchs;
for my $a (@all_archs) {
- push @newarchs, $a if !member($a, @ARGV);
+ push @newarchs, $a if !TeXLive::TLUtils::member($a, @ARGV);
}
$tlpdb->setting("available_architectures",@newarchs);
- $tlpdb->save;
+ $tlpdb->save unless $opt_dry;
return 0;
}