Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/common-functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common-functions')
-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