Improve error message to include the distribution that is failing to build

debian-cd
Raphaël Hertzog 11 years ago
parent dbf0a7c20c
commit 18123531a5

@ -2,6 +2,7 @@
set -e set -e
KALI_DIST=kali
KALI_VERSION="${VERSION:-daily}" KALI_VERSION="${VERSION:-daily}"
TARGET_DIR=$(dirname $0)/images/kali-$KALI_VERSION TARGET_DIR=$(dirname $0)/images/kali-$KALI_VERSION
@ -47,16 +48,19 @@ if [ -n "$OPT_kali_rolling" ]; then
if [ "$KALI_VERSION" = "daily" ]; then if [ "$KALI_VERSION" = "daily" ]; then
KALI_VERSION="rolling" KALI_VERSION="rolling"
fi fi
KALI_DIST="kali-rolling"
elif [ -n "$OPT_kali_dev" ]; then elif [ -n "$OPT_kali_dev" ]; then
echo "Using kali-dev as the base distribution" echo "Using kali-dev as the base distribution"
KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --kali-dev" KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --kali-dev"
if [ "$KALI_VERSION" = "daily" ]; then if [ "$KALI_VERSION" = "daily" ]; then
KALI_VERSION="dev" KALI_VERSION="dev"
fi fi
KALI_DIST="kali-dev"
fi fi
if [ -n "$OPT_pu" ]; then if [ -n "$OPT_pu" ]; then
echo "Integrating proposed-updates in the image" echo "Integrating proposed-updates in the image"
KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --proposed-updates" KALI_CONFIG_OPTS="$KALI_CONFIG_OPTS --proposed-updates"
KALI_DIST="$KALI_DIST+pu"
fi fi
# Set sane PATH (cron seems to lack /sbin/ dirs) # Set sane PATH (cron seems to lack /sbin/ dirs)
@ -80,7 +84,7 @@ for KALI_ARCH in $KALI_ARCHES; do
lb config -a $KALI_ARCH $KALI_CONFIG_OPTS >>prepare.log 2>&1 lb config -a $KALI_ARCH $KALI_CONFIG_OPTS >>prepare.log 2>&1
lb build >/dev/null lb build >/dev/null
if [ $? -ne 0 ] || [ ! -e $IMAGE_NAME ]; then if [ $? -ne 0 ] || [ ! -e $IMAGE_NAME ]; then
echo "Build of $KALI_ARCH live image failed" >&2 echo "Build of $KALI_DIST/$KALI_ARCH live image failed" >&2
echo "Last 50 lines of the log:" >&2 echo "Last 50 lines of the log:" >&2
tail -n 50 binary.log >&2 tail -n 50 binary.log >&2
exit 1 exit 1

Loading…
Cancel
Save