aboutsummaryrefslogtreecommitdiffstats
path: root/version_info.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-07-15 20:55:46 +0000
committerGuy Harris <guy@alum.mit.edu>2010-07-15 20:55:46 +0000
commitd9b1e79b1e2c70132b1b58b87775fcedb05e214e (patch)
tree32a0b8022c95e9b6bfd2fea1d6c27c5ca1399e93 /version_info.c
parentd7e9136268ff24681a51a6f0f20c0143f7075ceb (diff)
On OS X, give the OS version as
Mac OS X 10.x.y (Darwin a.b.c) rather than as Darwin a.b.c (Mac OS X 10.x.y) and also note that, on Linux, the lsb_release command might be able to give you the *distribution* name and version. svn path=/trunk/; revision=33542
Diffstat (limited to 'version_info.c')
-rw-r--r--version_info.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/version_info.c b/version_info.c
index 25136b3cc5..f7290fbd30 100644
--- a/version_info.c
+++ b/version_info.c
@@ -378,9 +378,20 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
* On Solaris, it's some kind of build information.
* On HP-UX, it appears to be some sort of subrevision
* thing.
+ * On *BSD and Darwin/OS X, it's a long string giving
+ * a build date, config file name, etc., etc., etc..
*/
- g_string_append_printf(str, "%s %s", name.sysname, name.release);
#ifdef HAVE_OS_X_FRAMEWORKS
+ /*
+ * On Mac OS X, report the Mac OS X version number as
+ * the OS, and put the Darwin information in parentheses.
+ *
+ * XXX - can we get the build name? There's no API to
+ * get it; it's currently in
+ * /System/Library/CoreServices/SystemVersion.plist
+ * but there's no guarantee that it will continue to
+ * be there.
+ */
Gestalt(gestaltSystemVersion, &macosx_ver);
/* The following functions are only available in Mac OS 10.4+ */
@@ -389,16 +400,27 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
Gestalt(gestaltSystemVersionMinor, &macosx_minor_ver);
Gestalt(gestaltSystemVersionBugFix, &macosx_bugfix_ver);
- g_string_append_printf(str, " (Mac OS %ld.%ld.%ld)",
+ g_string_append_printf(str, "Mac OS %ld.%ld.%ld",
(long)macosx_major_ver,
(long)macosx_minor_ver,
(long)macosx_bugfix_ver);
} else {
- g_string_append_printf(str, " (Mac OS X < 10.4 [%lx])",
+ g_string_append_printf(str, "Mac OS X < 10.4 [%lx]",
(long)macosx_ver);
/* See Apple's Gestalt Manager Reference for meanings
* of the macosx_ver values. */
}
+ g_string_append_printf(str, " (%s %s)", name.sysname, name.release);
+#else /* HAVE_OS_X_FRAMEWORKS */
+ /*
+ * XXX - on Linux, are there any APIs to get the distribution
+ * name and version number? I think some distributions have
+ * that.
+ *
+ * At least on Linux Standard Base-compliant distributions,
+ * there's an "lsb_release" command.
+ */
+ g_string_append_printf(str, "%s %s", name.sysname, name.release);
#endif /* HAVE_OS_X_FRAMEWORKS */
}
#else