mirror of
https://github.com/containers/skopeo.git
synced 2025-09-12 21:16:52 +00:00
Allow keeping vendor subdirectories in vendored packages
github.com/coreos/etcd as of v2.2.5 uses a Godeps subdirectory, and imports packages by including the Godeps path fragments directly in the package name; so we can't just remove the subdirectory and vendor the included package directly. So, add a flag to clone() to surpress removing the vendor subdirectories.
This commit is contained in:
@@ -10,6 +10,12 @@ export GOPATH="$GOPATH:${PWD}/vendor"
|
||||
find="/usr/bin/find"
|
||||
|
||||
clone() {
|
||||
local delete_vendor=true
|
||||
if [ "x$1" = x--keep-vendor ]; then
|
||||
delete_vendor=false
|
||||
shift
|
||||
fi
|
||||
|
||||
local vcs="$1"
|
||||
local pkg="$2"
|
||||
local rev="$3"
|
||||
@@ -39,8 +45,10 @@ clone() {
|
||||
echo -n 'rm VCS, '
|
||||
( cd "$target" && rm -rf .{git,hg} )
|
||||
|
||||
echo -n 'rm vendor, '
|
||||
( cd "$target" && rm -rf vendor Godeps/_workspace )
|
||||
if $delete_vendor; then
|
||||
echo -n 'rm vendor, '
|
||||
( cd "$target" && rm -rf vendor Godeps/_workspace )
|
||||
fi
|
||||
|
||||
echo done
|
||||
}
|
||||
|
Reference in New Issue
Block a user