Commit f0a7cadc5d65ccda306ca1edfdae8db0eae5f621

Thomas de Grivel 2023-02-13T00:25:22

clone before checkout

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 55fcb96..11a984b 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -169,6 +169,10 @@ shpkg_checkout () {
         if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
             err 1 "shpkg_checkout: unknown repo: $SHPKG_REPO"
         fi
+        SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+        if ! [ -d "${SHPKG_REPO_SRC_DIR}" ]; then
+            ( verbose 2 shpkg_clone "${SHPKG_REPO}"; )
+        fi
         ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
               verbose 1 git fetch origin "$TREE" &&
               verbose 1 git checkout "$TREE" &&