Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-07-01 10:32:11 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2023-07-01 10:32:11 +0200
commit6924d3996cd9b22e0ff81b4c53e0aedc64997a16 (patch)
treeb83dce0886f1c0a07e0852f6f3aa9b52b601b2c4
parent76a83eb27ba0ad0a628f477b743da736716f3ba6 (diff)
extract_source_directory: trying to handle upstream-packages curl error
-rwxr-xr-xlib/common-functions15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/common-functions b/lib/common-functions
index b1a39e3..58b1080 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -464,14 +464,23 @@ extract_source_directory() {
local mod_revision="$4"
local output="$5"
local sub_pkgrel="$6"
-
+ local res
+ local tmptarfile
+ local pkgtarfile
if [ -n "${revision}" ] \
&& [ "${revision}" != '0000000000000000000000000000000000000000' ]; then
local pkgbase_translated
pkgbase_translated=$(gitlab_project_name_to_path "${pkgbase}")
- curl -LSs "https://buildmaster.archlinux32.org/upstream-packages/${pkgbase_translated}-${revision}.tar.gz" \
- | tar -xz --strip-components=1 -C "${output}" -- "${pkgbase_translated}-${revision}"
+ tmptarfile=$(mktemp 'tmp.upstream-package.XXXXXXXXXX')
+ pkgtarfile="${tmp_dir}/${tmptarfile}"
+ curl -o "$pkgtarfile" -fLSs "https://buildmaster.archlinux32.org/upstream-packages/${pkgbase_translated}-${revision}.tar.gz"
+ res=$?
+ if [ "$res" -ne 0 ]; then
+ >&2 echo 'Download upstream-package from upstream via buildmaster cache failed. Curl exit code was $res.'
+ return 1
+ fi
+ tar -xz -f "${pkgtarfile}" --strip-components=1 -C "${output}" -- "${pkgbase_translated}-${revision}"
printf '\n' >> \
"${output}/PKGBUILD"
fi