[csw-devel] SF.net SVN: gar:[9827] csw/mgar/pkg/libevent/branches

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Fri May 7 11:42:26 CEST 2010


Revision: 9827
          http://gar.svn.sourceforge.net/gar/?rev=9827&view=rev
Author:   dmichelsen
Date:     2010-05-07 09:42:25 +0000 (Fri, 07 May 2010)

Log Message:
-----------
libevent: Make branch for new 2.0 alpha version

Added Paths:
-----------
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-broken-unsetenv-at-unit-test-runtime.patch
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-setenv-unsetenv-skip-main-base_environ-test.patch
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch

Removed Paths:
-------------
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile
    csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums

Deleted: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile
===================================================================
--- csw/mgar/pkg/libevent/trunk/Makefile	2009-12-07 09:20:11 UTC (rev 7572)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile	2010-05-07 09:42:25 UTC (rev 9827)
@@ -1,70 +0,0 @@
-GARNAME = libevent
-GARVERSION = 1.4.12
-CATEGORIES = lib
-
-EXTRA_MODULATORS = GARVERSION
-MODULATIONS_GARVERSION = 1.1a 1.4.12
-
-SKIP_MODULATIONS = isa-sparcv9-garversion-1.1a
-SKIP_MODULATIONS += isa-amd64-garversion-1.1a
-
-DISTVERSION-1.1a = 1.1a
-DISTVERSION-1.4.12 = 1.4.12-stable
-
-DESCRIPTION = Event notification library
-define BLURB
-  The libevent API provides a mechanism to execute a callback function when a
-  specific event occurs on a file descriptor or after a timeout has been
-  reached. Furthermore, libevent also support callbacks due to signals or
-  regular timeouts.
-endef
-
-MASTER_SITES = http://www.monkey.org/~provos/
-SOURCEFILES = $(foreach V,$(MODULATIONS_GARVERSION),$(GARNAME)-$(DISTVERSION-$V).tar.gz)
-DISTFILES += $(SOURCEFILES)
-
-NOEXTRACT = $(filter-out $(GARNAME)-$(DISTVERSION-$(GARVERSION)).tar.gz,$(SOURCEFILES))
-
-PACKAGES = CSWlibevent CSWlibevent-devel
-
-REQUIRED_PKGS_CSWlibevent-devel = CSWlibevent
-
-CATALOGNAME_CSWlibevent = libevent
-CATALOGNAME_CSWlibevent-devel = libevent_devel
-
-SPKG_DESC_CSWlibevent = Event notification library
-SPKG_DESC_CSWlibevent-devel = Event notification library header files
-
-# We define upstream file regex so we can be notifed of new upstream software release
-UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*)-stable.tar.gz
-
-SPKG_SOURCEURL = http://www.monkey.org/~provos/libevent/
-
-WORKSRC = $(WORKDIR)/$(GARNAME)-$(DISTVERSION-$(GARVERSION))
-
-BUILD64 = 1
-NO_ISAEXEC = 1
-CONFIGURE_ARGS  = $(DIRPATHS) 
-
-TEST_TARGET = verify
-
-MERGE_SCRIPTS_isa-default-garversion-1.1a = copy-only
-MERGE_DIRS_isa-default-garversion-1.1a = $(libdir)
-MERGE_SCRIPTS_isa-extra-garversion-1.1a = copy-relocated-only
-MERGE_DIRS_isa-extra-garversion-1.1a = $(libdir)
-
-MERGE_SCRIPTS_isa-default-garversion-1.4.12 = copy-all
-MERGE_SCRIPTS_isa-extra-garversion-1.4.12 = copy-relocated-only
-MERGE_DIRS_isa-extra-garversion-1.4.12 = $(libdir)
-
-PKGFILES_CSWlibevent-devel = $(PKGFILES_DEVEL)
-PKGFILES_CSWlibevent-devel += $(bindir)/.*
-
-include gar/category.mk
-
-#LIBS += -lresolv -lnsl
-#export LIBS
-
-post-extract-modulated:
-	-test -f $(WORKSRC)/test/test.sh && perl -pi -e 's,#!/bin/sh,#!/bin/bash,' $(WORKSRC)/test/test.sh
-	@$(MAKECOOKIE)

