[ovs-dev] [PATCH] debian : upstream_version fix

Zoltán Balogh zoltan.balogh at ericsson.com
Wed Mar 16 12:10:35 UTC 2016


Hi,

The Debian Policy Manual (https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version) says that the upstream_version may contain only alphanumerics and the characters . + - : ~ (full stop, plus, hyphen, colon, tilde) and should start with a digit.

Currently, the upstream_version is defined in the debian/rules file:

DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]:)*([^-]+).*,\2,p')

The version number is taken from the dpkg-parsechangelog printout then the first part of the version number which does not contain hyphen is filtered out with sed. However the Debian Policy Manual says that hyphen is allowed in the upstream_version. e.g. in case of 3:2.5.0-myOvs-12-1 the upstream_version should be 2.5.0-myOvs-12, but current implementation will filter it to 2.5.0.
I think the following patch solves this problem.

Signed-off-by: Zoltán Balogh <zoltan.balogh at ericsson.com>

---

diff --git a/debian/rules b/debian/rules
index d8e90c7..70539ab 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,7 +13,9 @@
 
 PACKAGE=openvswitch
 PACKAGE_DKMS=openvswitch-datapath-dkms
-DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]:)*([^-]+).*,\2,p')
+DEB_VERSION=$(shell dpkg-parsechangelog | awk '/^Version: / {print $$2}' | sed -rne 's,([0-9]:)+([.])*,\2,p')
+DEB_REVISION=$(shell expr "$(DEB_VERSION)" : '.*\(-.*\)' )
+DEB_UPSTREAM_VERSION=$(shell version=$(DEB_VERSION); expr + $${version%"$(DEB_REVISION)"})
 
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))




More information about the dev mailing list