- only run checkscripts if we built some rpms
authorMichael Schröder <mls@suse.de>
Tue, 25 Nov 2008 15:00:58 +0000 (15:00 +0000)
committerMichael Schröder <mls@suse.de>
Tue, 25 Nov 2008 15:00:58 +0000 (15:00 +0000)
build

diff --git a/build b/build
index 60e39d2..9ba9dd9 100755 (executable)
--- a/build
+++ b/build
@@ -1374,25 +1374,24 @@ for SPECFILE in "${SPECFILES[@]}" ; do
     test -d "$SRCDIR" && cd "$SRCDIR"
 done
 
-if test -n "$BUILD_USER_ABUILD_USED" ; then
+RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm"`
+
+if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
     echo "... checking for files with abuild user/group"
     BADFILE=
-    RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm"`
-    if test -n "$RPMS" ; then
-       while read un gn fn ; do
-           if test "$un" = abuild -o "$gn" = abuild -o "$un" = 399 -o "$gn" = 399 ; then
-               echo "  $un $gn $fn"
-               BADFILE=true
-           fi
-       done < <(rpm -qp --qf '[%{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]' $RPMS)
-    fi
+    while read un gn fn ; do
+       if test "$un" = abuild -o "$gn" = abuild -o "$un" = 399 -o "$gn" = 399 ; then
+           echo "  $un $gn $fn"
+           BADFILE=true
+       fi
+    done < <(rpm -qp --qf '[%{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]' $RPMS)
     if test -n "$BADFILE" ; then
        echo "please fix your filelist (e.g. add defattr)"
        cleanup_and_exit 1
     fi
 fi
 
-if test -d $BUILD_ROOT/usr/lib/build/checks ; then
+if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
     mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
     export PNAME=""
     export DO_RPM_REMOVE=true
@@ -1406,7 +1405,7 @@ if test -d $BUILD_ROOT/usr/lib/build/checks ; then
     umount -n $BUILD_ROOT/proc 2> /dev/null
 fi
 
-if test "$DO_CHECKS" != "false" -a -x $BUILD_ROOT/opt/testing/bin/rpmlint -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; then
+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-*" \
         -o -name "*-32bit-*" -o -name "*-64bit-*" \
@@ -1419,7 +1418,7 @@ if test "$DO_CHECKS" != "false" -a -x $BUILD_ROOT/opt/testing/bin/rpmlint -a -d
     chroot $BUILD_ROOT /opt/testing/bin/rpmlint --info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} ${SRPM_FILE_LIST[*]#$BUILD_ROOT} || cleanup_and_exit 1
 fi
 
-if test -n "$CREATE_BASELIBS" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; then
+if test -n "$RPMS" -a -n "$CREATE_BASELIBS" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; then
     if test -f $BUILD_ROOT/usr/lib/build/mkbaselibs -o "$CREATE_BASELIBS" != internal ; then
        mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
        create_baselibs