Ticket #549 (closed enhancement: fixed)
DEB_UN{DIVERT,REMOVE}_FILES always conditionalizes on upgrade version
Reported by: | broder | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | Upstream Utopia |
Component: | development | Keywords: | |
Cc: | tabbott, andersk | Fixed in version: | |
Upstream bug: |
Description
The automatically generated maintainer script code generated by both DEB_UNDIVERT_FILES and DEB_UNREMOVE_FILES always checks and conditionalizes the undiversion on the version being upgraded from.
This isn't always desirable, as sometimes our reasons for removing diversions are tied to other factors.
For example, in kerberos-config, we want to remove the krb.conf diversion if you're upgrading to a version of kerberos-config on a krb4-less platform.
A mechanism to remove a diversion iff it exists already would be sufficient for all the cases we've currently run into. I'm thinking something like setting DEB_UNDIVERT_VERSION_file = all for the interface.
Attachments
Change History
comment:1 Changed 14 years ago by broder
As a jumping-off point, I've attached a patch that I believe will serve our purposes of undoing any pre-existing diversion if DEB_UNDIVERT_VERSION_file=all.
I haven't tested it yet, but wanted to go ahead and post it for others' perusal.
comment:3 Changed 14 years ago by broder
Eww. Eww. But...that might work.
That being said, two thoughts:
- You will still get spew both from the OMINOUS WARNING and from dpkg-divert attempting to remove a diversion that's no longer in place. It'd be nice to suppress that
- This won't solve the kerberos-config problem, which is that I specifically want to remove a diversion but not a removal and vice-versa.
comment:4 Changed 14 years ago by broder
Ooh - there's an even more fun screw case with using $(DEB_VERSION)
Say that package-1 undiverts a file with DEB_UNDIVERT_VERSION_file = $(DEB_VERSION), then package-2 starts diverting the file.
The next time package-1 gets upgraded, it'll delete the symlink without undoing the diversion.
comment:5 Changed 14 years ago by broder
Is there actually a particularly compelling reason for having DEB_UN{DIVERT,REMOVE}_VERSION at all, instead of just always testing if the diversion you're removing is in place?
I guess there's a performance argument? Is dpkg --compare-versions actually enough faster than dpkg-divert --list to care? My inclination is no.
comment:6 Changed 14 years ago by broder
Ok. I just attached a new version of attachment:config-package-dev_trac549.diff that fixes several typos and errors and such.
I've done what I think is sufficient testing. I created a 1.0 package that diverts a file, and a 1.1 of the same package that undiverts it. I also created a 1.1 package that removes a file, and a 1.1 that unremoves it.
For each of those, I tried
- Installing the 1.0 and uninstalling the 1.0
- Installing the 1.0, upgrading to 1.1, and uninstalling 1.1
- Installing the 1.1 and uninstalling the 1.1
I can't come up with any other use cases that might need testing, so I think this is all done.
comment:7 Changed 14 years ago by jdreed
- Cc andersk added
- Priority changed from low to high
- Milestone changed from The Distant Future to Natty Release
Can we get this patch taken soon?
comment:8 Changed 14 years ago by jdreed
- Status changed from new to committed
- Milestone changed from Natty Release to Upstream Utopia
comment:9 Changed 13 years ago by geofft
- Status changed from committed to development
I've built and uploaded config-package-dev 4.12 into the Debathena -development repositories. In other news, it's in Wheezy and Oneiric.
comment:10 Changed 13 years ago by jdreed
- Status changed from development to closed
- Resolution set to fixed
This moved a while ago.