From 193bf51dd76b66a8f80a73ed58f6e69e15254524 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Tue, 27 May 2025 17:49:56 +0200 Subject: [PATCH 1/3] update to 0.6.3 (RHBZ#2368773) --- zsync.spec | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/zsync.spec b/zsync.spec index 23ab1d7..2abec77 100644 --- a/zsync.spec +++ b/zsync.spec @@ -1,19 +1,14 @@ Name: zsync Summary: a file transfer program using the same algorithm as rsync over HTTP -URL: http://zsync.moria.org.uk/ +URL: https://zsync.moria.org.uk/ License: Artistic-2.0 and Zlib and NTP and LicenseRef-Fedora-Public-Domain # Zlib: zlib/* # NTP: base64.c # PD: librcksum/* -Version: 0.6.2 +Version: 0.6.3 Release: %autorelease -Source0: http://zsync.moria.org.uk/download/%{name}-%{version}.tar.bz2 - -# https://sources.debian.org/data/main/z/zsync/0.6.2-7/debian/patches/fix-build-with-gcc-14.patch -Patch1: fix-build-with-gcc-14.patch -# https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0 (modif'd to apply) -Patch2: remove-ub-in-zlib.patch +Source0: https://zsync.moria.org.uk/download/%{name}-%{version}.tar.bz2 BuildRequires: gcc BuildRequires: make @@ -40,7 +35,6 @@ large scale file distribution. sed -i '/^doc_DATA/s/COPYING//' Makefile.am # avoid duplicating license file %build -autoreconf -if %configure %make_build CFLAGS+="-Wno-old-style-definition -D_DEFAULT_SOURCE" # bundled zlib uses old-style function definition, ignore. From 086fbd6811b63835a8a2361eff6e163d65344d37 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Thu, 29 May 2025 12:00:25 +0200 Subject: [PATCH 2/3] update to upstream 0.6.3 release --- .gitignore | 1 + fix-build-with-gcc-14.patch | 89 ------------------------------------- remove-ub-in-zlib.patch | 71 ----------------------------- sources | 2 +- zsync-0.6.3-fix-tests.patch | 21 +++++++++ zsync.spec | 1 + 6 files changed, 24 insertions(+), 161 deletions(-) delete mode 100644 fix-build-with-gcc-14.patch delete mode 100644 remove-ub-in-zlib.patch create mode 100644 zsync-0.6.3-fix-tests.patch diff --git a/.gitignore b/.gitignore index a590d08..fc099d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /zsync-0.6.2.tar.bz2 +/zsync-0.6.3.tar.bz2 diff --git a/fix-build-with-gcc-14.patch b/fix-build-with-gcc-14.patch deleted file mode 100644 index 43bce49..0000000 --- a/fix-build-with-gcc-14.patch +++ /dev/null @@ -1,89 +0,0 @@ -Description: Fix build with GCC-14 -Author: Marcos Talau -Bug-Debian: https://bugs.debian.org/1075710 -Forwarded: https://github.com/cph6/zsync/issues/20 -Last-Update: 2024-08-16 - -Index: zsync-0.6.2/client.c -=================================================================== ---- zsync-0.6.2.orig/client.c -+++ zsync-0.6.2/client.c -@@ -392,7 +392,7 @@ int fetch_remaining_blocks_http(struct z - */ - int fetch_remaining_blocks(struct zsync_state *zs) { - int n, utype; -- const char *const *url = zsync_get_urls(zs, &n, &utype); -+ char **url = zsync_get_urls(zs, &n, &utype); - int *status; /* keep status for each URL - 0 means no error */ - int ok_urls = n; - -@@ -452,7 +452,7 @@ extern long global_offset; - int main(int argc, char **argv) { - struct zsync_state *zs; - char *temp_file = NULL; -- char **seedfiles = NULL; -+ void **seedfiles = NULL; - int nseedfiles = 0; - char *filename = NULL; - long long local_used; -Index: zsync-0.6.2/libzsync/zmap.c -=================================================================== ---- zsync-0.6.2.orig/libzsync/zmap.c -+++ zsync-0.6.2/libzsync/zmap.c -@@ -333,7 +333,7 @@ int zmap_search(const struct zmap* zm, l - * and in the order that it returned them, this condition is satisfied. - */ - void configure_zstream_for_zdata(const struct zmap *zm, z_stream * zs, -- long zoffset, long long *poutoffset) { -+ long zoffset, off_t *poutoffset) { - /* Find the zmap entry corresponding to this offset */ - int i = zmap_search(zm, zoffset); - -Index: zsync-0.6.2/libzsync/zmap.h -=================================================================== ---- zsync-0.6.2.orig/libzsync/zmap.h -+++ zsync-0.6.2/libzsync/zmap.h -@@ -29,7 +29,7 @@ struct zmap* zmap_make(const struct gzbl - void zmap_free(struct zmap*); - - off_t* zmap_to_compressed_ranges(const struct zmap* zm, off_t* byterange, int nrange, int* num); --void configure_zstream_for_zdata(const struct zmap* zm, struct z_stream_s* zs, long zoffset, long long* poutoffset); -+void configure_zstream_for_zdata(const struct zmap* zm, struct z_stream_s* zs, long zoffset, off_t* poutoffset); - - /* gzip flag byte */ - #define GZ_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -Index: zsync-0.6.2/libzsync/zsync.c -=================================================================== ---- zsync-0.6.2.orig/libzsync/zsync.c -+++ zsync-0.6.2/libzsync/zsync.c -@@ -436,7 +436,7 @@ void zsync_progress(const struct zsync_s - * Note that these URLs could be for encoded versions of the target; a 'type' - * is returned in *type which tells libzsync in later calls what version of the - * target is being retrieved. */ --const char *const *zsync_get_urls(struct zsync_state *zs, int *n, int *t) { -+char **zsync_get_urls(struct zsync_state *zs, int *n, int *t) { - if (zs->zmap && zs->nzurl) { - *n = zs->nzurl; - *t = 1; -@@ -768,7 +768,7 @@ char *zsync_end(struct zsync_state *zs) - */ - void zsync_configure_zstream_for_zdata(const struct zsync_state *zs, - struct z_stream_s *zstrm, -- long zoffset, long long *poutoffset) { -+ long zoffset, off_t *poutoffset) { - configure_zstream_for_zdata(zs->zmap, zstrm, zoffset, poutoffset); - { /* Load in prev 32k sliding window for backreferences */ - long long pos = *poutoffset; -Index: zsync-0.6.2/libzsync/zsync.h -=================================================================== ---- zsync-0.6.2.orig/libzsync/zsync.h -+++ zsync-0.6.2/libzsync/zsync.h -@@ -58,7 +58,7 @@ int zsync_submit_source_file(struct zsyn - * (the URL pointers are still referenced by the library, and are valid only until zsync_end). - */ - --const char * const * zsync_get_urls(struct zsync_state* zs, int* n, int* t); -+char ** zsync_get_urls(struct zsync_state* zs, int* n, int* t); - - /* zsync_needed_byte_ranges - get the byte ranges needed from a URL. - * Returns the number of ranges in *num, and a malloc'd array (to be freed diff --git a/remove-ub-in-zlib.patch b/remove-ub-in-zlib.patch deleted file mode 100644 index 5c46d36..0000000 --- a/remove-ub-in-zlib.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 6a043145ca6e9c55184013841a67b2fef87e44c0 Mon Sep 17 00:00:00 2001 -From: Mark Adler -Date: Wed, 21 Sep 2016 23:35:50 -0700 -Subject: [PATCH] Remove offset pointer optimization in inftrees.c. - -inftrees.c was subtracting an offset from a pointer to an array, -in order to provide a pointer that allowed indexing starting at -the offset. This is not compliant with the C standard, for which -the behavior of a pointer decremented before its allocated memory -is undefined. Per the recommendation of a security audit of the -zlib code by Trail of Bits and TrustInSoft, in support of the -Mozilla Foundation, this tiny optimization was removed, in order -to avoid the possibility of undefined behavior. ---- - inftrees.c | 18 ++++++++---------- - 1 file changed, 8 insertions(+), 10 deletions(-) - -diff --git a/inftrees.c b/inftrees.c -index 22fcd6666..0d2670d57 100644 ---- a/zlib/inftrees.c -+++ b/zlib/inftrees.c -@@ -54,7 +54,7 @@ unsigned short FAR *work; - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ -- int end; /* use base and extra for symbol > end */ -+ unsigned match; /* use base and extra for symbol >= match */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ -@@ -181,19 +181,17 @@ unsigned short FAR *work; - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ -- end = 19; -+ match = 20; - break; - case LENS: - base = lbase; -- base -= 257; - extra = lext; -- extra -= 257; -- end = 256; -+ match = 257; - break; - default: /* DISTS */ - base = dbase; - extra = dext; -- end = -1; -+ match = 0; - } - - /* initialize state for loop */ -@@ -216,13 +214,13 @@ unsigned short FAR *work; - for (;;) { - /* create table entry */ - this.bits = (unsigned char)(len - drop); -- if ((int)(work[sym]) < end) { -+ if (work[sym] + 1 < match) { - this.op = (unsigned char)0; - this.val = work[sym]; - } -- else if ((int)(work[sym]) > end) { -- this.op = (unsigned char)(extra[work[sym]]); -- this.val = base[work[sym]]; -+ else if (work[sym] >= match) { -+ this.op = (unsigned char)(extra[work[sym] - match]); -+ this.val = base[work[sym] - match]; - } - else { - this.op = (unsigned char)(32 + 64); /* end of block */ diff --git a/sources b/sources index d62cd44..bbf2246 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsync-0.6.2.tar.bz2) = 56437594831f2320c532759805b5c51116c53c8848f14b54cfd9b76676d1d061abe7fc914264f496ed1c7922fbbd5b884166c855a2fb9eb1285f216e478c5f0d +SHA512 (zsync-0.6.3.tar.bz2) = b7b9f16c9dc9d3d7753eb43e57d8c4bc8adea37ed3b6372829b466d3b010dd2c287a1de2ec02a5f1a4d96ee52fdcfec6d6021776368fe4a3af862c785de20089 diff --git a/zsync-0.6.3-fix-tests.patch b/zsync-0.6.3-fix-tests.patch new file mode 100644 index 0000000..4134b10 --- /dev/null +++ b/zsync-0.6.3-fix-tests.patch @@ -0,0 +1,21 @@ +From a5cb28f923dd3cfdeb65e2930dd1faa727c2abf8 Mon Sep 17 00:00:00 2001 +From: Colin Phipps +Date: Thu, 29 May 2025 08:33:11 +0100 +Subject: [PATCH] Update check-zsyncmake for changes in 208ef06. + +--- + c/check-zsyncmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/c/check-zsyncmake b/c/check-zsyncmake +index 3006230..08791e1 100755 +--- a/check-zsyncmake ++++ b/check-zsyncmake +@@ -4,6 +4,6 @@ ${top_builddir-.}/zsyncmake -u foo -f foo ${srcdir-.}/INSTALL + + # Note TAB required for Solaris cksum + x=`perl -pe 's/^(zsync:).*$/$1 XXX/; s/^(MTime:)(.*)$/my ($x, $y) = ($1, $2); $y =~ s![a-zA-Z0-9]!_!g; "$x$y"/e;' foo.zsync | tee foo.tr.zsync | cksum | sed -e 's/[ ][0-9].*//'` +-[ $x = 4103379992 ] ++[ $x = 3456223344 ] + rm foo.zsync + diff --git a/zsync.spec b/zsync.spec index 2abec77..1bb1f8c 100644 --- a/zsync.spec +++ b/zsync.spec @@ -9,6 +9,7 @@ Version: 0.6.3 Release: %autorelease Source0: https://zsync.moria.org.uk/download/%{name}-%{version}.tar.bz2 +Patch0: zsync-0.6.3-fix-tests.patch BuildRequires: gcc BuildRequires: make From 0218adf9eaef45dc511f755352ba268454bb2d49 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:21:35 +0000 Subject: [PATCH 3/3] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild