From 255e2e1ff43fda550540085c7f223a380bfae59a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 24 May 2023 07:35:53 +0200 Subject: use bash for PKGBUILD parsing instead of sed-hacking the function names --- bin/build-packages | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/build-packages b/bin/build-packages index 821491a..d18f0e0 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -496,14 +496,11 @@ while [ "${count}" -ne 0 ] && \ set -e CARCH="${arch}" . /usr/share/makepkg/util/source.sh - eval "$( - sed ' - :a - s/^\(\S\+\)-/\1_/ - ta - ' PKGBUILD - )" - printf '%s\n' "${source[@]}" \ + bash -c ' # new shell is intentional + CARCH="'"${arch}"'" + . PKGBUILD + printf '"'"'%s\n'"'"' "${source[@]}" + ' \ | grep '^git+' \ | while read -r netfile; do fragment=$(get_uri_fragment "$netfile") @@ -519,13 +516,15 @@ while [ "${count}" -ne 0 ] && \ continue esac path=$(get_filename "$netfile") - git init "${path}" + [ -d "${path}" ] && continue + git init --bare "${path}" url=$(get_url "$netfile") url=${url#git+} url=${url%%#*} url=${url%%\?*} git -C "${path}" remote add origin "${url}" git -C "${path}" fetch --depth=1 origin "${ref}" + git -C "${path}" fetch --depth=1 origin done ) if CARCH="${arch}" makepkg --verifysource 2> "${log_file}"; then -- cgit v1.2.3-54-g00ecf