Add auto update script and needed script metadata

This commit is contained in:
BtbN 2022-07-12 19:55:52 +02:00
parent 38fccdcd44
commit 42202d95bc
9 changed files with 88 additions and 2 deletions

View file

@ -2,6 +2,7 @@
SCRIPT_REPO="https://github.com/openssl/openssl.git" SCRIPT_REPO="https://github.com/openssl/openssl.git"
SCRIPT_COMMIT="OpenSSL_1_1_1q" SCRIPT_COMMIT="OpenSSL_1_1_1q"
SCRIPT_TAGFILTER="OpenSSL_1_1_1*"
ffbuild_enabled() { ffbuild_enabled() {
return 0 return 0

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
SCRIPT_SKIP="1"
ffbuild_enabled() { ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1 [[ $TARGET != linux* ]] && return -1
return 0 return 0

View file

@ -2,6 +2,7 @@
SCRIPT_REPO="https://github.com/ARMmbed/mbedtls.git" SCRIPT_REPO="https://github.com/ARMmbed/mbedtls.git"
SCRIPT_COMMIT="v3.2.1" SCRIPT_COMMIT="v3.2.1"
SCRIPT_TAGFILTER="v3.*"
ffbuild_enabled() { ffbuild_enabled() {
return 0 return 0

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
SCRIPT_SKIP="1"
ffbuild_enabled() { ffbuild_enabled() {
[[ $TARGET == win* ]] [[ $TARGET == win* ]]
} }

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
SCRIPT_SKIP="1"
ffbuild_enabled() { ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1 [[ $TARGET != linux* ]] && return -1
return 0 return 0

View file

@ -2,7 +2,7 @@
SCRIPT_REPO="https://github.com/georgmartius/vid.stab.git" SCRIPT_REPO="https://github.com/georgmartius/vid.stab.git"
# TODO: clamp to e7715fc until georgmartius/vid.stab#104 get fixed # TODO: clamp to e7715fc until georgmartius/vid.stab#104 get fixed
SCRIPT_COMMIT="e7715fcf329573cdcff5c57d0e4a25f4c3a0cb7f" SCRIPT_COMMIT_PINNED="e7715fcf329573cdcff5c57d0e4a25f4c3a0cb7f"
ffbuild_enabled() { ffbuild_enabled() {
[[ $VARIANT == lgpl* ]] && return -1 [[ $VARIANT == lgpl* ]] && return -1
@ -10,7 +10,7 @@ ffbuild_enabled() {
} }
ffbuild_dockerbuild() { ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" vidstab git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT_PINNED" vidstab
cd vidstab cd vidstab
mkdir build && cd build mkdir build && cd build

View file

@ -2,6 +2,7 @@
SCRIPT_REPO="https://github.com/KhronosGroup/Vulkan-Headers.git" SCRIPT_REPO="https://github.com/KhronosGroup/Vulkan-Headers.git"
SCRIPT_COMMIT="v1.3.217" SCRIPT_COMMIT="v1.3.217"
SCRIPT_TAGFILTER="v?.*.*"
ffbuild_enabled() { ffbuild_enabled() {
[[ $ADDINS_STR == *4.4* ]] && return -1 [[ $ADDINS_STR == *4.4* ]] && return -1

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
SCRIPT_SKIP="1"
ffbuild_enabled() { ffbuild_enabled() {
[[ $TARGET == linux* ]] [[ $TARGET == linux* ]]
} }

75
util/update_scripts.sh Executable file
View file

@ -0,0 +1,75 @@
#!/bin/bash
set -eo pipefail
shopt -s globstar
export LC_ALL=C
cd "$(dirname "$0")"/..
for scr in scripts.d/**/*.sh; do
echo "Processing ${scr}"
(
source "$scr"
if [[ -n "$SCRIPT_SKIP" ]]; then
exit 0
fi
for i in "" $(seq 2 9); do
REPO_VAR="SCRIPT_REPO$i"
COMMIT_VAR="SCRIPT_COMMIT$i"
REV_VAR="SCRIPT_REV$i"
BRANCH_VAR="SCRIPT_BRANCH$i"
TAGFILTER_VAR="SCRIPT_TAGFILTER$i"
CUR_REPO="${!REPO_VAR}"
CUR_COMMIT="${!COMMIT_VAR}"
CUR_REV="${!REV_VAR}"
CUR_BRANCH="${!BRANCH_VAR}"
CUR_TAGFILTER="${!TAGFILTER_VAR}"
if [[ -z "${CUR_REPO}" ]]; then
if [[ -z "$i" ]]; then
# Mark scripts without repo source for manual check
echo "xxx_CHECKME_xxx" >> "$scr"
echo "Needs manual check."
fi
break
fi
if [[ -n "${CUR_REV}" ]]; then # SVN
echo "Checking svn rev for ${CUR_REPO}..."
NEW_REV="$(svn info --password="" "${CUR_REPO}" | grep ^Revision: | cut -d" " -f2 | xargs)"
echo "Got ${NEW_REV} (current: ${CUR_REV})"
if [[ "${NEW_REV}" != "${CUR_REV}" ]]; then
echo "Updating ${scr}"
sed -i "s/^${REV_VAR}=.*/${REV_VAR}=\"${NEW_REV}\"/" "${scr}"
fi
elif [[ -n "${CUR_COMMIT}" ]]; then # GIT
if [[ -n "${CUR_TAGFILTER}" ]]; then
NEW_COMMIT="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --tags --refs --sort "v:refname" "${CUR_REPO}" "refs/tags/${CUR_TAGFILTER}" | tail -n1 | cut -d/ -f3- | xargs)"
else
if [[ -z "${CUR_BRANCH}" ]]; then
# Fetch default branch name
CUR_BRANCH="$(git remote show "${CUR_REPO}" | grep "HEAD branch:" | cut -d":" -f2 | xargs)"
echo "Found default branch ${CUR_BRANCH}"
fi
NEW_COMMIT="$(git ls-remote --exit-code --heads --refs "${CUR_REPO}" refs/heads/"${CUR_BRANCH}" | cut -f1)"
fi
echo "Got ${NEW_COMMIT} (current: ${CUR_COMMIT})"
if [[ "${NEW_COMMIT}" != "${CUR_COMMIT}" ]]; then
echo "Updating ${scr}"
sed -i "s/^${COMMIT_VAR}=.*/${COMMIT_VAR}=\"${NEW_COMMIT}\"/" "${scr}"
fi
else
# Mark scripts with unknown layout for manual check
echo "xxx_CHECKME_UNKNOWN_xxx" >> "$scr"
echo "Unknown layout. Needs manual check."
break
fi
done
)
echo
done