aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-04 12:13:27 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-04 12:13:27 +0000
commite2db4284fbf843f8ef0a5da15ca8fefa320f7a5f (patch)
treefda1f264354736435dae023d5c925a11d8900393
parentf13b0442e43e49d1b564fa0f68b23304bb756589 (diff)
downloadrpmdrake-e2db4284fbf843f8ef0a5da15ca8fefa320f7a5f.tar
rpmdrake-e2db4284fbf843f8ef0a5da15ca8fefa320f7a5f.tar.gz
rpmdrake-e2db4284fbf843f8ef0a5da15ca8fefa320f7a5f.tar.bz2
rpmdrake-e2db4284fbf843f8ef0a5da15ca8fefa320f7a5f.tar.xz
rpmdrake-e2db4284fbf843f8ef0a5da15ca8fefa320f7a5f.zip
return useful value for adding a medium
-rw-r--r--rpmdrake.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 6b178775..4297989d 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -429,7 +429,9 @@ sub update_sources_check {
interactive_msg('rpmdrake',
N("Unable to update medium; it will be automatically disabled.\n\nErrors:\n%s",
join("\n", @error_msgs)));
+ return 0;
}
+ return 1;
}
sub update_sources_interactive {
@@ -474,17 +476,23 @@ sub add_medium_and_check {
interactive_msg('rpmdrake',
N("Unable to add medium, errors reported:\n\n%s",
join("\n", @error_msgs)));
- return;
+ return 0;
}
- update_sources_check($urpm, $options, $_[0]);
- my ($medium) = grep { $_->{name} eq $_[0] } @{$urpm->{media}};
- $medium or interactive_msg('rpmdrake', N("Unable to create medium."));
+ update_sources_check($urpm, $options, $_[0]) or return 0;
$urpm->write_config;
- return;
+
+ my ($medium) = grep { $_->{name} eq $_[0] } @{$urpm->{media}};
+ if ($medium) {
+ return 1;
+ } else {
+ interactive_msg('rpmdrake', N("Unable to create medium."));
+ return 0;
+ }
fatal_error:
interactive_msg(N("Failure when adding medium"),
N("There was a problem adding medium:\n\n%s", $fatal_msg));
+ return 0;
}