summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-17 15:52:45 +0200
committerErich Eckner <git@eckner.net>2018-09-17 15:52:45 +0200
commite0ab9252b8fe502b620f62278f8deff287c7e729 (patch)
tree57da7c2ddcda57ae5630adcb11e58739ee0470ce /lib/mysql-functions
parent891b045f1801a4c646631ea90be10a94690ccf9f (diff)
downloadbuilder-e0ab9252b8fe502b620f62278f8deff287c7e729.tar.xz
lib/mysql-functions: mysql_generate_package_metadata(): arch= definitions in package_xx() override arch= definitions elsewhere in the PKGBUILD
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions34
1 files changed, 24 insertions, 10 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index c596b38..dd17fde 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -292,16 +292,30 @@ mysql_generate_package_metadata() {
grep '^pkgname = ' "${temp_dir}/SRCINFO" | \
cut -d' ' -f3 | \
while read -r pkgname; do
- sed -n '
- /^pkgbase = \|^pkgname = '"$(str_to_regex "${pkgname}")"'$/,/^$/ {
- s/^pkgname/\t\0/
- /^\S/d
- /^\s*$/d
- s/^\s*//
- p
- }
- ' "${temp_dir}/SRCINFO" > \
- "${temp_dir}/SRCINFO.tmp"
+ # iff this pkgname defines some arch, ...
+ if sed -n '
+ /^pkgname = '"$(str_to_regex "${pkgname}")"'$/,/^$/ p
+ ' "${temp_dir}/SRCINFO" | \
+ grep -q '^\sarch = '; then
+ # ... it will override all archs defined in pkgbase
+ sed '
+ /^pkgbase = /,/^$/ {
+ /^\sarch = /d
+ }
+ ' "${temp_dir}/SRCINFO"
+ else
+ cat "${temp_dir}/SRCINFO"
+ fi | \
+ sed -n '
+ /^pkgbase = \|^pkgname = '"$(str_to_regex "${pkgname}")"'$/,/^$/ {
+ s/^pkgname/\t\0/
+ /^\S/d
+ /^\s*$/d
+ s/^\s*//
+ p
+ }
+ ' > \
+ "${temp_dir}/SRCINFO.tmp"
epoch=$(
{