aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-01-13 11:53:37 +0000
committerTimo Teräs <timo.teras@iki.fi>2017-02-02 06:41:14 +0000
commit0eb056df5f4e6fb5af12c3f3f8eef81100066b02 (patch)
tree3af46443117d3259335bdab64ac680ff854887df
parente719edc6313651540e9d90f5600c2ed605fa6abf (diff)
downloadaports-0eb056df5f4e6fb5af12c3f3f8eef81100066b02.tar.bz2
aports-0eb056df5f4e6fb5af12c3f3f8eef81100066b02.tar.xz
main/apk-tools: fix error message short read
also triggers rebuild which might fix apk.static (ref #6795) (cherry picked from commit 5ef7a332f8186986761c3280b8b2c2bf1c02f230)
-rw-r--r--main/apk-tools/0001-tar-return-correct-error-for-short-read-of-tar-archi.patch37
-rw-r--r--main/apk-tools/APKBUILD12
2 files changed, 45 insertions, 4 deletions
diff --git a/main/apk-tools/0001-tar-return-correct-error-for-short-read-of-tar-archi.patch b/main/apk-tools/0001-tar-return-correct-error-for-short-read-of-tar-archi.patch
new file mode 100644
index 0000000000..fa54f797f5
--- /dev/null
+++ b/main/apk-tools/0001-tar-return-correct-error-for-short-read-of-tar-archi.patch
@@ -0,0 +1,37 @@
+From ca368916e0333bf24cdcbdbe42130ec6a92c3f6e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Thu, 5 Jan 2017 16:14:44 +0200
+Subject: [PATCH] tar: return correct error for short read of tar archive
+
+---
+ src/archive.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/archive.c b/src/archive.c
+index e86a53a..07b33e2 100644
+--- a/src/archive.c
++++ b/src/archive.c
+@@ -105,12 +105,17 @@ static ssize_t tar_entry_read(void *stream, void *ptr, size_t size)
+
+ if (size > teis->bytes_left)
+ size = teis->bytes_left;
+- if (size == 0)
+- return 0;
++ if (size == 0)
++ return 0;
+
+ r = teis->tar_is->read(teis->tar_is, ptr, size);
+- if (r < 0)
++ if (r <= 0) {
++ /* If inner stream returned zero (end-of-stream), we
++ * are getting short read, because tar header indicated
++ * more was to be expected. */
++ if (r == 0) return -ECONNABORTED;
+ return r;
++ }
+
+ teis->bytes_left -= r;
+ if (teis->csum == NULL)
+--
+2.11.0
+
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index ca1b183903..aebff6a366 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.6.8
-pkgrel=1
+pkgrel=2
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static"
depends=
@@ -14,6 +14,7 @@ if [ "$CBUILD" = "$CHOST" ]; then
fi
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
0001-add-s390x-headers.patch
+ 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
@@ -84,8 +85,11 @@ luaapk() {
}
md5sums="cc3efedf3047c256f13549ba58df3291 apk-tools-2.6.8.tar.xz
-f77a0ce3b4a67cbefed14c3a3ebf253f 0001-add-s390x-headers.patch"
+f77a0ce3b4a67cbefed14c3a3ebf253f 0001-add-s390x-headers.patch
+b15f4cb8d0e9507a5a3fb84bb39f3deb 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch"
sha256sums="83f5cf9f0e75c19004a67150819eae2d4c859236b6c9c04d34d5b6968925f0d3 apk-tools-2.6.8.tar.xz
-db8519fd21f7b302e1b339d037b5b02cbcefcf197891b45af5362d17d8d66bd5 0001-add-s390x-headers.patch"
+db8519fd21f7b302e1b339d037b5b02cbcefcf197891b45af5362d17d8d66bd5 0001-add-s390x-headers.patch
+5754067cba52370e8522ea52e9491f0c73063ca06a5f12cad8c5b1d4e08a39d5 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch"
sha512sums="03fb42616335de9edaf3e44fd64a8d1c5dd8b0f25b7f3b176940b751a6547b8be153549f0cee9a5d65491025f6747799b6f5ba22b15d850593d499c07b5cc4c6 apk-tools-2.6.8.tar.xz
-7ab0a174c86613631d85cf6e51925b4a5a7ce42b6b02db2166bc5629517edf42d6abc1f9404621161e647b1d61f01641bc4ef91060e98e20b7a4bd4a9758fab5 0001-add-s390x-headers.patch"
+7ab0a174c86613631d85cf6e51925b4a5a7ce42b6b02db2166bc5629517edf42d6abc1f9404621161e647b1d61f01641bc4ef91060e98e20b7a4bd4a9758fab5 0001-add-s390x-headers.patch
+3f84b930ffc37f1aba9b1b6da31a494ab694ef4d2dd458b470bdebef6cd4155a7840832d12f2f5dd486a31d1c16ea054977638c511d60569565f66a0c9c0a9a0 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch"