-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2211] Use discretion in building shim filelist
This patch modifies our scripts/goListFiles to work more closely to its advertised function. That is, it will only report files actually related to golang/cgo sources rather than any files it encounters in the filesystem. Change-Id: I5b9532ce963c5d020e7cefe80e0aafcdd7177da6 Signed-off-by: Gregory Haskins <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
#!/bin/bash | ||
|
||
target=$1 | ||
find_golang_src() { | ||
find $1 -name "*.go" -or -name "*.h" -or -name "*.c" | ||
} | ||
|
||
deps=`go list -f '{{ join .Deps "\n" }}' $target` | ||
list_deps() { | ||
target=$1 | ||
|
||
find $GOPATH/src/$target -type f | ||
deps=`go list -f '{{ join .Deps "\n" }}' $target` | ||
|
||
for dep in $deps; | ||
do | ||
importpath=$GOPATH/src/$dep | ||
if [ -d $importpath ]; | ||
then | ||
find $importpath -type f | ||
fi | ||
done | ||
find_golang_src $GOPATH/src/$target | ||
|
||
for dep in $deps; | ||
do | ||
importpath=$GOPATH/src/$dep | ||
if [ -d $importpath ]; | ||
then | ||
find_golang_src $importpath | ||
fi | ||
done | ||
} | ||
|
||
list_deps $1 | sort | uniq |