From b8d85c62517da91cf49428a419eca10cf82682f2 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 2 Sep 2016 19:43:53 +0100 Subject: Update stuff for the new versioning system. --- configure | 2 +- include/modules.h | 4 ++-- make/common.pm | 15 ++++++++++----- make/template/config.h | 3 +-- make/template/inspircd | 2 +- make/template/inspircd-genssl.1 | 2 +- make/template/inspircd.1 | 2 +- src/inspircd.cpp | 2 +- src/logger.cpp | 2 +- src/server.cpp | 2 +- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/configure b/configure index efb19bfc1..025492e01 100755 --- a/configure +++ b/configure @@ -124,7 +124,7 @@ our $interactive = !( ); my %version = get_version(); -print_format "<|BOLD Configuring InspIRCd $version{MAJOR}.$version{MINOR}.$version{PATCH}+$version{LABEL} on $^O.|>\n"; +print_format "<|BOLD Configuring InspIRCd $version{FULL} on $^O.|>\n"; our %config; if ($interactive) { diff --git a/include/modules.h b/include/modules.h index 02460a38e..5deed943a 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1277,7 +1277,7 @@ struct AllModuleList { } \ return TRUE; \ } \ - extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION " " INSPIRCD_REVISION; + extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION; #else @@ -1286,7 +1286,7 @@ struct AllModuleList { { \ return new y; \ } \ - extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION " " INSPIRCD_REVISION; + extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION; #endif #define COMMAND_INIT(c) MODULE_INIT(CommandModule) diff --git a/make/common.pm b/make/common.pm index ea4c2a50c..53ee3f778 100644 --- a/make/common.pm +++ b/make/common.pm @@ -50,7 +50,7 @@ sub get_version { # Attempt to retrieve version information from src/version.sh chomp(my $vf = `sh src/version.sh 2>/dev/null`); - if ($vf =~ /^InspIRCd-([0-9]+)\.([0-9]+)\.([0-9]+)(?:\+(\w+))?$/) { + if ($vf =~ /^InspIRCd-([0-9]+)\.([0-9]+)\.([0-9]+)(?:-(\w+))?$/) { %version = ( MAJOR => $1, MINOR => $2, PATCH => $3, LABEL => $4 ); } @@ -63,10 +63,6 @@ sub get_version { $version{LABEL} = $4 if defined $4; } - # The user is using a stable release which does not have - # a label attached. - $version{LABEL} //= 'release'; - # If any of these fields are missing then the user has deleted the # version file and is not running from Git. Fill in the fields with # dummy data so we don't get into trouble with undef values later. @@ -74,6 +70,15 @@ sub get_version { $version{MINOR} //= '0'; $version{PATCH} //= '0'; + # If there is no label then the user is using a stable release which + # does not have a label attached. + if (defined $version{LABEL}) { + $version{FULL} = "$version{MAJOR}.$version{MINOR}.$version{PATCH}-$version{LABEL}" + } else { + $version{LABEL} = 'release'; + $version{FULL} = "$version{MAJOR}.$version{MINOR}.$version{PATCH}" + } + return %version; } diff --git a/make/template/config.h b/make/template/config.h index 513c550f5..660678b38 100644 --- a/make/template/config.h +++ b/make/template/config.h @@ -20,8 +20,7 @@ #pragma once #define INSPIRCD_BRANCH "InspIRCd-@VERSION_MAJOR@.@VERSION_MINOR@" -#define INSPIRCD_VERSION "InspIRCd-@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@" -#define INSPIRCD_REVISION "@VERSION_LABEL@" +#define INSPIRCD_VERSION "InspIRCd-@VERSION_FULL@" #define INSPIRCD_SYSTEM "@SYSTEM_NAME_VERSION@" #define INSPIRCD_CONFIG_PATH "@CONFIG_DIR@" diff --git a/make/template/inspircd b/make/template/inspircd index cb2d2902d..949f85cee 100644 --- a/make/template/inspircd +++ b/make/template/inspircd @@ -55,7 +55,7 @@ my $runpath = "@BASE_DIR@"; my $datadir = "@DATA_DIR@"; my $valgrindlogpath = "$basepath/valgrindlogs"; my $executable = "inspircd"; -my $version = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@+@VERSION_LABEL@"; +my $version = "@VERSION_FULL@"; my $uid = "@UID@"; if (!("--runasroot" ~~ @ARGV) && ($< == 0 || $> == 0)) { diff --git a/make/template/inspircd-genssl.1 b/make/template/inspircd-genssl.1 index 4be5f394c..d43a3b4e8 100644 --- a/make/template/inspircd-genssl.1 +++ b/make/template/inspircd-genssl.1 @@ -17,7 +17,7 @@ .\" -.TH "InspIRCd" "1" "June 2014" "InspIRCd @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@+@VERSION_LABEL@" "InspIRCd Manual" +.TH "InspIRCd" "1" "June 2014" "InspIRCd @VERSION_FULL@" "InspIRCd Manual" .SH "NAME" \t\fBInspIRCd\fR - \fIthe\fR stable, high-performance and modular Internet Relay Chat Daemon diff --git a/make/template/inspircd.1 b/make/template/inspircd.1 index 463db5c47..eb1453d2f 100644 --- a/make/template/inspircd.1 +++ b/make/template/inspircd.1 @@ -17,7 +17,7 @@ .\" -.TH "InspIRCd" "1" "June 2014" "InspIRCd @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@+@VERSION_LABEL@" "InspIRCd Manual" +.TH "InspIRCd" "1" "June 2014" "InspIRCd @VERSION_FULL@" "InspIRCd Manual" .SH "NAME" \t\fBInspIRCd\fR - \fIthe\fR stable, high-performance and modular Internet Relay Chat Daemon diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 5d4d8081f..5fe2ef076 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -326,7 +326,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : if (do_version) { - std::cout << std::endl << INSPIRCD_VERSION << " " << INSPIRCD_REVISION << std::endl; + std::cout << std::endl << INSPIRCD_VERSION << std::endl; Exit(EXIT_STATUS_NOERROR); } diff --git a/src/logger.cpp b/src/logger.cpp index 8bd5f7f88..5b4a948ee 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -50,7 +50,7 @@ */ const char LogStream::LogHeader[] = - "Log started for " INSPIRCD_VERSION " (" INSPIRCD_REVISION ", " MODULE_INIT_STR ")" + "Log started for " INSPIRCD_VERSION " (" MODULE_INIT_STR ")" " - compiled on " INSPIRCD_SYSTEM; LogManager::LogManager() diff --git a/src/server.cpp b/src/server.cpp index f22cf1ad4..932be319e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -64,7 +64,7 @@ void InspIRCd::Rehash(const std::string& uuid) std::string InspIRCd::GetVersionString(bool getFullVersion) { if (getFullVersion) - return INSPIRCD_VERSION " " + Config->ServerName + " :" INSPIRCD_SYSTEM " [" INSPIRCD_REVISION "," INSPIRCD_SOCKETENGINE_NAME "," + Config->sid + "]"; + return INSPIRCD_VERSION " " + Config->ServerName + " :" INSPIRCD_SYSTEM " [" INSPIRCD_SOCKETENGINE_NAME "," + Config->sid + "]"; return INSPIRCD_BRANCH " " + Config->ServerName + " :" + Config->CustomVersion; } -- cgit v1.2.3