<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27597">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">abuild: Fix shellcheck errors<br><br>Fix 6 new errors found by a newer version of shellcheck:<br>SC2155: Declare and assign separately to avoid masking return values.<br>4 x SC2086: Double quote to prevent globbing and word splitting.<br>SC2196: egrep is non-standard and deprecated. Use grep -E instead.<br><br>One of the SC2086 errors is masked because it needs word splitting.<br><br>Change-Id: I7f869e6d208f7247f739619c538be6075b802719<br>Signed-off-by: Martin Roth <gaumless@gmail.com><br>---<br>M util/abuild/abuild<br>1 file changed, 8 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/27597/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/abuild/abuild b/util/abuild/abuild</span><br><span>index f67117c..48549b6 100755</span><br><span>--- a/util/abuild/abuild</span><br><span>+++ b/util/abuild/abuild</span><br><span>@@ -167,12 +167,14 @@</span><br><span> function normalize_target</span><br><span> {</span><br><span>  local targets</span><br><span style="color: hsl(120, 100%, 40%);">+ local VARIANT_UC</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    local VARIANT_UC=$(echo "${variant}" | tr '[:lower:]' '[:upper:]')</span><br><span style="color: hsl(120, 100%, 40%);">+  VARIANT_UC=$(echo "${variant}" | tr '[:lower:]' '[:upper:]')</span><br><span> </span><br><span>   targets=$(get_mainboards "$1")</span><br><span>     if [ -n "$targets" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">-            targets=$(grep "${VARIANT_UC}\$" <<< ${targets})</span><br><span style="color: hsl(120, 100%, 40%);">+           # shellcheck disable=SC2086</span><br><span style="color: hsl(120, 100%, 40%);">+           targets="$(grep "${VARIANT_UC}\$" <<< ${targets})"</span><br><span>              echo "$targets"</span><br><span>            return</span><br><span>       fi</span><br><span>@@ -355,10 +357,10 @@</span><br><span> </span><br><span>       CURR=$( pwd )</span><br><span>        #stime=`perl -e 'print time();' 2>/dev/null || date +%s`</span><br><span style="color: hsl(0, 100%, 40%);">-     eval $BUILDPREFIX $MAKE "$verboseopt" DOTCONFIG="${build_dir}/config.build" obj="${build_dir}" objutil="$TARGET/sharedutils" BUILD_TIMELESS=$TIMELESS \</span><br><span style="color: hsl(120, 100%, 40%);">+       eval "$BUILDPREFIX" "$MAKE" "$verboseopt" DOTCONFIG="${build_dir}/config.build" obj="${build_dir}" objutil="$TARGET/sharedutils" BUILD_TIMELESS=$TIMELESS \</span><br><span>              &> "${build_dir}/make.log" ; \</span><br><span>              MAKE_FAILED=$?</span><br><span style="color: hsl(0, 100%, 40%);">-  cp ${ROOT}/.xcompile "${build_dir}/xcompile.build"</span><br><span style="color: hsl(120, 100%, 40%);">+  cp "${ROOT}/.xcompile" "${build_dir}/xcompile.build"</span><br><span>     cd "${build_dir}" || return $?</span><br><span> </span><br><span>         etime=$(perl -e 'print time();' 2>/dev/null || date +%s)</span><br><span>@@ -459,7 +461,7 @@</span><br><span>            return</span><br><span>       fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  required_arches=$(egrep "^CONFIG_ARCH_(BOOTBLOCK|R.MSTAGE|VERSTAGE)" "$TARGET/${BUILD_NAME}/config.build" | \</span><br><span style="color: hsl(120, 100%, 40%);">+     required_arches=$(grep -E "^CONFIG_ARCH_(BOOTBLOCK|R.MSTAGE|VERSTAGE)" "$TARGET/${BUILD_NAME}/config.build" | \</span><br><span>                  sed "s,^CONFIG_ARCH_[^_]*_\([^=]*\)=.*$,\1," |sort -u |tr 'A-Z\n\r' 'a-z  ')</span><br><span>       # shellcheck disable=SC2016,SC2059</span><br><span>   missing_arches=$(printf 'include .xcompile\nall: ; @echo $(foreach arch,'"$required_arches"',$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))' | $MAKE --no-print-directory -f -)</span><br><span>@@ -800,7 +802,7 @@</span><br><span>      local XMLFILE="$ABSPATH/__util.xml"</span><br><span>        rm -f "${XMLFILE}"</span><br><span>         stime=$(perl -e 'print time();' 2>/dev/null || date +%s)</span><br><span style="color: hsl(0, 100%, 40%);">-     $BUILDPREFIX $MAKE -j "$cpus" DOTCONFIG="$TMPCFG" obj="$TARGET/temp" objutil="$TARGET/sharedutils" tools > "$TARGET/sharedutils/make.log" 2>&1</span><br><span style="color: hsl(120, 100%, 40%);">+    $BUILDPREFIX "$MAKE" -j "$cpus" DOTCONFIG="$TMPCFG" obj="$TARGET/temp" objutil="$TARGET/sharedutils" tools > "$TARGET/sharedutils/make.log" 2>&1</span><br><span>       local ret=$?</span><br><span>         etime=$(perl -e 'print time();' 2>/dev/null || date +%s)</span><br><span>  local duration=$(( etime - stime ))</span><br><span>@@ -831,8 +833,6 @@</span><br><span> }</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-debug "ROOT=$ROOT"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> junit '<?xml version="1.0" encoding="utf-8"?>'</span><br><span> junit '<testsuite>'</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27597">change 27597</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27597"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I7f869e6d208f7247f739619c538be6075b802719 </div>
<div style="display:none"> Gerrit-Change-Number: 27597 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>