From c047d8b5cb00ebd1cc7f9183c7ea6b52046fb992 Mon Sep 17 00:00:00 2001 From: jwsimpson Date: Fri, 4 May 2012 17:16:42 +0000 Subject: [PATCH] Defect 3514607 - RPM checks for ifix git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12530 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/perl-xCAT.spec | 12 ++++++++++++ xCAT-IBMhpc/xCAT-IBMhpc.spec | 12 ++++++++++++ xCAT-client/xCAT-client.spec | 12 ++++++++++++ xCAT-rmc/xCAT-rmc.spec | 12 ++++++++++++ xCAT-server/xCAT-server.spec | 12 ++++++++++++ xCAT/xCAT.spec | 12 ++++++++++++ xCATsn/xCATsn.spec | 13 ++++++++++++- 7 files changed, 84 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index faa009ba4..c8de4c5f3 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -105,6 +105,18 @@ rm -rf $RPM_BUILD_ROOT # Just package everything that has been copied into RPM_BUILD_ROOT %{prefix} +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post %ifos linux if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings diff --git a/xCAT-IBMhpc/xCAT-IBMhpc.spec b/xCAT-IBMhpc/xCAT-IBMhpc.spec index 284b5ce4b..3bf81c822 100644 --- a/xCAT-IBMhpc/xCAT-IBMhpc.spec +++ b/xCAT-IBMhpc/xCAT-IBMhpc.spec @@ -66,6 +66,18 @@ rm -rf $RPM_BUILD_ROOT %changelog +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post %preun diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 67634da09..b5bde21d3 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -218,6 +218,18 @@ rm -rf $RPM_BUILD_ROOT * Tue Feb 20 2007 Jarrod Johnson - Start core rpm for 1.3 work +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post %ifos linux cat << EOF > /etc/profile.d/xcat.sh diff --git a/xCAT-rmc/xCAT-rmc.spec b/xCAT-rmc/xCAT-rmc.spec index fa413d801..9cad908f7 100644 --- a/xCAT-rmc/xCAT-rmc.spec +++ b/xCAT-rmc/xCAT-rmc.spec @@ -54,6 +54,18 @@ rm -rf $RPM_BUILD_ROOT %changelog +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post needCopyFiles=0 if [ -f /etc/xCATMN ]; then diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 3b26a247e..16124a4b5 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -250,6 +250,18 @@ rm -rf $RPM_BUILD_ROOT * Tue Feb 20 2007 Jarrod Johnson - Start core rpm for 1.3 work +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post %ifos linux ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 560abe6fe..330a77be4 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -123,6 +123,18 @@ cp %{SOURCE5} $RPM_BUILD_ROOT/etc/xCATMN mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif + %post %ifnos linux . /etc/profile diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index 0cf43a7c6..1b4808229 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -80,8 +80,19 @@ mkdir -p $RPM_BUILD_ROOT/opt/xcat/ cp %{SOURCE3} $RPM_BUILD_ROOT/etc/xCATSN %endif -%post +%pre +# only need to check on AIX +%ifnos linux +if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd + /usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found + if [ $? = 0 ]; then + echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation." + exit 2 + fi +fi +%endif +%post if [ "$1" = "1" ]; then #Only if installing for the first time..