aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2017-10-13 15:18:10 +0100
committerPascal Terjan <pterjan@mageia.org>2017-10-13 15:18:10 +0100
commitb916a14b9d07c7876bebfb70af5dddf8b4e86de7 (patch)
tree03ea62b81fe8d1eec7625978f80ec3683fa0134d /lib
parent25a0b8762f97e0cd6424e84859e69d76b9b6aca4 (diff)
downloadiurt-b916a14b9d07c7876bebfb70af5dddf8b4e86de7.tar
iurt-b916a14b9d07c7876bebfb70af5dddf8b4e86de7.tar.gz
iurt-b916a14b9d07c7876bebfb70af5dddf8b4e86de7.tar.bz2
iurt-b916a14b9d07c7876bebfb70af5dddf8b4e86de7.tar.xz
iurt-b916a14b9d07c7876bebfb70af5dddf8b4e86de7.zip
Change use_netns to allow per package setting
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Chroot.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index c54b180..9710b0f 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -49,7 +49,7 @@ sub clean_chroot {
}
-=head2 clean_and_build_chroot($chroot, $chroot_ref, $run, $config)
+=head2 clean_and_build_chroot($chroot, $chroot_ref, $run, $config, $use_netns)
Create or clean a chroot
I<$chroot> chroot path
@@ -60,10 +60,10 @@ Return true.
sub clean_and_build_chroot {
- my ($chroot, $chroot_ref, $run, $config) = @_;
+ my ($chroot, $chroot_ref, $run, $config, $use_netns) = @_;
clean_chroot($chroot, $run, $config) and return 1;
- if (!create_build_chroot($chroot, $chroot_ref, $run, $config)) {
+ if (!create_build_chroot($chroot, $chroot_ref, $run, $config, $use_netns)) {
plog('ERROR', "Failed to create chroot");
return;
}
@@ -188,11 +188,11 @@ sub add_local_user {
}
sub create_temp_chroot {
- my ($run, $config, $chroot_tmp, $chroot_ref) = @_;
+ my ($run, $config, $chroot_tmp, $chroot_ref, $use_netns) = @_;
plog("Install new chroot");
plog('DEBUG', "... in $chroot_tmp");
- clean_and_build_chroot($chroot_tmp, $chroot_ref, $run, $config) or return;
+ clean_and_build_chroot($chroot_tmp, $chroot_ref, $run, $config, $use_netns) or return;
$chroot_tmp;
}
@@ -298,7 +298,7 @@ sub check_chroot_need_update {
}
sub create_build_chroot {
- my ($chroot, $chroot_ref, $run, $config) = @_;
+ my ($chroot, $chroot_ref, $run, $config, $use_netns) = @_;
my $ret = 0;
if ($run->{storage} eq 'btrfs') {
$ret = create_build_chroot_btrfs($chroot, $chroot_ref, $run, $config);
@@ -316,7 +316,7 @@ sub create_build_chroot {
}
}
- if ($ret && $config->{use_netns}) {
+ if ($use_netns) {
sudo($config, '--netns_create', $chroot);
}
return $ret;