diff mbox

[ovs-dev] debian: Fix upgrade from OVS-2.5 to newer OVS.

Message ID 1466192550-7579-1-git-send-email-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer June 17, 2016, 7:42 p.m. UTC
Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
shifted a file between debian packages, but didn't update the
destination package annotations to indicate that it replaces a file
from earlier versions of the source package.

As a result, if one installs openvswitch-switch-2.5* and then tries to
upgrade to openvswitch-{switch,common}-2.5.90+, the install of
openvswitch-common will fail like the following:

dpkg: error processing archive
/tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
also in package openvswitch-switch 2.5.0-1

Fix the issue by adding "Replaces" and "Breaks" tags to the new
openvswitch-common section of debian/control.

Fixes: 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 debian/control | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joe Stringer June 17, 2016, 7:46 p.m. UTC | #1
On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
> Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> shifted a file between debian packages, but didn't update the
> destination package annotations to indicate that it replaces a file
> from earlier versions of the source package.
>
> As a result, if one installs openvswitch-switch-2.5* and then tries to
> upgrade to openvswitch-{switch,common}-2.5.90+, the install of
> openvswitch-common will fail like the following:
>
> dpkg: error processing archive
> /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
> trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
> also in package openvswitch-switch 2.5.0-1
>
> Fix the issue by adding "Replaces" and "Breaks" tags to the new
> openvswitch-common section of debian/control.

s/new//g
Daniele Di Proietto June 21, 2016, 6:43 p.m. UTC | #2
This looks good to me according to the debian policy manual:

https://www.debian.org/doc/debian-policy/ch-relationships.html#s-replaces

Acked-by: Daniele Di Proietto <diproiettod@vmware.com>

I noticed is that if I try to upgrade from 2.5.0 to 2.5.90(with this
change) using dpkg from command line the results may vary:

`dpkg -i openvswitch-common_2.5.90-1_amd64.deb
openvswitch-switch_2.5.90-1_amd64.deb`

still complains, because openvswitch-common is processed first and that
breaks the installed openvswitch-switch. dpkg doesn't seem to be smart
enough to realize that openvswitch-switch is being updated as well. This is
the alphabetical order, which is used if someone types `dpkg -i *.deb`

`dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
openvswitch-common_2.5.90-1_amd64.deb`

instead seem to work.

I'd be curious to hear from someone more expert than me in debian packaging
if this should be considered a bug in dpkg, or (unlikely, given the
explicit instructions in the Debian Policy Manual) if there's a better way
to handle the file transition.

Thanks,

Daniele

2016-06-17 12:46 GMT-07:00 Joe Stringer <joe@ovn.org>:

> On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
> > Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> > shifted a file between debian packages, but didn't update the
> > destination package annotations to indicate that it replaces a file
> > from earlier versions of the source package.
> >
> > As a result, if one installs openvswitch-switch-2.5* and then tries to
> > upgrade to openvswitch-{switch,common}-2.5.90+, the install of
> > openvswitch-common will fail like the following:
> >
> > dpkg: error processing archive
> > /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
> > trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
> > also in package openvswitch-switch 2.5.0-1
> >
> > Fix the issue by adding "Replaces" and "Breaks" tags to the new
> > openvswitch-common section of debian/control.
>
> s/new//g
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
Gurucharan Shetty June 22, 2016, 6:30 p.m. UTC | #3
On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:

> Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> shifted a file between debian packages, but didn't update the
> destination package annotations to indicate that it replaces a file
> from earlier versions of the source package.
>
> As a result, if one installs openvswitch-switch-2.5* and then tries to
> upgrade to openvswitch-{switch,common}-2.5.90+, the install of
> openvswitch-common will fail like the following:
>
> dpkg: error processing archive
> /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
> trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
> also in package openvswitch-switch 2.5.0-1
>
> Fix the issue by adding "Replaces" and "Breaks" tags to the new
> openvswitch-common section of debian/control.
>
> Fixes: 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> Signed-off-by: Joe Stringer <joe@ovn.org>
>

One option is to move back ovs-lib to openvswitch-switch and make
ovn-common depend on openvswitch-switch too. ovn-common is used by
ovn-central and ovn-host and both of them have a dependency on
openvswitch-switch anyway, so it is probably not a bad thing.

