From e0ab9252b8fe502b620f62278f8deff287c7e729 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 17 Sep 2018 15:52:45 +0200 Subject: lib/mysql-functions: mysql_generate_package_metadata(): arch= definitions in package_xx() override arch= definitions elsewhere in the PKGBUILD --- lib/mysql-functions | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'lib') 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=$( { -- cgit v1.2.3-70-g09d2