save rpmlint output for easier processing by external tools
authorLudwig Nussel <ludwig.nussel@suse.de>
Wed, 31 Mar 2010 12:49:05 +0000 (14:49 +0200)
committerLudwig Nussel <ludwig.nussel@suse.de>
Wed, 31 Mar 2010 12:49:05 +0000 (14:49 +0200)
build

diff --git a/build b/build
index e95a570..b4b9a7f 100755 (executable)
--- a/build
+++ b/build
@@ -1796,6 +1796,7 @@ if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
     done
 fi
 
+rm -f $TOPDIR/rpmlint.log
 if test -n "$RPMS" -a "$DO_CHECKS" != "false" -a -x "$BUILD_ROOT/opt/testing/bin/rpmlint" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; then
     LINT_RPM_FILE_LIST=($(find $BUILD_ROOT/$TOPDIR/RPMS \
        \( -name "*-debuginfo-*" -o -name "*-debugsource-*" \
@@ -1806,7 +1807,13 @@ if test -n "$RPMS" -a "$DO_CHECKS" != "false" -a -x "$BUILD_ROOT/opt/testing/bin
     echo
     echo "RPMLINT report:"
     echo "==============="
-    chroot $BUILD_ROOT /opt/testing/bin/rpmlint --info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} ${SRPM_FILE_LIST[*]#$BUILD_ROOT} || cleanup_and_exit 1
+    rpmlint_failed=
+    chroot $BUILD_ROOT /opt/testing/bin/rpmlint \
+           --info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} ${SRPM_FILE_LIST[*]#$BUILD_ROOT} \
+           > $TOPDIR/rpmlint.log 2>&1 || rpmlint_failed=1
+    cat $TOPDIR/rpmlint.log
+    mv $BUILD_ROOT/.build.rpmlint $TOPDIR/rpmlint.log
+    test -z "$rpmlint_failed" || cleanup_and_exit 1
 fi
 
 if test \( -n "$RPMS" -o -n "$DEBS" \) -a -n "$CREATE_BASELIBS" -a \( -d "$BUILD_ROOT/$TOPDIR/RPMS" -o -d "$BUILD_ROOT/$TOPDIR/DEBS" \)  ; then
@@ -1828,7 +1835,7 @@ if test -n "$RUNNING_IN_VM" -a -n "$VM_SWAP"; then
     args="--padstart 512 --padend 512 -v"
     case "$BUILDTYPE" in
        spec)
-           computeblocklists $args $TOPDIR/RPMS/*/*.rpm $TOPDIR/SRPMS/* > "$VM_SWAP"
+           computeblocklists $args $TOPDIR/RPMS/*/*.rpm $TOPDIR/SRPMS/* $TOPDIR/rpmlint.log > "$VM_SWAP"
            ;;
        dsc)
            computeblocklists $args $TOPDIR/DEBS/*.deb $TOPDIR/SOURCES.DEB/* > "$VM_SWAP"