aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-03-17 22:49:07 +0000
committerOlivier Blin <blino@mageia.org>2011-03-17 22:49:07 +0000
commit2b6ec2b677916762be4f08affcbd7a726e048ec3 (patch)
treec889a099c8eb6903d07febbf9fb46ea5af86d166
parent730974b8fb1489e40c88a09f742f2fd80cca9281 (diff)
downloadiurt-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-xiurt24
-rw-r--r--lib/Iurt/Chroot.pm2
-rw-r--r--lib/Iurt/Urpmi.pm17
3 files changed, 17 insertions, 6 deletions
diff --git a/iurt2 b/iurt2
index ba329e2..3bf94d2 100755
--- a/iurt2
+++ b/iurt2
@@ -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 {