1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:34:40 -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:
Rob Pike 2010-04-06 10:53:48 -07:00
parent ac3cf56d33
commit b26a7a2b88

View File

@ -18,10 +18,12 @@ dirpat=$(echo $dirs | sed 's/ /|/g; s/.*/^(&)$/')
for dir in $dirs; do (
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/\$(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=$(
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |