Merge "Fail with helpful message if RPM not found"
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 3 Jan 2018 21:02:49 +0000 (21:02 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 3 Jan 2018 21:02:49 +0000 (21:02 +0000)
jjb/packaging/test-rpm-deps.sh

index 70d1e584d5860ac44642b8e057dd500411703ef4..d8fd61e581adad291a5514d75ee158fa0b8c43b1 100644 (file)
@@ -14,6 +14,12 @@ set -- /home/$USER/rpmbuild/RPMS/noarch/*.rpm
 # If path is globbed (/path/to/*.rpm), expand it
 path=$(sudo find / -wholename /home/$USER/rpmbuild/RPMS/noarch/*.rpm)
 
+# If no RPM found, fail clearly
+if [ -z $path ]; then
+    echo "RPM not found"
+    exit 1
+fi
+
 # Requirements for package where SRPM was built into noarch on CentOS CBS
 # rpm -qp opendaylight-8.0.0-0.1.20171125rel2049.el7.noarch.rpm --requires
 # shellcheck disable=SC2034