From bd27f2e794392d22d45b4e33b95e827531488a0b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 1 Feb 2013 13:59:04 +0100 Subject: [PATCH] xbps: another patch from git to fix a fetch regression. --- ...don-t-check-for-file-truncation-if-s.patch | 27 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/0002-xbps_fetch_file-don-t-check-for-file-truncation-if-s.patch diff --git a/srcpkgs/xbps/patches/0002-xbps_fetch_file-don-t-check-for-file-truncation-if-s.patch b/srcpkgs/xbps/patches/0002-xbps_fetch_file-don-t-check-for-file-truncation-if-s.patch new file mode 100644 index 00000000000..7b8adebadbf --- /dev/null +++ b/srcpkgs/xbps/patches/0002-xbps_fetch_file-don-t-check-for-file-truncation-if-s.patch @@ -0,0 +1,27 @@ +From bdcdb9f1a042c7e542d23ae5790ae5a1925904c8 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Fri, 1 Feb 2013 13:40:27 +0100 +Subject: [PATCH] xbps_fetch_file: don't check for file truncation if server + answers with invalid info. + +--- + NEWS | 3 +++ + lib/download.c | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/download.c b/lib/download.c +index d73de87..090591d 100644 +--- lib/download.c ++++ lib/download.c +@@ -249,7 +249,7 @@ xbps_fetch_file(struct xbps_handle *xhp, const char *uri, const char *flags) + errno = EIO; + rv = -1; + goto out; +- } else if ((bytes_dload + url->offset) != url_st.size) { ++ } else if (url_st.size > 0 && ((bytes_dload + url->offset) != url_st.size)) { + xbps_dbg_printf(xhp, "file %s is truncated\n", filename); + errno = EIO; + rv = -1; +-- +1.8.1.1 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 3ba747bab81..5e0e4b4e134 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.20 -revision=2 +revision=3 build_style=configure configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin --enable-tests --enable-static --enable-debug"