aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2021-02-28 20:28:07 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2021-02-28 20:28:07 +0000
commitab9fbf8bd859d12e3c03c5de9f9dd9774cd3bfa3 (patch)
tree37146be45f2ad9fb1e522cf428a6203e5438f70d
parentc4030f9597e4300b6660691255064de51f90e4a4 (diff)
downloadaports-3.13-stable.tar.gz
aports-3.13-stable.tar.bz2
aports-3.13-stable.tar.xz
main/curl: backport fix for -w time_total output3.13-stable
This was fixed in 7.75.0, but broken in 7.74.0, so backport that fix.
-rw-r--r--main/curl/APKBUILD6
-rw-r--r--main/curl/fix-w-time-output-units.patch85
2 files changed, 89 insertions, 2 deletions
diff --git a/main/curl/APKBUILD b/main/curl/APKBUILD
index 78ef795b2f..d8d9ee38ef 100644
--- a/main/curl/APKBUILD
+++ b/main/curl/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=curl
pkgver=7.74.0
-pkgrel=0
+pkgrel=1
pkgdesc="URL retrival utility and library"
url="https://curl.haxx.se/"
arch="all"
@@ -16,6 +16,7 @@ makedepends_host="$depends_dev"
makedepends_build="autoconf automake groff libtool perl"
subpackages="$pkgname-dbg $pkgname-static $pkgname-doc $pkgname-dev libcurl"
source="https://curl.haxx.se/download/curl-$pkgver.tar.xz
+ fix-w-time-output-units.patch
"
# secfixes:
@@ -139,4 +140,5 @@ static() {
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib
}
-sha512sums="5d987f0b4d051c9e254f14d4e2a05f7cda9fb0f0ac7b3ca3664a25a51ee5ffe092ee072c0d9a613fcd3f34727d75bba14b70f5500cb110ca818591e071c3e6f4 curl-7.74.0.tar.xz"
+sha512sums="5d987f0b4d051c9e254f14d4e2a05f7cda9fb0f0ac7b3ca3664a25a51ee5ffe092ee072c0d9a613fcd3f34727d75bba14b70f5500cb110ca818591e071c3e6f4 curl-7.74.0.tar.xz
+d59f9695baf28d22ee3772922d204bb0421fc8fefe0384f2d77dd18a8a29038b7c6f8359533d44fee8398cd96d02e8254bcb7bf56c9e33a96d30e6136c3c2f0a fix-w-time-output-units.patch"
diff --git a/main/curl/fix-w-time-output-units.patch b/main/curl/fix-w-time-output-units.patch
new file mode 100644
index 0000000000..8371a226a0
--- /dev/null
+++ b/main/curl/fix-w-time-output-units.patch
@@ -0,0 +1,85 @@
+From 93a936d90d40ab196a5d6866780d628925828051 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 14 Dec 2020 22:43:57 +0100
+Subject: [PATCH] =?UTF-8?q?too=C4=BA=5Fwriteout:=20fix=20the=20-w=20time?=
+ =?UTF-8?q?=20output=20units?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix regression from commit fc813f80e1bcac (#6248) that changed the unit
+to microseconds instead of seconds with fractions
+
+Fixes #6321
+---
+ src/tool_writeout.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/src/tool_writeout.c b/src/tool_writeout.c
+index c12738c439aa..8b9f590053e5 100644
+--- a/src/tool_writeout.c
++++ b/src/tool_writeout.c
+@@ -106,6 +106,14 @@ static const struct writeoutvar variables[] = {
+ 0, JSON_NONE}
+ };
+
++static void us2sec(FILE *stream, curl_off_t us)
++{
++ curl_off_t secs = us / 1000000;
++ us %= 1000000;
++ fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU ".%06" CURL_FORMAT_CURL_OFF_TU,
++ secs, us);
++}
++
+ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo)
+ {
+ FILE *stream = stdout;
+@@ -190,41 +198,41 @@ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo)
+ case VAR_REDIRECT_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME_T, &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_TOTAL_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_NAMELOOKUP_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T,
+ &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_CONNECT_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_APPCONNECT_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME_T,
+ &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_PRETRANSFER_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T,
+ &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_STARTTRANSFER_TIME:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T,
+ &offinfo))
+- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo);
++ us2sec(stream, offinfo);
+ break;
+ case VAR_SIZE_UPLOAD:
+ if(CURLE_OK ==