aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-10-09 08:10:58 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2020-10-09 06:15:24 +0000
commit67a48490e043f8a5a24ef05d119fef8a20a299b6 (patch)
tree665123de398dc0c82d6a87a2fb8cba5ddb4fb9cb
parentadf5750d6378d837693753de10af70272e3b789a (diff)
downloadaports-67a48490e043f8a5a24ef05d119fef8a20a299b6.tar.gz
aports-67a48490e043f8a5a24ef05d119fef8a20a299b6.tar.bz2
aports-67a48490e043f8a5a24ef05d119fef8a20a299b6.tar.xz
main/abuild: backport fix for unsupported byte range
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10009
-rw-r--r--main/abuild/0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch44
-rw-r--r--main/abuild/APKBUILD8
2 files changed, 49 insertions, 3 deletions
diff --git a/main/abuild/0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch b/main/abuild/0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch
new file mode 100644
index 0000000000..1bd6699d17
--- /dev/null
+++ b/main/abuild/0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch
@@ -0,0 +1,44 @@
+From 2be7002cda0397c2df55a969968a2d5579fcb76f Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 8 Jul 2020 10:10:26 +0200
+Subject: [PATCH] abuild-fetch: retry download if byte range is unsupported
+
+fixes #10004
+---
+ abuild-fetch.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/abuild-fetch.c b/abuild-fetch.c
+index a2c3cf2..7906704 100644
+--- a/abuild-fetch.c
++++ b/abuild-fetch.c
+@@ -142,7 +142,7 @@ int fetch(char *url, const char *destdir, bool insecure)
+
+ if (access(partfile, F_OK) == 0) {
+ printf("Partial download found. Trying to resume.\n");
+- add_opt(&curlcmd, "-C");
++ add_opt(&curlcmd, "--continue-at");
+ add_opt(&curlcmd, "-");
+ add_opt(&wgetcmd, "-c");
+ }
+@@ -154,8 +154,16 @@ int fetch(char *url, const char *destdir, bool insecure)
+
+ /* CURLE_RANGE_ERROR (33)
+ The server does not support or accept range requests. */
+- if (status == 33)
++ if (status == 33) {
+ unlink(partfile);
++ if( curlcmd.argc >=3) {
++ /* remove --continue-at - options */
++ curlcmd.argv[curlcmd.argc-3] = curlcmd.argv[curlcmd.argc-1];
++ curlcmd.argv[curlcmd.argc-2] = NULL;
++ curlcmd.argc -= 2;
++ status = fork_exec(curlcmd.argv, 0);
++ }
++ }
+
+ /* is we failed execute curl, then fallback to wget */
+ if (status == 201)
+--
+2.28.0
+
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index 83d56552e3..8d6e99f02f 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.6.0
_ver=${pkgver%_git*}
-pkgrel=1
+pkgrel=2
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -25,7 +25,8 @@ subpackages="
"
options="suid !check"
pkggroups="abuild"
-source="https://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.bz2"
+source="https://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.bz2
+ 0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch"
builddir="$srcdir"/abuild-$pkgver
prepare() {
@@ -75,4 +76,5 @@ _rootbld() {
mkdir -p "$subpkgdir"
}
-sha512sums="fd5b8326171c9ab8f975e147995520990e7e1210929662ce4687267dad68812721ee9eb019bf7430f01abebc9278e6be1c0358d5b9bb2918bc96ccd5e2f1b3df abuild-3.6.0.tar.bz2"
+sha512sums="fd5b8326171c9ab8f975e147995520990e7e1210929662ce4687267dad68812721ee9eb019bf7430f01abebc9278e6be1c0358d5b9bb2918bc96ccd5e2f1b3df abuild-3.6.0.tar.bz2
+9e81f17ab6d19b85f53c12d664224467152c3c0abf3411a1249616508ce6c86d92ebd1af3b0265e24734c1b858b310d90220b091b2d135c4660e41e36f77909b 0001-abuild-fetch-retry-download-if-byte-range-is-unsuppo.patch"