diff options
author | Erich Eckner <git@eckner.net> | 2019-01-04 15:08:41 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-04 15:08:41 +0100 |
commit | 12dcb01b3ef9f956d04f8a708847d160f4756e4b (patch) | |
tree | b21ac4041976506bc34c3eb81fb27fc4e330dbd6 | |
parent | 6b77fd2493b382733c5375bab4734711de2f84db (diff) | |
download | archlinuxewe-12dcb01b3ef9f956d04f8a708847d160f4756e4b.tar.xz |
archPackagesUpdate: fix PKGBUILDpatch appliance
-rwxr-xr-x | archPackagesUpdate | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate index 0b2773221..afefbd5e7 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 |