aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-03 16:16:07 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-03 16:16:07 +0000
commit200dd8ce09808393f6c5ce9e775255cef9169f29 (patch)
treec8aedd1376ace5146f284976ea31c901198edda6
parent88f3f79c85c5eb255af7a723108a43c9880f42b7 (diff)
downloadrpmdrake-200dd8ce09808393f6c5ce9e775255cef9169f29.tar
rpmdrake-200dd8ce09808393f6c5ce9e775255cef9169f29.tar.gz
rpmdrake-200dd8ce09808393f6c5ce9e775255cef9169f29.tar.bz2
rpmdrake-200dd8ce09808393f6c5ce9e775255cef9169f29.tar.xz
rpmdrake-200dd8ce09808393f6c5ce9e775255cef9169f29.zip
Add option --silent-success to automatically add media (Thierry Vignaud)
-rwxr-xr-xgurpmi.addmedia15
1 files changed, 12 insertions, 3 deletions
diff --git a/gurpmi.addmedia b/gurpmi.addmedia
index 5d86109e..7a5691ca 100755
--- a/gurpmi.addmedia
+++ b/gurpmi.addmedia
@@ -32,7 +32,8 @@ where <url> is one of
http://<host>/<path> with <relative filename of hdlist>
removable://<path>
and [options] are from
- --update create an update medium.
+ --update create an update medium.
+ --silent-success don't show popup window on success
";
exit(0);
};
@@ -44,6 +45,7 @@ use common;
require_root_capability();
use rpmdrake;
+use Getopt::Long;
eval { require ugtk2; ugtk2->import(qw(:all)) };
if ($@) {
@@ -59,7 +61,14 @@ if (@ARGV == 1 && $ARGV[0] =~ /\.urpmi-media$/) {
$fromfile = 1;
}
-my $update = 0;
+my ($update, $silent_success) = (0, 0);
+
+GetOptions(
+ 'update' => \$update,
+ 'silent-success' => \$silent_success,
+);
+
+# compatibility with -update:
if ($ARGV[0] =~ /^-?-update/) {
$update = 1;
shift @ARGV;
@@ -84,7 +93,7 @@ my $urpm = urpm->new;
$urpm->read_config;
if (add_medium_and_check($urpm, { probe_with => !$with }, $name, $url, $with_hdlist, update => $update)) {
interactive_msg('gurpmi.addmedia',
- N("Successfully added medium `%s'.", $name));
+ N("Successfully added medium `%s'.", $name)) if !$silent_success;
myexit(0);
} else {
myexit(-1);