diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-08-07 21:23:10 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-08-07 21:23:10 +0000 |
commit | bd571b45ea287ccb77b48a1b93fa957ba280f8cb (patch) | |
tree | 484342080e741cdd7d57de75146782b881473d29 | |
parent | 69be89af130dc6f4180cfee77674f750086a7213 (diff) | |
download | iurt-bd571b45ea287ccb77b48a1b93fa957ba280f8cb.tar iurt-bd571b45ea287ccb77b48a1b93fa957ba280f8cb.tar.gz iurt-bd571b45ea287ccb77b48a1b93fa957ba280f8cb.tar.bz2 iurt-bd571b45ea287ccb77b48a1b93fa957ba280f8cb.tar.xz iurt-bd571b45ea287ccb77b48a1b93fa957ba280f8cb.zip |
Merge create_chroot into create_build_chroot
-rw-r--r-- | lib/Iurt/Chroot.pm | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 4c9cfd1..e37b6d8 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -19,7 +19,6 @@ our @EXPORT = qw( add_local_user create_temp_chroot remove_chroot - create_chroot create_build_chroot ); @@ -261,12 +260,6 @@ sub check_mounted { 0; } -sub create_build_chroot { - my ($chroot, $chroot_tar, $run, $config) = @_; - create_chroot($chroot, $chroot_tar, $run, $config, - { packages => $config->{basesystem_packages} }); -} - sub check_chroot_need_update { my ($tmp_chroot, $run) = @_; @@ -289,8 +282,10 @@ sub check_chroot_need_update { return 1; } } -sub create_chroot { - my ($chroot, $chroot_tar, $run, $config, $opt) = @_; + +sub create_build_chroot { + my ($chroot, $chroot_tar, $run, $config) = @_; + my $tmp_chroot = mktemp("$chroot.tmp.XXXXXX"); my $rebuild; my $clean = sub { @@ -299,7 +294,6 @@ sub create_chroot { }; plog('NOTIFY', "creating chroot"); - plog('DEBUG', "... with packages " . join(', ', @{$opt->{packages}})); mkdir_p($tmp_chroot); if (!-f $chroot_tar) { @@ -313,7 +307,7 @@ sub create_chroot { if ($rebuild) { sudo($config, '--rm', '-r', $chroot); - if (!build_chroot($run, $config, $tmp_chroot, $opt)) { + if (!build_chroot($run, $config, $tmp_chroot)) { plog('NOTIFY', "creating chroot failed."); $clean->(); return; @@ -335,10 +329,10 @@ sub create_chroot { } sub build_chroot { - my ($run, $config, $tmp_chroot, $opt) = @_; + my ($run, $config, $tmp_chroot) = @_; plog('DEBUG', "building the chroot with " - . join(', ', @{$opt->{packages}})); + . join(', ', @{$config->{basesystem_packages}})); sudo($config, "--mkdir", "-p", "$tmp_chroot/dev/pts", "$tmp_chroot/etc/sysconfig", "$tmp_chroot/proc", @@ -362,7 +356,7 @@ sub build_chroot { $urpmi->set_command($tmp_chroot); # (blino) install meta-task first for prefer.vendor.list to be used - foreach my $packages ([ 'meta-task' ], $opt->{packages}) { + foreach my $packages ([ 'meta-task' ], $config->{basesystem_packages}) { if (!$urpmi->install_packages( "chroot", $tmp_chroot, |