diff options
Diffstat (limited to 'recipes-networking/cni/relocation.inc')
-rw-r--r-- | recipes-networking/cni/relocation.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes-networking/cni/relocation.inc b/recipes-networking/cni/relocation.inc new file mode 100644 index 00000000..456e2c8a --- /dev/null +++ b/recipes-networking/cni/relocation.inc | |||
@@ -0,0 +1,30 @@ | |||
1 | export sites="golang.org/x/net:golang.org/x/net:force \ | ||
2 | golang.org/x/sys:golang.org/x/sys:force \ | ||
3 | gopkg.in/yaml.v3:gopkg.in/yaml.v3:force \ | ||
4 | golang.org/x/text:golang.org/x/text:force \ | ||
5 | golang.org/x/tools:golang.org/x/tools:force \ | ||
6 | github.com/onsi/gomega:github.com/onsi/gomega:force \ | ||
7 | github.com/go-logr/logr:github.com/go-logr/logr:force \ | ||
8 | github.com/google/pprof:github.com/google/pprof:force \ | ||
9 | github.com/google/go-cmp:github.com/google/go-cmp:force \ | ||
10 | github.com/onsi/ginkgo/v2:github.com/onsi/ginkgo/v2:force \ | ||
11 | github.com/vishvananda/netns:github.com/vishvananda/netns:force \ | ||
12 | github.com/go-task/slim-sprig:github.com/go-task/slim-sprig:force \ | ||
13 | github.com/Masterminds/semver/v3:github.com/Masterminds/semver/v3:force" | ||
14 | |||
15 | do_compile:prepend() { | ||
16 | cd ${S}/src/import | ||
17 | for s in $sites; do | ||
18 | site_dest=$(echo $s | cut -d: -f1) | ||
19 | site_source=$(echo $s | cut -d: -f2) | ||
20 | force_flag=$(echo $s | cut -d: -f3) | ||
21 | mkdir -p vendor.copy/$site_dest | ||
22 | if [ -n "$force_flag" ]; then | ||
23 | echo "[INFO] $site_dest: force copying .go files" | ||
24 | rm -rf vendor.copy/$site_dest | ||
25 | rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest | ||
26 | else | ||
27 | [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ] && { echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)" ; true ; } || { echo "[INFO] $site_dest: copying .go files" ; rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest ; } | ||
28 | fi | ||
29 | done | ||
30 | } | ||