[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga ./conga.spec.in.in ricci/modules/rpm/Pac ...



CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	kupcevic sourceware org	2006-12-13 20:27:40

Modified files:
	.              : conga.spec.in.in 
	ricci/modules/rpm: PackageHandler.cpp 

Log message:
	Fixed bz214989 (Package download not working for Conga during cluster creation)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.14&r2=1.45.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.1&r2=1.9.2.2

--- conga/conga.spec.in.in	2006/12/13 19:21:52	1.45.2.14
+++ conga/conga.spec.in.in	2006/12/13 20:27:40	1.45.2.15
@@ -290,6 +290,7 @@
 XXXXXXXXXXXXXXXXXXX UPDATE NOT RELEASED YET XXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
+- Fixed bz214989 (Package download not working for Conga during cluster creation)
 - 
 
 
--- conga/ricci/modules/rpm/PackageHandler.cpp	2006/10/23 21:13:21	1.9.2.1
+++ conga/ricci/modules/rpm/PackageHandler.cpp	2006/12/13 20:27:40	1.9.2.2
@@ -34,7 +34,6 @@
 #define RPM_PATH       "/bin/rpm"
 #define UP2DATE_PATH   "/usr/sbin/up2date-nox"
 #define YUM_PATH       "/usr/bin/yum"
-#define UNAME_PATH     "/bin/uname"
 
 
 static bool 
@@ -60,14 +59,13 @@
 bool
 PackageInstaller::available()
 {
-  if (RHEL4 || RHEL5) {
+  if (RHEL4) {
     bool rhn_available = true;
-    // check existance of /etc/sysconfig/rhn/systemid
+    // check existence of /etc/sysconfig/rhn/systemid
     if (access("/etc/sysconfig/rhn/systemid", F_OK))
       rhn_available = false;
-    // check if there are subscribed channels
-    if (rhn_available && 
-	RHEL4) {
+    // check for subscribed channels
+    if (rhn_available) {
       String out, err;
       int status;
       vector<String> args;
@@ -78,8 +76,8 @@
 	rhn_available = false;
     }
     return rhn_available;
-  } else if (FC5 || FC6) {
-    // nothing to check for, maybe ping repository???
+  } else if (FC5 || FC6 || RHEL5) {
+    // nothing to check for, maybe ping repositories???
     return true;
   } else
     return false;
@@ -156,8 +154,8 @@
     return true;
   
   if (RHEL4) {
-    // TODO: fix up2date handling
     
+    // TODO: fix up2date handling
     throw String("RHEL4 not supported, yet");
     
     String out, err;
@@ -314,7 +312,6 @@
 {
   set_release();
   
-  
   // get installed packages
   
   String out, err;
@@ -419,19 +416,11 @@
     set.packages.push_back("dlm");
     set.packages.push_back("fence");
     
-    // find kernel type
-    String out, err;
-    int status;
-    vector<String> args;
-    args.push_back("-r");
-    if (utils::execute(UNAME_PATH, args, out, err, status, true))
-      throw command_not_found_error_msg(UNAME_PATH);
-    if (status != 0)
-      throw String("uname -r failed");
-    if (out.find("smp") != out.npos) {
+    String kernel(utils::strip(File::open("/proc/sys/kernel/osrelease")));
+    if (kernel.find("smp") != kernel.npos) {
       set.packages.push_back("cman-kernel-smp");
       set.packages.push_back("dlm-kernel-smp");
-    } else if (out.find("hugemem") != out.npos) {
+    } else if (kernel.find("hugemem") != kernel.npos) {
       set.packages.push_back("cman-kernel-hugemen");
       set.packages.push_back("dlm-kernel-hugemem");
     } else {
@@ -475,34 +464,28 @@
 PackageSet
 PackageHandler::build_cluster_storage_set()
 {
+  String kernel(utils::strip(File::open("/proc/sys/kernel/osrelease")));
+  
   PackageSet set("Clustered Storage");
   set.packages.push_back("lvm2-cluster");
-
+  
   if (RHEL4 || FC5) {
     set.packages.push_back("GFS");
-    
-    // find kernel type
-    String out, err;
-    int status;
-    vector<String> args;
-    args.push_back("-r");
-    if (utils::execute(UNAME_PATH, args, out, err, status, true))
-      throw command_not_found_error_msg(UNAME_PATH);
-    if (status != 0)
-      throw String("uname -r failed");
-    if (out.find("smp") != out.npos) {
+    if (kernel.find("smp") != kernel.npos) {
       set.packages.push_back("GFS-kernel-smp");
-    } else if (out.find("hugemem") != out.npos) {
+    } else if (kernel.find("hugemem") != kernel.npos) {
       set.packages.push_back("GFS-kernel-hugemem");
     } else {
       set.packages.push_back("GFS-kernel");
     }
   } else if (RHEL5 || FC6) {
     set.packages.push_back("gfs2-utils");
-    // GFS1 not present on FC6
     if (RHEL5) {
       set.packages.push_back("gfs-utils");
-      set.packages.push_back("kmod-gfs");
+      if (kernel.find("xen") == kernel.npos)
+	set.packages.push_back("kmod-gfs");
+      else
+	set.packages.push_back("kmod-gfs-xen");
     }
   }
   
@@ -593,7 +576,7 @@
     String name(iter->name);
     map<String, PackageSet>::iterator set_iter = h_pre.sets().find(name);
     if (set_iter == h_pre.sets().end())
-      throw String("set ") + name + " present neither locally nor in repository";
+      throw String("packages of set ") + name + " present neither locally nor in repository";
     else {
       PackageSet& p_set = set_iter->second;
       if (p_set.installed) {
@@ -651,9 +634,7 @@
       RHEL4 = true;
     else if (release.find("Bordeaux") != release.npos)
       FC5 = true;
-    else if (release.find("Fedora Core") != release.npos &&
-	     release.find("6") != release.npos)
-      // TODO: get real FC6 codename
+    else if (release.find("Zod") != release.npos)
       FC6 = true;
     else if (release.find("Tikanga") != release.npos)
       RHEL5 = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]