diff options
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r-- | lib/Iurt/Chroot.pm | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index ab8df70..82df2b0 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -50,13 +50,13 @@ 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"); } # Do not run rm if there is something still mounted there - open (my $FP, "/proc/mounts") or die $!; + open(my $FP, "/proc/mounts") or die $!; my @list = grep { /$chroot/ } <$FP>; - close ($FP); + close($FP); if ($#list >= 0) { # Still referenced return 1; @@ -84,39 +84,38 @@ sub clean_chroot { # <mrl> 20071106 Second try? if (!-d "$chroot/proc" || !-d "$chroot/home/builder") { - create_build_chroot($chroot, $chroot_tar, $run, $config) + create_build_chroot($chroot, $chroot_tar, $run, $config); } if (!dump_rpmmacros($run, $config, "$chroot/home/builder/.rpmmacros")) { - plog ('ERROR', "Failed to dump macros"); + plog('ERROR', "Failed to dump macros"); return; } if (system("$sudo mount none -t proc $chroot/proc")) { - plog ('ERROR', "Failed to mount proc"); + plog('ERROR', "Failed to mount proc"); return; } if (system("$sudo mount none -t devpts $chroot/dev/pts")) { - plog ('ERROR', "Failed to mount dev/pts"); + plog('ERROR', "Failed to mount dev/pts"); return; } if ($run->{icecream}) { system("$sudo mkdir -p $chroot/var/cache/icecream"); if (system("$sudo mount -o bind /var/cache/icecream $chroot/var/cache/icecream")) { - plog ('ERROR', "Failed to mount var/cache/icecream"); + plog('ERROR', "Failed to mount var/cache/icecream"); return; } } if ($run->{additional_media} && $run->{additional_media}{repository}) { my $rep = $run->{additional_media}{repository}; - if (!($rep =~ m/^(http:|ftp:)/)) { + 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"); if (system("$sudo mount -o bind,ro $url $mount_point")) { - plog ('ERROR', "Failed to mount $url on $mount_point"); + plog('ERROR', "Failed to mount $url on $mount_point"); return; } } @@ -135,7 +134,7 @@ Return true. =cut sub update_chroot { - my ($chroot, $chroot_tar, $run, $config, $o_only_clean, $o_only_tar) = @_; + my ($_chroot, $_chroot_tar, $_run, $_config, $_only_clean, $_only_tar) = @_; plog('DEBUG', "update chroot"); @@ -577,7 +576,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, '.'); } |