only report git metadata for git checkout builds

This commit is contained in:
Dane Springmeyer 2014-10-23 00:42:10 -07:00
parent f6e077fb08
commit 036a3bb14f
2 changed files with 7 additions and 13 deletions

View file

@ -42,6 +42,7 @@ before_script:
- if [[ "${CXX}" == 'clang++' ]]; then export JOBS=4; export CXX="$(which clang++)"; export CC="$(which clang)"; fi;
script:
- rm -rf ./git
- ./configure CXX="${CXX}" CC="${CC}" CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS}" CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS}" XML_PARSER="${XML_PARSER}" ENABLE_LOG="${ENABLE_LOG}" DEBUG="${DEBUG}" DEMO="${DEMO}" BENCHMARK="${BENCHMARK}" CPP_TESTS=True CAIRO=True FAST=True || cat config.log
- if [[ "${DEBUG}" == True ]]; then export JOBS=$((JOBS/2)); fi;
- make

View file

@ -79,28 +79,21 @@ dep_libs = ''.join([' -l%s' % i for i in env['LIBMAPNIK_LIBS']])
# remove local agg from public linking
dep_libs = dep_libs.replace('-lagg','')
git_revision = 'unknown'
git_describe = 'unknown'
# special GIT_REVISION/GIT_DESCRIBE files present only for official releases
# where the git directory metadata is stripped
# more info: https://github.com/mapnik/mapnik/wiki/MapnikReleaseSteps
revision_release_file = '../../GIT_REVISION'
if os.path.exists(revision_release_file):
git_revision = open(revision_release_file,'r').read()
else:
git_revision = ''
git_describe = ''
try:
git_cmd = "git rev-list --max-count=1 HEAD"
stdin, stderr = Popen(git_cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
git_revision = stdin.strip()
describe_release_file = '../../GIT_DESCRIBE'
if os.path.exists(describe_release_file):
git_describe = open(describe_release_file,'r').read()
else:
git_cmd = "git describe"
stdin, stderr = Popen(git_cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
git_describe = stdin.strip()
except:
pass
# for fonts and input plugins we should try
# to store the relative path, if feasible