summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-12-23 00:49:42 +0000
committerKarl Berry <karl@freefriends.org>2008-12-23 00:49:42 +0000
commitb49e41c5e8dbcb5ef1dd605f7fb7bd6b7ada9648 (patch)
tree898cf1516f55b1472e374d25954b6e3265bf6ccd
parentce9d6e88b93e5715d26160610f9d9a61af006047 (diff)
avoid $flag variable masking; activate missing action message again
git-svn-id: svn://tug.org/texlive/trunk@11694 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl28
1 files changed, 13 insertions, 15 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index 69bce3ecfb3..ae06725cae6 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -202,9 +202,7 @@ ddebug("action = $action\n");
for my $k (keys %opts) {
ddebug("$k => $opts{$k}\n");
}
-if (@ARGV) {
- ddebug("arguments: @ARGV\n");
-}
+ddebug("arguments: @ARGV\n") if @ARGV;
sub give_version {
if (!defined($::version_string)) {
@@ -223,7 +221,7 @@ sub give_version {
}
if ($opts{"version"} || (defined $action && $action eq "version")) {
- info( give_version() );
+ info(give_version());
finish(0);
}
@@ -231,7 +229,7 @@ if (defined($action) && ($action =~ m/^help/i)) {
$opts{"help"} = 1;
}
-if (!defined($action) && !$opts{"help"}) {
+if (!defined($action) || !$action) {
die "$0: missing action; try --help if you need it.\n";
}
@@ -249,7 +247,7 @@ if ($opts{"help"}) {
# unify arguments so that the $action contains paper in all cases
# and push the first arg back to @ARGV for action_paper processing
if ($action =~ /paper|dvips|xdvi|pdftex|dvipdfmx?|context/) {
- @ARGV = ($action, @ARGV);
+ unshift(@ARGV, $action);
$action = "paper";
}
@@ -264,7 +262,7 @@ for my $k (keys %opts) {
if ($k eq "n" || $k eq "dry-run") {
$kk = "dry-run|n";
}
- if ( !defined($suppargs{$kk}) && !defined($globaloptions{$kk}) ) {
+ if (!defined($suppargs{$kk}) && !defined($globaloptions{$kk})) {
push @notvalidargs, $k;
}
}
@@ -399,7 +397,7 @@ sub execute_action {
merge_into(\%ret, action_uninstall());
finish(0);
} else {
- die "$0: unknown action: $action\n";
+ die "$0: unknown action: $action; try --help if you need it.\n";
}
# close the special log file
if ($packagelogfile && !$::gui_mode) {
@@ -1255,21 +1253,21 @@ sub close_w32_updater {
# tlmgr update --no-depends-at-all foo
# will absolutely only update foo not even taking .ARCH into account
#
-# TLMedia->install_package does ONLY INSTALL ONE PACKAGE, no deps whatsoever
+# TLMedia->install_package INSTALLS ONLY ONE PACKAGE, no deps whatsoever
# anymore. That has all to be done by hand.
#
sub machine_line {
- my ($flag) = @_;
+ my ($flag1) = @_;
my $ret = 0;
- if ($flag eq "-ret") {
+ if ($flag1 eq "-ret") {
$ret = 1;
shift;
}
my ($pkg, $flag, $lrev, $rrev, @args) = @_;
- $lrev || ($lrev = "-");
- $rrev || ($rrev = "-");
- $flag || ($flag = "?");
- my $str = "$pkg\t$flag\t$lrev\t$rrev\t" . join("\t",@args) . "\n";
+ $lrev ||= "-";
+ $rrev ||= "-";
+ $flag ||= "?";
+ my $str = "$pkg\t$flag\t$lrev\t$rrev\t" . join("\t", @args) . "\n";
return($str) if $ret;
print $str;
}