From 6e9aa5b21b839b45e9d71c150b0efd013bde2cbd Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 24 Aug 2012 17:10:43 +0000 Subject: [PATCH] Merge r10645, r10647, r10659, r10667 from trunk * make $admin::VERSION UNIVERSAL-compatible * fix precedence hickup (perls "or" has actually the lowest and not the same as "||") * Update debian packaging regarding VERSION/BUILD_VERSION * Release new version 3.4.3 --- debian/changelog | 11 +++++++++++ debian/rules | 10 +++++++--- lib/admin.pm | 6 +++++- lib/admin/Controller/Root.pm | 2 ++ lib/admin/Controller/subscriber.pm | 2 +- root/layout/footer | 2 +- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18b28f6..5273b7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +ngcp-www-admin (3.4.3) unstable; urgency=low + + [ Michael Prokop ] + * Update debian packaging regarding VERSION/BUILD_VERSION + + [ Christian Veigl ] + * fix precedence hickup + * make $admin::VERSION UNIVERSAL-compatible + + -- Michael Prokop Fri, 24 Aug 2012 18:38:23 +0200 + ngcp-www-admin (3.4.2) unstable; urgency=low [ mprokop ] diff --git a/debian/rules b/debian/rules index 7fcdebb..5d2b6b9 100755 --- a/debian/rules +++ b/debian/rules @@ -10,13 +10,16 @@ # export DH_VERBOSE=1 b=$(CURDIR)/debian/build -VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }') +VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }' | sed 's/+.*//') +BUILD_VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }') build: build-stamp build-stamp: dh_testdir - egrep -q "VERSION = 'UNRELEASED'" lib/admin.pm || \ + egrep -q "\$VERSION = 'VERSION'" lib/admin.pm || \ + (echo "Wrong version in lib/csc.pm" && exit 2) + egrep -q "\$BUILD_VERSION = 'BUILD_VERSION'" lib/admin.pm || \ (echo "Wrong version in lib/csc.pm" && exit 2) mkdir -p pro/etc/ngcp-www-admin pro/etc/apache2/sites-available mkdir -p ce/etc/ngcp-www-admin ce/etc/apache2/sites-available @@ -47,7 +50,8 @@ ngcp-www-admin: dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ dh_install -p$@ -P$(b)/$@ - sed -i -e "s/VERSION = 'UNRELEASED'/VERSION = '$(VERSION)'/" $(b)/$@/usr/share/ngcp-www-admin/lib/admin.pm + sed -i -e "s/VERSION = 'VERSION'/VERSION = '$(VERSION)'/" $(b)/$@/usr/share/ngcp-www-admin/lib/admin.pm + sed -i -e "s/BUILD_VERSION = 'BUILD_VERSION'/BUILD_VERSION = '$(BUILD_VERSION)'/" $(b)/$@/usr/share/ngcp-www-admin/lib/admin.pm dh_installexamples -p$@ -P$(b)/$@ dh_installman -p$@ -P$(b)/$@ # drop svn files: diff --git a/lib/admin.pm b/lib/admin.pm index b634044..294ad11 100644 --- a/lib/admin.pm +++ b/lib/admin.pm @@ -21,7 +21,11 @@ use Catalyst qw/ConfigLoader Static::Simple Unicode Session Session::Store::FastMmap Session::State::Cookie /; -our $VERSION = 'UNRELEASED'; +# $VERSION and $BUILD_VERSION will be set during the build-process of the debian package +# In addition to the known $VERSION the variable $BUILD_VERSION may contain more information +# about the build. A much more relaxed syntax is possible here. See also: debian/rules. +our $VERSION = 'VERSION'; +our $BUILD_VERSION = 'BUILD_VERSION'; # Configure the application. # diff --git a/lib/admin/Controller/Root.pm b/lib/admin/Controller/Root.pm index 468c106..2989355 100644 --- a/lib/admin/Controller/Root.pm +++ b/lib/admin/Controller/Root.pm @@ -31,6 +31,8 @@ Verify user is logged in. sub auto : Private { my ($self, $c) = @_; + $c->stash->{build_version} = $admin::BUILD_VERSION; + if ($c->controller =~ /^admin::Controller::Root\b/ or $c->controller =~ /^admin::Controller::login\b/) { diff --git a/lib/admin/Controller/subscriber.pm b/lib/admin/Controller/subscriber.pm index a0e4e63..e865c15 100644 --- a/lib/admin/Controller/subscriber.pm +++ b/lib/admin/Controller/subscriber.pm @@ -169,7 +169,7 @@ sub detail : Local { config->{VARIABLES}{site_config}{language}, 'Web.Subscriber.Lock'.$$preferences{lock}) if $$preferences{lock}; - $c->stash->{subscriber}{lock} = $$preferences{lock} or 'none'; + $c->stash->{subscriber}{lock} = ($$preferences{lock} or 'none'); } else { $c->stash->{account_id} = $c->request->params->{account_id}; diff --git a/root/layout/footer b/root/layout/footer index 7553d9a..c3675f1 100644 --- a/root/layout/footer +++ b/root/layout/footer @@ -1,7 +1,7 @@