upg btrfs-progs curl jansson

This commit is contained in:
joborun linux 2024-03-29 02:15:41 +02:00
parent 51f639a0e9
commit db835f78e5
10 changed files with 230 additions and 37 deletions

View File

@ -6,7 +6,7 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=btrfs-progs
pkgver=6.7.1
pkgver=6.8
pkgrel=01
pkgdesc='Btrfs filesystem utilities w/o systemd'
makedepends=('asciidoc' 'xmlto' 'python' 'python-setuptools' 'e2fsprogs'
@ -72,10 +72,11 @@ license=('GPL-2.0-only')
validpgpkeys=('F2B41200C54EFB30380C1756C565D5F9D76D583B')
sha256sums=(24dc7b974f0a57ba0eca80f97440b840dfa85b0f1cb2c01bdfd97659a480b200 # btrfs-progs-v6.7.1.tar.xz
181ebfef6c8fb7df1015478b5ecec2a33a49437ed1c4e48188eed722648b6ee1 # btrfs-progs-v6.7.1.tar.sign
sha256sums=(9c21645feac182611e28b47769d5f613cb9e2ecab58ece60b10e6c55a9ead575 # btrfs-progs-v6.8.tar.xz
f5a8b2c11bfc48f94609a5d35239df7869255f5d069536bd9ad77e4f6f9db79e # btrfs-progs-v6.8.tar.sign
bbe60b35d1b1e2efc1308a8f54f1fdc6808240a81c5f5b4d75321b7ee86e41f4 # initcpio-install-btrfs
35efeee8590d6d60c711ae9cdc918e4841ab61d10cb02359e65e36ebff95ffc5) # initcpio-hook-btrfs
## 2b7c446a389b12c5e059dfff5f25782e39c0bdeb8589f4cc1000dc4b7ff5a1f1 btrfs-progs-6.7.1-01-x86_64.pkg.tar.lz
## a161d89df2b251ae98054b7aecb82069b126371435d450e7e7bf0a023e0270ae btrfs-progs-6.8-01-x86_64.pkg.tar.lz

View File

@ -3,7 +3,7 @@
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
pkgname=btrfs-progs
pkgver=6.7.1
pkgver=6.8
pkgrel=1
pkgdesc='Btrfs filesystem utilities'
arch=('x86_64')
@ -28,7 +28,7 @@ source=("https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-
install=btrfs-progs.install
options=(!staticlibs)
sha256sums=('SKIP'
'24dc7b974f0a57ba0eca80f97440b840dfa85b0f1cb2c01bdfd97659a480b200'
'9c21645feac182611e28b47769d5f613cb9e2ecab58ece60b10e6c55a9ead575'
'bbe60b35d1b1e2efc1308a8f54f1fdc6808240a81c5f5b4d75321b7ee86e41f4'
'35efeee8590d6d60c711ae9cdc918e4841ab61d10cb02359e65e36ebff95ffc5'
'eaa7af92d28bfa8940bb551560fd7be777f9f175292eaa72b5f6ef00fb240252'

View File

@ -9,3 +9,4 @@ python-typing_extensions
python-sphinx_rtd_theme

View File

@ -0,0 +1,164 @@
From 8188569bc39516d900886eb1dbeeff98ed302e60 Mon Sep 17 00:00:00 2001
From: Stefan Eissing <stefan@eissing.org>
Date: Thu, 28 Mar 2024 11:08:15 +0100
Subject: [PATCH] brotli and others, simply pass through 0-length writes
- refs #13212 and #13209
- curl's transfer handling may write 0-length chunks at
the end of the download with an EOS flag. (HTTP/2 does
this commonly)
- content encoders need to pass-through such a write and
not count this as error in case they are finished decoding
---
lib/content_encoding.c | 10 +++++-----
tests/http/test_02_download.py | 13 +++++++++++++
tests/http/testenv/env.py | 7 ++++++-
tests/http/testenv/httpd.py | 20 ++++++++++++++++++++
4 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index c1abf24e8c027c..8e926dd2ecd5ad 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -300,7 +300,7 @@ static CURLcode deflate_do_write(struct Curl_easy *data,
struct zlib_writer *zp = (struct zlib_writer *) writer;
z_stream *z = &zp->z; /* zlib state structure */
- if(!(type & CLIENTWRITE_BODY))
+ if(!(type & CLIENTWRITE_BODY) || !nbytes)
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
/* Set the compressed input when this function is called */
@@ -457,7 +457,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data,
struct zlib_writer *zp = (struct zlib_writer *) writer;
z_stream *z = &zp->z; /* zlib state structure */
- if(!(type & CLIENTWRITE_BODY))
+ if(!(type & CLIENTWRITE_BODY) || !nbytes)
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
if(zp->zlib_init == ZLIB_INIT_GZIP) {
@@ -669,7 +669,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data,
CURLcode result = CURLE_OK;
BrotliDecoderResult r = BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT;
- if(!(type & CLIENTWRITE_BODY))
+ if(!(type & CLIENTWRITE_BODY) || !nbytes)
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
if(!bp->br)
@@ -762,7 +762,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data,
ZSTD_outBuffer out;
size_t errorCode;
- if(!(type & CLIENTWRITE_BODY))
+ if(!(type & CLIENTWRITE_BODY) || !nbytes)
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
if(!zp->decomp) {
@@ -916,7 +916,7 @@ static CURLcode error_do_write(struct Curl_easy *data,
(void) buf;
(void) nbytes;
- if(!(type & CLIENTWRITE_BODY))
+ if(!(type & CLIENTWRITE_BODY) || !nbytes)
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
failf(data, "Unrecognized content encoding type. "
diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py
index 4db9c9d36e9ed5..395fc862f2f839 100644
--- a/tests/http/test_02_download.py
+++ b/tests/http/test_02_download.py
@@ -394,6 +394,19 @@ def test_02_27_paused_no_cl(self, env: Env, httpd, nghttpx, repeat):
r = client.run(args=[url])
r.check_exit_code(0)
+ @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
+ def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, repeat, proto):
+ if proto == 'h3' and not env.have_h3():
+ pytest.skip("h3 not supported")
+ count = 1
+ urln = f'https://{env.authority_for(env.domain1brotli, proto)}/data-100k?[0-{count-1}]'
+ curl = CurlClient(env=env)
+ r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[
+ '--compressed'
+ ])
+ r.check_exit_code(code=0)
+ r.check_response(count=count, http_status=200)
+
def check_downloads(self, client, srcfile: str, count: int,
complete: bool = True):
for i in range(count):
diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py
index a207059dcd57c5..13c5d6bd46ee57 100644
--- a/tests/http/testenv/env.py
+++ b/tests/http/testenv/env.py
@@ -129,10 +129,11 @@ def __init__(self):
self.htdocs_dir = os.path.join(self.gen_dir, 'htdocs')
self.tld = 'http.curl.se'
self.domain1 = f"one.{self.tld}"
+ self.domain1brotli = f"brotli.one.{self.tld}"
self.domain2 = f"two.{self.tld}"
self.proxy_domain = f"proxy.{self.tld}"
self.cert_specs = [
- CertificateSpec(domains=[self.domain1, 'localhost'], key_type='rsa2048'),
+ CertificateSpec(domains=[self.domain1, self.domain1brotli, 'localhost'], key_type='rsa2048'),
CertificateSpec(domains=[self.domain2], key_type='rsa2048'),
CertificateSpec(domains=[self.proxy_domain, '127.0.0.1'], key_type='rsa2048'),
CertificateSpec(name="clientsX", sub_specs=[
@@ -376,6 +377,10 @@ def htdocs_dir(self) -> str:
def domain1(self) -> str:
return self.CONFIG.domain1
+ @property
+ def domain1brotli(self) -> str:
+ return self.CONFIG.domain1brotli
+
@property
def domain2(self) -> str:
return self.CONFIG.domain2
diff --git a/tests/http/testenv/httpd.py b/tests/http/testenv/httpd.py
index c04c22699a62c4..b8615875a9a558 100644
--- a/tests/http/testenv/httpd.py
+++ b/tests/http/testenv/httpd.py
@@ -50,6 +50,7 @@ class Httpd:
'alias', 'env', 'filter', 'headers', 'mime', 'setenvif',
'socache_shmcb',
'rewrite', 'http2', 'ssl', 'proxy', 'proxy_http', 'proxy_connect',
+ 'brotli',
'mpm_event',
]
COMMON_MODULES_DIRS = [
@@ -203,6 +204,7 @@ def _mkpath(self, path):
def _write_config(self):
domain1 = self.env.domain1
+ domain1brotli = self.env.domain1brotli
creds1 = self.env.get_credentials(domain1)
domain2 = self.env.domain2
creds2 = self.env.get_credentials(domain2)
@@ -285,6 +287,24 @@ def _write_config(self):
f'</VirtualHost>',
f'',
])
+ # Alternate to domain1 with BROTLI compression
+ conf.extend([ # https host for domain1, h1 + h2
+ f'<VirtualHost *:{self.env.https_port}>',
+ f' ServerName {domain1brotli}',
+ f' Protocols h2 http/1.1',
+ f' SSLEngine on',
+ f' SSLCertificateFile {creds1.cert_file}',
+ f' SSLCertificateKeyFile {creds1.pkey_file}',
+ f' DocumentRoot "{self._docs_dir}"',
+ f' SetOutputFilter BROTLI_COMPRESS',
+ ])
+ conf.extend(self._curltest_conf(domain1))
+ if domain1 in self._extra_configs:
+ conf.extend(self._extra_configs[domain1])
+ conf.extend([
+ f'</VirtualHost>',
+ f'',
+ ])
conf.extend([ # https host for domain2, no h2
f'<VirtualHost *:{self.env.https_port}>',
f' ServerName {domain2}',

View File

@ -11,7 +11,7 @@ pkgname=(curl libcurl-compat libcurl-gnutls)
#_tag_name='8_6_0'
#pkgver="${_tag_name//_/.}"
pkgver=8.7.1
pkgrel=01
pkgrel=03
pkgdesc='command line tool and library for transferring data with URLs - w/o ipv6 & zstd'
url='https://curl.se'
#options=(debug) # uncomment this to produce debug package
@ -19,14 +19,19 @@ depends=('ca-certificates' 'brotli' 'libbrotlidec.so' 'krb5' 'libgssapi_krb5.so'
'libidn2' 'libidn2.so' 'libnghttp2' 'libnghttp3' 'libpsl'
'libpsl.so' 'libssh2' 'libssh2.so' 'zlib')
makedepends=('patchelf' 'git')
checkdepends=('valgrind')
#source=("https://curl.haxx.se/download/${pkgname}-${pkgver}.tar.gz"{,.asc}
#source=("git+https://github.com/curl/curl.git#tag=${_tag}?signed")
source=("git+https://github.com/curl/curl.git#tag=curl-${pkgver//./_}?signed"
'0001-bump-version-to-match-last-tag.patch')
'0001-bump-version-to-match-last-tag.patch'
'0002-brotli-and-others-simply-pass-through-0-length-writes.patch')
_backports=(
)
_reverts=(
)
prepare() {
cd "$pkgbase"
@ -45,6 +50,7 @@ prepare() {
done
patch -Np1 < ../0001-bump-version-to-match-last-tag.patch
patch -Np1 < ../0002-brotli-and-others-simply-pass-through-0-length-writes.patch
# no '-DEV' in version, release date from tagged commit...
sed -i \
@ -80,9 +86,11 @@ build() {
# "${srcdir}/${pkgbase}-${pkgver}"/configure \
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--enable-versioned-symbols \
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d/ \
--with-openssl \
--with-openssl-quic \
--enable-versioned-symbols
--with-zsh-functions-dir=/usr/share/zsh/site-functions/
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
@ -92,9 +100,9 @@ build() {
# "${srcdir}/${pkgbase}-${pkgver}"/configure \
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--disable-versioned-symbols \
--with-openssl \
--with-openssl-quic \
--disable-versioned-symbols
--with-openssl-quic
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
patchelf --set-soname 'libcurl-compat.so.4' ./lib/.libs/libcurl.so
@ -106,19 +114,24 @@ build() {
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--disable-versioned-symbols \
--with-gnutls \
--without-openssl \
--without-zstd \
--with-gnutls
--without-zstd
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so
}
check() {
# test curl
cd "${srcdir}"/build-curl
make test
cd build-curl
# -v: verbose
# -a: keep going on failure (so we see everything which breaks, not just the first failing test)
# -k: keep test files after completion
# -am: automake style TAP output
# -p: print logs if test fails
# -j: parallelization
# disable test 433, since it requires the glibc debug info
make TFLAGS="-v -a -k -p -j$(nproc) !433" test-nonflaky
}
package_curl() {
@ -189,11 +202,10 @@ validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
sha512sums=('38b55dc916a64a1fd40a8af3e9a694ae918f8efb714430834491ebbe0ceeee4b58ba804afa15da966cbcf9cd7100ce373aed7b2101dff56f742996072caaf09a'
'51df4903eff9f1a15b1317ea4a8ee2b8537f347984f2524f42213b09344cd6109c621a4b81b37d2fcf2027387bb81cf0a744a48e96b86c4e268c43261ff86845')
'51df4903eff9f1a15b1317ea4a8ee2b8537f347984f2524f42213b09344cd6109c621a4b81b37d2fcf2027387bb81cf0a744a48e96b86c4e268c43261ff86845'
'6bb9bf70eacef55a91ed0cec5edd8887af9a7ef6e6d819624c6c532360fe1f524aa9b2417496fcdca54e1ede22bc542c6581d420b068b5c24da932ea03426106')
sha256sums=(SKIP
e05b46b3cea5ca4dfa39fdaa5d8f85095e5fc3dda9fc460cfdc002c5d7670357) # 0001-bump-version-to-match-last-tag.patch
## 8686a98f8c260a4e4dcb78be79113b03e83c41276a997875f6bc6093ba4c5e20 curl-8.7.1-01-x86_64.pkg.tar.lz
## 12fb8d7933ef21ec30ea013a58dbcbd80e951e0c9f5b28f3875deda30ffc3d13 libcurl-compat-8.7.1-01-x86_64.pkg.tar.lz
## 9691b120a2be8f4ed6f37f9ca6cec63000f0ce5e3fd9b9a4bf3dc298d8850a3c libcurl-gnutls-8.7.1-01-x86_64.pkg.tar.lz
e05b46b3cea5ca4dfa39fdaa5d8f85095e5fc3dda9fc460cfdc002c5d7670357 # 0001-bump-version-to-match-last-tag.patch
00c2fb9332be11ab6127b99f4748aa8802ce3f0ca94dab7c5fb9ac206daeaff6) # 0002-brotli-and-others-simply-pass-through-0-length-writes.patch
##

View File

@ -7,7 +7,7 @@
pkgbase=curl
pkgname=(curl libcurl-compat libcurl-gnutls)
pkgver=8.7.1
pkgrel=1
pkgrel=3
pkgdesc='command line tool and library for transferring data with URLs'
arch=('x86_64')
url='https://curl.se/'
@ -23,11 +23,14 @@ depends=('ca-certificates'
'zlib' 'libz.so'
'zstd' 'libzstd.so')
makedepends=('git' 'patchelf')
checkdepends=('valgrind')
validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
source=("git+https://github.com/curl/curl.git#tag=curl-${pkgver//./_}?signed"
'0001-bump-version-to-match-last-tag.patch')
'0001-bump-version-to-match-last-tag.patch'
'0002-brotli-and-others-simply-pass-through-0-length-writes.patch')
sha512sums=('38b55dc916a64a1fd40a8af3e9a694ae918f8efb714430834491ebbe0ceeee4b58ba804afa15da966cbcf9cd7100ce373aed7b2101dff56f742996072caaf09a'
'51df4903eff9f1a15b1317ea4a8ee2b8537f347984f2524f42213b09344cd6109c621a4b81b37d2fcf2027387bb81cf0a744a48e96b86c4e268c43261ff86845')
'51df4903eff9f1a15b1317ea4a8ee2b8537f347984f2524f42213b09344cd6109c621a4b81b37d2fcf2027387bb81cf0a744a48e96b86c4e268c43261ff86845'
'6bb9bf70eacef55a91ed0cec5edd8887af9a7ef6e6d819624c6c532360fe1f524aa9b2417496fcdca54e1ede22bc542c6581d420b068b5c24da932ea03426106')
_backports=(
)
@ -53,6 +56,7 @@ prepare() {
done
patch -Np1 < ../0001-bump-version-to-match-last-tag.patch
patch -Np1 < ../0002-brotli-and-others-simply-pass-through-0-length-writes.patch
# no '-DEV' in version, release date from tagged commit...
sed -i \
@ -85,9 +89,11 @@ build() {
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--enable-versioned-symbols \
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d/ \
--with-openssl \
--with-openssl-quic \
--enable-versioned-symbols
--with-zsh-functions-dir=/usr/share/zsh/site-functions/
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
@ -96,9 +102,9 @@ build() {
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--disable-versioned-symbols \
--with-openssl \
--with-openssl-quic \
--disable-versioned-symbols
--with-openssl-quic
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
patchelf --set-soname 'libcurl-compat.so.4' ./lib/.libs/libcurl.so
@ -109,18 +115,23 @@ build() {
"${srcdir}/${pkgbase}"/configure \
"${_configure_options[@]}" \
--disable-versioned-symbols \
--without-openssl \
--with-gnutls
--with-gnutls \
--without-openssl
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so
}
check() {
# test curl
cd "${srcdir}"/build-curl
make test
cd build-curl
# -v: verbose
# -a: keep going on failure (so we see everything which breaks, not just the first failing test)
# -k: keep test files after completion
# -am: automake style TAP output
# -p: print logs if test fails
# -j: parallelization
# disable test 433, since it requires the glibc debug info
make TFLAGS="-v -a -k -p -j$(nproc) !433" test-nonflaky
}
package_curl() {

View File

@ -3,5 +3,6 @@ git
autoconf
automake
libnghttp3
valgrind

View File

@ -7,7 +7,7 @@
pkgname=jansson
pkgver=2.14
pkgrel=02
pkgrel=03
pkgdesc='C library for encoding, decoding and manipulating JSON data'
url='https://www.digip.org/jansson/'
depends=('glibc')
@ -38,3 +38,5 @@ validpgpkeys=('B5D6953E6D5059ED7ADA0F2FD3657D24D058434C') # Petri Lehtinen <petr
sha256sums=(5798d010e41cf8d76b66236cfb2f2543c8d082181d16bc3085ab49538d4b9929 # jansson-2.14.tar.gz
a29cab18600e0439b5ef08cd71c9b8241c6467ec02a8af52a25ed3b95d109c1c) # jansson-2.14.tar.gz.asc
## a33c3ff824c5d3c12cc8d11b331a4433c1f90bd43d11454feb630c9273af329a jansson-2.14-03-x86_64.pkg.tar.lz

View File

@ -3,7 +3,7 @@
pkgname=jansson
pkgver=2.14
pkgrel=2
pkgrel=3
pkgdesc='C library for encoding, decoding and manipulating JSON data'
arch=('x86_64')
url='https://www.digip.org/jansson/'

View File

@ -1 +1,2 @@