diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | functions | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index be40b74..13f6097 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debootstrap (1.0.40) UNRELEASED; urgency=low + + * When installation or configuration of a package fails, output a message + that points the user to the log file. Attempt to grep out the first + package that dpkg failed on and show its name too. Closes: #472704 + + -- Joey Hess <joeyh@debian.org> Tue, 17 Apr 2012 20:35:53 -0400 + debootstrap (1.0.39) unstable; urgency=low * Retry corrupted downloads rather than carrying on almost regardless. @@ -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 |