File local-only-build.diff of Package k3s

diff --git a/scripts/build b/scripts/build
index 1bb17ca62..43e26927e 100755
--- a/scripts/build
+++ b/scripts/build
@@ -136,23 +136,17 @@ for i in "${containerd_binaries[@]}"; do
     fi
 done
 
-cleanup() {
-    exit_status=$?
-    rm -rf $TMPDIR
-    exit ${exit_status}
-}
-
 INSTALLBIN=$(pwd)/bin
 if [ ! -x ${INSTALLBIN}/cni${BINARY_POSTFIX} ]; then
 (
     echo Building cni
-    TMPDIR=$(mktemp -d)
-    trap cleanup EXIT
+    TMPDIR=$PWD/build
+#    trap cleanup EXIT
     WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins
-    git clone --single-branch --depth=1 --branch=$VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
+#    git clone --single-branch --depth=1 --branch=$VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
     cd $WORKDIR
-    rm -rf plugins/meta/flannel
-    git clone --single-branch --depth=1 --branch=$VERSION_FLANNEL_PLUGIN https://github.com/flannel-io/cni-plugin.git plugins/meta/flannel
+#    rm -rf plugins/meta/flannel
+#    git clone --single-branch --depth=1 --branch=$VERSION_FLANNEL_PLUGIN https://github.com/flannel-io/cni-plugin.git plugins/meta/flannel
     sed -i 's/package main/package flannel/; s/func main/func Main/' plugins/meta/flannel/*.go
     GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o $INSTALLBIN/cni${BINARY_POSTFIX}
 )
openSUSE Build Service is sponsored by