Copied: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile (from rev 7772, csw/mgar/pkg/libevent/trunk/Makefile)
===================================================================
--- csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile	                        (rev 0)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/Makefile	2010-05-07 09:42:25 UTC (rev 9827)
@@ -0,0 +1,79 @@
+GARNAME = libevent
+GARVERSION = 2.0.4
+CATEGORIES = lib
+
+EXTRA_MODULATORS = GARVERSION
+#MODULATIONS_GARVERSION = 1.1a 2.0.4
+MODULATIONS_GARVERSION = 2.0.4
+
+SKIP_MODULATIONS = isa-sparcv9-garversion-1.1a
+SKIP_MODULATIONS += isa-amd64-garversion-1.1a
+
+DISTVERSION-1.1a = 1.1a
+DISTVERSION-2.0.4 = 2.0.4-alpha
+
+DESCRIPTION = Event notification library
+define BLURB
+  The libevent API provides a mechanism to execute a callback function when a
+  specific event occurs on a file descriptor or after a timeout has been
+  reached. Furthermore, libevent also support callbacks due to signals or
+  regular timeouts.
+endef
+
+MASTER_SITES = http://www.monkey.org/~provos/
+SOURCEFILES = $(foreach V,$(MODULATIONS_GARVERSION),$(GARNAME)-$(DISTVERSION-$V).tar.gz)
+DISTFILES += $(SOURCEFILES)
+
+# We define upstream file regex so we can be notifed of new upstream software release
+UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*)-alpha.tar.gz
+
+PATCHFILES += 0001-Detect-broken-unsetenv-at-unit-test-runtime.patch
+PATCHFILES += 0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch
+
+NOEXTRACT = $(filter-out $(GARNAME)-$(DISTVERSION-$(GARVERSION)).tar.gz,$(SOURCEFILES))
+
+LICENSE = LICENSE
+
+PACKAGES = CSWlibevent CSWlibevent-devel
+
+RUNTIME_DEP_PKGS_CSWlibevent += CSWosslrt
+RUNTIME_DEP_PKGS_CSWlibevent-devel = CSWlibevent
+
+CATALOGNAME_CSWlibevent = libevent
+CATALOGNAME_CSWlibevent-devel = libevent_devel
+
+SPKG_DESC_CSWlibevent = Event notification library
+SPKG_DESC_CSWlibevent-devel = Event notification library header files
+
+SPKG_SOURCEURL = http://www.monkey.org/~provos/libevent/
+
+WORKSRC = $(WORKDIR)/$(GARNAME)-$(DISTVERSION-$(GARVERSION))
+
+BUILD64 = 1
+NOISAEXEC = 1
+CONFIGURE_ARGS  = $(DIRPATHS) 
+
+TEST_TARGET = verify
+
+MERGE_SCRIPTS_isa-default-garversion-1.1a = copy-only
+MERGE_DIRS_isa-default-garversion-1.1a = $(libdir)
+MERGE_SCRIPTS_isa-extra-garversion-1.1a = copy-relocated-only
+MERGE_DIRS_isa-extra-garversion-1.1a = $(libdir)
+
+MERGE_SCRIPTS_isa-default-garversion-2.0.4 = copy-all
+MERGE_SCRIPTS_isa-extra-garversion-2.0.4 = copy-relocated-only
+MERGE_DIRS_isa-extra-garversion-2.0.4 = $(libdir)
+
+PKGFILES_CSWlibevent-devel = $(PKGFILES_DEVEL)
+PKGFILES_CSWlibevent-devel += $(bindir)/.*
+
+CHECKPKG_OVERRIDES_CSWlibevent-devel += missing-dependency|CSWpython
+CHECKPKG_OVERRIDES_CSWlibevent-devel += surplus-dependency|CSWlibevent
+
+include gar/category.mk
+
+post-extract-modulated:
+	-test -f $(WORKSRC)/test/test.sh && perl -pi -e 's,#!/bin/sh,#!/bin/bash,' $(WORKSRC)/test/test.sh
+	@$(MAKECOOKIE)
+
+

