Merge branch '11349-nodemanager-status-api'
[arvados.git] / build / run-library.sh
index 1d7fda6a353cab8183d898d66b4de3c4c24ea2d8..a13470bc434a7f52ba82cda6b3af5a85be107b0d 100755 (executable)
@@ -199,7 +199,7 @@ test_package_presence() {
       deb_architecture="amd64"
 
       if [[ "$pkgtype" =~ ^(python|python3)$ ]]; then
-        rpm_architecture="all"
+        rpm_architecture="noarch"
         deb_architecture="all"
       fi
 
@@ -208,7 +208,7 @@ test_package_presence() {
         deb_architecture="all"
       fi
 
-      # These packages have binary components
+      # These python packages have binary components
       if [[ "$pkgname" =~ (ruamel|ciso|pycrypto|pyyaml) ]]; then
         rpm_architecture="x86_64"
         deb_architecture="amd64"
@@ -442,6 +442,11 @@ fpm_build () {
   FPM_EXIT_CODE=$?
 
   fpm_verify $FPM_EXIT_CODE $FPM_RESULTS
+
+  # if something went wrong and debug is off, print out the fpm command that errored
+  if [[ 0 -ne $? ]] && [[ "$STDOUT_IF_DEBUG" == "/dev/null" ]]; then
+    echo -e "\n${COMMAND_ARR[@]}\n"
+  fi
 }
 
 # verify build results
@@ -457,14 +462,19 @@ fpm_verify () {
 
   if [[ "$FPM_PACKAGE_NAME" == "" ]]; then
     EXITCODE=1
+    echo
     echo "Error: $PACKAGE: Unable to figure out package name from fpm results:"
     echo
     echo $FPM_RESULTS
     echo
+    return 1
   elif [[ "$FPM_RESULTS" =~ "File already exists" ]]; then
     echo "Package $FPM_PACKAGE_NAME exists, not rebuilding"
+    return 0
   elif [[ 0 -ne "$FPM_EXIT_CODE" ]]; then
+    EXITCODE=1
     echo "Error building package for $1:\n $FPM_RESULTS"
+    return 1
   fi
 }