From cba24c4c42eaa8be272c0aab448449484b9a2007 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 May 2023 09:28:22 +0200 Subject: extract_source_directory(): fix some bugs: * rev -> revision * the downloaded tar.gz has actually a folder with the desired content --- lib/common-functions | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/common-functions b/lib/common-functions index 19d608c..02fd36b 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -457,11 +457,11 @@ extract_source_directory() { local output="$5" local sub_pkgrel="$6" - if [ -n "${rev}" ] \ - && [ "${rev}" != '0000000000000000000000000000000000000000' ]; then + if [ -n "${revision}" ] \ + && [ "${revision}" != '0000000000000000000000000000000000000000' ]; then # TODO: use cache, here curl -LSs "https://gitlab.archlinux.org/archlinux/packaging/packages/${pkgbase}/-/archive/${revision}/${pkgbase}-${revision}.tar.gz" \ - |tar -xz -C "${output}" + |tar -xz --strip-components=1 -C "${output}" -- "${pkgbase}-${revision}" printf '\n' >> \ "${output}/PKGBUILD" fi @@ -490,7 +490,6 @@ extract_source_directory() { # we don't want write permissions on the PKGBUILD - otherwise pkgver() # will change the version! (**HACK**) chmod oga-w "${output}/PKGBUILD" - } # download_sources_by_hash -- cgit v1.2.3-54-g00ecf