aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-04 12:08:09 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-04 12:08:09 +0000
commitd77a6e8f8eda33f9c246014794cddf664b4439fb (patch)
tree6cfd08cb2dd18d15b6eea7268363849889c5d28a
parentc8576efc256a9886d9b8b9e587dba090dce3fe53 (diff)
downloadrpmdrake-d77a6e8f8eda33f9c246014794cddf664b4439fb.tar
rpmdrake-d77a6e8f8eda33f9c246014794cddf664b4439fb.tar.gz
rpmdrake-d77a6e8f8eda33f9c246014794cddf664b4439fb.tar.bz2
rpmdrake-d77a6e8f8eda33f9c246014794cddf664b4439fb.tar.xz
rpmdrake-d77a6e8f8eda33f9c246014794cddf664b4439fb.zip
add a message saying that medium was successfully added, and use POSIX::_exit to fuck atexit gtk stuff fucking with my exitcode
-rwxr-xr-xgurpmi.addmedia12
1 files changed, 9 insertions, 3 deletions
diff --git a/gurpmi.addmedia b/gurpmi.addmedia
index 3d82676d..14fa5518 100755
--- a/gurpmi.addmedia
+++ b/gurpmi.addmedia
@@ -45,6 +45,7 @@ and [options] are from
require_root_capability();
use rpmdrake;
+use POSIX;
eval { require ugtk2; ugtk2->import(qw(:all)) };
if ($@) {
@@ -66,10 +67,15 @@ my ($name, $url, $with, $with_hdlist) = @ARGV;
if ($url !~ m,^(file://|ftp://|http://|removable://), || $with && !$with_hdlist) {
interactive_msg('gurpmi.addmedia',
N("Unable to add medium, wrong or missing arguments"));
- exit(-1);
+ POSIX::_exit(-1);
}
my $urpm = urpm->new;
$urpm->read_config;
-add_medium_and_check($urpm, { probe_with => !$with }, $name, $url, $with_hdlist, update => $update);
-
+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));
+ POSIX::_exit(0);
+} else {
+ POSIX::_exit(-1);
+}