help-cfengine
[Top][All Lists]
Advanced

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

Re: The ongoing relstring saga


From: Erik Williamson
Subject: Re: The ongoing relstring saga
Date: Thu, 10 Mar 2005 14:20:15 -0700
User-agent: Mozilla Thunderbird (X11/20050218)


so the FERMI stuff in your patch would be deadwood.

Good to know - I'm new to SL, so thanks for the heads-up. I've taken the Fermi bit out, and attached the patch again.

Best,
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-10 14:08:26.837508480 -0700
+++ misc.c      2005-03-10 14:10:11.066663240 -0700
@@ -972,6 +972,8 @@
 #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 RELEASE_FLAG "release "
 
@@ -985,6 +987,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 +1062,16 @@
     {
     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
     {
     Verbose("Could not identify OS distro from %s\n", RH_REL_FILENAME);
@@ -1071,6 +1084,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]