From 8cff1bf6eda4945ade0619e57a20e37d6f168011 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 13 Feb 2020 15:26:44 +0100 Subject: bin/local-build-package: remove hard-coded package suffixes --- bin/local-build-package | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/bin/local-build-package b/bin/local-build-package index fd4fdab..a04cc0d 100755 --- a/bin/local-build-package +++ b/bin/local-build-package @@ -7,8 +7,6 @@ # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" -# TODO: remove hard-coded package suffixes - # shellcheck disable=SC2016 usage() { >&2 echo '' @@ -173,9 +171,9 @@ if ! ${nobuild}; then extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" - rm -f \ - ./*"-${arch}.pkg.tar.xz" ./*"-${arch}.pkg.tar.xz.sig" \ - ./*"-${arch}.pkg.tar.zst" ./*"-${arch}.pkg.tar.zst.sig" + find . -maxdepth 1 -type f \ + -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?' \ + -delete cd "${tmp_dir}" || exit 1 @@ -192,11 +190,12 @@ else fi if ${bootstrap}; then - rm -f \ - ./*"-${arch}.pkg.tar.xz.sig" \ - ./*"-${arch}.pkg.tar.zst.sig" + find . -maxdepth 1 -type f \ + -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\.sig' \ + -delete - find . -maxdepth 1 -type f -name "*${arch}.pkg.tar.zst" \ + find . -maxdepth 1 -type f \ + -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \ -execdir gpg --local-user="${signkey}" --detach-sign '{}' \; case "$repository" in @@ -211,8 +210,16 @@ if ${bootstrap}; then ;; esac - scp -P "${bootstrap_port}" -rC "${tmp_dir}/"*"-${arch}.pkg.tar.zst" "${tmp_dir}/"*"-${arch}.pkg.tar.zst.sig" "${bootstrap_host}:${bootstrap_dir}/${staging_repo}/." - ssh -p "${bootstrap_port}" "${bootstrap_host}" bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz *-${arch}.pkg.tar.zst'" + # shellcheck disable=SC2046 + scp -P "${bootstrap_port}" -rC $( + find "${tmp_dir}" -type f \ + -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?' + ) "${bootstrap_host}:${bootstrap_dir}/${staging_repo}/." + ssh -p "${bootstrap_port}" "${bootstrap_host}" bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz $( + find "${tmp_dir}" -type f \ + -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \ + -printf '%f ' + )'" fi # do not delete build reports, why might actually to want to have a look for things -- cgit v1.2.3