summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-01-29 10:50:18 +0100
committerErich Eckner <git@eckner.net>2020-01-29 10:50:18 +0100
commitc43be87402ae4467a8731e8918b40e6b2a1af0da (patch)
treeb0d830bb8b631cb5d83ee9602b115b4ed6f8e00c
parent811a05a48e46ca93341482037b2389b29050a126 (diff)
downloadarchlinuxewe-c43be87402ae4467a8731e8918b40e6b2a1af0da.tar.xz
archPackagesUpdate: cache submodules
-rwxr-xr-xarchPackagesUpdate25
1 files changed, 22 insertions, 3 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate
index e068bc5c7..313664360 100755
--- a/archPackagesUpdate
+++ b/archPackagesUpdate
@@ -204,7 +204,10 @@ fi
echo '... done'
-${aufRechenknecht} && pkgSrcDir="${pkgSrcDir}/archPackages"
+if ${aufRechenknecht}; then
+ submoduleDir="${pkgSrcDir}/submodules"
+ pkgSrcDir="${pkgSrcDir}/archPackages"
+fi
# extract git ${branch}
git -C "${pkgSrcDir}" archive --format tar "${branch}" | \
@@ -275,8 +278,24 @@ if [ -f '.gitmodules' ]; then
continue
fi
mkdir -p "${path}"
- >&2 printf 'cloning %s into %s ...' "${url}" "${path}"
- git clone -q "${url}" "${path}"
+ >&2 printf 'submodule %s: ' "${path}"
+ if [ -n "${submoduleDir}" ]; then
+ upstream="${submoduleDir}/${path}"
+ >&2 printf ' cached'
+ if [ ! -d "${upstream}" ]; then
+ >&2 printf ', cloning ...'
+ git clone -q "${url}" "${upstream}"
+ >&2 printf ' done'
+ fi
+ else
+ upstream="${pkgSrcDir}/${path}"
+ >&2 printf ' true submodule'
+ fi
+ >&2 printf ', pulling ...'
+ git -C "${upstream}" pull -q --ff-only
+ >&2 printf ' done'
+ >&2 printf ', cloning ...'
+ git clone -q "${upstream}" "${path}"
>&2 printf ' done.\n'
done
fi