[libapache-session-memcached-perl] 02/02: Unapplied grammar patch, renamed to grammar.patch Created test-env-var.patch which allows Memcached port to be specified in an environment variable when testing. Updated debian/rules and debian/tests/custom_smoke to use this.
Christopher Hoskin
christopher.hoskin at gmail.com
Sun Feb 8 23:46:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
grinorcole-guest pushed a commit to branch master
in repository libapache-session-memcached-perl.
commit 7e403cea1ece21587fe7443a8acca44fb2d86d7a
Author: Christopher Hoskin <christopher.hoskin at gmail.com>
Date: Sun Feb 8 23:39:33 2015 +0000
Unapplied grammar patch, renamed to grammar.patch
Created test-env-var.patch which allows Memcached port to be specified
in an environment variable when testing. Updated debian/rules and
debian/tests/custom_smoke to use this.
---
debian/changelog | 19 -------------------
debian/control | 5 +++--
debian/patches/grammar | 33 ---------------------------------
debian/patches/grammar.patch | 16 ++++++++++++++++
debian/patches/series | 3 ++-
debian/patches/test-env-var.patch | 25 +++++++++++++++++++++++++
debian/rules | 6 +++++-
debian/tests/control | 2 +-
debian/tests/custom_smoke | 6 +++++-
lib/Apache/Session/Memcached.pm | 2 +-
10 files changed, 58 insertions(+), 59 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f0c5a18..f0bd98f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,25 +9,6 @@ libapache-session-memcached-perl (0.03-1) UNRELEASED; urgency=low
+ version can be removed from libapache-session-perl and
libcache-memcached-perl, there's nothing older in the archive
(tip: cme is helpful for this kind of check)
- - d/rules / override_dh_autotest:
- this doesn't work. output:
- TEMPDIR=`mktemp -d`
- /usr/bin/memcached -u `whoami` -p 20000 -P/m.pid -d
- ..
- [ ! -s m.pid ] || /bin/kill `cat /m.pid`
- (make is not shell, and the dir is missing in the last line; memcached is
- never killed, TEMPDIR never set; kill needs procps)
-
- libmongodb-perl/debian/rules has an example
-
- ok, since I was curious I've tried to fix it now in d/rules and d/control
- :) please check
- - autopktest (declared in d/control) fail, because the smoke tests fail,
- because there's no running memcached. I've add debian/tests/pkg-perl/SKIP
- now.
- - the tests complain about:
- Use of uninitialized value $proto in socket at /usr/share/perl5/Cache/Memcached.pm line 300, <CFG> line 1.
- -> add 'netbase' to Build-Depends-Indep
* Initial Release. Closes: #775796
diff --git a/debian/control b/debian/control
index 7e7987f..20d83d6 100644
--- a/debian/control
+++ b/debian/control
@@ -3,11 +3,12 @@ Section: perl
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Christopher Hoskin <christopher.hoskin at gmail.com>
-Build-Depends: debhelper (>= 9), memcached
+Build-Depends: debhelper (>= 9), memcached, net-tools
Build-Depends-Indep: perl,
libapache-session-perl (>= 1.54),
libcache-memcached-perl (>= 1.14),
- procps
+ procps,
+ netbase
Standards-Version: 3.9.6
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libapache-session-memcached-perl.git
Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libapache-session-memcached-perl.git
diff --git a/debian/patches/grammar b/debian/patches/grammar
deleted file mode 100644
index 81bec1e..0000000
--- a/debian/patches/grammar
+++ /dev/null
@@ -1,33 +0,0 @@
-Description: Minor grammar corrections
- Minor grammar corrections
- .
- libapache-session-memcached-perl (0.03-1) UNRELEASED; urgency=low
- .
- * Initial Release. Closes: #775796
-Author: Christopher Hoskin <christopher.hoskin at gmail.com>
-Bug-Debian: https://bugs.debian.org/775796
-
----
-The information above should follow the Patch Tagging Guidelines, please
-checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
-are templates for supplementary fields that you might want to add:
-
-Origin: <vendor|upstream|other>, <url of original patch>
-Bug: <url in upstream bugtracker>
-Bug-Debian: https://bugs.debian.org/<bugnumber>
-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
-Forwarded: <no|not-needed|url proving that it has been forwarded>
-Reviewed-By: <name and email of someone who approved the patch>
-Last-Update: <YYYY-MM-DD>
-
---- libapache-session-memcached-perl-0.03.orig/lib/Apache/Session/Memcached.pm
-+++ libapache-session-memcached-perl-0.03/lib/Apache/Session/Memcached.pm
-@@ -46,7 +46,7 @@ cache daemon) for Apache::Session storag
- Apache::Session::Memcached is a bridge between Apache::Session and
- memcached, a distributed memory cache daemon.
-
--More informations about memcached are available at
-+More information about memcached is available at
- L<http://www.danga.com/memcached>.
-
- This module provides a way to use Cache::Memcached (memcached Perl API) as
diff --git a/debian/patches/grammar.patch b/debian/patches/grammar.patch
new file mode 100644
index 0000000..72aa169
--- /dev/null
+++ b/debian/patches/grammar.patch
@@ -0,0 +1,16 @@
+Description: Minor grammar corrections
+Author: Christopher Hoskin <christopher.hoskin at gmail.com>
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=102007
+Last-Update: 2015-02-08
+
+--- libapache-session-memcached-perl-0.03.orig/lib/Apache/Session/Memcached.pm
++++ libapache-session-memcached-perl-0.03/lib/Apache/Session/Memcached.pm
+@@ -46,7 +46,7 @@ cache daemon) for Apache::Session storag
+ Apache::Session::Memcached is a bridge between Apache::Session and
+ memcached, a distributed memory cache daemon.
+
+-More informations about memcached are available at
++More information about memcached is available at
+ L<http://www.danga.com/memcached>.
+
+ This module provides a way to use Cache::Memcached (memcached Perl API) as
diff --git a/debian/patches/series b/debian/patches/series
index ab0f349..a44ee95 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
-grammar
+grammar.patch
+test-env-var.patch
diff --git a/debian/patches/test-env-var.patch b/debian/patches/test-env-var.patch
new file mode 100644
index 0000000..72174ea
--- /dev/null
+++ b/debian/patches/test-env-var.patch
@@ -0,0 +1,25 @@
+Description: Allow override of test config by environment variables
+ The get_config sub in t/testlib.pl has been modified so that an environment
+ variable named MEMCACHED_param will override the parameter param in the config
+ file t/CONFIG. This is useful, for example, when the port number is determined
+ on the fly during automated testing.
+Author: Christopher Hoskin <christopher.hoskin at gmail.com>
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=102008
+Last-Update: 2015-02-08
+
+--- a/t/testlib.pl
++++ b/t/testlib.pl
+@@ -12,8 +12,11 @@
+
+ sub get_config {
+ my ($config, $param) = @_;
+- if ($config =~ /^$param\s*?=\s*(.*?)$/m) {
+- return $1;
++ if (exists $ENV{"MEMCACHED_$param"}) {
++ return $ENV{"MEMCACHED_$param"};
++ }
++ elsif ($config =~ /^$param\s*?=\s*(.*?)$/m) {
++ return $1;
+ }
+ return '';
+ }
diff --git a/debian/rules b/debian/rules
index baa776b..9037fb3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,8 +1,11 @@
#!/usr/bin/make -f
+#Inspired by libmongodb-perl
BUILDHOME = $(CURDIR)/debian/build
PIDFILE = $(BUILDHOME)/mongod.pid
WHOAMI = $(shell whoami)
+PORT := $(shell /bin/netstat -want | perl -w -e 'while (<>) { $$used{$$1}=1 if /127\.0\.0\.1:(\d+)/;}; $$port = 20000; while ($$used{$$port}) { $$port++ }; print "$$port\n";')
+#MEMCACHED_SERVERS = localhost:$(PORT)
%:
dh $@
@@ -10,7 +13,8 @@ WHOAMI = $(shell whoami)
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
mkdir -p $(BUILDHOME)
- memcached -u $(WHOAMI) -p 20000 -P $(PIDFILE) -d
+ memcached -u $(WHOAMI) -p $(PORT) -P $(PIDFILE) -d
+ export MEMCACHED_Servers=127.0.0.1:$(PORT);\
dh_auto_test
[ ! -s $(PIDFILE) ] || /bin/kill `cat $(PIDFILE)`
endif
diff --git a/debian/tests/control b/debian/tests/control
index dcf30bd..00e1e6e 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -12,4 +12,4 @@ Test-Command: /usr/share/pkg-perl-autopkgtest/runner heavy-deps
Depends: @, pkg-perl-autopkgtest, pkg-perl-autopkgtest-heavy
Tests: custom_smoke
-Depends: @, memcached, procps, pkg-perl-autopkgtest
+Depends: @, memcached, procps, pkg-perl-autopkgtest, net-tools, netbase
diff --git a/debian/tests/custom_smoke b/debian/tests/custom_smoke
index d880abc..6af345b 100644
--- a/debian/tests/custom_smoke
+++ b/debian/tests/custom_smoke
@@ -1,8 +1,12 @@
#!/bin/sh
PIDFILE=${ADTTMP}/m.pid
+PORT=$(/bin/netstat -want | perl -w -e 'while (<>) { $used{$1}=1 if /127\.0\.0\.1:(\d+)/;}; $port = 20000; while ($used{$port}) { $port++ }; print "$port\n";')
+export MEMCACHED_Servers=127.0.0.1:${PORT}
-/usr/bin/memcached -u `whoami` -p 20000 -P$PIDFILE -d
+echo $MEMCACHED_SERVERS
+
+/usr/bin/memcached -u `whoami` -p$PORT -P$PIDFILE -d
/usr/share/pkg-perl-autopkgtest/build-deps.d/smoke
RET=$?
[ ! -s $PIDFILE ] || /bin/kill `cat ${PIDFILE}`
diff --git a/lib/Apache/Session/Memcached.pm b/lib/Apache/Session/Memcached.pm
index 86dcb21..8ee5010 100644
--- a/lib/Apache/Session/Memcached.pm
+++ b/lib/Apache/Session/Memcached.pm
@@ -46,7 +46,7 @@ cache daemon) for Apache::Session storage
Apache::Session::Memcached is a bridge between Apache::Session and
memcached, a distributed memory cache daemon.
-More information about memcached is available at
+More informations about memcached are available at
L<http://www.danga.com/memcached>.
This module provides a way to use Cache::Memcached (memcached Perl API) as
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libapache-session-memcached-perl.git
More information about the Pkg-perl-cvs-commits
mailing list