1) I would like to know on update what version I am updating from. My project is somewhat experimental, so data the user has saved *may* have to undergo some conversion, depending on what version they are updating from.
I need to know how to query rpm in the %pre script and then use the information from that query in the post script to determine if conversions need to be run:
%pre OLDVERSION=`rpm -q --qf '%%{VERSION}' %{name}` %define OldVersion $OLDVERSION echo "about_to_install" echo %{OldVersion} %post echo "post install" echo %{OldVersion}
This doesn't work. I am guessing it is because macros are expanded before the script is run. How can I save a value in one script to use in another?
2) The other question I have is that I have some configuration files which contain default data at the top of the file, and then a section at the bottom of the file where the data can be redefined for site-specific customizations. I understand that I need to list them as config files, and that the old files will be saved with the .rpmsave extension if modified. My question is, what is the most reliable way of getting the path of all files that have been saved at install, so I can run them through a merging process whereby the defaults from the new version can be merged with the user-customizations from a previous version?
Thanks
Travis
_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list