From 4c930859de17120d539f568e095eb1085ba9a51e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 23 Oct 2008 13:22:21 +0000 Subject: (action_update): announce if dry run; silently accept -n as a synonym for --dry-run. git-svn-id: svn://tug.org/texlive/trunk@11037 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 40 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 6ae9df0d18a..0cb279b60c3 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -462,10 +462,10 @@ sub action_remove { my $opt_force = 0; my $opt_dry = 0; Getopt::Long::Configure(@getopt_configure_subopts); - GetOptions("no-depends" => \$opt_nodepends, + GetOptions("no-depends" => \$opt_nodepends, "no-depends-at-all" => \$opt_reallynodepends, - "force" => \$opt_force, - "dry-run" => \$opt_dry) or pod2usage(2); + "force" => \$opt_force, + "n|dry-run" => \$opt_dry) or pod2usage(2); $opt_nodepends = 1 if $opt_reallynodepends; my %already_removed; my @more_removal; @@ -637,7 +637,7 @@ sub action_restore { my $opt_dry = 0; Getopt::Long::Configure(@getopt_configure_subopts); GetOptions("backupdir=s" => \$opt_backupdir, - "dry-run" => \$opt_dry, + "n|dry-run" => \$opt_dry, "force" => \$opt_force) or pod2usage(2); if (!defined($opt_backupdir)) { die "restore needs --backupdir\n"; @@ -903,27 +903,31 @@ sub action_update { my $opt_noremove = 0; my $opt_backupdir; Getopt::Long::Configure(@getopt_configure_subopts); - GetOptions("no-depends" => \$opt_nodepends, + GetOptions("no-depends" => \$opt_nodepends, "no-depends-at-all" => \$opt_reallynodepends, - "all" => \$opt_all, - "list" => \$opt_list, - "no-remove" => \$opt_noremove, - "backupdir=s" => \$opt_backupdir, - "dry-run" => \$opt_dry) or pod2usage(2); + "all" => \$opt_all, + "list" => \$opt_list, + "no-remove" => \$opt_noremove, + "backupdir=s" => \$opt_backupdir, + "n|dry-run" => \$opt_dry) or pod2usage(2); $opt_nodepends = 1 if $opt_reallynodepends; my $nrupdated = 0; my %ret; + init_tlmedia(); my $mediatlpdb = $tlmediasrc->tlpdb; + info("update: dry run, no changes will be made\n") if $opt_dry; + # these two variables are used throughout this function my $root = $localtlpdb->root; my $temp = "$root/temp"; - # + # remove old _BACKUP packages that have piled up in temp # they can be recognized by their name starting with __BACKUP_ for my $f (<$temp/__BACKUP_*>) { unlink($f) unless $opt_dry; } + my @todo; my %removals; if ($opt_all || $opt_list) { @@ -1100,10 +1104,12 @@ sub action_update { if (win32() && ($pkg =~ m/$WinSpecialUpdatePackagesRegexp/)) { add_win32_updater($mediatlp, $opt_dry); } else { - info("update: $pkg ($rev -> $mediarev) ... "); + info("update: $pkg ($rev -> $mediarev)"); if ($opt_dry) { - info("done\n"); + info("\n"); next; + } else { + info(" ... "); # more to come } if (!$unwind_package) { @@ -1225,10 +1231,10 @@ sub action_install { my $opt_dry = 0; my $opt_reinstall = 0; Getopt::Long::Configure(@getopt_configure_subopts); - GetOptions("no-depends" => \$opt_nodepends, + GetOptions("no-depends" => \$opt_nodepends, "no-depends-at-all" => \$opt_reallynodepends, - "reinstall" => \$opt_reinstall, - "dry-run" => \$opt_dry) or pod2usage(2); + "reinstall" => \$opt_reinstall, + "n|dry-run" => \$opt_dry) or pod2usage(2); my %ret; init_tlmedia(); my $tlmediatlpdb = $tlmediasrc->tlpdb; @@ -1371,7 +1377,7 @@ sub action_arch { my %ret; my $opt_dry = 0; Getopt::Long::Configure(@getopt_configure_subopts); - GetOptions("dry-run" => \$opt_dry) or pod2usage(2); + GetOptions("n|dry-run" => \$opt_dry) or pod2usage(2); my $what = shift @ARGV; init_local_db(1); $what || ($what = "list"); -- cgit v1.2.3