Permalink
Browse files

MB-7455: Fix ep-engine version to allow override for releases

The script was broken that allowed us to override the normal
git version that is used automatically. This change is
neccessary for production builds to reduce confusion when
looking at stats.

Change-Id: I9bc893beaa9f9ab057a0a8dd300933358e1acccb
Reviewed-on: http://review.couchbase.org/23664
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
  • Loading branch information...
1 parent 5fab317 commit e2bf12af4c871a76f8a5686af0ededfa035f0491 @mikewied mikewied committed Jan 2, 2013
Showing with 9 additions and 5 deletions.
  1. +4 −4 config/autorun.sh
  2. +5 −1 config/version.pl
View
@@ -2,9 +2,9 @@
set -e
-cat > m4/version.m4 <<EOF
-m4_define([VERSION_NUMBER], [`git describe | tr '-' '_'`])
-m4_define([GIT_CHANGESET],[`git rev-parse HEAD`])
-EOF
+if [ -d .git ]
+then
+ perl config/version.pl || die "Failed to run config/version.pl"
+fi
autoreconf -i --force
View
@@ -5,10 +5,12 @@
use strict;
my $version = `git describe`;
+my $changeset = `git rev-parse HEAD`;
if ($ENV{'PRODUCT_VERSION'}) {
$version = $ENV{'PRODUCT_VERSION'}
}
chomp $version;
+chomp $changeset;
# Test the various versions.
#my $version = 'foob';
#my $version = '1.4.2-30-gf966dba';
@@ -20,7 +22,9 @@
}
$version =~ s/-/_/g;
-write_file('m4/version.m4', "m4_define([VERSION_NUMBER], [$version])\n");
+my $version_str = "m4_define([VERSION_NUMBER], [$version])\n";
+my $changeset_str = "m4_define([GIT_CHANGESET], [$changeset])\n";
+write_file('m4/version.m4', ($version_str . $changeset_str));
my ($VERSION, $FULLVERSION, $RELEASE);
if ($version =~ m/^(\d+\.\d+\.\d+)_rc(\d+)$/) {

0 comments on commit e2bf12a

Please sign in to comment.