aboutsummaryrefslogtreecommitdiffstats
path: root/gurpmi.addmedia
diff options
context:
space:
mode:
Diffstat (limited to 'gurpmi.addmedia')
-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);