From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9A583139085 for ; Thu, 22 Dec 2016 01:20:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B9AAC234003; Thu, 22 Dec 2016 01:20:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8E21C2241FA for ; Thu, 22 Dec 2016 01:20:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5793D341149 for ; Thu, 22 Dec 2016 01:20:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D9A9724E4 for ; Thu, 22 Dec 2016 01:20:18 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1482369603.12b23fa07ea78234450010f8a57d31eb8ed143b7.vapier@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools/ X-VCS-Repository: proj/releng X-VCS-Files: tools/catalyst-auto X-VCS-Directories: tools/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 12b23fa07ea78234450010f8a57d31eb8ed143b7 X-VCS-Branch: master Date: Thu, 22 Dec 2016 01:20:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c76d663b-84b1-49ec-8c02-1a12d181cc17 X-Archives-Hash: 14b8ae39fce5ece394a56124d862f224 commit: 12b23fa07ea78234450010f8a57d31eb8ed143b7 Author: Mike Frysinger gentoo org> AuthorDate: Fri Dec 9 04:45:55 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Dec 22 01:20:03 2016 +0000 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=12b23fa0 catalyst-auto: fix quoting in a number of places tools/catalyst-auto | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index 6c84aa9..793e0c6 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -77,9 +77,9 @@ run_cmd() { if [ $verbose = 1 ]; then echo "*** Running command: ${cmd}" - ${cmd} 2>&1 | tee ${logfile} + ${cmd} 2>&1 | tee "${logfile}" else - ${cmd} &> ${logfile} + ${cmd} &> "${logfile}" fi } @@ -174,13 +174,13 @@ EMAIL_FROM="catalyst@${HOSTNAME:-$(hostname)}" EMAIL_SUBJECT_PREPEND="[${SUBARCH}-auto]" doneconfig=0 -for config_file in ${config_files[@]}; do +for config_file in "${config_files[@]}"; do # Make sure all required values were specified if [ -z "${config_file}" -o ! -e "${config_file}" ]; then usage "ERROR: You must specify a valid config file to use: '$config_file' is not valid" exit 1 fi - source ${config_file} + source "${config_file}" doneconfig=1 done if [[ $doneconfig -eq 0 ]]; then @@ -202,7 +202,7 @@ if [[ ${lastrun} -ne 0 ]]; then fi DATESTAMP=$(date +%Y%m%d) -TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" catalyst-auto.${DATESTAMP}.XXXXXX) +TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" "catalyst-auto.${DATESTAMP}.XXXXXX") # Nuke any previous tmpdirs to keep them from accumulating. if [[ ${preclean} -eq 1 ]]; then @@ -225,7 +225,7 @@ if ! run_cmd "pre_build" "${TMPDIR}/log/pre_build.log"; then exit 1 fi -cd ${SPECS_DIR} +cd "${SPECS_DIR}" || exit 1 for a in "" ${SETS}; do if [ -z "${a}" ]; then @@ -237,40 +237,40 @@ for a in "" ${SETS}; do fi for i in ${!specs_var} ${!optional_specs_var}; do - cp --parents ${i} ${TMPDIR}/specs/ + cp --parents "${i}" "${TMPDIR}"/specs/ done done -find ${KCONFIG_DIR} -type f -exec cp {} ${TMPDIR}/kconfig \; +find "${KCONFIG_DIR}" -type f -exec cp {} "${TMPDIR}"/kconfig \; -cd ${TMPDIR}/specs +cd "${TMPDIR}/specs" || exit 1 # Fix up specs with datestamp for i in $(find -name '*.spec'); do # Grab current version_stamp and source_subpath - old_version_stamp=$(grep version_stamp ${i} | sed -e 's|^version_stamp: *||') - old_source_subpath=$(grep source_subpath ${i} | sed -e 's|^source_subpath: *||') + old_version_stamp=$(grep version_stamp "${i}" | sed -e 's|^version_stamp: *||') + old_source_subpath=$(grep source_subpath "${i}" | sed -e 's|^source_subpath: *||') - new_version_stamp=$(echo "${old_version_stamp}" | sed -e 's|^\(.*-\)\?.*$|\1'${DATESTAMP}'|') - new_source_subpath=$(echo "${old_source_subpath}" | sed -e 's|'${old_version_stamp}'|'${new_version_stamp}'|') + new_version_stamp=$(echo "${old_version_stamp}" | sed -e "s|^\(.*-\)\?.*$|\1${DATESTAMP}|") + new_source_subpath=$(echo "${old_source_subpath}" | sed -e "s|${old_version_stamp}|${new_version_stamp}|") - sed -i 's|^version_stamp:.*$|version_stamp: '${new_version_stamp}'|' ${i} - sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i} + sed -i "s|^version_stamp:.*$|version_stamp: ${new_version_stamp}|" "${i}" + sed -i "s|^snapshot:.*$|snapshot: ${DATESTAMP}|" "${i}" # We don't want to mangle the source_subpath for our stage1 spec - if ! grep -q '^target: *stage[14]$' ${i}; then - sed -i 's|^source_subpath:.*$|source_subpath: '${new_source_subpath}'|' ${i} + if ! grep -q '^target: *stage[14]$' "${i}"; then + sed -i "s|^source_subpath:.*$|source_subpath: ${new_source_subpath}|" "${i}" fi - sed -i '/^livecd\/iso/s|'${old_version_stamp}'|'${new_version_stamp}'|' ${i} - sed -i '/^livecd\/volid/s|'${old_version_stamp}'|'${new_version_stamp}'|' ${i} + sed -i "/^livecd\/iso/s|${old_version_stamp}|${new_version_stamp}|" "${i}" + sed -i "/^livecd\/volid/s|${old_version_stamp}|${new_version_stamp}|" "${i}" - kconfig_lines=$(grep '^boot/kernel/[^/]\+/config:' ${i}) + kconfig_lines=$(grep '^boot/kernel/[^/]\+/config:' "${i}") if [ -n "${kconfig_lines}" ]; then echo "${kconfig_lines}" | while read line; do key=$(echo "${line}" | cut -d: -f1) filename=$(basename $(echo "${line}" | cut -d: -f2)) - sed -i "s|^${key}:.*\$|${key}: ${TMPDIR}/kconfig/${filename}|" ${i} + sed -i "s|^${key}:.*\$|${key}: ${TMPDIR}/kconfig/${filename}|" "${i}" done fi @@ -320,7 +320,7 @@ for a in "" ${SETS}; do for i in ${!specs_var}; do LOGFILE="${TMPDIR}/log/$(echo "${i}" | sed -e 's:/:_:' -e 's:\.spec$::').log" - run_cmd "${timeprefix} catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" ${LOGFILE} + run_cmd "${timeprefix} catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" "${LOGFILE}" if [ $? != 0 ]; then build_failure=1 send_email "Catalyst fatal build error - ${i}" "" "${LOGFILE}" @@ -330,7 +330,7 @@ for a in "" ${SETS}; do for i in ${!optional_specs_var}; do LOGFILE="${TMPDIR}/log/$(echo "${i}" | sed -e 's:/:_:' -e 's:\.spec$::').log" - run_cmd "${timeprefix} catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" ${LOGFILE} + run_cmd "${timeprefix} catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" "${LOGFILE}" if [ $? != 0 ]; then build_failure=1 send_email "Catalyst non-fatal build error - ${i}" "" "${LOGFILE}"