diff mbox

[ovs-dev] debian : upstream_version fix

Message ID 397FD63D94A70042B39B21380C6225A829B0C36E@ESESSMB305.ericsson.se
State Deferred
Headers show

Commit Message

Zoltan Balogh March 16, 2016, 12:10 p.m. UTC
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@ericsson.com>

---

Comments

Ben Pfaff March 23, 2016, 3:41 p.m. UTC | #1
On Wed, Mar 16, 2016 at 12:10:35PM +0000, Zoltán Balogh wrote:
> 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.

I don't understand the problem.  Currently the Debian version number is
2.5.90-1.  This filters it to 2.5.90.  What's the problem?

We've never used a version number like 3:2.5.0-myOvs-12-1, where does
that come from?
Zoltan Balogh March 23, 2016, 9:05 p.m. UTC | #2
Hi Ben,

Currently, this is not a problem for vanilla OVS. Our team faced this problem as we added extensions to OVS and wanted to distinguish our debian packages and running ovs-vswitchd from vanilla 2.5.0 version.
We added a postfix string including a hyphen to the upstream version and that broke installation of datapath-dkms package.

Best regards,
Zoltán


-----Original Message-----
From: Ben Pfaff [mailto:blp@ovn.org] 
Sent: Wednesday, March 23, 2016 4:41 PM
To: Zoltán Balogh
Cc: dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH] debian : upstream_version fix

On Wed, Mar 16, 2016 at 12:10:35PM +0000, Zoltán Balogh wrote:
> 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.

I don't understand the problem.  Currently the Debian version number is 2.5.90-1.  This filters it to 2.5.90.  What's the problem?

We've never used a version number like 3:2.5.0-myOvs-12-1, where does that come from?
Ben Pfaff March 23, 2016, 9:17 p.m. UTC | #3
Can you resubmit the patch with more information in the commit message,
then?

On Wed, Mar 23, 2016 at 09:05:17PM +0000, Zoltán Balogh wrote:
> Hi Ben,
> 
> Currently, this is not a problem for vanilla OVS. Our team faced this problem as we added extensions to OVS and wanted to distinguish our debian packages and running ovs-vswitchd from vanilla 2.5.0 version.
> We added a postfix string including a hyphen to the upstream version and that broke installation of datapath-dkms package.
> 
> Best regards,
> Zoltán
> 
> 
> -----Original Message-----
> From: Ben Pfaff [mailto:blp@ovn.org] 
> Sent: Wednesday, March 23, 2016 4:41 PM
> To: Zoltán Balogh
> Cc: dev@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH] debian : upstream_version fix
> 
> On Wed, Mar 16, 2016 at 12:10:35PM +0000, Zoltán Balogh wrote:
> > 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.
> 
> I don't understand the problem.  Currently the Debian version number is 2.5.90-1.  This filters it to 2.5.90.  What's the problem?
> 
> We've never used a version number like 3:2.5.0-myOvs-12-1, where does that come from?
diff mbox

Patch

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)))