aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2010-11-04 17:37:18 +0000
committerDexter Morgan <dmorgan@mageia.org>2010-11-04 17:37:18 +0000
commitfddb01e4b1225adfb9adeb6f9e8b6032170c68ce (patch)
tree1178567dfa0799bbf117f08a585fe0a41c2c7f6d
parenta12f26be8174be4cfd367bc3930da04091cc5083 (diff)
downloadiurt-fddb01e4b1225adfb9adeb6f9e8b6032170c68ce.tar
iurt-fddb01e4b1225adfb9adeb6f9e8b6032170c68ce.tar.gz
iurt-fddb01e4b1225adfb9adeb6f9e8b6032170c68ce.tar.bz2
iurt-fddb01e4b1225adfb9adeb6f9e8b6032170c68ce.tar.xz
iurt-fddb01e4b1225adfb9adeb6f9e8b6032170c68ce.zip
wrap urpmi.addmedia in iurt_root_command
-rwxr-xr-xiurt_root_command6
-rw-r--r--lib/Iurt/Urpmi.pm3
2 files changed, 8 insertions, 1 deletions
diff --git a/iurt_root_command b/iurt_root_command
index cd0fedd..af51ef5 100755
--- a/iurt_root_command
+++ b/iurt_root_command
@@ -159,6 +159,7 @@ $run{todo} = [];
my %commands_with_more_args = (
"--urpmi" => [ \&urpmi, "urpmi" ],
+ "--urpmi-addmedia" => [ \&urpmi_addmedia, "urpmi.addmedia" ],
"--chroot" => [ \&run_chroot, "chroot" ],
);
@@ -448,6 +449,11 @@ sub urpmi {
return check_urpmi_chroot_options(\@options) && !system('urpmi', @options);
}
+sub urpmi_addmedia {
+ my ($_run, @options) = @_;
+ return check_urpmi_chroot_options(\@options) && !system('urpmi.addmedia', @options);
+}
+
sub run_chroot {
my ($_run, $dir, @options) = @_;
if (!$dir) {
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index dd55a59..83d2d23 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -197,10 +197,11 @@ sub add_media__urpmi_root {
plog("adding distrib $self->{distrib_url} with option --urpmi-root in chroot $chroot");
- perform_command("sudo urpmi.addmedia -v --urpmi-root $chroot --distrib $self->{distrib_url} --probe-synthesis",
+ perform_command("urpmi-addmedia -v --urpmi-root $chroot --distrib $self->{distrib_url} --probe-synthesis",
$run, $config, $cache,
mail => $config->{admin},
timeout => 300,
+ use_iurt_root_command => 1,
freq => 1,
retry => 2,
debug_mail => $run->{debug});