[SCM] Apache ZooKeeper branch, master, updated. debian/3.3.4+dfsg1-2-5-g954cd54
James Page
james.page at ubuntu.com
Mon Jan 30 22:07:06 UTC 2012
The following commit has been merged in the master branch:
commit 59a09594315fea644aa301f633fb37221d6ed4de
Author: James Page <james.page at ubuntu.com>
Date: Mon Jan 30 13:22:19 2012 +0000
Sync changes from Ubuntu:
* Sync changes from Ubuntu:
- Switch zookeeperd upstart configuration to use start-stop-daemon.
Thanks to Clint Byrum for this fix.
- Enable C and Java test suites:
- d/patches/fixes/ZOOKEEPER-1374: Use __sync_* primitives
instead of ASM code when avaliable to improve portability across
supported platforms.
- d/patches/fix-broken-c-client-test.patch: Fixes the unit test so
it will pass with EINVAL which is the correct error. Thanks to
Clint Byrum for this fix.
- d/rules: Enable C client test suite for all architectures.
- d/rules: Only run core Java test suite when building
Architecture: all packages.
diff --git a/debian/changelog b/debian/changelog
index 86bb70c..70ae10a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+zookeeper (3.3.4+dfsg1-3) unstable; urgency=low
+
+ * Sync changes from Ubuntu:
+ - Switch zookeeperd upstart configuration to use start-stop-daemon.
+ Thanks to Clint Byrum for this fix.
+ - Enable C and Java test suites:
+ - d/patches/fixes/ZOOKEEPER-1374: Use __sync_* primitives
+ instead of ASM code when avaliable to improve portability across
+ supported platforms.
+ - d/patches/fix-broken-c-client-test.patch: Fixes the unit test so
+ it will pass with EINVAL which is the correct error. Thanks to
+ Clint Byrum for this fix.
+ - d/rules: Enable C client test suite for all architectures.
+ - d/rules: Only run core Java test suite when building
+ Architecture: all packages.
+
+ -- James Page <james.page at ubuntu.com> Mon, 30 Jan 2012 13:21:21 +0000
+
zookeeper (3.3.4+dfsg1-2) unstable; urgency=low
* Added new libzookeeper-st{2,-dev} packages (Closes: #650938) and
diff --git a/debian/control b/debian/control
index 017d916..ef9db1f 100644
--- a/debian/control
+++ b/debian/control
@@ -68,7 +68,7 @@ Description: High-performance coordination service for distributed applications
Package: zookeeperd
Architecture: all
-Depends: zookeeper (= ${binary:Version}), ${misc:Depends}, ${zookeeperd-deps}
+Depends: zookeeper (= ${binary:Version}), ${misc:Depends}, lsb-base (>= 3.2-14)
Description: Init control scripts for zookeeper
ZooKeeper is a centralized, reliable, service for maintaining configuration
information, naming, providing distributed synchronization, and group
diff --git a/debian/debian_control_vars b/debian/debian_control_vars
deleted file mode 100644
index c83f47f..0000000
--- a/debian/debian_control_vars
+++ /dev/null
@@ -1 +0,0 @@
-zookeeperd-deps= lsb-base (>= 3.2-14)
diff --git a/debian/patches/fix-broken-c-client-unittest.patch b/debian/patches/fix-broken-c-client-unittest.patch
new file mode 100644
index 0000000..3f8afd9
--- /dev/null
+++ b/debian/patches/fix-broken-c-client-unittest.patch
@@ -0,0 +1,20 @@
+Description: Loosens C client unit test to allow multiple errors
+ The test incorrectly assumes that ENOENT will eb returned on a clearly
+ incorrectly formatted hostname. Some other C library implementations
+ may do this, so we accept ENOENT or EINVAL.
+Author: Clint Byrum <clint at ubuntu.com>
+Bug: https://issues.apache.org/jira/browse/ZOOKEEPER-1353
+Bug-Ubuntu: http://pad.lv/912935
+Forwarded: yes
+
+--- zookeeper-3.3.4+dfsg1.orig/src/c/tests/TestZookeeperInit.cc
++++ zookeeper-3.3.4+dfsg1/src/c/tests/TestZookeeperInit.cc
+@@ -230,7 +230,7 @@ public:
+ const string INVALID_HOST("host1:1111+host:123");
+ zh=zookeeper_init(INVALID_HOST.c_str(),0,0,0,0,0);
+ CPPUNIT_ASSERT(zh==0);
+- CPPUNIT_ASSERT_EQUAL(ENOENT,errno);
++ CPPUNIT_ASSERT((ENOENT|EINVAL) & errno);
+ }
+ void testNonexistentHost()
+ {
diff --git a/debian/patches/fixes/ZOOKEEPER-1374 b/debian/patches/fixes/ZOOKEEPER-1374
new file mode 100644
index 0000000..3b75735
--- /dev/null
+++ b/debian/patches/fixes/ZOOKEEPER-1374
@@ -0,0 +1,39 @@
+Description: Use __sync primitives for better cross platform support when
+ compiling with gcc.
+Origin: https://issues.apache.org/jira/browse/ZOOKEEPER-1374
+
+Index: zookeeper/src/c/tests/ThreadingUtil.cc
+===================================================================
+--- zookeeper.orig/src/c/tests/ThreadingUtil.cc 2012-01-27 22:36:14.696423169 +0000
++++ zookeeper/src/c/tests/ThreadingUtil.cc 2012-01-27 22:36:46.460422374 +0000
+@@ -47,6 +47,9 @@
+ // Atomics
+ int32_t atomic_post_incr(volatile int32_t* operand, int32_t incr)
+ {
++#if defined(__GNUC__)
++ return __sync_fetch_and_add(operand,incr);
++#else
+ int32_t result;
+ __asm__ __volatile__(
+ "lock xaddl %0,%1\n"
+@@ -54,15 +57,20 @@
+ : "0"(incr)
+ : "memory");
+ return result;
++#endif
+ }
+ int32_t atomic_fetch_store(volatile int32_t *ptr, int32_t value)
+ {
++#if defined(__GNUC__)
++ return __sync_lock_test_and_set(ptr,value);
++#else
+ int32_t result;
+ __asm__ __volatile__("lock xchgl %0,%1\n"
+ : "=r"(result), "=m"(*ptr)
+ : "0"(value)
+ : "memory");
+ return result;
++#endif
+ }
+ #else
+ int32_t atomic_post_incr(volatile int32_t* operand, int32_t incr){
diff --git a/debian/patches/series b/debian/patches/series
index 947159a..1e279d4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ debian/patch-build-system
debian/disable-cygwin-detection
fixes/ZOOKEEPER-705
fixes/ZOOKEEPER-1033
+fix-broken-c-client-unittest.patch
+fixes/ZOOKEEPER-1374
diff --git a/debian/rules b/debian/rules
index 429ba63..658d018 100755
--- a/debian/rules
+++ b/debian/rules
@@ -52,21 +52,26 @@ override_dh_install:
done
dh_install
-#ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
-#override_dh_auto_test-arch:
-# # C testing starts/stops zookeeper
-# # this ensures that all the right classes are found
-# for jar in jline log4j-1.2 xercesImpl xmlParserAPIs; do \
-# ln -sf /usr/share/java/$$jar.jar build/lib/$$jar.jar; \
-# done;
-# # Execute multi-threaded test suite
-# $(MAKE) -C src/c zktest-mt
-# cd src/c && ./zktest-mt
-#
-#override_dh_auto_test-indep:
-# # Run core Java test suite against zookeeper
-# ant -Dversion=$(DEB_UPSTREAM_VERSION) -DlastRevision=-1 test-core-java
-#endif
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+override_dh_auto_test-arch:
+ # C testing starts/stops zookeeper
+ # this ensures that all the right classes are found
+ for jar in jline log4j-1.2 xercesImpl xmlParserAPIs; do \
+ ln -sf /usr/share/java/$$jar.jar build/lib/$$jar.jar; \
+ done;
+ # Execute multi-threaded test suite
+ $(MAKE) -C src/c zktest-mt
+ cd src/c && ./zktest-mt
+
+# Only run core Java unit tests on i386 architecture as this is the arch
+# that they are built and published on - works around -indep not working
+# in Ubuntu.
+ifeq (i386, $(DEB_BUILD_ARCH))
+override_dh_auto_test-indep:
+ # Run core Java test suite against zookeeper
+ ant -Dversion=$(DEB_UPSTREAM_VERSION) -DlastRevision=-1 test-core-java
+endif
+endif
override_dh_clean:
dh_clean --exclude=src/java \
@@ -130,11 +135,3 @@ override_dh_installinit:
cp debian/zookeeperd.upstart.in debian/zookeeperd.upstart ; \
fi
dh_installinit -d
-
-# init/upstart require difference dependencies for zookeeperd
-override_dh_gencontrol:
- if dpkg-vendor --derives-from ubuntu ; then \
- dh_gencontrol -- -T$(CURDIR)/debian/ubuntu_control_vars ; \
- else \
- dh_gencontrol -- -T$(CURDIR)/debian/debian_control_vars ; \
- fi
diff --git a/debian/ubuntu_control_vars b/debian/ubuntu_control_vars
deleted file mode 100644
index e551528..0000000
--- a/debian/ubuntu_control_vars
+++ /dev/null
@@ -1 +0,0 @@
-zookeeperd-deps= daemon
diff --git a/debian/zookeeperd.upstart.in b/debian/zookeeperd.upstart.in
index 3354657..167ae02 100644
--- a/debian/zookeeperd.upstart.in
+++ b/debian/zookeeperd.upstart.in
@@ -21,7 +21,7 @@ script
if [ -z "$JMXDISABLE" ]; then
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY"
fi
- exec daemon --name=zookeeper --inherit --user=$USER \
- -- $JAVA -cp $CLASSPATH $JAVA_OPTS -Dzookeeper.log.dir=${ZOO_LOG_DIR} \
+ exec start-stop-daemon --start -c $USER --exec $JAVA --name zookeeper \
+ -- -cp $CLASSPATH $JAVA_OPTS -Dzookeeper.log.dir=${ZOO_LOG_DIR} \
-Dzookeeper.root.logger=${ZOO_LOG4J_PROP} $ZOOMAIN $ZOOCFG
end script
--
Apache ZooKeeper
More information about the pkg-java-commits
mailing list