mirror of
https://github.com/containers/skopeo.git
synced 2025-09-17 23:39:13 +00:00
Do not clean test-only dependencies from vendor packages
Instead of only checking dependencies of the "main" packages, include also test dependencies of all subpackages of the project, and their transitive dependencies.
This commit is contained in:
@@ -46,10 +46,7 @@ clone() {
|
||||
}
|
||||
|
||||
clean() {
|
||||
local packages=(
|
||||
"${PROJECT}/cmd/skopeo" # package main
|
||||
"${PROJECT}/integration" # package main
|
||||
)
|
||||
local packages=($(go list -e ./... | grep -v "^${PROJECT}/vendor"))
|
||||
local platforms=( linux/amd64 linux/386 )
|
||||
|
||||
local buildTags=( )
|
||||
@@ -66,6 +63,10 @@ clean() {
|
||||
go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}"
|
||||
done | grep -vE "^${PROJECT}" | sort -u
|
||||
) )
|
||||
# .TestImports does not include indirect dependencies, so do one more iteration.
|
||||
imports+=( $(
|
||||
go list -e -f '{{join .Deps "\n"}}' "${imports[@]}" | grep -vE "^${PROJECT}" | sort -u
|
||||
) )
|
||||
imports=( $(go list -e -f '{{if not .Standard}}{{.ImportPath}}{{end}}' "${imports[@]}") )
|
||||
unset IFS
|
||||
|
||||
|
Reference in New Issue
Block a user