From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/modules/rpm PackageHandler.cpp
Date: 26 Sep 2006 00:56:13 -0000 [thread overview]
Message-ID: <20060926005613.29682.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-09-26 00:56:13
Modified files:
ricci/modules/rpm: PackageHandler.cpp
Log message:
rpm module: fix of RHEL5 support
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
--- conga/ricci/modules/rpm/PackageHandler.cpp 2006/08/15 00:06:48 1.5
+++ conga/ricci/modules/rpm/PackageHandler.cpp 2006/09/26 00:56:13 1.6
@@ -66,7 +66,8 @@
if (access("/etc/sysconfig/rhn/systemid", F_OK))
rhn_available = false;
// check if there are subscribed channels
- if (rhn_available) {
+ if (rhn_available &&
+ RHEL4) {
String out, err;
int status;
vector<String> args;
@@ -92,13 +93,10 @@
if (!available())
return rpms;
- String out, err;
- int status;
- vector<String> args;
-
- if (RHEL4 || RHEL5) {
- out = err = "";
- args.clear();
+ if (RHEL4) {
+ String out, err;
+ int status;
+ vector<String> args;
args.push_back("--showall");
if (utils::execute(UP2DATE_PATH, args, out, err, status, false))
throw String("execute failed");
@@ -119,9 +117,10 @@
rpms[name] = version;
}
- } else if (FC5 || FC6) {
- out = err = "";
- args.clear();
+ } else if (FC5 || FC6 || RHEL5) {
+ String out, err;
+ int status;
+ vector<String> args;
args.push_back("-y");
args.push_back("list");
args.push_back("all");
@@ -159,13 +158,10 @@
if (rpms.empty())
return true;
- String out, err;
- int status;
- vector<String> args;
-
- if (RHEL4 || RHEL5) {
- out = err = "";
- args.clear();
+ if (RHEL4) {
+ String out, err;
+ int status;
+ vector<String> args;
for (vector<String>::size_type i=0; i<rpms.size(); i++)
args.push_back(rpms[i]);
if (utils::execute(UP2DATE_PATH, args, out, err, status, true))
@@ -174,17 +170,18 @@
throw String(UP2DATE_PATH) + " failed";
return true;
- } else if (FC5 || FC6) {
+ } else if (FC5 || FC6 || RHEL5) {
// install
vector<String> rpms_to_install;
- out = err = "";
- args.clear();
+ String out, err;
+ int status;
+ vector<String> args;
args.push_back("-y");
args.push_back("list");
args.push_back("installed");
if (utils::execute(YUM_PATH, args, out, err, status, false))
throw String("execute failed");
- if (status != 0)
+ if (status)
return false;
vector<String> lines = utils::split(utils::strip(out), "\n");
for (vector<String>::const_iterator rpm = rpms.begin();
@@ -213,7 +210,7 @@
args.push_back(*rpm);
if (utils::execute(YUM_PATH, args, out, err, status, false))
throw String("execute failed");
- if (status != 0)
+ if (status)
return false;
}
// update
@@ -227,9 +224,7 @@
args.push_back(*rpm);
if (utils::execute(YUM_PATH, args, out, err, status, false))
throw String("execute failed");
- if (status != 0)
- return false;
- return true;
+ return !status;
} else
return false;
@@ -500,9 +495,11 @@
}
} else if (RHEL5 || FC6) {
set.packages.push_back("gfs2-utils");
-
- // TODO: implement GFS1
-
+ // GFS1 not present on FC6
+ if (RHEL5) {
+ set.packages.push_back("gfs-utils");
+ set.packages.push_back("kmod-gfs");
+ }
}
return set;
@@ -625,8 +622,7 @@
is.read(buff, length);
String rel(buff, length);
- delete [] buff;
- buff = 0;
+ delete [] buff; buff = 0;
release = utils::strip(rel);
} catch ( ... ) {
@@ -640,9 +636,12 @@
FC5 = true;
else if (release.find("Fedora Core") != release.npos &&
release.find("6") != release.npos)
- // TODO: detect FC6
+ // TODO: get real FC6 codename
FC6 = true;
- // TODO: detect RHEL5
+ else if (release.find("Tikanga") != release.npos)
+ RHEL5 = true;
+ else
+ throw String("Unsupported OS");
release_set = true;
}
next reply other threads:[~2006-09-26 0:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 0:56 kupcevic [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-10-11 22:33 [Cluster-devel] conga/ricci/modules/rpm PackageHandler.cpp kupcevic
2007-02-05 11:10 kupcevic
2007-02-05 21:29 rmccabe
2007-02-05 22:19 kupcevic
2007-03-03 5:15 rmccabe
2007-03-03 5:16 rmccabe
2007-03-03 5:18 rmccabe
2009-03-09 20:20 rmccabe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060926005613.29682.qmail@sourceware.org \
--to=kupcevic@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.