summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-12-11 00:11:43 +0100
committerSergei Golubchik <serg@mariadb.org>2023-01-19 12:39:28 +0100
commiteb26bf6e09f714bfeda8e411b411b4991edf1c4d (patch)
tree0962cb1e582513a7c044a424c3b8885a2c9e1f03 /extra
parent314e50b464e31a45c791ea47661efdadf924cfc5 (diff)
downloadmariadb-git-eb26bf6e09f714bfeda8e411b411b4991edf1c4d.tar.gz
unify client/tool version string
it should now always be /path/to/exe Ver <tool version> Distrib <server version> for <OS> (<ARCH>) in all tools and clients
Diffstat (limited to 'extra')
-rw-r--r--extra/innochecksum.cc16
-rw-r--r--extra/mariabackup/xbstream.cc11
-rw-r--r--extra/my_print_defaults.c13
-rw-r--r--extra/perror.c9
-rw-r--r--extra/replace.c6
-rw-r--r--extra/resolve_stack_dump.c10
-rw-r--r--extra/resolveip.c10
7 files changed, 16 insertions, 59 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index fc616f1aa14..1f7f341e397 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -26,6 +26,8 @@
Published with a permission.
*/
+#define VER "1.0"
+
#include <my_global.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1209,20 +1211,6 @@ static struct my_option innochecksum_options[] = {
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-/** Print out the version and build information. */
-static void print_version()
-{
-#ifdef DBUG_OFF
- printf("%s Ver %s, for %s (%s)\n",
- my_progname, PACKAGE_VERSION,
- SYSTEM_TYPE, MACHINE_TYPE);
-#else
- printf("%s-debug Ver %s, for %s (%s)\n",
- my_progname, PACKAGE_VERSION,
- SYSTEM_TYPE, MACHINE_TYPE);
-#endif /* DBUG_OFF */
-}
-
static void usage(void)
{
print_version();
diff --git a/extra/mariabackup/xbstream.cc b/extra/mariabackup/xbstream.cc
index 6306806b867..3a3ba55b8b2 100644
--- a/extra/mariabackup/xbstream.cc
+++ b/extra/mariabackup/xbstream.cc
@@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
*******************************************************/
+#define VER "1.0"
#include <my_global.h>
#include <my_base.h>
#include <my_getopt.h>
@@ -26,8 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "common.h"
#include "xbstream.h"
#include "datasink.h"
+#include <welcome_copyright_notice.h>
-#define XBSTREAM_VERSION "1.0"
#define XBSTREAM_BUFFER_SIZE (10 * 1024 * 1024UL)
#define START_FILE_HASH_SIZE 16
@@ -148,14 +149,6 @@ get_options(int *argc, char ***argv)
static
void
-print_version(void)
-{
- printf("%s Ver %s for %s (%s)\n", my_progname, XBSTREAM_VERSION,
- SYSTEM_TYPE, MACHINE_TYPE);
-}
-
-static
-void
usage(void)
{
print_version();
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index ef2f483556a..6aa60aa8ce8 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -21,13 +21,14 @@
**
** Written by Monty
*/
-
+#define VER "1.7"
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <my_getopt.h>
#include <my_default.h>
#include <mysql_version.h>
+#include <welcome_copyright_notice.h>
#define load_default_groups mysqld_groups
#include <mysqld_default_groups.h>
@@ -68,16 +69,10 @@ static void cleanup_and_exit(int exit_code)
exit(exit_code);
}
-static void version()
-{
- printf("%s Ver 1.7 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
-}
-
-
static void usage() __attribute__ ((noreturn));
static void usage()
{
- version();
+ print_version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Displays the options from option groups of option files, which is useful to see which options a particular tool will use");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
@@ -104,7 +99,7 @@ get_one_option(const struct my_option *opt __attribute__((unused)),
verbose++;
break;
case 'V':
- version();
+ print_version();
/* fall through */
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
diff --git a/extra/perror.c b/extra/perror.c
index ee6e362e06b..c9e9ae6e334 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -16,7 +16,7 @@
/* Return error-text for system error messages and handler messages */
-#define PERROR_VERSION "2.11"
+#define VER "2.11"
#include <my_global.h>
#include <my_sys.h>
@@ -76,13 +76,6 @@ static HA_ERRORS ha_errlist[]=
};
-static void print_version(void)
-{
- printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION,
- SYSTEM_TYPE,MACHINE_TYPE);
-}
-
-
static void usage(void)
{
print_version();
diff --git a/extra/replace.c b/extra/replace.c
index 8b20f812be0..81c7f484bdf 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -41,12 +41,13 @@
Written by Monty.
fill_buffer_retaining() is taken from gnu-grep and modified.
*/
-
+#define VER "1.4"
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>
+#include <welcome_copyright_notice.h>
#define PC_MALLOC 256 /* Bytes for pointers */
#define PS_MALLOC 512 /* Bytes for data */
@@ -176,8 +177,7 @@ static int static_get_options(int *argc, char***argv)
case 'I':
case '?':
help=1; /* Help text written */
- printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE,
- MACHINE_TYPE);
+ print_version();
if (version)
break;
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index fe2f297fd33..2b09f5bf1fb 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -18,6 +18,7 @@
versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
*/
+#define VER "1.4"
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
@@ -25,11 +26,11 @@
#include <mysql_version.h>
#include <errno.h>
#include <my_getopt.h>
+#include <welcome_copyright_notice.h>
#define INIT_SYM_TABLE 4096
#define INC_SYM_TABLE 4096
#define MAX_SYM_SIZE 128
-#define DUMP_VERSION "1.4"
#define HEX_INVALID (uchar)255
typedef ulong my_long_addr_t ; /* at some point, we need to fix configure
@@ -65,13 +66,6 @@ static struct my_option my_long_options[] =
static void verify_sort();
static void clean_up();
-static void print_version(void)
-{
- printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
- MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
-}
-
-
static void usage()
{
print_version();
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 890912d9850..d964802d3b3 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -16,7 +16,7 @@
/* Resolves IP's to hostname and hostnames to IP's */
-#define RESOLVE_VERSION "2.3"
+#define VER "2.3"
#include <my_global.h>
#include <m_ctype.h>
@@ -31,6 +31,7 @@
#endif
#include <my_net.h>
#include <my_getopt.h>
+#include <welcome_copyright_notice.h>
#if !defined(_AIX) && !defined(h_errno)
extern int h_errno;
@@ -52,13 +53,6 @@ static struct my_option my_long_options[] =
};
-static void print_version(void)
-{
- printf("%s Ver %s, for %s (%s)\n",my_progname,RESOLVE_VERSION,
- SYSTEM_TYPE,MACHINE_TYPE);
-}
-
-
static void usage(void)
{
print_version();