diff options
author | Norbert Preining <preining@logic.at> | 2016-04-10 00:31:57 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2016-04-10 00:31:57 +0000 |
commit | b035d1d5ec1ffb1c431719cb5c12d59cf758e0ba (patch) | |
tree | e876e00efb400720ddbf311ba518007f1114943e | |
parent | 2c56ad085c04f7681ecb27ca09ecba4964415542 (diff) |
backup --clean: report removed files but honor -v/-q
git-svn-id: svn://tug.org/texlive/trunk@40376 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index f16680b64ca..9e99cf8c75a 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -1989,8 +1989,9 @@ sub action_backup { my %backups = get_available_backups($opts{"backupdir"}, 0); init_local_db(1); for my $p (sort keys %backups) { - clear_old_backups ($p, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}); + clear_old_backups ($p, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}, 1); } + info("no action taken due to --dry-run\n") if $opts{"dry-run"}; return ($F_OK | $F_NOPOSTACTION); } @@ -2009,7 +2010,7 @@ sub action_backup { } foreach my $pkg (@todo) { if ($clean_mode) { - clear_old_backups ($pkg, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}); + clear_old_backups ($pkg, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}, 1); } else { my $tlp = $localtlpdb->get_package($pkg); info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . @@ -2020,6 +2021,7 @@ sub action_backup { } } } + info("no action taken due to --dry-run\n") if $opts{"dry-run"}; # TODO_ERRORCHECKING neets checking of the above return ($F_OK); } @@ -6129,8 +6131,9 @@ sub norm_tlpdb_path { # mind that with $autobackup == 0 all packages are cleared # sub clear_old_backups { - my ($pkg, $backupdir, $autobackup, $dry) = @_; + my ($pkg, $backupdir, $autobackup, $dry, $v) = @_; + my $verb = ($v ? 1 : 0); my $dryrun = 0; $dryrun = 1 if ($dry); # keep arbitrary many backups @@ -6148,7 +6151,13 @@ sub clear_old_backups { my $i = 1; for my $e (reverse sort {$a <=> $b} @backups) { if ($i > $autobackup) { - log ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); + # only echo out if explicitly asked for verbose which is done + # in the backup --clean action + if ($verb) { + info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); + } else { + log ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); + } unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun; } $i++; |