[tools, cmake] refactor: update/hash check scripts, use tags for some more deps, proper CPMUtil separation #2666

Merged
crueter merged 19 commits from update-fmt into master 2025-10-05 03:04:54 +02:00
2 changed files with 18 additions and 4 deletions
Showing only changes of commit 96f1881f45 - Show all commits

View file

@ -9,6 +9,8 @@
# shellcheck disable=SC1091
. tools/cpm/common.sh
RETURN=0
for PACKAGE in "$@"
do
export PACKAGE
@ -30,12 +32,15 @@ do
ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD")
# shellcheck disable=SC2028
[ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL"
[ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" && [ "$UPDATE" != "true" ] && RETURN=1
if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then
# shellcheck disable=SC2034
NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"")
export NEW_JSON
tools/cpm/replace.sh
fi
done
done
exit $RETURN

View file

@ -13,9 +13,12 @@
# shellcheck disable=SC1091
. tools/cpm/common.sh
RETURN=0
filter() {
TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan
}
for PACKAGE in "$@"
do
export PACKAGE
@ -55,6 +58,8 @@ do
[ "$LATEST" = "$TAG" ] && [ "$FORCE" != "true" ] && echo "-- * Up-to-date" && continue
RETURN=1
if [ "$HAS_REPLACE" = "true" ]; then
# this just extracts the tag prefix
VERSION_PREFIX=$(echo "$ORIGINAL_TAG" | cut -d"%" -f1)
@ -71,14 +76,18 @@ do
echo "-- * New hash: $HASH"
if [ "$UPDATE" = "true" ]; then
RETURN=0
if [ "$HAS_REPLACE" = "true" ]; then
# shellcheck disable=SC2034
NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .git_version = \"$NEW_GIT_VERSION\"")
else
# shellcheck disable=SC2034
NEW_JSON=$(echo "$JSON" | jq ".hash = \"$HASH\" | .tag = \"$LATEST\"")
fi
export NEW_JSON
tools/cpm/replace.sh
fi
done
exit $RETURN