From c6164efb1fcaf9767704c42e8d15b9a2e27f73e5 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Sep 10 2015 14:25:41 +0000 Subject: use local vars in shell functions to not hit scope issue (thanks walters for the catch) --- diff --git a/scripts/build-cloud-images b/scripts/build-cloud-images index bf0ab68..65097cd 100755 --- a/scripts/build-cloud-images +++ b/scripts/build-cloud-images @@ -75,8 +75,8 @@ do done set_ostree_kickstart() { - ks=$1 - url=$2 + local ks=$1 + local url=$2 sed -i -e "s|--url=[^ ]*|--url=\"${url}\"|g" ${ks} sed -i -e "s|ostree remote add.*|ostree remote add --set=gpg-verify=false fedora-atomic '"${url}"'|g" ${ks} } diff --git a/scripts/build-functions.sh b/scripts/build-functions.sh index 50e5dcf..12b4bd6 100644 --- a/scripts/build-functions.sh +++ b/scripts/build-functions.sh @@ -51,14 +51,14 @@ logfile="${logdir}/build${DIST}.log" touch "${logfile}" function log() { - message="${1}" + local message="${1}" echo "$(date --utc) build${DIST}: ${message}" | tee -a "${logfile}" >&2 } function send_fedmsg() { - log="${1}" - topic="${2}" + local log="${1}" + local topic="${2}" # Emit a message using bodhi's cert (since we should be running as "masher"). echo "{\"log\": \"${log}\", \"branch\": \"$BRANCHED\", \"arch\": \"$ARCH\"}" | fedmsg-logger \ --cert-prefix bodhi \