Sfoglia il codice sorgente

Merge pull request #1242 from infosiftr/mawk

Switch from using "[[:space:]]" to just using "[ \t]" (especially so that mawk is an acceptable awk implementation)
yosifkit 10 anni fa
parent
commit
dbce3b1ca1
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      test/tests/docker-build.sh

+ 2 - 2
test/tests/docker-build.sh

@@ -23,14 +23,14 @@ trap "rm -rf '$tmp'" EXIT
 
 cat > "$tmp/Dockerfile"
 
-from="$(awk -F '[[:space:]]+' 'toupper($1) == "FROM" { print $2; exit }' "$tmp/Dockerfile")"
+from="$(awk -F '[ \t]+' 'toupper($1) == "FROM" { print $2; exit }' "$tmp/Dockerfile")"
 onbuilds="$(docker inspect -f '{{len .Config.OnBuild}}' "$from")"
 if [ "$onbuilds" -gt 0 ]; then
 	# crap, the image we want to build has some ONBUILD instructions
 	# those are kind of going to ruin our day
 	# let's do some hacks to strip those bad boys out in a new fake layer
 	"$(dirname "$(readlink -f "$BASH_SOURCE")")/remove-onbuild.sh" "$from" "$imageTag"
-	awk -F '[[:space:]]+' 'toupper($1) == "FROM" { $2 = "'"$imageTag"'" } { print }' "$tmp/Dockerfile" > "$tmp/Dockerfile.new"
+	awk -F '[ \t]+' 'toupper($1) == "FROM" { $2 = "'"$imageTag"'" } { print }' "$tmp/Dockerfile" > "$tmp/Dockerfile.new"
 	mv "$tmp/Dockerfile.new" "$tmp/Dockerfile"
 fi