Ben do you have any opinions on what is the "debain way" here?


> ---
>  debian/control | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/debian/control b/debian/control
> index 2c07a73cd60f..78e00045042d 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -63,6 +63,8 @@ Depends: openssl,
>           ${misc:Depends},
>           ${shlibs:Depends}
>  Suggests: ethtool
> +Replaces: openvswitch-switch (<< 2.5.90)
> +Breaks: openvswitch-switch (<< 2.5.90)
>  Description: Open vSwitch common components
>   Open vSwitch is a production quality, multilayer, software-based,
>   Ethernet virtual switch. It is designed to enable massive network
> --
> 2.8.2
>
>
Ben Pfaff June 25, 2016, 2:04 a.m. UTC | #4
dpkg is a pretty low-level tool that users wouldn't ordinarily use.
Users should ordinarily be using "apt" or something else that does
proper sequencing based on dependencies.

On Tue, Jun 21, 2016 at 11:43:53AM -0700, Daniele Di Proietto wrote:
> This looks good to me according to the debian policy manual:
> 
> https://www.debian.org/doc/debian-policy/ch-relationships.html#s-replaces
> 
> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
> 
> I noticed is that if I try to upgrade from 2.5.0 to 2.5.90(with this
> change) using dpkg from command line the results may vary:
> 
> `dpkg -i openvswitch-common_2.5.90-1_amd64.deb
> openvswitch-switch_2.5.90-1_amd64.deb`
> 
> still complains, because openvswitch-common is processed first and that
> breaks the installed openvswitch-switch. dpkg doesn't seem to be smart
> enough to realize that openvswitch-switch is being updated as well. This is
> the alphabetical order, which is used if someone types `dpkg -i *.deb`
> 
> `dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
> openvswitch-common_2.5.90-1_amd64.deb`
> 
> instead seem to work.
> 
> I'd be curious to hear from someone more expert than me in debian packaging
> if this should be considered a bug in dpkg, or (unlikely, given the
> explicit instructions in the Debian Policy Manual) if there's a better way
> to handle the file transition.
> 
> Thanks,
> 
> Daniele
> 
> 2016-06-17 12:46 GMT-07:00 Joe Stringer <joe@ovn.org>:
> 
> > On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
> > > Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> > > shifted a file between debian packages, but didn't update the
> > > destination package annotations to indicate that it replaces a file
> > > from earlier versions of the source package.
> > >
> > > As a result, if one installs openvswitch-switch-2.5* and then tries to
> > > upgrade to openvswitch-{switch,common}-2.5.90+, the install of
> > > openvswitch-common will fail like the following:
> > >
> > > dpkg: error processing archive
> > > /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
> > > trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
> > > also in package openvswitch-switch 2.5.0-1
> > >
> > > Fix the issue by adding "Replaces" and "Breaks" tags to the new
> > > openvswitch-common section of debian/control.
> >
> > s/new//g
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
> >
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Ben Pfaff June 25, 2016, 2:06 a.m. UTC | #5
On Wed, Jun 22, 2016 at 11:30:16AM -0700, Guru Shetty wrote:
> On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
> 
> > Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> > shifted a file between debian packages, but didn't update the
> > destination package annotations to indicate that it replaces a file
> > from earlier versions of the source package.
> >
> > As a result, if one installs openvswitch-switch-2.5* and then tries to
> > upgrade to openvswitch-{switch,common}-2.5.90+, the install of
> > openvswitch-common will fail like the following:
> >
> > dpkg: error processing archive
> > /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
> > trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
> > also in package openvswitch-switch 2.5.0-1
> >
> > Fix the issue by adding "Replaces" and "Breaks" tags to the new
> > openvswitch-common section of debian/control.
> >
> > Fixes: 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
> > Signed-off-by: Joe Stringer <joe@ovn.org>
> >
> 
> One option is to move back ovs-lib to openvswitch-switch and make
> ovn-common depend on openvswitch-switch too. ovn-common is used by
> ovn-central and ovn-host and both of them have a dependency on
> openvswitch-switch anyway, so it is probably not a bad thing.
> 
> Ben do you have any opinions on what is the "debain way" here?

