From 58fca7807a2b61bbd983c9e8cb542f8a3bebb8ea Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 23 Jun 2023 07:10:52 +0200 Subject: pkgctl --arch32: check out also build-support, do not overwrite PKGBUILD if we already have one --- src/lib/repo/arch32.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/lib') diff --git a/src/lib/repo/arch32.sh b/src/lib/repo/arch32.sh index d1039ed..3ee248e 100644 --- a/src/lib/repo/arch32.sh +++ b/src/lib/repo/arch32.sh @@ -11,16 +11,23 @@ pkgctl_repo_patch_arch32() { "${pkgname}/PKGBUILD" # iterate the arch32 diffs in the archlinux32/master branch (we don't know - # the destination repo, so we just scan both 'core' and 'extra') + # the destination repo, so we just scan both 'core' and 'extra' as well as + # 'build-support') listfile=$(mktemp --tmpdir="${WORKDIR}" pkgctl-arch32.XXXXXXXXXX) - git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "core/${pkgname}" >"${listfile}" - git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "extra/${pkgname}" >>"${listfile}" + >"${listfile}" + for repo in core extra build-support; do + git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "${repo}/${pkgname}" >>"${listfile}" + done for file in $(cat "${listfile}"); do - if [[ "${file##*/}" = "PKGBUILD" ]]; then - printf "\n\n# -- Arch32 specific --\n\n" >> "${pkgname}/PKGBUILD" - git -C "${pkgname}" show archlinux32/master:"${file}" >> "${pkgname}/PKGBUILD" - else - git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/${file##*/}" - fi + if [[ "${file##*/}" = "PKGBUILD" ]]; then + if [ -f "${pkgname}/PKGBUILD" ]; then + printf "\n\n# -- Arch32 specific --\n\n" >> "${pkgname}/PKGBUILD" + git -C "${pkgname}" show archlinux32/master:"${file}" >> "${pkgname}/PKGBUILD" + else + git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/PKGBUILD" + fi + else + git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/${file##*/}" + fi done } -- cgit v1.2.3-70-g09d2