From e016f1f4c29c45fe108fe6ae4799ff42744ab49f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 25 May 2014 12:09:30 -0700 Subject: [PATCH] Port package scripts to Git. --- support/buildbot/helpers.pm | 18 ++++++++++++++++++ support/buildbot/package.pl | 2 +- support/buildbot/symstore.pl | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/support/buildbot/helpers.pm b/support/buildbot/helpers.pm index c30bbd5..ab2e3ca 100644 --- a/support/buildbot/helpers.pm +++ b/support/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/support/buildbot/package.pl b/support/buildbot/package.pl index ae00de0..55322a9 100755 --- a/support/buildbot/package.pl +++ b/support/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/support/buildbot/symstore.pl b/support/buildbot/symstore.pl index 35b6081..e8d0fcb 100755 --- a/support/buildbot/symstore.pl +++ b/support/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('support/buildbot/build_type'));