LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   preserve configuration files during RPM upgrade (rpm -U) (http://www.linuxquestions.org/questions/red-hat-31/preserve-configuration-files-during-rpm-upgrade-rpm-u-156227/)

charrua 03-11-2004 06:30 AM

preserve configuration files during RPM upgrade (rpm -U)
 
Original file = X, Current file = Y, New file = Z
Here the original file was modified at some point. The new file is different from both the original and the modified versions of the original file.

RPM is not able to analyze the contents of the files, and determine what is going on. In this instance, it takes the best possible approach. The new file is known to work properly with the rest of the software in the new package — at least the people building the new package should have insured that it does. The modified original file is an unknown: it might work with the new package, it might not. So RPM installs the new file.

BUT… The existing file was definitely modified. Someone made an effort to change the file, for some reason. Perhaps the information contained in the file is still of use. Therefore, RPM saves the modified file, naming it <file>.rpmsave, and prints a warning, so the user knows what happened: warning: /etc/skel/.bashrc saved as /etc/skel/.bashrc.rpmsave




Hi

We have a configuration file (i.e.: <some path>/<some file>) delivered with package <name>-<release_r1>-<build_b1> (let's name it X); after the package installation this file is modified (let's name it Y); thereafter it is brought again (having different contents from X and Y) with <name>-<release_r2>-<build_b2> (let's name it Z)

We perform rpm -i <name>-<release_r1>-<build_b1>; then modify <some path>/<some file> configuration file; finally we execute rpm -U <name>-<release_r2>-<build_b2>



As expected "RPM installs the new file" (Z) , but it does not save the existing file (Y)

Why?

jailbait 03-11-2004 02:06 PM

"As expected "RPM installs the new file" (Z) , but it does not save the existing file (Y)

Why?"

This is not a function of the rpm program per se. rpm is acting on the instructions given to it by the person who built the rpm package. So the question shifts to "Why did the blooming idiot do it that way?" Your guess is as good as mine.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

charrua 03-14-2004 10:47 AM

Hi jailbait,

rpm -U did not save the modified file (Y)
it just deployed the new file (Z)

what am i doing wrong?
please explain.

jailbait 03-14-2004 02:18 PM

"rpm -U did not save the modified file (Y)
it just deployed the new file (Z)

what am i doing wrong?
please explain."

You aren't doing anything wrong. The person who set up the rpm probably should not be deploying the file you call Z. In any case the solution to the mess is for your distributor to create smarter update rpms.

The file Y was originally set up by either your distribution's installer or by your distribution's control program such as YaST2 in SuSE. You can fix up the file by looking at Y and Z and deciding what to do. Perhaps you want to use Y or perhaps you want to merge the information in Y and Z.

Or you can use Z and run your distributions control program to make the necessary changes to Z.

Personally when I run into this situation I almost always just use Y and delete Z but it varies on a case by case basis.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites


All times are GMT -5. The time now is 07:34 PM.