From 23e50952efdc355fa3583baaef6accaf34efd0b6 Mon Sep 17 00:00:00 2001 From: Erick Cafferata Date: Thu, 31 Jan 2019 14:39:32 -0500 Subject: replace sed oneliner with awk Upstream asp depends only on awk for string manipulation. asp32 added a sed oneliner for inplace substitution (from builder repo). To avoid having to add an extra dependency for asp32, let's replace it with an awk equivalent. --- package.inc.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/package.inc.sh b/package.inc.sh index 1f9f824..2d7ead2 100644 --- a/package.inc.sh +++ b/package.inc.sh @@ -132,12 +132,8 @@ package_patch_arch32() { read -r repo arch < <(package_get_repos_with_arch "$pkgname" "$remote" \ | awk '!/testing/ && (/x86_64/ || /any/) {print $1" "$2; exit}') subtree=${1:-repos/${repo}-${arch}} - # borrowed from archlinux32/builder/lib/common-functions' mangle_pkgbuild() - sed -i ' - /^arch=[^#]*any/!{ - /^arch=(/s/(/(i486 i686 pentium3 / - } - ' "$pkgname/${subtree}/PKGBUILD" + awk -i inplace '!/^arch=[^#]*any/ {gsub(/^arch=\(/,"arch=(i486 i686 pentium3 ")}; {print}' \ + "$pkgname/${subtree}/PKGBUILD" for line in $(git ls-tree -r --name-only remotes/packages32/master ${repo}/${pkgname}); do if [[ "${line##*/}" = "PKGBUILD" ]]; then git show remotes/packages32/master:${line} >> ${pkgname}/${subtree}/PKGBUILD -- cgit v1.2.3-70-g09d2