diff --git a/build-scripts/unpack-tarballs b/build-scripts/unpack-tarballs index 01f67afb8..bb67aa9af 100755 --- a/build-scripts/unpack-tarballs +++ b/build-scripts/unpack-tarballs @@ -68,5 +68,5 @@ log_debug "UNPACKING MASTERFILES TARBALL: $MASTERFILES_TARBALL AND SYMLINKING ma # We want globbing here gzip -dc $MASTERFILES_TARBALL | tar -xf - # the masterfiles tarball would match cfengine-masterfiles-* so find the unpacked dir specifically -_cfmpfdir=$(find -type d -name 'cfengine-masterfiles-*') +_cfmpfdir=$(find . -type d -name 'cfengine-masterfiles-*') ln -s "$_cfmpfdir" masterfiles diff --git a/ci/fix-buildhost.sh b/ci/fix-buildhost.sh index beea92f0e..d825bfc04 100755 --- a/ci/fix-buildhost.sh +++ b/ci/fix-buildhost.sh @@ -1,13 +1,18 @@ #!/usr/bin/env bash # it is expected that this file is sourced, not executed directly set -ex -my_path="$(realpath "${BASH_SOURCE[0]}")" -my_dir="$(dirname "$my_path")" if [ -f /etc/os-release ]; then source /etc/os-release if [ "$ID" = "centos" ] && [ "$VERSION_ID" = "7" ]; then - source "$my_dir"/centos-7-setup-devtoolset-11.sh + if command -v realpath >/dev/null; then + my_path="$(realpath "${BASH_SOURCE[0]}")" + my_dir="$(dirname "$my_path")" + source "$my_dir"/centos-7-setup-devtoolset-11.sh + else + echo "FAIL: could not find realpath command on rhel/centos-7 to source needed centos-7-setup-devtoolset-11.sh" + exit 1 + fi fi fi diff --git a/ci/initialize-build-host.sh b/ci/initialize-build-host.sh index 7080d2dd4..eefbbc937 100644 --- a/ci/initialize-build-host.sh +++ b/ci/initialize-build-host.sh @@ -8,7 +8,7 @@ # serial execution of initialization steps. It will post the output when # finished, if any. # -# 2. If $(pwd)/proxy-target.txt exists, it means this is a proxy host, and the +# 2. If $HOME/proxy-target.txt exists, it means this is a proxy host, and the # real build machine is on the host specified by the login details inside # that file. If the file does not exist, we are on the build slave itself. # After figuring that stuff out, the script will run the rest of the original @@ -227,7 +227,7 @@ reset_nested_vm() { fi if [ ! -z "$login" ] then - ip=`sed 's/.*@//' $(pwd)/proxy-target.txt` + ip=`sed 's/.*@//' $HOME/proxy-target.txt` if sudo arp | grep -q $ip then sudo arp -d $ip @@ -235,7 +235,7 @@ reset_nested_vm() { fi # TODO, remove this, we don't need or use or test nested-vms $HOME/mender-qa/scripts/nested-vm.sh $HOME/*.qcow2 - login="`cat $(pwd)/proxy-target.txt`" + login="`cat $HOME/proxy-target.txt`" if $RSH $login true then echo "Nested VM is back up, it seems. Happily continuing!" @@ -277,13 +277,13 @@ reset_nested_vm() { fi } -if [ -f $(pwd)/proxy-target.txt ] +if [ -f $HOME/proxy-target.txt ] then # -------------------------------------------------------------------------- # Check target machine health. # -------------------------------------------------------------------------- - login="$(cat $(pwd)/proxy-target.txt)" + login="$(cat $HOME/proxy-target.txt)" if [ ! -z "$login" ] && $RSH $login true then