There is a .spec file to build an rpm package for our software. In the %pre section of the .spec file there is a check if a previous major version of our software is installed. If yes, the installation is aborted with a nice error message. In the former RHEL versions everything did work fine.
In RHEL 6.7 (and seems like also in RHEL 6.5) the rpm installer does not reach (or ignore?) the %pre section and complains that "file ... from install of our-software-server-23.01-1.el6.i386 conflicts with file from package our-software-server-22.07-1.el6.i386" and then the installation aborts. And there are tons of such files. And this is exactly the case that our %pre section in the .spec file was taking care about.
What has been changed in the rpm handling between the recent releases? I found nothing so far.
rpm --version shows 4.8.0
Any help is much appreciated!
%pre server
if [ $1 -gt 1 ]; then
# Check for an unsupported major version upgrade
INSTALLED_VER=$(rpm -q our-software-server|sed -e 's/our-software-server-\([0-9]\+\).*/\1/')
echo "Upgrade check:"
echo "installed : $INSTALLED_VER"
echo "new version: %{majorver}"
if [ "$INSTALLED_VER" -ne "%{majorver}" ]; then
echo
echo "ERROR:"
echo "An automatic RPM upgrade across major versions is not supported!"
echo "Please refer to the Upgrade Notes on how to manually perform"
echo "an upgrade and migrate the configuration data."
echo
exit 1
fi
...