aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-08-27 22:37:55 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-08-27 22:37:55 +0200
commit091fd4d11654949e2d8e6c8f03cc9c675d472a91 (patch)
tree4fae5d9797926e3f92d500e0085c2104555db3ee /scripts
parentdfb8d3379f73de254a56b7b80d00fa19023cfd58 (diff)
Added CMake option BUILD_NDPI_FORCE_GIT_UPDATE to fix broken submodule caches in GitLab CIs..
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-and-build-libndpi.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/get-and-build-libndpi.sh b/scripts/get-and-build-libndpi.sh
index 102909d18..cd8be48ab 100755
--- a/scripts/get-and-build-libndpi.sh
+++ b/scripts/get-and-build-libndpi.sh
@@ -50,6 +50,7 @@ MAKE_PROGRAM=${MAKE_PROGRAM:-}
MAKEFLAGS=${MAKEFLAGS}
DEST_INSTALL=${DEST_INSTALL:-}
NDPI_COMMIT_HASH=${NDPI_COMMIT_HASH:-}
+FORCE_GIT_UPDATE=${FORCE_GIT_UPDATE:-}
-----------------------------------
EOF
@@ -60,7 +61,14 @@ cd "$(dirname "${0}")/.."
GIT_SUCCESS=0
if [ -d ./.git -o -f ./.git ]; then
GIT_SUCCESS=1
- LINES_CHANGED="$(git --no-pager diff ./libnDPI 2>/dev/null | wc -l || printf '0')"
+
+ if [ ! -z "${FORCE_GIT_UPDATE}" ]; then
+ git submodule deinit --force -- ./libnDPI || { GIT_SUCCESS=0; true; }
+ LINES_CHANGED=0
+ else
+ LINES_CHANGED="$(git --no-pager diff ./libnDPI 2>/dev/null | wc -l || printf '0')"
+ fi
+
if [ ${LINES_CHANGED} -eq 0 ]; then
git submodule update --progress --init ./libnDPI || { GIT_SUCCESS=0; true; }
else