Re: How to avoid reinstalling deliberately deleted config files on upgrade

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





--- On Fri, 6/12/09, Richard Siddall <richard.siddall@xxxxxxxxxxx> wrote:

> From: Richard Siddall <richard.siddall@xxxxxxxxxxx>
> Subject: How to avoid reinstalling deliberately deleted config files on upgrade
> To: "General discussion about the RPM package manager" <rpm-list@xxxxxxxxxxxxx>
> Date: Friday, June 12, 2009, 5:10 AM
> I'm packaging a system that uses the
> presence of configuration files to set some options: the
> option is on if the file is present, and off if the file is
> missing.
> 
> The problem I've run into (obviously) is that when I
> upgrade the RPM to a newer version, rpm reinstalls all the
> deliberately deleted config files.
> 
> I can't think of a way to stop rpm from doing this. 
> Does anyone have any suggestions?
In the pre-install script:
rm -rf /tmp/configs
mkdir -p /tmp/configs

[ -e /path1/config_1 ] && touch /tmp/configs/config_1
[ -e /path2/config_2 ] && touch /tmp/configs/config_2
...
[ -e /pathN/config_N ] && touch /tmp/configs/config_N

in the post-install script
[ -e /tmp/configs/config_1 ] || rm -f /path1/config_1
[ -e /tmp/configs/config_2 ] || rm -f /path2/config_2
...
[ -e /tmp/configs/config_N ] || rm -f /pathN/config_N
rm -rf /tmp/configs


It's an idea. You have to think how you are going to handle config options that were added/removed in the new version of package

Valery

> 
> Regards,
> 
>     Richard Siddall
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxxxxx
> http://lists.rpm.org/mailman/listinfo/rpm-list
> 


      
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux