From 8f4872a2ba82be5fc50f6f1b7fa7ed5642f3dafd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 May 2023 16:37:16 +0200 Subject: fix pkgbase_translation apparently, sometimes "+" is translated by "-" - see e.g. https://gitlab.archlinux.org/archlinux/packaging/packages/gtk2-extra what a mess --- lib/common-functions | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/common-functions') diff --git a/lib/common-functions b/lib/common-functions index ba03fc1..9b439be 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -458,18 +458,19 @@ extract_source_directory() { local output="$5" local sub_pkgrel="$6" - local pkgbase_translated - pkgbase_translated=$( - printf '%s\n' "${pkgbase}" \ - | sed ' - s@+@plus@g - ' - ) if [ -n "${revision}" ] \ && [ "${revision}" != '0000000000000000000000000000000000000000' ]; then - curl -LSs "https://buildmaster.archlinux32.org/upstream-packages/${pkgbase_translated}-${revision}.tar.gz" \ - |tar -xz --strip-components=1 -C "${output}" -- "${pkgbase_translated}-${revision}" + local pkgbase_translated + for substitution in '' 's@+@plus@g' 's@+@-@g'; do + pkgbase_translated=$( + printf '%s\n' "${pkgbase}" \ + | sed "${substitution}" + ) + curl -LSs "https://buildmaster.archlinux32.org/upstream-packages/${pkgbase_translated}-${revision}.tar.gz" \ + | tar -xz --strip-components=1 -C "${output}" -- "${pkgbase_translated}-${revision}" \ + && break + done printf '\n' >> \ "${output}/PKGBUILD" fi -- cgit v1.2.3-54-g00ecf