diff options
author | Olivier Blin <blino@mageia.org> | 2011-03-17 22:49:07 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2011-03-17 22:49:07 +0000 |
commit | 2b6ec2b677916762be4f08affcbd7a726e048ec3 (patch) | |
tree | c889a099c8eb6903d07febbf9fb46ea5af86d166 | |
parent | 730974b8fb1489e40c88a09f742f2fd80cca9281 (diff) | |
download | iurt-2b6ec2b677916762be4f08affcbd7a726e048ec3.tar iurt-2b6ec2b677916762be4f08affcbd7a726e048ec3.tar.gz iurt-2b6ec2b677916762be4f08affcbd7a726e048ec3.tar.bz2 iurt-2b6ec2b677916762be4f08affcbd7a726e048ec3.tar.xz iurt-2b6ec2b677916762be4f08affcbd7a726e048ec3.zip |
when building chroot, do not use --distrib but use media from base_media in config
-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 { |