I don't think there's anything wrong with that proposal but one wouldn't
normally make packaging choices on the basis that someone might type
dpkg commands in the wrong order.
Joe Stringer July 19, 2016, 6:15 p.m. UTC | #6
On 24 June 2016 at 19:06, Ben Pfaff <blp@ovn.org> wrote:
> On Wed, Jun 22, 2016 at 11:30:16AM -0700, Guru Shetty wrote:
>> On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
>>
>> > Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
>> > shifted a file between debian packages, but didn't update the
>> > destination package annotations to indicate that it replaces a file
>> > from earlier versions of the source package.
>> >
>> > As a result, if one installs openvswitch-switch-2.5* and then tries to
>> > upgrade to openvswitch-{switch,common}-2.5.90+, the install of
>> > openvswitch-common will fail like the following:
>> >
>> > dpkg: error processing archive
>> > /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
>> > trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
>> > also in package openvswitch-switch 2.5.0-1
>> >
>> > Fix the issue by adding "Replaces" and "Breaks" tags to the new
>> > openvswitch-common section of debian/control.
>> >
>> > Fixes: 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
>> > Signed-off-by: Joe Stringer <joe@ovn.org>
>> >
>>
>> One option is to move back ovs-lib to openvswitch-switch and make
>> ovn-common depend on openvswitch-switch too. ovn-common is used by
>> ovn-central and ovn-host and both of them have a dependency on
>> openvswitch-switch anyway, so it is probably not a bad thing.
>>
>> Ben do you have any opinions on what is the "debain way" here?
>
> I don't think there's anything wrong with that proposal but one wouldn't
> normally make packaging choices on the basis that someone might type
> dpkg commands in the wrong order.

OK, it seems like the approach in this patch is fine so I will apply it soon.
Joe Stringer July 21, 2016, 8:13 p.m. UTC | #7
On 19 July 2016 at 11:15, Joe Stringer <joe@ovn.org> wrote:
> On 24 June 2016 at 19:06, Ben Pfaff <blp@ovn.org> wrote:
>> On Wed, Jun 22, 2016 at 11:30:16AM -0700, Guru Shetty wrote:
>>> On 17 June 2016 at 12:42, Joe Stringer <joe@ovn.org> wrote:
>>>
>>> > Commit 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
>>> > shifted a file between debian packages, but didn't update the
>>> > destination package annotations to indicate that it replaces a file
>>> > from earlier versions of the source package.
>>> >
>>> > As a result, if one installs openvswitch-switch-2.5* and then tries to
>>> > upgrade to openvswitch-{switch,common}-2.5.90+, the install of
>>> > openvswitch-common will fail like the following:
>>> >
>>> > dpkg: error processing archive
>>> > /tmp/openvswitch-common_2.5.90-1_amd64.deb (--install):
>>> > trying to overwrite '/usr/share/openvswitch/scripts/ovs-lib', which is
>>> > also in package openvswitch-switch 2.5.0-1
>>> >
>>> > Fix the issue by adding "Replaces" and "Breaks" tags to the new
>>> > openvswitch-common section of debian/control.
>>> >
>>> > Fixes: 0dcc739e7a28 ("debian: Move ovs-lib to openvswitch-common.")
>>> > Signed-off-by: Joe Stringer <joe@ovn.org>
>>> >
>>>
>>> One option is to move back ovs-lib to openvswitch-switch and make
>>> ovn-common depend on openvswitch-switch too. ovn-common is used by
>>> ovn-central and ovn-host and both of them have a dependency on
>>> openvswitch-switch anyway, so it is probably not a bad thing.
>>>
>>> Ben do you have any opinions on what is the "debain way" here?
>>
>> I don't think there's anything wrong with that proposal but one wouldn't
>> normally make packaging choices on the basis that someone might type
>> dpkg commands in the wrong order.
>
> OK, it seems like the approach in this patch is fine so I will apply it soon.

Applied.
diff mbox

Patch

diff --git a/debian/control b/debian/control
index 2c07a73cd60f..78e00045042d 100644
--- a/debian/control
+++ b/debian/control
@@ -63,6 +63,8 @@  Depends: openssl,
          ${misc:Depends},
          ${shlibs:Depends}
 Suggests: ethtool
+Replaces: openvswitch-switch (<< 2.5.90)
+Breaks: openvswitch-switch (<< 2.5.90)
 Description: Open vSwitch common components
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network