Avoid No RPM in arch message when useless
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 May 2014 12:19:08 +0000 (14:19 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 May 2014 12:19:08 +0000 (14:19 +0200)
id-rpm-build/upload-rpms.sh

index bc4e6c7..0562b70 100755 (executable)
@@ -44,19 +44,23 @@ fi
 for pkg in ${pkg_names}; do
        if $inc_src; then
                if test ! -f ${BUILD_DIR}/SRPMS/${pkg}.src.rpm; then
-                       echo "No SRPM for ${pkg}"
-               else
-                       scp ${BUILD_DIR}/SRPMS/${pkg}.src.rpm ${UPLOAD_URI}/redhat/${DISTRO}/SRPMS/
-               fi      
-       fi  
+                       echo "FAILED: No SRPM for ${pkg}"
+                       exit 1
+               fi
+               scp ${BUILD_DIR}/SRPMS/${pkg}.src.rpm ${UPLOAD_URI}/redhat/${DISTRO}/SRPMS/
+       fi
        if $inc_bin; then
+               copy=false
                for dir in ${BUILD_DIR}/RPMS/*; do
                        arch=`basename ${dir}`
                        if test -f ${dir}/${pkg}.${arch}.rpm; then
+                               copy=true
                                scp ${dir}/${pkg}.${arch}.rpm ${UPLOAD_URI}/redhat/${DISTRO}/RPMS/${arch}/
-                       else
-                               echo "No ${pkg} in arch ${arch}"
                        fi
                done
+               if ! $copy; then
+                       echo "FAILED: No RPM copied for: ${pkg}"
+                       exit 1
+               fi
        fi
 done