14714: Tests use cluster config
[arvados.git] / build / run-library.sh
index af95cdc6012cb65b160819fd78042e8d8ba4d4fd..cb5549df7183676217270adc03b98b1ddbb0cf25 100755 (executable)
@@ -104,6 +104,9 @@ handle_ruby_gem() {
 }
 
 calculate_go_package_version() {
+  # $__returnvar has the nameref attribute set, which means it is a reference
+  # to another variable that is passed in as the first argument to this function.
+  # see https://www.gnu.org/software/bash/manual/html_node/Shell-Parameters.html
   local -n __returnvar="$1"; shift
   local src_path="$1"; shift
 
@@ -226,6 +229,15 @@ test_rails_package_presence() {
 }
 
 get_complete_package_name() {
+  # if the errexit flag is set, unset it until this function returns
+  # otherwise, the shift calls below will abort the program if optional arguments are not supplied
+  if [ -o errexit ]; then
+    set +e
+    trap 'set -e' RETURN
+  fi
+  # $__returnvar has the nameref attribute set, which means it is a reference
+  # to another variable that is passed in as the first argument to this function.
+  # see https://www.gnu.org/software/bash/manual/html_node/Shell-Parameters.html
   local -n __returnvar="$1"; shift
   local pkgname="$1"; shift
   local version="$1"; shift