summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rw-r--r--functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions b/functions
index edc6332..ad7b211 100644
--- a/functions
+++ b/functions
@@ -877,6 +877,18 @@ in_target_failmsg () {
shift; shift; shift
if ! $CHROOT_CMD "$@"; then
warning "$code" "$msg" "$arg"
+ # Try to point user at actual failing package.
+ msg="See %s for details"
+ if [ -e "$TARGET/debootstrap/debootstrap.log" ]; then
+ arg="$TARGET/debootstrap/debootstrap.log"
+ local pkg="$(grep '^dpkg: error processing ' "$TARGET/debootstrap/debootstrap.log" | head -n 1 | cut -d ' ' -f 4)"
+ if [ -n "$pkg" ]; then
+ msg="$msg (possibly the package $pkg is at fault)"
+ fi
+ else
+ arg="the log"
+ fi
+ warning "$code" "$msg" "$arg"
return 1
fi
return 0