mirror of
https://github.com/golang/go
synced 2024-11-22 00:44:39 -07:00
build: use awk instead of giant egrep regexp
Avoids buggy version of egrep on some Macs. R=r, dsymonds CC=golang-dev https://golang.org/cl/4603056
This commit is contained in:
parent
832e87500e
commit
f011bd378f
@ -15,7 +15,13 @@ fi
|
|||||||
|
|
||||||
# Get list of directories from Makefile
|
# Get list of directories from Makefile
|
||||||
dirs=$(gomake --no-print-directory echo-dirs)
|
dirs=$(gomake --no-print-directory echo-dirs)
|
||||||
dirpat=$(echo $dirs C | sed 's/ /|/g; s/.*/^(&)$/')
|
dirpat=$(echo $dirs C | awk '{
|
||||||
|
for(i=1;i<=NF;i++){
|
||||||
|
x=$i
|
||||||
|
gsub("/", "\\/", x)
|
||||||
|
printf("/^(%s)$/\n", x)
|
||||||
|
}
|
||||||
|
}')
|
||||||
|
|
||||||
for dir in $dirs; do (
|
for dir in $dirs; do (
|
||||||
cd $dir || exit 1
|
cd $dir || exit 1
|
||||||
@ -30,7 +36,7 @@ for dir in $dirs; do (
|
|||||||
deps=$(
|
deps=$(
|
||||||
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
|
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
|
||||||
cut -d '"' -f2 |
|
cut -d '"' -f2 |
|
||||||
egrep "$dirpat" |
|
awk "$dirpat" |
|
||||||
grep -v "^$dir\$" |
|
grep -v "^$dir\$" |
|
||||||
sed 's/$/.install/' |
|
sed 's/$/.install/' |
|
||||||
sed 's;^C\.install;runtime/cgo.install;' |
|
sed 's;^C\.install;runtime/cgo.install;' |
|
||||||
|
Loading…
Reference in New Issue
Block a user