diff --git a/tools/buildbot/helpers.pm b/tools/buildbot/helpers.pm index c30bbd5c..1e3e13ea 100644 --- a/tools/buildbot/helpers.pm +++ b/tools/buildbot/helpers.pm @@ -9,6 +9,24 @@ our $SVN = "/usr/bin/svn"; our $SVN_USER = 'dvander'; our $SVN_ARGS = ''; +sub GitRevNum +{ + my ($path) = (@_); + my ($cd, $text, $rev); + + $cd = Cwd::cwd(); + chdir($path); + $text = `git rev-list --count HEAD`; + chdir($cd); + + chomp $text; + if ($text =~ /^(\d+)/) { + return $1; + } + + return 0; +} + sub HgRevNum { my ($path) = (@_); diff --git a/tools/buildbot/package.pl b/tools/buildbot/package.pl index 8f3d08f0..e3e79e81 100755 --- a/tools/buildbot/package.pl +++ b/tools/buildbot/package.pl @@ -34,7 +34,7 @@ my ($version); $version = Build::ProductVersion(Build::PathFormat('../../build/product.version')); $version =~ s/-dev//g; -$version .= '-hg' . Build::HgRevNum('../../build'); +$version .= '-git' . Build::GitRevNum('../../build'); # Append OS to package version if ($^O eq "darwin") diff --git a/tools/buildbot/symstore.pl b/tools/buildbot/symstore.pl index 264b4d30..128b1453 100755 --- a/tools/buildbot/symstore.pl +++ b/tools/buildbot/symstore.pl @@ -16,7 +16,7 @@ open(PDBLOG, '../OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n"; my ($version); $version = Build::ProductVersion(Build::PathFormat('product.version')); $version =~ s/-dev//g; -$version .= '-hg' . Build::HgRevNum('.'); +$version .= '-git' . Build::GitRevNum('.'); my ($build_type); $build_type = Build::GetBuildType(Build::PathFormat('tools/buildbot/build_type'));