aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Chroot.pm
diff options
context:
space:
mode:
authorMarcelo Leitner <mrl@mandriva.com>2007-06-15 17:18:23 +0000
committerMarcelo Leitner <mrl@mandriva.com>2007-06-15 17:18:23 +0000
commit4725311c93db97c21df6182f4074129a02f74c01 (patch)
tree52dfd41d063fefae8f08dd23c9eaa74f1abeaf0f /lib/Iurt/Chroot.pm
parenta8ec2f4a2099ab52c86bee8160b90abb3d02634e (diff)
downloadiurt-4725311c93db97c21df6182f4074129a02f74c01.tar
iurt-4725311c93db97c21df6182f4074129a02f74c01.tar.gz
iurt-4725311c93db97c21df6182f4074129a02f74c01.tar.bz2
iurt-4725311c93db97c21df6182f4074129a02f74c01.tar.xz
iurt-4725311c93db97c21df6182f4074129a02f74c01.zip
- --additional-media option on --chrooted-urpmi one, as they are almost clones.
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r--lib/Iurt/Chroot.pm27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index 9b465de..42974bc 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -49,7 +49,7 @@ sub clean_chroot {
system("$sudo umount $chroot/var/cache/icecream &> /dev/null");
}
if (-d "$chroot/urpmi_medias/") {
- system ("$sudo umount $chroot/urpmi_medias/*");
+ system ("$sudo umount $chroot/urpmi_medias");
}
sudo($run, $config, '--rm', '-r', $chroot);
}
@@ -75,21 +75,16 @@ sub clean_chroot {
system("$sudo mount -o bind /var/cache/icecream $chroot/var/cache/icecream &>/dev/null") and return;
}
- my $count = 0;
- foreach my $m (@{$run->{additional_media}}) {
- if (($m =~ m/^(http:|ftp:)/)) {
- next;
+ if ($run->{additional_media} && $run->{additional_media}{repository}) {
+ my $rep = $run->{additional_media}{repository};
+ if (!($rep =~ m/^(http:|ftp:)/)) {
+ my $mount_point = "$chroot/urpmi_medias";
+ my $bind;
+ my $url = $rep;
+ $url =~ s!^file://!!;
+ system("$sudo mkdir -p $mount_point");
+ system("$sudo mount -o bind $url $mount_point") and return;
}
- my $mount_point = "$chroot/urpmi_medias/$count";
- my $bind;
- my ($url) = $m;
- $url =~ s!^(http://|ftp://|file://)!!;
- if (($m =~ m/^(file:)/)) {
- $bind = "-o bind";
- }
- system("$sudo mkdir -p $mount_point");
- system("$sudo mount $bind $url $mount_point") and return;
- $count++;
}
1;
}
@@ -500,7 +495,7 @@ sub build_chroot {
system("$sudo umount $tmp_chroot/var/cache/icecream &> /dev/null");
}
if (-d "$tmp_chroot/urpmi_medias/") {
- system ("$sudo umount $tmp_chroot/urpmi_medias/*");
+ system ("$sudo umount $tmp_chroot/urpmi_medias");
}
return !system($sudo, 'tar', 'czf', $chroot_tar, '-C', $tmp_chroot, '.');
}