Deleted: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums
===================================================================
--- csw/mgar/pkg/libevent/trunk/checksums	2009-12-07 09:20:11 UTC (rev 7572)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums	2010-05-07 09:42:25 UTC (rev 9827)
@@ -1,2 +0,0 @@
-6cc776458ecaf9247550863702a44d7c  libevent-1.1a.tar.gz
-77b0d8b9885496871bb083165b35ba11  libevent-1.4.12-stable.tar.gz

Copied: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums (from rev 7772, csw/mgar/pkg/libevent/trunk/checksums)
===================================================================
--- csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums	                        (rev 0)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/checksums	2010-05-07 09:42:25 UTC (rev 9827)
@@ -0,0 +1,4 @@
+50c285b06a7843509d5a1d6ae7310153  0001-Detect-broken-unsetenv-at-unit-test-runtime.patch
+8f00dfd6a27eb8ab308014ef15bb1883  0001-Detect-setenv-unsetenv-skip-main-base_environ-test.patch
+cfb3d03f400a75503595795b60a05244  0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch
+dbc50f32af9f2ade151a0737e5edf205  libevent-2.0.4-alpha.tar.gz

Added: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-broken-unsetenv-at-unit-test-runtime.patch
===================================================================
--- csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-broken-unsetenv-at-unit-test-runtime.patch	                        (rev 0)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-broken-unsetenv-at-unit-test-runtime.patch	2010-05-07 09:42:25 UTC (rev 9827)
@@ -0,0 +1,37 @@
+From 3a003733e6c8081c07fec51a77f65d3d5d8a1094 Mon Sep 17 00:00:00 2001
+From: Nick Mathewson <nickm at torproject.org>
+Date: Wed, 21 Apr 2010 12:25:29 -0400
+Subject: [PATCH] Detect broken unsetenv at unit-test runtime
+
+If we have an unsetenv function that doesn't work, we can't run the
+main/base_environ unit test, so we should skip it.
+---
+ test/regress.c |   12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/test/regress.c b/test/regress.c
+index 513c3c8..cda0892 100644
+--- a/test/regress.c
++++ b/test/regress.c
+@@ -1830,6 +1830,18 @@ test_base_environ(void *arg)
+ 	int i, n_methods=0;
+ 	const char *defaultname;
+ 
++	/* See if unsetenv works before we rely on it. */
++	setenv("EVENT_NOWAFFLES", "1", 1);
++	unsetenv("EVENT_NOWAFFLES");
++	if (getenv("EVENT_NOWAFFLES") != NULL) {
++#ifndef _EVENT_HAVE_UNSETENV
++		TT_DECLARE("NOTE", ("Can't fake unsetenv; skipping test"));
++#else
++		TT_DECLARE("NOTE", ("unsetenv doesn't work; skipping test"));
++#endif
++		tt_skip();
++	}
++
+ 	basenames = event_get_supported_methods();
+ 	for (i = 0; basenames[i]; ++i) {
+ 		methodname_to_envvar(basenames[i], varbuf, sizeof(varbuf));
+-- 
+1.6.6.1
+

Added: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-setenv-unsetenv-skip-main-base_environ-test.patch
===================================================================
--- csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-setenv-unsetenv-skip-main-base_environ-test.patch	                        (rev 0)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Detect-setenv-unsetenv-skip-main-base_environ-test.patch	2010-05-07 09:42:25 UTC (rev 9827)
@@ -0,0 +1,120 @@
+From b76470ed69b4b7875d5f764cc0f0d0577ef8b21f Mon Sep 17 00:00:00 2001
+From: Nick Mathewson <nickm at torproject.org>
+Date: Tue, 29 Dec 2009 16:38:03 -0500
+Subject: [PATCH] Detect setenv/unsetenv; skip main/base_environ test if we can't fake them.
+
+Previously, we assumed that we would have setenv/unsetenv everywhere
+but WIN32, where we could fake them with putenv.  This isn't so: some
+other non-windows systems lack setenv/unsetenv, and some of them lack
+putenv too.
+
+The first part of the solution, then, is to detect setenv/unsetenv/
+putenv from configure.in, and to fake setenv/unsetenv with putenv
+whenever we have the latter but not one of the former.
+
+But what should we do when we don't even have putenv?  We could do
+elaborate tricks to manipulate the environ pointer, but since we're
+only doing this for the unit tests, let's just skip the one test in
+question that uses setenv/unsetenv.
+---
+ configure.in   |    3 +--
+ test/regress.c |   42 +++++++++++++++++++++++++++++-------------
+ 2 files changed, 30 insertions(+), 15 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 67f0816..76bf85b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -180,8 +180,7 @@ AC_C_INLINE
+ AC_HEADER_TIME
+ 
+ dnl Checks for library functions.
+-AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random issetugid geteuid getegid getservbyname getprotobynumber)
+-
++AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random issetugid geteuid getegid getservbyname getprotobynumber setenv unsetenv putenv)
+ 
+ # Check for gethostbyname_r in all its glorious incompatible versions.
+ #   (This is cut-and-pasted from Tor, which based its logic on
+diff --git a/test/regress.c b/test/regress.c
+index 4e4e11b..f34890a 100644
+--- a/test/regress.c
++++ b/test/regress.c
+@@ -1683,39 +1683,52 @@ end:
+ 		event_config_free(cfg);
+ }
+ 
+-static void
+-methodname_to_envvar(const char *mname, char *buf, size_t buflen)
+-{
+-	char *cp;
+-	evutil_snprintf(buf, buflen, "EVENT_NO%s", mname);
+-	for (cp = buf; *cp; ++cp) {
+-		*cp = toupper(*cp);
+-	}
+-}
+-
+-#ifdef WIN32
++#ifdef _EVENT_HAVE_SETENV
++#define SETENV_OK
++#elif !defined(_EVENT_HAVE_SETENV) && defined(_EVENT_HAVE_PUTENV)
+ static void setenv(const char *k, const char *v, int _o)
+ {
+ 	char b[256];
+ 	evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
+ 	putenv(b);
+ }
++#define SETENV_OK
++#endif
++
++#ifdef _EVENT_HAVE_UNSETENV
++#define UNSETENV_OK
++#elif !defined(_EVENT_HAVE_UNSETENV) && defined(_EVENT_HAVE_PUTENV)
+ static void unsetenv(const char *k)
+ {
+ 	char b[256];
+ 	evutil_snprintf(b, sizeof(b), "%s=",k);
+ 	putenv(b);
+ }
++#define UNSETENV_OK
++#endif
++
++#if defined(SETENV_OK) && defined(UNSETENV_OK)
++static void
++methodname_to_envvar(const char *mname, char *buf, size_t buflen)
++{
++	char *cp;
++	evutil_snprintf(buf, buflen, "EVENT_NO%s", mname);
++	for (cp = buf; *cp; ++cp) {
++		*cp = toupper(*cp);
++	}
++}
+ #endif
+ 
+ static void
+ test_base_environ(void *arg)
+ {
++	struct event_base *base = NULL;
++	struct event_config *cfg = NULL;
++
++#if defined(SETENV_OK) && defined(UNSETENV_OK)
+ 	const char **basenames;
+ 	char varbuf[128];
+ 	int i, n_methods=0;
+-	struct event_base *base = NULL;
+-	struct event_config *cfg = NULL;
+ 	const char *defaultname;
+ 
+ 	basenames = event_get_supported_methods();
+@@ -1757,6 +1770,9 @@ test_base_environ(void *arg)
+ 	base = event_base_new_with_config(cfg);
+ 	tt_assert(base);
+ 	tt_str_op(defaultname, ==, event_base_get_method(base));
++#else
++	tt_skip();
++#endif
+ 
+ end:
+ 	if (base)
+-- 
+1.6.0.5
+

Added: csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch
===================================================================
--- csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch	                        (rev 0)
+++ csw/mgar/pkg/libevent/branches/libevent-2.0.3-alpha/files/0001-Fix-getaddrinfo-with-protocol-unset-on-Solaris-9.patch	2010-05-07 09:42:25 UTC (rev 9827)
@@ -0,0 +1,115 @@
+From af71b4553549bced3cae1b51cc17c42ce8dc2bb0 Mon Sep 17 00:00:00 2001
+From: Nick Mathewson <nickm at torproject.org>
+Date: Wed, 21 Apr 2010 11:57:55 -0400
+Subject: [PATCH] Fix getaddrinfo with protocol unset on Solaris 9.  Found by Dagobert Michelsen
+
+Apparently when you call Solaris 9's getaddrinfo() with socktype set,
+but protocol unset, it likes to leave ai_protocol unset in the result.
+This is no way to behave, if I'm reading RFC3493 right.
+
+This patch makes us check for a getaddrinfo() that's broken in this way,
+and work around it by trying to infer socktype and protocol from one
+another.
+
+Possible partial bugfix for 2987542
+---
+ evutil.c |   46 ++++++++++++++++++++++++++++++++++++----------
+ 1 files changed, 36 insertions(+), 10 deletions(-)
+
+diff --git a/evutil.c b/evutil.c
+index 2509f17..9d36941 100644
+--- a/evutil.c
++++ b/evutil.c
+@@ -959,6 +959,10 @@ evutil_adjust_hints_for_addrconfig(struct evutil_addrinfo *hints)
+ }
+ 
+ #ifdef USE_NATIVE_GETADDRINFO
++static int need_numeric_port_hack_=0;
++static int need_socktype_protocol_hack_=0;
++static int tested_for_getaddrinfo_hacks=0;
++
+ /* Some older BSDs (like OpenBSD up to 4.6) used to believe that
+    giving a numeric port without giving an ai_socktype was verboten.
+    We test for this so we can apply an appropriate workaround.  If it
+@@ -973,17 +977,17 @@ evutil_adjust_hints_for_addrconfig(struct evutil_addrinfo *hints)
+ 
+    We test for this bug at runtime, since otherwise we can't have the
+    same binary run on multiple BSD versions.
++
++   - Some versions of Solaris believe that if the protocol field isn't
++   specified, it's nice to leave it as 0. We test for this so we can apply an
++   appropriate workaround.
+ */
+-static int
+-need_numeric_port_hack(void)
++static void
++test_for_getaddrinfo_hacks(void)
+ {
+-	static int tested=0;
+-	static int need_hack=0;
+ 	int r, r2;
+ 	struct evutil_addrinfo *ai=NULL, *ai2=NULL;
+ 	struct evutil_addrinfo hints;
+-	if (tested)
+-		return need_hack;
+ 
+ 	memset(&hints,0,sizeof(hints));
+ 	hints.ai_family = PF_UNSPEC;
+@@ -999,21 +1003,40 @@ need_numeric_port_hack(void)
+ 	hints.ai_socktype = SOCK_STREAM;
+ 	r2 = getaddrinfo("1.2.3.4", "80", &hints, &ai2);
+ 	if (r2 == 0 && r != 0) {
+-		need_hack=1;
++		need_numeric_port_hack_=1;
++	}
++	if (ai2 && ai2->ai_protocol == 0) {
++		need_socktype_protocol_hack_=1;
+ 	}
++
+ 	if (ai)
+ 		freeaddrinfo(ai);
+ 	if (ai2)
+ 		freeaddrinfo(ai2);
+-	tested = 1;
+-	return need_hack;
++	tested_for_getaddrinfo_hacks=1;
++}
++
++static inline int
++need_numeric_port_hack(void)
++{
++	if (!tested_for_getaddrinfo_hacks)
++		test_for_getaddrinfo_hacks();
++	return need_numeric_port_hack_;
++}
++
++static inline int
++need_socktype_protocol_hack(void)
++{
++	if (!tested_for_getaddrinfo_hacks)
++		test_for_getaddrinfo_hacks();
++	return need_socktype_protocol_hack_;
+ }
+ 
+ static void
+ apply_numeric_port_hack(int port, struct evutil_addrinfo **ai)
+ {
+ 	/* Now we run through the list and set the ports on all of the
+-	 * results where ports */
++	 * results where ports would make sense. */
+ 	for ( ; *ai; ai = &(*ai)->ai_next) {
+ 		struct sockaddr *sa = (*ai)->ai_addr;
+ 		if (sa && sa->sa_family == AF_INET) {
+@@ -1100,6 +1123,9 @@ evutil_getaddrinfo(const char *nodename, const char *servname,
+ 		servname = NULL;
+ 	}
+ 
++	if (need_socktype_protocol_hack())
++		evutil_getaddrinfo_infer_protocols(&hints);
++
+ 	/* Make sure that we didn't actually steal any AI_FLAGS values that
+ 	 * the system is using.  (This is a constant expression, and should ge
+ 	 * optimized out.)
+-- 
+1.6.6.1
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list