mirror of
https://github.com/golang/go
synced 2024-11-25 07:17:56 -07:00
fix deps.bash. \t does not mean tab in some seds.
also: add /dev/null to the ls args to repair handling of empty dependency lists. R=rsc CC=golang-dev https://golang.org/cl/883045
This commit is contained in:
parent
ac3cf56d33
commit
b26a7a2b88
@ -18,10 +18,12 @@ dirpat=$(echo $dirs | sed 's/ /|/g; s/.*/^(&)$/')
|
|||||||
for dir in $dirs; do (
|
for dir in $dirs; do (
|
||||||
cd $dir || exit 1
|
cd $dir || exit 1
|
||||||
|
|
||||||
sources=$(sed -n 's/^[ \t]*\([^ \t]*\.go\)[ \t]*\\*[ \t]*$/\1/p' Makefile)
|
sources=$(sed -n 's/^[ ]*\([^ ]*\.go\)[ ]*\\*[ ]*$/\1/p' Makefile)
|
||||||
sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g')
|
sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g')
|
||||||
sources=$(echo $sources | sed 's/\$(GOARCH)/'$GOARCH'/g')
|
sources=$(echo $sources | sed 's/\$(GOARCH)/'$GOARCH'/g')
|
||||||
sources=$(ls $sources 2> /dev/null) # remove .s, .c, etc.
|
# /dev/null here means we get an empty dependency list if $sources is empty
|
||||||
|
# instead of listing every file in the directory.
|
||||||
|
sources=$(ls $sources /dev/null 2> /dev/null) # remove .s, .c, etc.
|
||||||
|
|
||||||
deps=$(
|
deps=$(
|
||||||
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
|
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
|
||||||
|
Loading…
Reference in New Issue
Block a user