bug-cfengine
[Top][All Lists]
Advanced

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

more helpful classes for Irix


From: Dave Love
Subject: more helpful classes for Irix
Date: Thu, 22 Jan 2004 18:00:13 +0000
User-agent: Gnus/5.1005 (Gnus v5.10.5) Emacs/21.2 (gnu/linux)

Currently for Irix, the only handle you have on the point release
version of Irix 6.5 is a class like irix64_ip27_6_5_10070055.  In this
the last component appears to correspond to the `22' in Irix 6.5.22,
but the class isn't generally useful because it's conflated with the
`board type' (?) of the processor, `ip27' in this case.  The point
release is important for things like installing patches and packages
generally.

This change to 2.1.1 adds a class `irix64_6_5_22m' in the above case.
It's still not really good enough, because I have to test both
irix64_6_5_22m and irix_6_5_22m, but it does prevent me from having to
run `uname -sR' to get the information.

(I'm not sure whether it's the right approach.  It might be OK just to
have irix64_6_5_10070055, for instance, but that's rather more obscure
and I may not have been sure how to do it when I looked at it (some
time ago with 2.1.0p1).)

--- nameinfo.c  2004/01/22 17:42:21     1.1
+++ nameinfo.c  2004/01/22 17:42:38
@@ -33,6 +33,9 @@
 #include "cf.defs.h"
 #include "cf.extern.h"
 #include "../pub/global.h"
+#ifdef IRIX
+#include <sys/syssgi.h>
+#endif
 
 /* FreeBSD has size macro defined as ifreq is variable size */
 #ifdef _SIZEOF_ADDR_IFREQ
@@ -53,6 +56,9 @@
 #ifdef AIX
   char real_version[_SYS_NMLN];
 #endif
+#ifdef IRIX
+  char real_version[256];      /* see <sys/syssgi.h> */
+#endif
 #ifdef HAVE_SYSINFO
 #ifdef SI_ARCHITECTURE
   long sz;
@@ -72,6 +78,9 @@
 #ifdef AIX
 snprintf(real_version,_SYS_NMLN,"%.80s.%.80s", VSYSNAME.version, 
VSYSNAME.release);
 strncpy(VSYSNAME.release, real_version, _SYS_NMLN);
+#elif defined IRIX
+/* This gets us something like `6.5.19m' rather than just `6.5'.  */ 
+ syssgi (SGI_RELEASE_NAME, 256, real_version);
 #endif 
 
 for (sp = VSYSNAME.sysname; *sp != '\0'; sp++)
@@ -181,6 +190,14 @@
 
 snprintf(VBUFF,bufsize,"%s_%s",VSYSNAME.sysname,VSYSNAME.release);
 AddClassToHeap(CanonifyName(VBUFF));
+
+#ifdef IRIX
+/* Get something like `irix64_6_5_19m' defined as well as
+   `irix64_6_5'.  Just copying the latter into VSYSNAME.release
+   wouldn't be backwards-compatible.  */
+snprintf(VBUFF,bufsize,"%s_%s",VSYSNAME.sysname,real_version);
+AddClassToHeap(CanonifyName(VBUFF));
+#endif
 
 AddClassToHeap(CanonifyName(VSYSNAME.machine));
  

reply via email to

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