Aastra XML RPM overwrites config files

Is there any chance that the Aastra XML script RPM could be built using the %config(noreplace) directive to prevent config files from being overwritten when the package is updated?

I applied a few distro updates to a system last night and did not notice that the Aastra XML RPM would end up getting upgraded. Sure enough all of the XML configs got stomped and needed to be restored from backup to get the client back to normal. Now I knew of this behavior from past experience, so it’s my fault for not checking to see the upgrade coming but at the same time when RPM provides the functionality to prevent the situation it it would seem that would save a lot of hassle every time the RPM was upgraded.

As far as I can recall /var/www/html/aastra/asterisk/.prf and /var/www/html/aastra/config/ would be the files in question that need to be flagged as %config(noreplace)

[Note this could also apply to the Aastra firmware files (*.st)in the Aastra-IPPhone package, to prevent them from being overwritten by a package update… in the case where the user may have manually placed upgraded or downgraded firmware in place to resolve an issue]


A special option to the %config directive, noreplace, tells RPM not to overwrite, or replace a configuration file.

For example:
%files /sbin/ypbind
%config /etc/rc.d/init.d/*
%config(noreplace) /etc/yp.conf

Use this option to help protect local modifications. If you use %config(noreplace), the file will not overwrite an existing file that has been modified. If the file has not been modified on disk, the rpm command will overwrite the file. But, if the file has been modified on disk, the rpm command will copy the new file with an extra file-name extension of .rpmnew.

Similarly, %config(missingok) means that the file does not have to exist on disk. You can use this modifier for files or links that are created during the %post scripts but will need to be removed if the package is removed.
–end snip–