[Rpm-maint] rpm install - sed file - rpmsave for rollback

Tom Brown tom at ng23.net
Tue Mar 4 11:27:29 UTC 2008

> Earlier i mentioned how i sed a file on installation of an rpm - This 
> all works perfectly.
> I now wonder how i can mark that changed file, which did not come from 
> the package that seds it, so that if i remove that rpm the changes are 
> rolled back.
> ie - i install package X that changes the sendmail.cf and sets a smart 
> host to my choice. If i then remove package X the sendmail.cf file 
> gets reverted back.
> I presume i do this by having %config(noreplace) /etc/mail/sendmail.cf 
> but can i have that line as the only entry in the %files section?

i got around this by backing up any file i touched to .rpmsave before 
the sed and then in the %postun move the .rpmsave back oner the file 
that was changed.

%config in the files section did not work as i am not replacing the file 
just changing some contents within it


More information about the Rpm-maint mailing list