From: Simon McVittie Date: Mon, 18 Mar 2019 17:27:40 +0000 Subject: build-recipe-dsc: List contents of build results Debian's sbuild dumps the metadata and contents of all build results into its own logs, which is often helpful when comparing build logs and package contents. Let's do the same. Signed-off-by: Simon McVittie Forwarded: https://github.com/openSUSE/obs-build/pull/497 --- build-recipe-dsc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/build-recipe-dsc b/build-recipe-dsc index 3ee4077..3bf145e 100644 --- a/build-recipe-dsc +++ b/build-recipe-dsc @@ -86,6 +86,8 @@ EOF dsc_build() { local buildroot=$1 + local changes + local f DSC_BUILD_OPTIONS= if test -n "$BUILD_JOBS" ; then @@ -106,6 +108,37 @@ dsc_build() { chroot $buildroot su - else chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true + + for changes in "$buildroot/$TOPDIR"/*.changes ; do + echo + echo "==== $(basename "$changes") ====" + echo + cat "$changes" + echo + + while read f ; do + case "$f" in + (*.buildinfo) + echo "==== $f ====" + echo + cat "$buildroot/$TOPDIR/$f" + echo + esac + done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes") + + while read f ; do + case "$f" in + (*.deb|*.ddeb|*.udeb) + echo "==== $f ====" + echo + chroot "$buildroot" su -c "dpkg-deb --info $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true + echo + chroot "$buildroot" su -c "dpkg-deb --contents $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true + echo + esac + done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes") + done + if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then DEB_CHANGESFILE=${DEB_DSCFILE%.dsc}$OBS_DCH_RELEASE"_"$(chroot $buildroot su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes" chroot $buildroot su -c "cd $TOPDIR && echo Running lintian && (set -x && lintian -i $TOPDIR/$DEB_CHANGESFILE)" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=false