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

[Cluster-devel] conga/ricci/modules/rpm PackageHandler.cpp



CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	kupcevic sourceware org	2007-02-05 11:10:43

Modified files:
	ricci/modules/rpm: PackageHandler.cpp 

Log message:
	modrpm: enable up2date handling

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.11&r2=1.11.2.1

--- conga/ricci/modules/rpm/PackageHandler.cpp	2006/12/13 19:33:14	1.11
+++ conga/ricci/modules/rpm/PackageHandler.cpp	2007/02/05 11:10:43	1.11.2.1
@@ -26,6 +26,7 @@
 #include "File.h"
 
 #include <unistd.h>
+#include <sys/utsname.h>
 
 
 using namespace std;
@@ -154,10 +155,6 @@
     return true;
   
   if (RHEL4) {
-    
-    // TODO: fix up2date handling
-    throw String("RHEL4 not supported, yet");
-    
     String out, err;
     int status;
     vector<String> args;
@@ -416,7 +413,9 @@
     set.packages.push_back("dlm");
     set.packages.push_back("fence");
     
-    String kernel(utils::strip(File::open("/proc/sys/kernel/osrelease")));
+    struct utsname uts;
+    uname(&uts);
+    String kernel(uts.release);
     if (kernel.find("smp") != kernel.npos) {
       set.packages.push_back("cman-kernel-smp");
       set.packages.push_back("dlm-kernel-smp");
@@ -464,7 +463,9 @@
 PackageSet
 PackageHandler::build_cluster_storage_set()
 {
-  String kernel(utils::strip(File::open("/proc/sys/kernel/osrelease")));
+  struct utsname uts;
+  uname(&uts);
+  String kernel(uts.release);
   
   PackageSet set("Clustered Storage");
   set.packages.push_back("lvm2-cluster");
@@ -523,10 +524,9 @@
       const Package& pack = iter->second;
       if (pack.version.empty())
 	set.installed = false;
-      if (pack.repo_version.empty()) {
+      if (pack.repo_version.empty())
 	set.in_repo = false;
-	set.upgradeable = false;
-      } else if (pack.repo_version > pack.version)
+      else if (pack.repo_version > pack.version)
 	set.upgradeable = true;
     }
   }


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