Clearer error message if unexpected num RPMs 52/67452/1
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 23 Jan 2018 01:01:59 +0000 (20:01 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Tue, 23 Jan 2018 01:01:59 +0000 (20:01 -0500)
Change-Id: Ia277eed4b9c164ff8071d0e88d6aff1c8886e565
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
jjb/packaging/test-rpm-deps.sh

index 6def490d0721d740f4215ee6ab3ca72979f3b0b5..460bdaeed14f7d78e72aeacfa5871cf0816057d2 100644 (file)
@@ -8,8 +8,12 @@ set -ex -o pipefail
 
 # Verify exactly 1 RPM is in the path we expect
 set -- /home/$USER/rpmbuild/RPMS/noarch/*.rpm
-# shellcheck disable=SC1054
-[ $# -eq 1 ] || {{ echo "Expected 1 RPM, found $#"; exit 1; }}
+if [ $# -eq 1 ]; then
+    echo "Found one RPM in build out dir, as expected"
+else
+    echo "Expected 1 RPM, found $#"
+    echo 1
+fi
 
 # If path is globbed (/path/to/*.rpm), expand it
 path=$(sudo find / -wholename /home/$USER/rpmbuild/RPMS/noarch/*.rpm)