FreeBSD Bugzilla – Attachment 186059 Details for
Bug 222048
emulators/open-vm-tools: [PROPOSAL] OS version detection can be specified by OPTIONS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
SHOWVER option patch
emulators_open-vm-tools.diff (text/plain), 5.51 KB, created by
Toshimichi Masubuchi
on 2017-09-04 12:27:47 UTC
(
hide
)
Description:
SHOWVER option patch
Filename:
MIME Type:
Creator:
Toshimichi Masubuchi
Created:
2017-09-04 12:27:47 UTC
Size:
5.51 KB
patch
obsolete
>diff -uarN open-vm-tools.orig/Makefile open-vm-tools/Makefile >--- open-vm-tools.orig/Makefile 2017-08-30 01:43:48.000000000 +0900 >+++ open-vm-tools/Makefile 2017-09-04 20:29:26.679922000 +0900 >@@ -22,13 +22,14 @@ > RELEASE_VER= 10.1.10 > BUILD_VER= 6082533 > >-OPTIONS_DEFINE= DNET ICU LIBNOTIFY OPENSSL X11 >-OPTIONS_DEFAULT= DNET ICU LIBNOTIFY OPENSSL X11 >+OPTIONS_DEFINE= DNET ICU LIBNOTIFY OPENSSL X11 SHOWVER >+OPTIONS_DEFAULT= DNET ICU LIBNOTIFY OPENSSL X11 SHOWVER > > OPTIONS_SUB= > > DNET_DESC= libdnet support > LIBNOTIFY_DESC= Desktop notification support >+SHOWVER_DESC= Show FreeBSD Version support > > X11_CONFIGURE_WITH= x gtk2 gtkmm > X11_USE= xorg=ice,sm,x11,xext,xi,xinerama,xineramaproto,xrandr,xrender,xtst \ >@@ -41,6 +42,7 @@ > ICU_CONFIGURE_WITH= icu > ICU_LIB_DEPENDS= libicuuc.so:devel/icu > OPENSSL_CONFIGURE_WITH= ssl >+SHOWVER_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-lib_misc_hostinfoPosix.c > > WRKSRC_SUBDIR= open-vm-tools > >diff -uarN open-vm-tools.orig/files/extra-patch-lib_misc_hostinfoPosix.c open-vm-tools/files/extra-patch-lib_misc_hostinfoPosix.c >--- open-vm-tools.orig/files/extra-patch-lib_misc_hostinfoPosix.c 1970-01-01 09:00:00.000000000 +0900 >+++ open-vm-tools/files/extra-patch-lib_misc_hostinfoPosix.c 2017-08-30 01:43:48.000000000 +0900 >@@ -0,0 +1,53 @@ >+--- lib/misc/hostinfoPosix.c.orig 2017-07-28 21:59:15 UTC >++++ lib/misc/hostinfoPosix.c >+@@ -1,5 +1,5 @@ >+ /********************************************************* >+- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved. >++ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. >+ * >+ * This program is free software; you can redistribute it and/or modify it >+ * under the terms of the GNU Lesser General Public License as published >+@@ -1080,28 +1080,32 @@ HostinfoOSData(void) >+ >+ Str_Strcpy(osName, distroShort, sizeof osName); >+ } else if (strstr(osNameFull, "FreeBSD")) { >+- size_t nameLen = sizeof STR_OS_FREEBSD - 1; >+- size_t releaseLen = 0; >+- char *dashPtr; >++ char distroShort[DISTRO_BUF_SIZE]; >++ int majorVersion; >+ >+ /* >+- * FreeBSD releases report their version as "x.y-RELEASE". We'll be >+- * naive look for the first dash, and use everything before it as the >+- * version number. >++ * FreeBSD releases report their version as "x.y-RELEASE". >+ */ >+ >+- dashPtr = Str_Strchr(buf.release, '-'); >+- if (dashPtr != NULL) { >+- releaseLen = dashPtr - buf.release; >++ majorVersion = Hostinfo_OSVersion(0); >++ >++ /* >++ * FreeBSD 11 and later are identified using >++ * a different guestId. >++ */ >++ if (majorVersion >= 11) { >++ Str_Strcpy(distroShort, STR_OS_FREEBSD11, sizeof distroShort); >++ } else { >++ Str_Strcpy(distroShort, STR_OS_FREEBSD, sizeof distroShort); >+ } >+ >+- if (nameLen + releaseLen + 1 > sizeof osName) { >++ if (strlen(distroShort) + 1 > sizeof osName) { >+ Warning("%s: Error: buffer too small\n", __FUNCTION__); >+ >+ return FALSE; >+ } >+ >+- Str_Strcpy(osName, STR_OS_FREEBSD, sizeof osName); >++ Str_Strcpy(osName, distroShort, sizeof osName); >+ } else if (strstr(osNameFull, "SunOS")) { >+ size_t nameLen = sizeof STR_OS_SOLARIS - 1; >+ size_t releaseLen = 0; >diff -uarN open-vm-tools.orig/files/patch-lib_misc_hostinfoPosix.c open-vm-tools/files/patch-lib_misc_hostinfoPosix.c >--- open-vm-tools.orig/files/patch-lib_misc_hostinfoPosix.c 2017-08-30 01:43:48.000000000 +0900 >+++ open-vm-tools/files/patch-lib_misc_hostinfoPosix.c 1970-01-01 09:00:00.000000000 +0900 >@@ -1,53 +0,0 @@ >---- lib/misc/hostinfoPosix.c.orig 2017-07-28 21:59:15 UTC >-+++ lib/misc/hostinfoPosix.c >-@@ -1,5 +1,5 @@ >- /********************************************************* >-- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved. >-+ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. >- * >- * This program is free software; you can redistribute it and/or modify it >- * under the terms of the GNU Lesser General Public License as published >-@@ -1080,28 +1080,32 @@ HostinfoOSData(void) >- >- Str_Strcpy(osName, distroShort, sizeof osName); >- } else if (strstr(osNameFull, "FreeBSD")) { >-- size_t nameLen = sizeof STR_OS_FREEBSD - 1; >-- size_t releaseLen = 0; >-- char *dashPtr; >-+ char distroShort[DISTRO_BUF_SIZE]; >-+ int majorVersion; >- >- /* >-- * FreeBSD releases report their version as "x.y-RELEASE". We'll be >-- * naive look for the first dash, and use everything before it as the >-- * version number. >-+ * FreeBSD releases report their version as "x.y-RELEASE". >- */ >- >-- dashPtr = Str_Strchr(buf.release, '-'); >-- if (dashPtr != NULL) { >-- releaseLen = dashPtr - buf.release; >-+ majorVersion = Hostinfo_OSVersion(0); >-+ >-+ /* >-+ * FreeBSD 11 and later are identified using >-+ * a different guestId. >-+ */ >-+ if (majorVersion >= 11) { >-+ Str_Strcpy(distroShort, STR_OS_FREEBSD11, sizeof distroShort); >-+ } else { >-+ Str_Strcpy(distroShort, STR_OS_FREEBSD, sizeof distroShort); >- } >- >-- if (nameLen + releaseLen + 1 > sizeof osName) { >-+ if (strlen(distroShort) + 1 > sizeof osName) { >- Warning("%s: Error: buffer too small\n", __FUNCTION__); >- >- return FALSE; >- } >- >-- Str_Strcpy(osName, STR_OS_FREEBSD, sizeof osName); >-+ Str_Strcpy(osName, distroShort, sizeof osName); >- } else if (strstr(osNameFull, "SunOS")) { >- size_t nameLen = sizeof STR_OS_SOLARIS - 1; >- size_t releaseLen = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222048
: 186059 |
186104