From 36d1dc99999f2f6978981584f1b728c359630648 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 18 Mar 2014 14:14:52 +0100 Subject: [PATCH] xbps: add patch from git to fix libfetch issues with some buggy HTTP servers. --- ...etch-always-add-Accept-in-the-HTTP-h.patch | 33 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/0005-Fix-34-make-libfetch-always-add-Accept-in-the-HTTP-h.patch diff --git a/srcpkgs/xbps/patches/0005-Fix-34-make-libfetch-always-add-Accept-in-the-HTTP-h.patch b/srcpkgs/xbps/patches/0005-Fix-34-make-libfetch-always-add-Accept-in-the-HTTP-h.patch new file mode 100644 index 0000000000..4c5c90c6f5 --- /dev/null +++ b/srcpkgs/xbps/patches/0005-Fix-34-make-libfetch-always-add-Accept-in-the-HTTP-h.patch @@ -0,0 +1,33 @@ +From d0a9bbb912630fee4fe7d29b6ec0655142f42fad Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Tue, 18 Mar 2014 14:08:40 +0100 +Subject: [PATCH] Fix #34 (make libfetch always add "Accept: */*" in the HTTP + header). + +--- + NEWS | 6 ++++++ + lib/fetch/http.c | 8 ++++++++ + 2 files changed, 14 insertions(+) + +--- lib/fetch/http.c ++++ lib/fetch/http.c +@@ -939,8 +939,16 @@ http_request(struct url *URL, const char *op, struct url_stat *us, + http_cmd(conn, "User-Agent: %s\r\n", p); + else + http_cmd(conn, "User-Agent: %s\r\n", _LIBFETCH_VER); ++ ++ /* ++ * Some servers returns 406 (Not Acceptable) if the Accept field is not ++ * provided by the user agent, such example is http://alioth.debian.org. ++ */ ++ http_cmd(conn, "Accept: */*\r\n"); ++ + if (url->offset > 0) + http_cmd(conn, "Range: bytes=%lld-\r\n", (long long)url->offset); ++ + http_cmd(conn, "\r\n"); + + /* +-- +1.9.0 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 1b77019799..efb4c282b5 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.33 -revision=3 +revision=4 bootstrap=yes short_desc="The XBPS package system utilities" maintainer="Juan RP "