summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-11-25 15:17:09 +0100
committerGitHub <noreply@github.com>2016-11-25 15:17:09 +0100
commit7ee8ea71b7d6e939d8e08d332feee2a27d662155 (patch)
tree2b55effb2608f58c46daff537e5f0e1bfaae5fdd
parent8189eb162eeef6a080bee90b6d6bac119ce4739c (diff)
parent3ad1a0bad2c701e19792618264d01f551c59a1bd (diff)
Merge pull request #1252 from SaberUK/master+distribution
Fix the distribution label not showing up since b8d85c6251.
-rwxr-xr-xconfigure11
-rw-r--r--make/common.pm4
-rw-r--r--make/configure.pm5
3 files changed, 11 insertions, 9 deletions
diff --git a/configure b/configure
index b81a7809a..696d94886 100755
--- a/configure
+++ b/configure
@@ -126,7 +126,7 @@ our $interactive = !(
defined $opt_uid
);
-my %version = get_version();
+my %version = get_version $opt_distribution_label;
print_format "<|BOLD Configuring InspIRCd $version{FULL} on $^O.|>\n";
our %config;
@@ -188,12 +188,6 @@ if (defined $opt_socketengine) {
}
}
-# If the user has specified a distribution label then we use it in
-# place of the label from src/version.sh or Git.
-if (defined $opt_distribution_label) {
- $version{LABEL} = $opt_distribution_label;
-}
-
if (defined $opt_system) {
$config{BASE_DIR} = $opt_prefix // '/var/lib/inspircd';
$config{BINARY_DIR} = $opt_binary_dir // '/usr/sbin';
@@ -310,6 +304,9 @@ if (<src/modules/m_ssl_*.cpp> && prompt_bool $interactive, 'Would you like to ge
system './tools/genssl', 'auto';
}
+# Cache the distribution label so that its not lost when --update is run.
+$config{DISTRIBUTION} = $opt_distribution_label if $opt_distribution_label;
+
write_configure_cache %config;
parse_templates \%config, \%compiler, \%version;
diff --git a/make/common.pm b/make/common.pm
index 53ee3f778..b1608db56 100644
--- a/make/common.pm
+++ b/make/common.pm
@@ -63,6 +63,10 @@ sub get_version {
$version{LABEL} = $4 if defined $4;
}
+ # If the user has specified a distribution label then we use it in
+ # place of the label from src/version.sh or Git.
+ $version{LABEL} = shift // $version{LABEL};
+
# 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.
diff --git a/make/configure.pm b/make/configure.pm
index e88454658..6b4693d45 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -159,7 +159,8 @@ MISC OPTIONS
--socketengine=[name] Sets the socket engine to be used. Possible
values are $SELIST.
--uid=[id|name] Sets the user to run InspIRCd as.
- --update Updates the build environment.
+ --update Updates the build environment with the settings
+ from the cache.
FLAGS
@@ -180,7 +181,7 @@ sub cmd_update {
say 'Updating...';
my %config = read_configure_cache();
my %compiler = get_compiler_info($config{CXX});
- my %version = get_version();
+ my %version = get_version $config{DISTRIBUTION};
parse_templates(\%config, \%compiler, \%version);
say 'Update complete!';
exit 0;