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

2015-06-29 Thread Gordon Messmer
On 06/28/2015 05:11 PM, Anand Buddhdev wrote: 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). Bear in mind that one of the reasons

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

2015-06-29 Thread Leon Fauster
Am 29.06.2015 um 02:11 schrieb Anand Buddhdev ana...@ripe.net: On 29/06/15 01:07, Kahlil Hodgson wrote: On 29 June 2015 at 07:37, John R Pierce pie...@hogranch.com wrote: so a regex looking for system: vs system { should nicely delineate these. I dunno, I might even put that into the

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

2015-06-29 Thread Rex Dieter
Anand Buddhdev wrote: Hi CentOS folk, In an RPM post-install script, is it possible to know the previous version number, and the new version number of a package if it's an update? I need to know this, because for a certain package, if updating from version 1.x to 2.x, I need to run a

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

2015-06-28 Thread Leon Fauster
Am 28.06.2015 um 01:59 schrieb Anand Buddhdev ana...@ripe.net: In an RPM post-install script, is it possible to know the previous version number, and the new version number of a package if it's an update? I need to know this, because for a certain package, if updating from version 1.x to

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

2015-06-28 Thread Anand Buddhdev
On 28/06/15 03:06, Joseph L. Casale wrote: Hi Joseph, Well normal convention would be if you replace then the old one gets appended with .rpmsave, if you are not replacing then the new one gets appended with .rpmnew. I'm also aware of this, but it's not what I need :) On the other hand,

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

2015-06-28 Thread John R Pierce
On 6/27/2015 5:38 PM, Anand Buddhdev wrote: Thanks Joseph. I am aware of this option, but it would be only a last resort, because checking the format of the config file is error-prone. why doesn't the config file have the version in it ? not having that makes your whole system error prone.

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

2015-06-28 Thread Anand Buddhdev
On 28/06/15 17:50, John R Pierce wrote: On 6/27/2015 5:38 PM, Anand Buddhdev wrote: Thanks Joseph. I am aware of this option, but it would be only a last resort, because checking the format of the config file is error-prone. why doesn't the config file have the version in it ? not having

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

2015-06-28 Thread John R Pierce
On 6/28/2015 2:26 PM, Anand Buddhdev wrote: On 28/06/15 17:50, John R Pierce wrote: why doesn't the config file have the version in it ? not having that makes your whole system error prone. Perhaps I wasn't clear. Version 1 of the package uses a config file that looks like this: system {

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

2015-06-28 Thread Leon Fauster
Am 28.06.2015 um 17:50 schrieb John R Pierce pie...@hogranch.com: On 6/27/2015 5:38 PM, Anand Buddhdev wrote: Thanks Joseph. I am aware of this option, but it would be only a last resort, because checking the format of the config file is error-prone. why doesn't the config file have the

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

2015-06-28 Thread Kahlil Hodgson
On 29 June 2015 at 07:37, John R Pierce pie...@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

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

2015-06-28 Thread Anand Buddhdev
On 29/06/15 01:07, Kahlil Hodgson wrote: On 29 June 2015 at 07:37, John R Pierce pie...@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

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

2015-06-27 Thread Joseph L. Casale
Thanks Joseph. I am aware of this option, but it would be only a last resort, because checking the format of the config file is error-prone. I would prefer RPM to tell me the old and new version numbers, so my question still stands. Well normal convention would be if you replace then the

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

2015-06-27 Thread Anand Buddhdev
On 28/06/15 02:17, Joseph L. Casale wrote: Your script within the rpm should have the logic. Clearly if you know how to update it, you know how to identify if it needs updating. Thanks Joseph. I am aware of this option, but it would be only a last resort, because checking the format of the

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

2015-06-27 Thread Anand Buddhdev
Hi CentOS folk, In an RPM post-install script, is it possible to know the previous version number, and the new version number of a package if it's an update? I need to know this, because for a certain package, if updating from version 1.x to 2.x, I need to run a program to convert the config

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

2015-06-27 Thread Joseph L. Casale
I need to know this, because for a certain package, if updating from version 1.x to 2.x, I need to run a program to convert the config file of the package from version 1.x format to version 2.x format. Your script within the rpm should have the logic. Clearly if you know how to update it,