Commit b26a7a2b authored by Rob Pike's avatar Rob Pike

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
parent ac3cf56d
......@@ -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 |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment