Accepting request 438810 from home:mvyskocil:branches:devel:libraries:c_c++
- Update to 1.2.0 (no changelog provided) - Add 0001-Problem-can-t-build-on-czmq-4.patch to build against czmq4 OBS-URL: https://build.opensuse.org/request/show/438810 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/zyre?expand=0&rev=3
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 5 14:49:39 UTC 2016 - mvyskocil@opensuse.org
|
||||
|
||||
- Update to 1.2.0 (no changelog provided)
|
||||
- Add 0001-Problem-can-t-build-on-czmq-4.patch to build against czmq4
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 19 13:26:36 UTC 2015 - mvyskocil@opensuse.org
|
||||
|
||||
|
||||
@@ -16,19 +16,21 @@
|
||||
#
|
||||
|
||||
Name: zyre
|
||||
Version: 1.1.0~git.1442594014.b92cb1b
|
||||
Version: 1.2.0
|
||||
Release: 0
|
||||
License: GPL-3.0+ or LGPL-3.0+
|
||||
Summary: Open-source framework for proximity-based peer-to-peer applications
|
||||
Url: https://github.com/zeromq/zyre
|
||||
Group: Development/Libraries/C and C++
|
||||
Source0: zyre-%{version}.tar.xz
|
||||
Source0: https://github.com/zeromq/zyre/archive/v%{version}.tar.gz
|
||||
Patch0: 0001-Problem-can-t-build-on-czmq-4.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: pkgconfig(libczmq) >= 3.0.0
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: automake
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pkgconfig(libsodium)
|
||||
# documentation
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: xmlto
|
||||
@@ -60,6 +62,7 @@ Development files (headers, pkgconfig, cmake) for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
./autogen.sh
|
||||
@@ -104,6 +107,8 @@ cp src/.libs/{perf_local,perf_remote,zpinger,ztester_beacon,ztester_gossip} %{bu
|
||||
%{_mandir}/man3/zre_msg.3.gz
|
||||
%{_mandir}/man3/zyre.3.gz
|
||||
%{_mandir}/man3/zyre_event.3.gz
|
||||
%dir %{_datadir}/zproject/
|
||||
%{_datadir}/zproject/%{name}
|
||||
|
||||
%changelog
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="url">https://github.com/zeromq/zyre.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="exclude">.git</param>
|
||||
<param name="versionformat">1.1.0~git.%ct.%h</param>
|
||||
<param name="revision">master</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
<param name="file">zyre-*git*.tar</param>
|
||||
<param name="compression">xz</param>
|
||||
</service>
|
||||
<service name="set_version" mode="disabled">
|
||||
<param name="basename">zyre</param>
|
||||
</service>
|
||||
</services>
|
||||
@@ -0,0 +1,183 @@
|
||||
From 5b86c78a8be76ef49fffd413ccdb3d1992448387 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vyskocil <michalvyskocil@eaton.com>
|
||||
Date: Sat, 5 Nov 2016 15:22:50 +0100
|
||||
Subject: [PATCH] Problem: can't build on czmq 4
|
||||
|
||||
Solution: do not use removed zhash_foreach, butr zhash_first/zhash_next
|
||||
---
|
||||
src/zyre_event.c | 10 ++++++--
|
||||
src/zyre_group.c | 8 +++++-
|
||||
src/zyre_node.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++--------
|
||||
3 files changed, 73 insertions(+), 12 deletions(-)
|
||||
|
||||
Index: zyre-1.2.0/src/zyre_event.c
|
||||
===================================================================
|
||||
--- zyre-1.2.0.orig/src/zyre_event.c
|
||||
+++ zyre-1.2.0/src/zyre_event.c
|
||||
@@ -131,7 +131,7 @@ zyre_event_destroy (zyre_event_t **self_
|
||||
}
|
||||
|
||||
static int
|
||||
-zyre_event_log_pair (const char *key, void *item, void *argument)
|
||||
+zyre_event_log_pair (const char *key, void *item)
|
||||
{
|
||||
zsys_info (" - %s: %s", key, (const char *)item);
|
||||
return 0;
|
||||
@@ -150,7 +150,13 @@ zyre_event_print (zyre_event_t *self)
|
||||
case ZYRE_EVENT_ENTER:
|
||||
zsys_info (" - type=ENTER");
|
||||
zsys_info (" - headers=%zu:", zhash_size (self->headers));
|
||||
- zhash_foreach (self->headers, (zhash_foreach_fn *) zyre_event_log_pair, self);
|
||||
+ void *value = zhash_first (self->headers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->headers);
|
||||
+ zyre_event_log_pair (key, value);
|
||||
+ value = zhash_first (self->headers);
|
||||
+ }
|
||||
zsys_info (" - address=%s", zyre_event_address(self));
|
||||
break;
|
||||
|
||||
Index: zyre-1.2.0/src/zyre_group.c
|
||||
===================================================================
|
||||
--- zyre-1.2.0.orig/src/zyre_group.c
|
||||
+++ zyre-1.2.0/src/zyre_group.c
|
||||
@@ -114,7 +114,13 @@ void
|
||||
zyre_group_send (zyre_group_t *self, zre_msg_t **msg_p)
|
||||
{
|
||||
assert (self);
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) s_peer_send, *msg_p);
|
||||
+ void *value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ s_peer_send (key, value, *msg_p);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
zre_msg_destroy (msg_p);
|
||||
}
|
||||
|
||||
Index: zyre-1.2.0/src/zyre_node.c
|
||||
===================================================================
|
||||
--- zyre-1.2.0.orig/src/zyre_node.c
|
||||
+++ zyre-1.2.0/src/zyre_node.c
|
||||
@@ -244,7 +244,7 @@ zyre_node_stop (zyre_node_t *self)
|
||||
}
|
||||
|
||||
|
||||
-// Send message to one peer; called via zhash_foreach
|
||||
+// Send message to one peer
|
||||
|
||||
static int
|
||||
zyre_node_send_peer (const char *key, void *item, void *argument)
|
||||
@@ -291,13 +291,31 @@ zyre_node_dump (zyre_node_t *self)
|
||||
zsys_info (" - connect endpoint=%s", self->gossip_connect);
|
||||
}
|
||||
zsys_info (" - headers=%zu:", zhash_size (self->headers));
|
||||
- zhash_foreach (self->headers, (zhash_foreach_fn *) zyre_node_log_pair, self);
|
||||
+ void *value = zhash_first (self->headers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->headers);
|
||||
+ zyre_node_log_pair (key, value, self);
|
||||
+ value = zhash_first (self->headers);
|
||||
+ }
|
||||
|
||||
zsys_info (" - peers=%zu:", zhash_size (self->peers));
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) zyre_node_log_item, self);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ zyre_node_log_item (key, value, self);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
|
||||
zsys_info (" - groups=%zu:", zhash_size (self->own_groups));
|
||||
- zhash_foreach (self->own_groups, (zhash_foreach_fn *) zyre_node_log_item, self);
|
||||
+ value = zhash_first (self->own_groups);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->own_groups);
|
||||
+ zyre_node_log_item (key, value, self);
|
||||
+ value = zhash_first (self->own_groups);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +437,13 @@ zyre_node_recv_api (zyre_node_t *self)
|
||||
zre_msg_set_group (msg, name);
|
||||
// Update status before sending command
|
||||
zre_msg_set_status (msg, ++(self->status));
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) zyre_node_send_peer, msg);
|
||||
+ void *value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ zyre_node_send_peer (key, value, msg);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
zre_msg_destroy (&msg);
|
||||
if (self->verbose)
|
||||
zsys_info ("(%s) JOIN group=%s", self->name, name);
|
||||
@@ -436,7 +460,13 @@ zyre_node_recv_api (zyre_node_t *self)
|
||||
zre_msg_set_group (msg, name);
|
||||
// Update status before sending command
|
||||
zre_msg_set_status (msg, ++(self->status));
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) zyre_node_send_peer, msg);
|
||||
+ void *value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ zyre_node_send_peer (key, value, msg);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
zre_msg_destroy (&msg);
|
||||
zhash_delete (self->own_groups, name);
|
||||
if (self->verbose)
|
||||
@@ -518,7 +548,13 @@ zyre_node_require_peer (zyre_node_t *sel
|
||||
zyre_peer_t *peer = (zyre_peer_t *) zhash_lookup (self->peers, zuuid_str (uuid));
|
||||
if (!peer) {
|
||||
// Purge any previous peer on same endpoint
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) zyre_node_purge_peer, (char *) endpoint);
|
||||
+ void *value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ zyre_node_purge_peer (key, value, (char*) endpoint);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
|
||||
peer = zyre_peer_new (self->peers, uuid);
|
||||
assert (peer);
|
||||
@@ -567,7 +603,14 @@ zyre_node_remove_peer (zyre_node_t *self
|
||||
self->name, zyre_peer_name (peer), zyre_peer_endpoint (peer));
|
||||
|
||||
// Remove peer from any groups we've got it in
|
||||
- zhash_foreach (self->peer_groups, (zhash_foreach_fn *) zyre_node_delete_peer, peer);
|
||||
+ void *value = zhash_first (self->peer_groups);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peer_groups);
|
||||
+ zyre_node_delete_peer (key, value, peer);
|
||||
+ value = zhash_first (self->peer_groups);
|
||||
+ }
|
||||
+
|
||||
// To destroy peer, we remove from peers hash table
|
||||
zhash_delete (self->peers, zyre_peer_identity (peer));
|
||||
}
|
||||
@@ -902,7 +945,13 @@ zyre_node_actor (zsock_t *pipe, void *ar
|
||||
if (zclock_mono () >= reap_at) {
|
||||
reap_at = zclock_mono () + REAP_INTERVAL;
|
||||
// Ping all peers and reap any expired ones
|
||||
- zhash_foreach (self->peers, (zhash_foreach_fn *) zyre_node_ping_peer, self);
|
||||
+ void *value = zhash_first (self->peers);
|
||||
+ while (value)
|
||||
+ {
|
||||
+ const char *key = zhash_cursor (self->peers);
|
||||
+ zyre_node_ping_peer (key, value, self);
|
||||
+ value = zhash_first (self->peers);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a47dd553ca699ee7c4b4b11c5ea316d11267adad1bfd3ad48c3c5d608668596
|
||||
size 455172
|
||||
Reference in New Issue
Block a user