From c71a2c8302f034c5f2d5919972761368671278f7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 2 Jun 2017 09:54:40 +0200 Subject: bin/common-functions: apply_package_customizations: bugfix --- bin/common-functions | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/common-functions b/bin/common-functions index 565ae85..a04e734 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -55,16 +55,26 @@ apply_package_customizations() { exit 1 fi + local repo + local package + + repo="$(pwd)" + package="${repo%/*/*}" + package="${package##*/}" + repo="${repo##*/}" + repo="${repo%-any}" + repo="${repo%-x86_64}" + if [ ! -f 'PKGBUILD.changes-applied' ]; then # add i686 to the arch list sed '/^arch=[^#]*any/!s|^\(arch=(\)\([^#]*)\)\s*\(#.*\)\?$|\1'"'i686'"' \2|' -i 'PKGBUILD' - if [ -f "${repo_paths["archlinux32"]}/$2/$1/PKGBUILD" ]; then + if [ -f "${repo_paths["archlinux32"]}/${repo}/${package}/PKGBUILD" ]; then # If this package has modifications (or is new), apply them now: # append PKGBUILD - cat "${repo_paths["archlinux32"]}/$2/$1/PKGBUILD" >> \ + cat "${repo_paths["archlinux32"]}/${repo}/${package}/PKGBUILD" >> \ 'PKGBUILD' # copy (and overwrite) other files - for file in "${repo_paths["archlinux32"]}/$2/$1/"*; do + for file in "${repo_paths["archlinux32"]}/${repo}/${package}/"*; do if [ -f "${file}" ] && [ "${file##*/}" != 'PKGBUILD' ]; then cp "${file}" ./ fi -- cgit v1.2.3-70-g09d2