diff options
-rwxr-xr-x | iurt2 | 4 | ||||
-rw-r--r-- | lib/Iurt/Chroot.pm | 2 | ||||
-rw-r--r-- | lib/Iurt/Urpmi.pm | 17 |
3 files changed, 17 insertions, 6 deletions
@@ -425,6 +425,10 @@ my %config_usage = ( 'contrib' => [ 'release' ] } }, + base_media => { + desc => 'List of base media used to build chroot', + default => [ 'core/release' ], + }, basesystem_packages => { desc => 'List of packages needed for the chroot creation', default => [ diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index c41f9ea..547cd03 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -503,7 +503,7 @@ sub build_chroot { my $urpmi = $run->{urpmi}; if ($urpmi->{use__urpmi_root}) { - if (!$urpmi->add_media__urpmi_root($tmp_chroot)) { + if (!$urpmi->add_media__urpmi_root($tmp_chroot, $config->{base_media})) { plog('ERROR', "urpmi.addmedia --urpmi-root failed"); return 0; } diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 7dff2d4..d22b90d 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -188,21 +188,28 @@ sub check_media_added { } sub add_media__urpmi_root { - my ($self, $chroot) = @_; + my ($self, $chroot, $media) = @_; my $run = $self->{run}; my $config = $self->{config}; my $cache = $run->{cache}; - plog("adding distrib $self->{distrib_url} with option --urpmi-root in chroot $chroot"); - - perform_command("urpmi-addmedia -v --urpmi-root $chroot --distrib $self->{distrib_url} --probe-synthesis", + foreach my $m (@{$media || []}) { + my $url = $self->{distrib_url} . "/media/" . $m; + my $name = $m; + $name =~ s![/:]!_!g; + plog("adding media $name from $url with option --urpmi-root in chroot $chroot"); + perform_command("urpmi-addmedia -v --urpmi-root $chroot $name $url --probe-synthesis", $run, $config, $cache, mail => $config->{admin}, timeout => 300, use_iurt_root_command => 1, freq => 1, retry => 2, - debug_mail => $run->{debug}); + debug_mail => $run->{debug}) + or return; + } + + 1; } sub add_media { |