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

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 peopl

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 : > On 29/06/15 01:07, Kahlil Hodgson wrote: > >> On 29 June 2015 at 07:37, John R Pierce wrote: >> >>> so a regex looking for "system:" vs "system {" should nicely delineate >>> these. I dunno, I might even put that into the conversion utility a

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

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

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

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 : > 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 ?

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 Leon Fauster
Am 28.06.2015 um 01:59 schrieb Anand Buddhdev : > 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

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

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

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,