From fba0dc55187ebe0a7d94e2137d46c88c0a88133b Mon Sep 17 00:00:00 2001 From: jwsimpson Date: Mon, 23 Apr 2012 20:52:13 +0000 Subject: [PATCH] Defect 3514607 - RPM checks for ifix git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@12305 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/perl-xCAT.spec | 12 ++++++++++++ xCAT-IBMhpc/xCAT-IBMhpc.spec | 12 ++++++++++++ xCAT-client/xCAT-client.spec | 13 +++++++++++++ xCAT-rmc/xCAT-rmc.spec | 18 +++++++++++++----- xCAT-server/xCAT-server.spec | 12 ++++++++++++ xCAT/xCAT.spec | 11 ++++++++++- xCATsn/xCATsn.spec | 13 ++++++++++++- 7 files changed, 84 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index a58649604..f478cf6a2 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -94,6 +94,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 7ba078a79..3b0eb3232 100644 --- a/xCAT-IBMhpc/xCAT-IBMhpc.spec +++ b/xCAT-IBMhpc/xCAT-IBMhpc.spec @@ -70,6 +70,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 5ecec8053..d3d5eacc6 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -30,6 +30,7 @@ Requires: expat xCAT-client provides the xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters. %prep + %setup -q -n xCAT-client %build # This phase is done in (for RH): /usr/src/redhat/BUILD/xCAT-client-2.0 @@ -217,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 4e6264169..2e01f33d2 100644 --- a/xCAT-rmc/xCAT-rmc.spec +++ b/xCAT-rmc/xCAT-rmc.spec @@ -24,6 +24,7 @@ Provides: xCAT-rmc = %{version} Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors. %prep + %setup -q -n xCAT-rmc %build %install @@ -75,6 +76,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 %ifos linux if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image @@ -95,8 +108,3 @@ rm -rf $RPM_BUILD_ROOT %endif exit 0 - - - - - diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 2c074c251..2e0568aaf 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -177,6 +177,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 1a8acf52a..7676e45ba 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -77,7 +77,16 @@ if [ -e "/etc/SuSE-release" ]; then exit -1; fi fi - +# 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 %install mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index c2ef827ab..6d6bd62ea 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -79,8 +79,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..