Author: brane
Date: Wed Aug 8 15:36:25 2012
New Revision: 1370813
URL: http://svn.apache.org/viewvc?rev=1370813&view=rev
Log:
Expand "svn --version" output with information about the running system
when --verbose is also given on the command line. Currently available:
- Minimal running system info on systems with uname().
- System info and commercial release name on Windows.
* build.conf (libsvn_subr): Require kernel32.lib on Windows.
* configure.ac: Check for uname() in sys/utsname.h.
* subversion/include/svn_opt.h (svn_opt_print_help4): New, with verbose option.
(svn_opt_print_help3): Deprecate.
* subversion/libsvn_subr/sysinfo.c, subversion/libsvn_subr/sysinfo.h: New.
* subversion/libsvn_subr/opt.h (svn_opt__print_version_info): Add "verbose".
* subversion/libsvn_subr/opt.c: Include sysinfo.h.
(svn_opt__print_version_info): In verbose mode, print svn_sysinfo__*.
(svn_opt_print_help4): Implement.
(svn_opt_print_help3): Remove.
* subversion/libsvn_subr/deprecated.c
(svn_opt_print_help3, svn_opt_print_help3): Reimplenment in terms of
svn_opt_print_help4.
(svn_opt_print_help): Update call to svn_opt__print_version_info.
* subversion/svn/main.c: Add --verbose option to "svn --version".
* subversion/svnlook/main.c: Add --verbose option to "svn --version".
Use svn_opt_print_help4 instead of svn_opt_print_help3.
* subversion/svn/help-cmd.c, subversion/svnadmin/main.c,
subversion/svndumpfilter/main.c, subversion/svnmucc/svnmucc.c,
subversion/svnrdump/svnrdump.c, subversion/svnserve/main.c,
subversion/svnsync/main.c, subversion/svnversion/main.c,
tools/dev/svnraisetreeconflict/main.c,
tools/server-side/svn-rep-sharing-stats.c:
Use svn_opt_print_help4 instead of svn_opt_print_help3.
Added:
subversion/trunk/subversion/libsvn_subr/sysinfo.c
subversion/trunk/subversion/libsvn_subr/sysinfo.h
Modified:
subversion/trunk/build.conf
subversion/trunk/configure.ac
subversion/trunk/subversion/include/svn_opt.h
subversion/trunk/subversion/libsvn_subr/deprecated.c
subversion/trunk/subversion/libsvn_subr/opt.c
subversion/trunk/subversion/libsvn_subr/opt.h
subversion/trunk/subversion/svn/help-cmd.c
subversion/trunk/subversion/svn/main.c
subversion/trunk/subversion/svnadmin/main.c
subversion/trunk/subversion/svndumpfilter/main.c
subversion/trunk/subversion/svnlook/main.c
subversion/trunk/subversion/svnmucc/svnmucc.c
subversion/trunk/subversion/svnrdump/svnrdump.c
subversion/trunk/subversion/svnserve/main.c
subversion/trunk/subversion/svnsync/main.c
subversion/trunk/subversion/svnversion/main.c
subversion/trunk/tools/dev/svnraisetreeconflict/main.c
subversion/trunk/tools/server-side/svn-rep-sharing-stats.c
Modified: subversion/trunk/build.conf
URL:
http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Wed Aug 8 15:36:25 2012
@@ -296,7 +296,7 @@ type = lib
install = fsmod-lib
path = subversion/libsvn_subr
libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic
-msvc-libs = advapi32.lib shfolder.lib ole32.lib crypt32.lib version.lib
+msvc-libs = kernel32.lib advapi32.lib shfolder.lib ole32.lib crypt32.lib
version.lib
msvc-export =
svn_auth.h svn_base64.h svn_cache_config.h svn_checksum.h svn_cmdline.h
svn_compat.h svn_config.h svn_ctype.h svn_dirent_uri.h svn_dso.h
Modified: subversion/trunk/configure.ac
URL:
http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Wed Aug 8 15:36:25 2012
@@ -877,6 +877,8 @@ AC_FUNC_VPRINTF
dnl check for functions needed in special file handling
AC_CHECK_FUNCS(symlink readlink)
+dnl check for uname
+AC_CHECK_HEADERS(sys/utsname.h, AC_CHECK_FUNCS(uname), [])
dnl Process some configuration options ----------
Modified: subversion/trunk/subversion/include/svn_opt.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_opt.h?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_opt.h (original)
+++ subversion/trunk/subversion/include/svn_opt.h Wed Aug 8 15:36:25 2012
@@ -680,7 +680,8 @@ svn_opt_parse_path(svn_opt_revision_t *r
* Else, if @a print_version is TRUE, then print version info, in
* brief form if @a quiet is also TRUE; if @a quiet is FALSE, then if
* @a version_footer is non-NULL, print it following the version
- * information.
+ * information. If @a verbose is TRUE, also print information about
+ * the running system and loaded shared libraries, where available.
*
* Else, if @a os is not @c NULL and does not contain arguments, print
* generic help, via svn_opt_print_generic_help2() with the @a header,
@@ -695,8 +696,30 @@ svn_opt_parse_path(svn_opt_revision_t *r
* --version flag *and* subcommand arguments on a help command line.
* The logic for handling such a situation should be in one place.
*
- * @since New in 1.5.
+ * @since New in 1.8.
*/
+
+svn_error_t *
+svn_opt_print_help4(apr_getopt_t *os,
+ const char *pgm_name,
+ svn_boolean_t print_version,
+ svn_boolean_t quiet,
+ svn_boolean_t verbose,
+ const char *version_footer,
+ const char *header,
+ const svn_opt_subcommand_desc2_t *cmd_table,
+ const apr_getopt_option_t *option_table,
+ const int *global_options,
+ const char *footer,
+ apr_pool_t *pool);
+
+/**
+ * Same as svn_opt_print_help4(), but with @a verbose always @c FALSE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
+ */
+
+SVN_DEPRECATED
svn_error_t *
svn_opt_print_help3(apr_getopt_t *os,
const char *pgm_name,
Modified: subversion/trunk/subversion/libsvn_subr/deprecated.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/deprecated.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_subr/deprecated.c Wed Aug 8 15:36:25
2012
@@ -524,6 +524,33 @@ svn_opt_args_to_target_array(apr_array_h
}
svn_error_t *
+svn_opt_print_help3(apr_getopt_t *os,
+ const char *pgm_name,
+ svn_boolean_t print_version,
+ svn_boolean_t quiet,
+ const char *version_footer,
+ const char *header,
+ const svn_opt_subcommand_desc2_t *cmd_table,
+ const apr_getopt_option_t *option_table,
+ const int *global_options,
+ const char *footer,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(svn_opt_print_help4(os,
+ pgm_name,
+ print_version,
+ quiet,
+ FALSE,
+ version_footer,
+ header,
+ cmd_table,
+ option_table,
+ global_options,
+ footer,
+ pool));
+}
+
+svn_error_t *
svn_opt_print_help2(apr_getopt_t *os,
const char *pgm_name,
svn_boolean_t print_version,
@@ -535,10 +562,11 @@ svn_opt_print_help2(apr_getopt_t *os,
const char *footer,
apr_pool_t *pool)
{
- return svn_error_trace(svn_opt_print_help3(os,
+ return svn_error_trace(svn_opt_print_help4(os,
pgm_name,
print_version,
quiet,
+ FALSE,
version_footer,
header,
cmd_table,
@@ -576,8 +604,8 @@ svn_opt_print_help(apr_getopt_t *os,
}
}
else if (print_version) /* just --version */
- SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer, quiet,
- pool));
+ SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
+ quiet, FALSE, pool));
else if (os && !targets->nelts) /* `-h', `--help', or `help' */
svn_opt_print_generic_help(header,
cmd_table,
Modified: subversion/trunk/subversion/libsvn_subr/opt.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.c Wed Aug 8 15:36:25 2012
@@ -49,6 +49,7 @@
#include "private/svn_opt_private.h"
#include "opt.h"
+#include "sysinfo.h"
#include "svn_private_config.h"
@@ -1105,6 +1106,7 @@ svn_error_t *
svn_opt__print_version_info(const char *pgm_name,
const char *footer,
svn_boolean_t quiet,
+ svn_boolean_t verbose,
apr_pool_t *pool)
{
if (quiet)
@@ -1128,15 +1130,38 @@ svn_opt__print_version_info(const char *
SVN_ERR(svn_cmdline_printf(pool, "%s\n", footer));
}
+ if (verbose)
+ {
+ const char *const host = svn_sysinfo__canonical_host(pool);
+ const char *const relname = svn_sysinfo__release_name(pool);
+ const char *const dlibs = svn_sysinfo__loaded_libs(pool);
+
+ SVN_ERR(svn_cmdline_fputs(_("System information:\n\n"), stdout, pool));
+ if (relname)
+ SVN_ERR(svn_cmdline_printf(pool, _("* running on %s\n"
+ " - %s\n"),
+ host, relname));
+ else
+ SVN_ERR(svn_cmdline_printf(pool, _("* running on %s\n"), host));
+
+ if (dlibs)
+ {
+ SVN_ERR(svn_cmdline_fputs(_("\nLoaded shared libraries:\n"),
+ stdout, pool));
+ SVN_ERR(svn_cmdline_printf(pool, "\n%s\n", dlibs));
+ }
+ }
+
return SVN_NO_ERROR;
}
svn_error_t *
-svn_opt_print_help3(apr_getopt_t *os,
+svn_opt_print_help4(apr_getopt_t *os,
const char *pgm_name,
svn_boolean_t print_version,
svn_boolean_t quiet,
+ svn_boolean_t verbose,
const char *version_footer,
const char *header,
const svn_opt_subcommand_desc2_t *cmd_table,
@@ -1162,8 +1187,8 @@ svn_opt_print_help3(apr_getopt_t *os,
}
}
else if (print_version) /* just --version */
- SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer, quiet,
- pool));
+ SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
+ quiet, verbose, pool));
else if (os && !targets->nelts) /* `-h', `--help', or `help' */
svn_opt_print_generic_help2(header,
cmd_table,
Modified: subversion/trunk/subversion/libsvn_subr/opt.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.h?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.h (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.h Wed Aug 8 15:36:25 2012
@@ -33,7 +33,7 @@ extern "C" {
/* Print version info for PGM_NAME. If QUIET is true, print in
* brief. Else if QUIET is not true, print the version more
* verbosely, and if FOOTER is non-null, print it following the
- * version information.
+ * version information. If VERBOSE is true, print running system info.
*
* Use POOL for temporary allocations.
*/
@@ -41,6 +41,7 @@ svn_error_t *
svn_opt__print_version_info(const char *pgm_name,
const char *footer,
svn_boolean_t quiet,
+ svn_boolean_t verbose,
apr_pool_t *pool);
#ifdef __cplusplus
Added: subversion/trunk/subversion/libsvn_subr/sysinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sysinfo.c?rev=1370813&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sysinfo.c (added)
+++ subversion/trunk/subversion/libsvn_subr/sysinfo.c Wed Aug 8 15:36:25 2012
@@ -0,0 +1,470 @@
+/*
+ * sysinfo.c : information about the running system
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ */
+
+
+
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#define APR_WANT_STRFUNC
+#include <apr_want.h>
+
+#include <apr_lib.h>
+#include <apr_pools.h>
+
+#include "svn_ctype.h"
+#include "svn_error.h"
+#include "svn_utf.h"
+
+#include "sysinfo.h"
+#include "svn_private_config.h"
+
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
+#if HAVE_UNAME
+static const char* canonical_host_from_uname(apr_pool_t *pool);
+#endif
+
+#ifdef WIN32
+static const char * win32_canonical_host(apr_pool_t *pool);
+static const char * win32_release_name(apr_pool_t *pool);
+#endif /* WIN32 */
+
+
+const char *
+svn_sysinfo__canonical_host(apr_pool_t *pool)
+{
+#if HAVE_UNAME
+ return canonical_host_from_uname(pool);
+#elif defined(WIN32)
+ return win32_canonical_host(pool);
+#else
+ return "unknown-unknown-unknown";
+#endif
+}
+
+
+const char *
+svn_sysinfo__release_name(apr_pool_t *pool)
+{
+#ifdef WIN32
+ return win32_release_name(pool);
+#else
+ return NULL;
+#endif
+}
+
+
+const char *
+svn_sysinfo__loaded_libs(apr_pool_t *pool)
+{
+ return NULL;
+}
+
+
+#if HAVE_UNAME
+static const char*
+canonical_host_from_uname(apr_pool_t *pool)
+{
+ const char *machine = "unknown";
+ const char *vendor = "unknown";
+ const char *sysname = "unknown";
+ const char *sysver = "";
+ struct utsname info;
+
+ if (0 <= uname(&info))
+ {
+ svn_error_t *err;
+ const char *tmp;
+
+ err = svn_utf_cstring_to_utf8(&tmp, info.machine, pool);
+ if (err)
+ svn_error_clear(err);
+ else
+ machine = tmp;
+
+ err = svn_utf_cstring_to_utf8(&tmp, info.sysname, pool);
+ if (err)
+ svn_error_clear(err);
+ else
+ {
+ char *lwr = apr_pstrdup(pool, tmp);
+ char *it = lwr;
+ while (*it)
+ {
+ if (svn_ctype_isupper(*it))
+ *it = apr_tolower(*it);
+ ++it;
+ }
+ sysname = lwr;
+ }
+
+ if (0 == strcmp(sysname, "darwin"))
+ vendor = "apple";
+
+ err = svn_utf_cstring_to_utf8(&tmp, info.release, pool);
+ if (err)
+ svn_error_clear(err);
+ else
+ sysver = tmp;
+ }
+
+ return apr_psprintf(pool, "%s-%s-%s%s", machine, vendor, sysname, sysver);
+}
+#endif /* HAVE_UNAME */
+
+
+#ifdef WIN32
+typedef DWORD (WINAPI *FNGETNATIVESYSTEMINFO)(LPSYSTEM_INFO);
+typedef BOOL (WINAPI *FNGETPRODUCTINFO)(DWORD, DWORD, DWORD, DWORD, PDWORD);
+
+static BOOL
+system_info(SYSTEM_INFO *sysinfo,
+ SYSTEM_INFO *local_sysinfo,
+ OSVERSIONINFOEXW *osinfo)
+{
+ FNGETNATIVESYSTEMINFO GetNativeSystemInfo_ = (FNGETNATIVESYSTEMINFO)
+ GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetNativeSystemInfo");
+
+ ZeroMemory(sysinfo, sizeof *sysinfo);
+ if (local_sysinfo)
+ {
+ ZeroMemory(local_sysinfo, sizeof *local_sysinfo);
+ GetSystemInfo(local_sysinfo);
+ if (GetNativeSystemInfo_)
+ GetNativeSystemInfo_(sysinfo);
+ else
+ memcpy(sysinfo, local_sysinfo, sizeof *sysinfo);
+ }
+ else
+ GetSystemInfo(sysinfo);
+
+ ZeroMemory(osinfo, sizeof *osinfo);
+ osinfo->dwOSVersionInfoSize = sizeof *osinfo;
+ if (!GetVersionExW((LPVOID)osinfo))
+ return FALSE;
+
+ return TRUE;
+}
+
+static const char *
+processor_name(SYSTEM_INFO *sysinfo)
+{
+ switch (sysinfo->wProcessorArchitecture)
+ {
+ case PROCESSOR_ARCHITECTURE_AMD64: return "x86_64";
+ case PROCESSOR_ARCHITECTURE_IA64: return "ia64";
+ case PROCESSOR_ARCHITECTURE_INTEL: return "x86";
+ case PROCESSOR_ARCHITECTURE_MIPS: return "mips";
+ case PROCESSOR_ARCHITECTURE_ALPHA: return "alpha32";
+ case PROCESSOR_ARCHITECTURE_PPC: return "powerpc";
+ case PROCESSOR_ARCHITECTURE_SHX: return "shx";
+ case PROCESSOR_ARCHITECTURE_ARM: return "arm";
+ case PROCESSOR_ARCHITECTURE_ALPHA64: return "alpha";
+ case PROCESSOR_ARCHITECTURE_MSIL: return "msil";
+ case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: return "x86_wow64";
+ default: return "unknown";
+ }
+}
+
+static char *
+default_release_name(OSVERSIONINFOEXW *osinfo, apr_pool_t *pool)
+{
+ return apr_psprintf(pool, "Windows v%u.%u",
+ (unsigned int)osinfo->dwMajorVersion,
+ (unsigned int)osinfo->dwMinorVersion);
+}
+
+static const char *
+win32_canonical_host(apr_pool_t *pool)
+{
+ SYSTEM_INFO sysinfo;
+ SYSTEM_INFO local_sysinfo;
+ OSVERSIONINFOEXW osinfo;
+
+ if (system_info(&sysinfo, &local_sysinfo, &osinfo))
+ {
+ const char *arch = processor_name(&local_sysinfo);
+ const char *machine = processor_name(&sysinfo);
+ const char *vendor = "microsoft";
+ const char *sysname = "windows";
+ const char *sysver = apr_psprintf(pool, "%u.%u.%u",
+ (unsigned int)osinfo.dwMajorVersion,
+ (unsigned int)osinfo.dwMinorVersion,
+ (unsigned int)osinfo.dwBuildNumber);
+
+ if (sysinfo.wProcessorArchitecture
+ == local_sysinfo.wProcessorArchitecture)
+ return apr_psprintf(pool, "%s-%s-%s%s",
+ machine, vendor, sysname, sysver);
+ return apr_psprintf(pool, "%s/%s-%s-%s%s",
+ arch, machine, vendor, sysname, sysver);
+ }
+
+ return "unknown-microsoft-windows";
+}
+
+static const char *
+win32_release_name(apr_pool_t *pool)
+{
+ SYSTEM_INFO sysinfo;
+ OSVERSIONINFOEXW osinfo;
+ char *relname = NULL;
+
+ if (!system_info(&sysinfo, NULL, &osinfo))
+ return NULL;
+
+ if (6 == osinfo.dwMajorVersion)
+ {
+ FNGETPRODUCTINFO GetProductInfo_ = (FNGETPRODUCTINFO)
+ GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetProductInfo");
+ DWORD product_type;
+
+ if (osinfo.wProductType == VER_NT_WORKSTATION)
+ switch (osinfo.dwMinorVersion)
+ {
+ case 2: relname = "Windows 8"; break;
+ case 1: relname = "Windows 7"; break;
+ case 0: relname = "Windows Vista"; break;
+ }
+ else
+ switch (osinfo.dwMinorVersion)
+ {
+ case 2: relname = "Windows Server 2012"; break;
+ case 1: relname = "Windows Server 2008 R2"; break;
+ case 0: relname = "Windows Server 2008"; break;
+ }
+ if (!relname)
+ relname = default_release_name(&osinfo, pool);
+
+ GetProductInfo_(osinfo.dwMajorVersion, osinfo.dwMinorVersion,
+ 0, 0, &product_type);
+ switch (product_type)
+ {
+ case PRODUCT_ULTIMATE:
+ relname = apr_pstrcat(pool, relname, " Ultimate Edition", NULL);
+ break;
+ case PRODUCT_PROFESSIONAL:
+ relname = apr_pstrcat(pool, relname, " Professional", NULL);
+ break;
+ case PRODUCT_HOME_PREMIUM:
+ relname = apr_pstrcat(pool, relname, " Home Premium Edition", NULL);
+ break;
+ case PRODUCT_HOME_BASIC:
+ relname = apr_pstrcat(pool, relname, " Home Basic Edition", NULL);
+ break;
+ case PRODUCT_ENTERPRISE:
+ relname = apr_pstrcat(pool, relname, " Enterprise Edition", NULL);
+ break;
+ case PRODUCT_BUSINESS:
+ relname = apr_pstrcat(pool, relname, " Business Edition", NULL);
+ break;
+ case PRODUCT_STARTER:
+ relname = apr_pstrcat(pool, relname, " Starter Edition", NULL);
+ break;
+ case PRODUCT_CLUSTER_SERVER:
+ relname = apr_pstrcat(pool, relname,
+ " Cluster Server Edition", NULL);
+ break;
+ case PRODUCT_DATACENTER_SERVER:
+ relname = apr_pstrcat(pool, relname, " Datacenter Edition", NULL);
+ break;
+ case PRODUCT_DATACENTER_SERVER_CORE:
+ relname = apr_pstrcat(pool, relname,
+ " Datacenter Edition (core installation)",
+ NULL);
+ break;
+ case PRODUCT_ENTERPRISE_SERVER:
+ relname = apr_pstrcat(pool, relname, " Enterprise Edition", NULL);
+ break;
+ case PRODUCT_ENTERPRISE_SERVER_CORE:
+ relname = apr_pstrcat(pool, relname,
+ " Enterprise Edition (core installation)",
+ NULL);
+ break;
+ case PRODUCT_ENTERPRISE_SERVER_IA64:
+ relname = apr_pstrcat(pool, relname,
+ " Enterprise Edition for Itanium", NULL);
+ break;
+ case PRODUCT_SMALLBUSINESS_SERVER:
+ relname = apr_pstrcat(pool, relname,
+ " Small Business Server Edition", NULL);
+ break;
+ case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
+ relname = apr_pstrcat(pool, relname,
+ " Small Business Server Premium Edition",
+ NULL);
+ break;
+ case PRODUCT_STANDARD_SERVER:
+ relname = apr_pstrcat(pool, relname, " Standard Edition", NULL);
+ break;
+ case PRODUCT_STANDARD_SERVER_CORE:
+ relname = apr_pstrcat(pool, relname,
+ " Standard Edition (core installation)",
+ NULL);
+ break;
+ case PRODUCT_WEB_SERVER:
+ relname = apr_pstrcat(pool, relname, " Web Server Edition", NULL);
+ break;
+ }
+ }
+ else if (5 == osinfo.dwMajorVersion)
+ {
+ switch (osinfo.dwMinorVersion)
+ {
+ case 2:
+ if (GetSystemMetrics(SM_SERVERR2))
+ relname = "Windows Server 2003 R2";
+ else if (osinfo.wSuiteMask & VER_SUITE_STORAGE_SERVER)
+ relname = "Windows Storage Server 2003";
+ else if (osinfo.wSuiteMask & VER_SUITE_WH_SERVER)
+ relname = "Windows Home Server";
+ else if (osinfo.wProductType == VER_NT_WORKSTATION
+ && (sysinfo.wProcessorArchitecture
+ == PROCESSOR_ARCHITECTURE_AMD64))
+ relname = "Windows XP Professional x64 Edition";
+ else
+ relname = "Windows Server 2003";
+
+ if (osinfo.wProductType != VER_NT_WORKSTATION)
+ switch (sysinfo.wProcessorArchitecture)
+ {
+ case PROCESSOR_ARCHITECTURE_IA64:
+ if (osinfo.wSuiteMask & VER_SUITE_DATACENTER)
+ relname = apr_pstrcat(pool, relname,
+ " Datacenter Edition for Itanium",
+ NULL);
+ else if (osinfo.wSuiteMask & VER_SUITE_ENTERPRISE)
+ relname = apr_pstrcat(pool, relname,
+ " Enterprise Edition for Itanium",
+ NULL);
+ break;
+
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ if (osinfo.wSuiteMask & VER_SUITE_DATACENTER)
+ relname = apr_pstrcat(pool, relname,
+ " Datacenter x64 Edition", NULL);
+ else if (osinfo.wSuiteMask & VER_SUITE_ENTERPRISE)
+ relname = apr_pstrcat(pool, relname,
+ " Enterprise x64 Edition", NULL);
+ else
+ relname = apr_pstrcat(pool, relname,
+ " Standard x64 Edition", NULL);
+ break;
+
+ default:
+ if (osinfo.wSuiteMask & VER_SUITE_COMPUTE_SERVER)
+ relname = apr_pstrcat(pool, relname,
+ " Compute Cluster Edition", NULL);
+ else if (osinfo.wSuiteMask & VER_SUITE_DATACENTER)
+ relname = apr_pstrcat(pool, relname,
+ " Datacenter Edition", NULL);
+ else if (osinfo.wSuiteMask & VER_SUITE_ENTERPRISE)
+ relname = apr_pstrcat(pool, relname,
+ " Enterprise Edition", NULL);
+ else if (osinfo.wSuiteMask & VER_SUITE_BLADE)
+ relname = apr_pstrcat(pool, relname, " Web Edition", NULL);
+ else
+ relname = apr_pstrcat(pool, relname,
+ " Standard Edition", NULL);
+ }
+ break;
+
+ case 1:
+ if (osinfo.wSuiteMask & VER_SUITE_PERSONAL)
+ relname = "Windows XP Home";
+ else
+ relname = "Windows XP Professional";
+ break;
+
+ case 0:
+ if (osinfo.wProductType == VER_NT_WORKSTATION)
+ relname = "Windows 2000 Professional";
+ else
+ {
+ if (osinfo.wSuiteMask & VER_SUITE_DATACENTER)
+ relname = "Windows 2000 Datacenter Server";
+ else if (osinfo.wSuiteMask & VER_SUITE_ENTERPRISE)
+ relname = "Windows 2000 Advanced Server";
+ else
+ relname = "Windows 2000 Server";
+ }
+ break;
+
+ default:
+ relname = default_release_name(&osinfo, pool);
+ }
+ }
+ else if (5 > osinfo.dwMajorVersion)
+ {
+ relname = apr_psprintf(pool, "Windows NT %d.%d%s",
+ (unsigned int)osinfo.dwMajorVersion,
+ (unsigned int)osinfo.dwMinorVersion,
+ (osinfo.wProductType != VER_NT_WORKSTATION
+ ? " Server" : ""));
+ }
+ else
+ {
+ relname = default_release_name(&osinfo, pool);
+ }
+
+ if (*osinfo.szCSDVersion)
+ {
+ const int bufsize = WideCharToMultiByte(CP_UTF8, 0,
+ osinfo.szCSDVersion, -1,
+ NULL, 0, NULL, NULL);
+ if (bufsize > 0)
+ {
+ char *const servicepack = apr_palloc(pool, bufsize + 1);
+ WideCharToMultiByte(CP_UTF8, 0,
+ osinfo.szCSDVersion, -1,
+ servicepack, bufsize,
+ NULL, NULL);
+ relname = apr_psprintf(pool, "%s, %s, build %d",
+ relname, servicepack,
+ (unsigned int)osinfo.dwBuildNumber);
+ }
+ /* Assume wServicePackMajor > 0 if szCSDVersion is not empty */
+ else if (osinfo.wServicePackMinor)
+ relname = apr_psprintf(pool, "%s SP%d.%d, build %d", relname,
+ (unsigned int)osinfo.wServicePackMajor,
+ (unsigned int)osinfo.wServicePackMinor,
+ (unsigned int)osinfo.dwBuildNumber);
+ else
+ relname = apr_psprintf(pool, "%s SP%d, build %d", relname,
+ (unsigned int)osinfo.wServicePackMajor,
+ (unsigned int)osinfo.dwBuildNumber);
+ }
+ else
+ {
+ relname = apr_psprintf(pool, "%s, build %d", relname,
+ (unsigned int)osinfo.dwBuildNumber);
+ }
+
+ return relname;
+}
+#endif /* WIN32 */
Added: subversion/trunk/subversion/libsvn_subr/sysinfo.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sysinfo.h?rev=1370813&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sysinfo.h (added)
+++ subversion/trunk/subversion/libsvn_subr/sysinfo.h Wed Aug 8 15:36:25 2012
@@ -0,0 +1,59 @@
+/*
+ * sysinfo.h: share svn_sysinfo__* functions
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ */
+
+#ifndef SVN_LIBSVN_SUBR_SYSINFO_H
+#define SVN_LIBSVN_SUBR_SYSINFO_H
+
+#include <apr_pools.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Return a canonical name similar to the output of config.guess,
+ * identifying the running system.
+ *
+ * All allocations are done in POOL.
+ */
+const char *svn_sysinfo__canonical_host(apr_pool_t *pool);
+
+/* Return the release name (i.e., marketing name) of the running
+ * system, or NULL if it's not available.
+ *
+ * All allocations are done in POOL.
+ */
+const char *svn_sysinfo__release_name(apr_pool_t *pool);
+
+/* Return a string containing a list of shared libraries loaded by the
+ * running process, including their versions where applicable, or NULL
+ * if the information is not available.
+ *
+ * All allocations are done in POOL.
+ */
+const char *svn_sysinfo__loaded_libs(apr_pool_t *pool);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_LIBSVN_SUBR_SYSINFO_H */
Modified: subversion/trunk/subversion/svn/help-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/help-cmd.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/help-cmd.c (original)
+++ subversion/trunk/subversion/svn/help-cmd.c Wed Aug 8 15:36:25 2012
@@ -79,10 +79,11 @@ svn_cl__help(apr_getopt_t *os,
version_footer = svn_stringbuf_create(ra_desc_start, pool);
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- return svn_opt_print_help3(os,
+ return svn_opt_print_help4(os,
"svn", /* ### erm, derive somehow? */
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ opt_state ? opt_state->verbose : FALSE,
version_footer->data,
help_header, /* already gettext()'d */
svn_cl__cmd_table,
Modified: subversion/trunk/subversion/svn/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Wed Aug 8 15:36:25 2012
@@ -2187,6 +2187,7 @@ sub_main(int argc, const char *argv[], a
{ "--version", svn_cl__help, {0}, "",
{opt_version, /* must accept its own option */
'q', /* brief output */
+ 'v', /* verbose output */
opt_config_dir /* all commands accept this */
} };
Modified: subversion/trunk/subversion/svnadmin/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/main.c (original)
+++ subversion/trunk/subversion/svnadmin/main.c Wed Aug 8 15:36:25 2012
@@ -990,9 +990,10 @@ subcommand_help(apr_getopt_t *os, void *
version_footer = svn_stringbuf_create(fs_desc_start, pool);
SVN_ERR(svn_fs_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnadmin",
+ SVN_ERR(svn_opt_print_help4(os, "svnadmin",
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
version_footer->data,
header, cmd_table, options_table, NULL, NULL,
pool));
Modified: subversion/trunk/subversion/svndumpfilter/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/main.c (original)
+++ subversion/trunk/subversion/svndumpfilter/main.c Wed Aug 8 15:36:25 2012
@@ -1135,11 +1135,12 @@ subcommand_help(apr_getopt_t *os, void *
"\n"
"Available subcommands:\n");
- SVN_ERR(svn_opt_print_help3(os, "svndumpfilter",
+ SVN_ERR(svn_opt_print_help4(os, "svndumpfilter",
opt_state ? opt_state->version : FALSE,
- opt_state ? opt_state->quiet : FALSE, NULL,
- header, cmd_table, options_table, NULL,
- NULL, pool));
+ opt_state ? opt_state->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
+ NULL, header, cmd_table, options_table,
+ NULL, NULL, pool));
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/svnlook/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnlook/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnlook/main.c (original)
+++ subversion/trunk/subversion/svnlook/main.c Wed Aug 8 15:36:25 2012
@@ -2049,9 +2049,10 @@ subcommand_help(apr_getopt_t *os, void *
version_footer = svn_stringbuf_create(fs_desc_start, pool);
SVN_ERR(svn_fs_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnlook",
+ SVN_ERR(svn_opt_print_help4(os, "svnlook",
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ opt_state ? opt_state->verbose : FALSE,
version_footer->data,
header, cmd_table, options_table, NULL,
NULL, pool));
@@ -2447,7 +2448,7 @@ main(int argc, const char *argv[])
static const svn_opt_subcommand_desc2_t pseudo_cmd =
{ "--version", subcommand_help, {0}, "",
{svnlook__version, /* must accept its own option */
- 'q',
+ 'q', 'v',
} };
subcommand = &pseudo_cmd;
Modified: subversion/trunk/subversion/svnmucc/svnmucc.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnmucc/svnmucc.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnmucc/svnmucc.c (original)
+++ subversion/trunk/subversion/svnmucc/svnmucc.c Wed Aug 8 15:36:25 2012
@@ -940,7 +940,8 @@ display_version(apr_getopt_t *os, apr_po
version_footer = svn_stringbuf_create(ra_desc_start, pool);
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnmucc", TRUE, FALSE, version_footer->data,
+ SVN_ERR(svn_opt_print_help4(os, "svnmucc", TRUE, FALSE, FALSE,
+ version_footer->data,
NULL, NULL, NULL, NULL, NULL, pool));
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.c Wed Aug 8 15:36:25 2012
@@ -505,8 +505,8 @@ version(const char *progname,
pool);
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- return svn_opt_print_help3(NULL, ensure_appname(progname, pool),
- TRUE, quiet, version_footer->data,
+ return svn_opt_print_help4(NULL, ensure_appname(progname, pool),
+ TRUE, quiet, FALSE, version_footer->data,
NULL, NULL, NULL, NULL, NULL, pool);
}
@@ -579,9 +579,9 @@ help_cmd(apr_getopt_t *os,
"\n"
"Available subcommands:\n");
- return svn_opt_print_help3(os, "svnrdump", FALSE, FALSE, NULL, header,
- svnrdump__cmd_table, svnrdump__options, NULL,
- NULL, pool);
+ return svn_opt_print_help4(os, "svnrdump", FALSE, FALSE, FALSE, NULL,
+ header, svnrdump__cmd_table, svnrdump__options,
+ NULL, NULL, pool);
}
/* Examine the OPT_BATON's 'start_revision' and 'end_revision'
Modified: subversion/trunk/subversion/svnserve/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/main.c (original)
+++ subversion/trunk/subversion/svnserve/main.c Wed Aug 8 15:36:25 2012
@@ -327,7 +327,8 @@ static svn_error_t * version(svn_boolean
_("\nCyrus SASL authentication is available.\n"));
#endif
- return svn_opt_print_help3(NULL, "svnserve", TRUE, quiet,
version_footer->data,
+ return svn_opt_print_help4(NULL, "svnserve", TRUE, quiet, FALSE,
+ version_footer->data,
NULL, NULL, NULL, NULL, NULL, pool);
}
Modified: subversion/trunk/subversion/svnsync/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/main.c (original)
+++ subversion/trunk/subversion/svnsync/main.c Wed Aug 8 15:36:25 2012
@@ -1857,9 +1857,10 @@ help_cmd(apr_getopt_t *os, void *baton,
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnsync",
+ SVN_ERR(svn_opt_print_help4(os, "svnsync",
opt_baton ? opt_baton->version : FALSE,
opt_baton ? opt_baton->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
version_footer->data, header,
svnsync_cmd_table, svnsync_options, NULL,
NULL, pool));
Modified: subversion/trunk/subversion/svnversion/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnversion/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/subversion/svnversion/main.c (original)
+++ subversion/trunk/subversion/svnversion/main.c Wed Aug 8 15:36:25 2012
@@ -37,8 +37,8 @@
static svn_error_t *
version(svn_boolean_t quiet, apr_pool_t *pool)
{
- return svn_opt_print_help3(NULL, "svnversion", TRUE, quiet, NULL, NULL,
- NULL, NULL, NULL, NULL, pool);
+ return svn_opt_print_help4(NULL, "svnversion", TRUE, quiet, FALSE,
+ NULL, NULL, NULL, NULL, NULL, NULL, pool);
}
static void
Modified: subversion/trunk/tools/dev/svnraisetreeconflict/main.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/dev/svnraisetreeconflict/main.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/tools/dev/svnraisetreeconflict/main.c (original)
+++ subversion/trunk/tools/dev/svnraisetreeconflict/main.c Wed Aug 8 15:36:25
2012
@@ -67,8 +67,8 @@
static svn_error_t *
version(apr_pool_t *pool)
{
- return svn_opt_print_help3(NULL, "svnraisetreeconflict", TRUE, FALSE, NULL,
- NULL, NULL, NULL, NULL, NULL, pool);
+ return svn_opt_print_help4(NULL, "svnraisetreeconflict", TRUE, FALSE, FALSE,
+ NULL, NULL, NULL, NULL, NULL, NULL, pool);
}
static void
Modified: subversion/trunk/tools/server-side/svn-rep-sharing-stats.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svn-rep-sharing-stats.c?rev=1370813&r1=1370812&r2=1370813&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svn-rep-sharing-stats.c (original)
+++ subversion/trunk/tools/server-side/svn-rep-sharing-stats.c Wed Aug 8
15:36:25 2012
@@ -42,8 +42,8 @@
static svn_error_t *
version(apr_pool_t *pool)
{
- return svn_opt_print_help3(NULL, "svn-rep-sharing-stats", TRUE, FALSE, NULL,
- NULL, NULL, NULL, NULL, NULL, pool);
+ return svn_opt_print_help4(NULL, "svn-rep-sharing-stats", TRUE, FALSE, FALSE,
+ NULL, NULL, NULL, NULL, NULL, NULL, pool);
}
static void