I'm playing around with the rpm -upgrade command and noticed rpm has different ways of handling modified configuration files so it doesn't get lost during the upgrade. From what I understand, if a config file was modified and the package is upgraded with rpm -U, rpm will rename the original properties file as {file}.rpmsave and install the new configuration file with the original file name {file}.
However, when I attempt to run rpm -U with the package I've created, what I actually see is the original configuration file gets deleted and the new configuration file gets renamed to {file}.rpmsave. Is this the intended behavior? In my install script I also modify some text in the configuration file with "sed". Could this have interfered with the way rpm handles configuration file during an upgrade?
This is the intended behaviour. If you want the configuration file to never get overwritten (and moved to .rpmsave), use %config(noreplace)
instead of %config
in the rpm .spec file, and the file won't be replaced. Instead, the new file from the rpm package will get created as .rpmnew, and the one there is left alone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With