summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-27 02:32:47 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-27 02:32:47 +0000
commit62f60a99f83c7b5c820dcb9452d00dfffd381035 (patch)
treedf97879bbd9f330b51a889f66c7f376f3539eedb
parent458bbe750abd279dc9749b824a986a73f0cffafd (diff)
downloadurpmi-62f60a99f83c7b5c820dcb9452d00dfffd381035.tar
urpmi-62f60a99f83c7b5c820dcb9452d00dfffd381035.tar.gz
urpmi-62f60a99f83c7b5c820dcb9452d00dfffd381035.tar.bz2
urpmi-62f60a99f83c7b5c820dcb9452d00dfffd381035.tar.xz
urpmi-62f60a99f83c7b5c820dcb9452d00dfffd381035.zip
Add options -q and -v (quiet and verbose) to urpmi.update
-rw-r--r--urpm/args.pm2
-rwxr-xr-xurpmi.update6
2 files changed, 7 insertions, 1 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 48ce9b38..4c2f62bc 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -244,6 +244,8 @@ my %options_spec = (
'limit-rate=s' => \$options{limit_rate},
'no-md5sum' => \$options{nomd5sum},
'noa|d' => \my $dummy, # default, keeped for compatibility
+ 'q|quiet' => sub { --$options{verbose} },
+ 'v|verbose' => sub { ++$options{verbose} },
'<>' => sub { push @::toupdates, $_[0] },
},
diff --git a/urpmi.update b/urpmi.update
index 4dd07bfc..d018c694 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -41,6 +41,8 @@ where <name> is a medium name to update.
") . N(" -a - select all non-removable media.
") . N(" -c - clean headers cache directory.
") . N(" -f - force generation of hdlist files.
+") . N(" -q - quiet mode.
+") . N(" -v - verbose mode.
");
exit 0;
}
@@ -50,10 +52,12 @@ sub main {
my $urpm = new urpm;
$options{force} = 0;
- $options{noclean} = 1;
+ $options{noclean} = $options{verbose} = 1;
urpm::args::parse_cmdline(urpm => $urpm);
+ $options{verbose} > 0 or $urpm->{log} = sub {};
+
if ($< != 0) {
$urpm->{fatal}(1, N("Only superuser is allowed to update media"));
}