summaryrefslogtreecommitdiff
path: root/archPackagesUpdate
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-04 15:08:41 +0100
committerErich Eckner <git@eckner.net>2019-01-04 15:08:41 +0100
commit12dcb01b3ef9f956d04f8a708847d160f4756e4b (patch)
treeb21ac4041976506bc34c3eb81fb27fc4e330dbd6 /archPackagesUpdate
parent6b77fd2493b382733c5375bab4734711de2f84db (diff)
downloadarchlinuxewe.git.save-12dcb01b3ef9f956d04f8a708847d160f4756e4b.tar.xz
archPackagesUpdate: fix PKGBUILDpatch appliance
Diffstat (limited to 'archPackagesUpdate')
-rwxr-xr-xarchPackagesUpdate38
1 files changed, 25 insertions, 13 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate
index 0b277322..afefbd5e 100755
--- a/archPackagesUpdate
+++ b/archPackagesUpdate
@@ -547,17 +547,28 @@ if ${aufRechenknecht}; then
# add PKGBUILD-patches to the PKGBUILD
{
- printf '%s\n' \
- 'eval "$(' \
- ' declare -f package | \' \
- ' sed '"'"'$d'"'"
- for patch in "${tmp_dir}/"*".PKGBUILDpatch"; do
- printf ' cat "${srcdir}/%s"\n' \
- "${patch##*/}"
- done
- printf '%s\n' \
- ')"' \
- 'source+=('
+ if grep -q '^\s*pkgbase=' PKGBUILD; then
+ (
+ eval "$(
+ sed -n '/^\s*pkgname=(/,/)/ p' PKGBUILD
+ )"
+ printf 'package_%s\n' "${pkgname[@]}"
+ )
+ else
+ printf 'package\n'
+ fi \
+ | while read -r function; do
+ printf '%s\n' \
+ 'eval "$(' \
+ ' declare -f package | \' \
+ ' sed '"'"'$d'"'"
+ for patch in "${tmp_dir}/"*".PKGBUILDpatch"; do
+ printf ' cat "%s"\n' \
+ "${patch##*/}"
+ done
+ printf ')\n}"\n'
+ done
+ printf 'source+=(\n'
for patch in "${tmp_dir}/"*".PKGBUILDpatch"; do
printf '"%s"\n' \
"${patch##*/}"
@@ -576,8 +587,9 @@ if ${aufRechenknecht}; then
| awk '{print $1}'
printf ')\n'
done
- } | \
- sponge -a PKGBUILD
+ } > PKGBUILD.append
+ cat PKGBUILD.append >> PKGBUILD
+ rm PKGBUILD.append
if [ "${arch}" = 'i686' ]; then
# 32-bit is built in chroot /opt/arch32