[CentOS] Old and new package version numbers during RPM update

Mon Jun 29 00:11:50 UTC 2015
Anand Buddhdev <anandb at ripe.net>

On 29/06/15 01:07, Kahlil Hodgson wrote:

> On 29 June 2015 at 07:37, John R Pierce <pierce at hogranch.com> wrote:
> 
>> so a regex looking for "system:" vs "system {"   should nicely delineate
>> these.   I dunno, I might even put that into the conversion utility and
>> have it just quit if the file is already in the new format, and always run
>> it.
> 
> ​+1 for the idempotent approach. IMHO much more robust. Also consider what
> will happen if someone does a 'yum downgrade' on the package or a
> dependency -- you might want to allow the conversion to go both ways or at
> least complain appropriately.

Yep. I've already considered this approach, but I avoid regexes as much
as possible. They're great for some work, but they can inadvertently
match too much or fail (for example if the "system" keyword and the
opening brace are on different lines). You see where I'm going? But,
this is a digression...

I also prefer an idempotent approach, and I'm already talking to the
authors of this specific package (knot dns), about making their knot1to2
utility idempotent, so that it's always safe to run it.

However, one problem is that nothing can handle downgrades. The v2
config format is a superset of the v1 format, and while not impossible,
it's very hard to go back. There is no reverse knot2to1 utility.

I'd like to thank everyone for the various suggestions. I'm going to
place with them and see which one works out best.

Finally, as an aside, I'd like to mention that upgrading my own systems
is easy, because I have control over them. My motivation for asking this
question was for making an EPEL package that can work for most people
without breaking their installations (especially if they have unattended
yum updates, like with yum-cron).

Anand