diff options
author | Erich Eckner <git@eckner.net> | 2018-09-17 15:52:45 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-17 15:52:45 +0200 |
commit | e0ab9252b8fe502b620f62278f8deff287c7e729 (patch) | |
tree | 57da7c2ddcda57ae5630adcb11e58739ee0470ce /lib | |
parent | 891b045f1801a4c646631ea90be10a94690ccf9f (diff) | |
download | builder-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')
-rwxr-xr-x | lib/mysql-functions | 34 |
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=$( { |