help-cfengine
[Top][All Lists]
Advanced

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

The ongoing relstring saga


From: Erik Williamson
Subject: The ongoing relstring saga
Date: Wed, 09 Mar 2005 11:16:49 -0700
User-agent: Mozilla Thunderbird (X11/20050218)

Sorry for starting a new thread, I accidently deleted the other.

Steve was right, myself being new to Scientific Linux I didn't think to take into account the Fermi and Cern branches. So, with that in mind, here's yet another attempt at this. I thought that the SL, CERN and FERMI branches could be treated as editions (like AS, WS, etc with RHEL)

So, with this patch, the following classes are defined on my machine:

redhat scientific scientific_sl scientific_sl_4 scientific_sl_4_0

Similarly, for a Cerm machine, you would get these:

redhat scientific scientific_cern scientific_cern_4 scientific_cern_4_0

Provided I've got the strings correct. Anyhow, Let me know your thoughts, etc. Hopefully this could be useful to people - if not, I can just patch it locally.

Thanks,
Erik.

--
e r i k   w i l l i a m s o n                     erik@cpsc.ucalgary.ca
 system admin . department of computer science . university of calgary

--- misc.c.orig 2005-03-09 11:00:30.857545112 -0700
+++ misc.c      2005-03-09 10:57:52.959549256 -0700
@@ -972,6 +972,9 @@
 #define MANDRAKE_10_1_ID "Mandrakelinux"
 #define FEDORA_ID "Fedora Core"
 #define WHITEBOX_ID "White Box Enterprise Linux"
+#define SCIENTIFIC_SL_ID "Scientific Linux SL"
+#define SCIENTIFIC_CERN_ID "Scientific Linux CERN"
+#define SCIENTIFIC_FERMI_ID "Scientific Linux FERMI"
  
 #define RELEASE_FLAG "release "
 
@@ -985,6 +988,7 @@
  * Red Hat Enterprise Linux ES release 2.1 (Panama)
  * Fedora Core release 1 (Yarrow)
  * White Box Enterprise linux release 3.0 (Liberation)
+ * Scientific Linux SL Release 4.0 (Beryllium)
  */
 
 #define RH_REL_FILENAME "/etc/redhat-release"
@@ -1059,6 +1063,21 @@
     {
     vendor = "whitebox";
     }
+ else if(!strncmp(relstring, SCIENTIFIC_SL_ID, strlen(SCIENTIFIC_SL_ID)))
+    {
+    vendor = "scientific";
+    edition = "sl";
+    }
+ else if(!strncmp(relstring, SCIENTIFIC_CERN_ID, strlen(SCIENTIFIC_CERN_ID)))
+    {
+    vendor = "scientific";
+    edition = "cern";
+    }
+ else if(!strncmp(relstring, SCIENTIFIC_FERMI_ID, strlen(SCIENTIFIC_FERMI_ID)))
+    {
+    vendor = "scientific";
+    edition = "fermi";
+    }
  else
     {
     Verbose("Could not identify OS distro from %s\n", RH_REL_FILENAME);
@@ -1071,6 +1090,15 @@
   * have the word 'release' before the numerical release.
   */
  
+  /* Convert relstring to lowercase so that vendors like
+    Scientific Linux don't fall through the cracks.
+  */
+ int i;
+ for (i = 0; i < strlen(relstring); i++)
+   {
+   relstring[i] = tolower(relstring[i]);
+   }
+ 
  release = strstr(relstring, RELEASE_FLAG);
  if(release == NULL)
     {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]