aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-03-23 18:09:38 +0000
committerOlivier Blin <blino@mageia.org>2011-03-23 18:09:38 +0000
commit3834ae1110ac4588d0b270dd21e08fd45b2bd72f (patch)
tree1abba6791066181ca749ae53043b92cb2baab80f
parenta82216519b7076aa705444996420e4660347f629 (diff)
downloadiurt-3834ae1110ac4588d0b270dd21e08fd45b2bd72f.tar
iurt-3834ae1110ac4588d0b270dd21e08fd45b2bd72f.tar.gz
iurt-3834ae1110ac4588d0b270dd21e08fd45b2bd72f.tar.bz2
iurt-3834ae1110ac4588d0b270dd21e08fd45b2bd72f.tar.xz
iurt-3834ae1110ac4588d0b270dd21e08fd45b2bd72f.zip
move rpmbuild check in build_chroot, which is a better place than install_packages
-rw-r--r--lib/Iurt/Chroot.pm7
-rw-r--r--lib/Iurt/Urpmi.pm8
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index 547cd03..0fc5a26 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -525,6 +525,13 @@ sub build_chroot {
return 0;
}
+ # <mrl> URPMI saying ok or not, we check this anyway. So that's why
+ # it's outside the else.
+ if (! -f "$tmp_chroot/usr/bin/rpmbuild") {
+ plog(1, "ERROR: rpm-build is missing!");
+ return 0;
+ }
+
# remove files used by --urpmi-root
sudo($run, $config, "--rm", "$tmp_chroot/etc/urpmi/urpmi.cfg");
sudo($run, $config, "--rm", "$tmp_chroot/var/lib/urpmi/*");
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index d22b90d..ff5b3e3 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -547,13 +547,7 @@ sub install_packages {
$ok = 0;
}
- # <mrl> URPMI saying ok or not, we check this anyway. So that's why
- # it's outside the else.
- if (! -f "$chroot_tmp/usr/bin/rpmbuild") {
- plog(1, "ERROR: rpm-build is missing!");
- $ok = 0;
- }
- elsif ($ok && (!@rpm || are_installed($chroot_tmp, @rpm))) {
+ if ($ok && (!@rpm || are_installed($chroot_tmp, @rpm))) {
plog("installation successful");
$ok = 1;
}