public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/zsync/files/, net-misc/zsync/
@ 2025-03-01  7:03 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2025-03-01  7:03 UTC (permalink / raw
  To: gentoo-commits

commit:     223c1bbb323e6efcbc517f5c2a999c9a6a87a6ca
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  1 06:52:22 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  1 07:03:24 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=223c1bbb

net-misc/zsync: fix Modern C issues

Closes: https://bugs.gentoo.org/921150
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/zsync/files/zsync-0.6.2-c99.patch         | 82 ++++++++++++++++++++++
 ...zsync-0.6.2-r3.ebuild => zsync-0.6.2-r4.ebuild} |  3 +-
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/net-misc/zsync/files/zsync-0.6.2-c99.patch b/net-misc/zsync/files/zsync-0.6.2-c99.patch
new file mode 100644
index 000000000000..f71453129d35
--- /dev/null
+++ b/net-misc/zsync/files/zsync-0.6.2-c99.patch
@@ -0,0 +1,82 @@
+https://bugs.gentoo.org/921150
+https://sources.debian.org/data/main/z/zsync/0.6.2-7/debian/patches/fix-build-with-gcc-14.patch
+
+Description: Fix build with GCC-14
+Author: Marcos Talau <talau@debian.org>
+Bug-Debian: https://bugs.debian.org/1075710
+Forwarded: https://github.com/cph6/zsync/issues/20
+Last-Update: 2024-08-16
+
+--- a/client.c
++++ b/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;
+--- a/libzsync/zmap.c
++++ b/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);
+ 
+--- a/libzsync/zmap.h
++++ b/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 */
+--- a/libzsync/zsync.c
++++ b/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;
+--- a/libzsync/zsync.h
++++ b/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/net-misc/zsync/zsync-0.6.2-r3.ebuild b/net-misc/zsync/zsync-0.6.2-r4.ebuild
similarity index 93%
rename from net-misc/zsync/zsync-0.6.2-r3.ebuild
rename to net-misc/zsync/zsync-0.6.2-r4.ebuild
index 798fb552ab27..f878a449a366 100644
--- a/net-misc/zsync/zsync-0.6.2-r3.ebuild
+++ b/net-misc/zsync/zsync-0.6.2-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -22,6 +22,7 @@ KEYWORDS="amd64 ~arm ppc ppc64 x86"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.6.2-musl-off_t-fix.patch
+	"${FILESDIR}"/${PN}-0.6.2-c99.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-01  7:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01  7:03 [gentoo-commits] repo/gentoo:master commit in: net-misc/zsync/files/, net-misc/zsync/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox