Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/build-packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-05-24 07:35:53 +0200
committerErich Eckner <git@eckner.net>2023-05-24 07:35:53 +0200
commit255e2e1ff43fda550540085c7f223a380bfae59a (patch)
tree7772626ba99c094df13ac9edf26ca7ea80b0f107 /bin/build-packages
parent7e22c8c43c06d49594e895f4c775164541ae81cb (diff)
use bash for PKGBUILD parsing instead of sed-hacking the function names
Diffstat (limited to 'bin/build-packages')
-rwxr-xr-xbin/build-packages17
1 files 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