From d4225d6635f2fbb24030209c5d845ad1a7600aab Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 16 Mar 2017 15:58:19 -0500 Subject: [PATCH] change code to determine package type --- oamapps/mcsadmin/mcsadmin.cpp | 14 +++++++------- oamapps/postConfigure/postConfigure.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/oamapps/mcsadmin/mcsadmin.cpp b/oamapps/mcsadmin/mcsadmin.cpp index e90e31559..8e304cc6e 100644 --- a/oamapps/mcsadmin/mcsadmin.cpp +++ b/oamapps/mcsadmin/mcsadmin.cpp @@ -5007,13 +5007,13 @@ int processCommand(string* arguments) cout << endl; if ( rootUser) { - system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); - if (oam.checkLogStatus("/tmp/columnstore.txt", "Name")) - system("cat /tmp/columnstore.txt"); - else { - system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); - if (oam.checkLogStatus("/tmp/columnstore.txt", "Status: install")) - system("cat /tmp/columnstore.txt"); + int rtnCode = system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); + if (WEXITSTATUS(rtnCode) == 0) + system("cat /tmp/columnstore.txt"); + else { + rtnCode = system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); + if (WEXITSTATUS(rtnCode) == 0) + system("cat /tmp/columnstore.txt"); else { SystemSoftware systemsoftware; oam.getSystemSoftware(systemsoftware); diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 98d637a6d..02151c772 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -2683,12 +2683,12 @@ int main(int argc, char *argv[]) EEPackageType = "binary"; else { - system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); - if (oam.checkLogStatus("/tmp/columnstore.txt", "Name")) + int rtnCode = system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); + if (WEXITSTATUS(rtnCode) == 0) EEPackageType = "rpm"; else { - system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); - if (oam.checkLogStatus("/tmp/columnstore.txt", "Status: install")) + rtnCode = system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); + if (WEXITSTATUS(rtnCode) == 0) EEPackageType = "deb"; else EEPackageType = "binary";