summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Lichtenheld <flichtenheld@astaro.com>2012-09-05 14:52:48 +0200
committerStephan Kulow <coolo@suse.de>2012-09-24 16:57:58 +0200
commit677a5514e26cfd6f2e6498e237cf85e58567b110 (patch)
tree95165b0a12936854ae8cbfe121aaa64f087aa9a4
parent53f35599848969b64e588db96cd0c1e20eb40002 (diff)
downloadbuild-677a5514e26cfd6f2e6498e237cf85e58567b110.tar.gz
build-677a5514e26cfd6f2e6498e237cf85e58567b110.tar.bz2
build-677a5514e26cfd6f2e6498e237cf85e58567b110.zip
init_buildsystem: fail early on reorder failure
If reorder fails for some reason (e.g. a rpm is missing) currently build will happily try to remove all packages and leave the chroot in a completely broken state. Also the error message is hard to find since there comes so many output after it. Just bail out directly after the failure.
-rwxr-xr-xinit_buildsystem6
1 files changed, 5 insertions, 1 deletions
diff --git a/init_buildsystem b/init_buildsystem
index 3de85b5..bb962bd 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -301,7 +301,7 @@ reorder()
for PKG in "$@" ; do
echo "$PKG" >> $BUILD_ROOT/.init_b_cache/order.manifest
done
- $BUILD_DIR/order --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR --manifest $BUILD_ROOT/.init_b_cache/order.manifest $BUILD_ROOT/.init_b_cache/rpms
+ $BUILD_DIR/order --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR --manifest $BUILD_ROOT/.init_b_cache/order.manifest $BUILD_ROOT/.init_b_cache/rpms || touch $BUILD_ROOT/exit
rm -f $BUILD_ROOT/.init_b_cache/order.manifest
}
@@ -865,6 +865,8 @@ if test ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rp
progress_step PACKAGES_TO_CBPREINSTALL_FILTERED
preinstall ${PKG##*/}
done
+ # for reorder
+ check_exit
if [ -w /root ]; then
test -c $BUILD_ROOT/dev/null || create_devs
fi
@@ -888,6 +890,7 @@ if test -n "$PREPARE_VM" ; then
# alreadyinstalled check will not work, but we have to live with that...
echo -n 'reordering...'
PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
+ check_exit
echo 'done'
Q="'\''"
echo "PACKAGES_TO_INSTALL='${PACKAGES_TO_INSTALL//"'"/$Q}'" > $BUILD_ROOT/.build/init_buildsystem.data
@@ -940,6 +943,7 @@ fi
if ! test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
echo -n 'reordering...'
PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
+ check_exit
echo 'done'
fi