diff options
Diffstat (limited to 'lib/mysql-functions')
-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=$( { |