1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 22:07:35 +00:00

Ports: Switch to the new files syntax

This commit is contained in:
Tim Schumacher 2023-09-02 06:32:27 +02:00
parent 920dc1ba53
commit 456fd9f574
325 changed files with 368 additions and 351 deletions

View file

@ -115,6 +115,10 @@ fi
mkdir -p "${PORT_BUILD_DIR}"
cd "${PORT_BUILD_DIR}"
# 1 = url
# 2 = sha256sum
FILES_SIMPLE_PATTERN='^(https?:\/\/.+)#([0-9a-f]{64})$'
cleanup_git() {
echo "WARNING: Reverting changes to $workdir as we are in dev mode!"
run git clean -xffd >/dev/null 2>&1
@ -367,8 +371,15 @@ func_defined fetch || fetch() {
pre_fetch
for f in "${files[@]}"; do
read url auth_sum <<< $(echo "${f}")
fetch_simple "${url}" "${auth_sum}"
if [[ "${f}" =~ ${FILES_SIMPLE_PATTERN} ]]; then
url="${BASH_REMATCH[1]}"
sha256sum="${BASH_REMATCH[2]}"
fetch_simple "${url}" "${sha256sum}"
continue
fi
echo "error: Unknown syntax for files entry '${f}'"
exit 1
done
post_fetch
@ -422,9 +433,15 @@ clean() {
}
clean_dist() {
for f in "${files[@]}"; do
read url hash <<< "$f"
filename=$(basename "$url")
rm -f "${PORT_META_DIR}/${filename}"
if [[ "${f}" =~ ${FILES_SIMPLE_PATTERN} ]]; then
url="${BASH_REMATCH[1]}"
filename=$(basename "$url")
rm -f "${PORT_META_DIR}/${filename}"
continue
fi
echo "error: Unknown syntax for files entry '${f}'"
exit 1
done
}
clean_all() {