From 58fb713daca8368b897a87c39c6449cba0f4601f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 May 2023 11:26:15 +0200 Subject: attempt to fix local-build-package * it was broken before, don't expect too much --- bin/local-build-package | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'bin') diff --git a/bin/local-build-package b/bin/local-build-package index e0b02dc..fca63f2 100755 --- a/bin/local-build-package +++ b/bin/local-build-package @@ -153,23 +153,21 @@ if ! ${nobuild}; then git -C "${repo_path}" pull done + if [ "${arch}" == 'any' ]; then + upstream_arch='any' + build_arch=$(pacman-conf Architecture) + else + upstream_arch='x86_64' + build_arch="${arch}" + fi + repository=$1 package=$2 - case $repository in - core) - repo_path='../work/repos/packages' - ;; - extra) - repo_path='../work/repos/packages' - ;; - community) - repo_path='../work/repos/community' - ;; - *) - >&2 echo 'Repository is either "core", "extra" or "community"' - usage - esac - git_revision=$(git -C "${repo_path}" rev-parse HEAD) + git_revision=$( + git -C "${repo_paths__state}" archive HEAD -- "${repository}-${upstream_arch}/${package}" \ + | tar -Ox \ + | cut -d' ' -f4 + ) mod_git_revision=$(git -C "${repo_paths__archlinux32}" stash create) if [ -z "${mod_git_revision}" ]; then @@ -177,9 +175,9 @@ if ! ${nobuild}; then fi if [[ -z "${straws[:with_build_support:]}" ]]; then - build_command="staging-${arch}-build" + build_command="staging-${build_arch}-build" else - build_command='staging-with-build-support-'"${arch}"'-build' + build_command='staging-with-build-support-'"${build_arch}"'-build' fi parameters="-r ${archbuild_chroots}" @@ -187,10 +185,7 @@ if ! ${nobuild}; then parameters='-- -- --nocheck' fi - git_repo=$(find_repository_with_commit "${git_revision}") - find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}" - - extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" + extract_source_directory "${repository}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" '0' rm -f \ ./*"-${arch}.pkg.tar.xz" ./*"-${arch}.pkg.tar.xz.sig" \ -- cgit v1.2.3-70-g09d2