diff options
author | Arnstein Ressem <aressem@verizonmedia.com> | 2019-08-28 09:41:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 09:41:13 +0200 |
commit | f1991f6ef4901dc3d8099e779c5f629450d9c3ed (patch) | |
tree | 1c768c67dfc1b00e2f8ab4fa8d71932d26d3e497 | |
parent | bd65431ca39696ec242d63e4d378bae1a333e0c9 (diff) | |
parent | 1a50010feff03e06090ec245089f0cb3eeb2912d (diff) |
Merge pull request #10438 from vespa-engine/aressem/use-dummy-date-and-commit-if-git-not-available
Set dummy commit ref and date 0 when git is not available in tree. MERGEOK
-rwxr-xr-x | dist.sh | 2 | ||||
-rwxr-xr-x | dist/getversion.pl | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -9,7 +9,7 @@ fi VERSION="$1" mkdir -p ~/rpmbuild/{SOURCES,SPECS} -GZIP=-1 tar -zcf ~/rpmbuild/SOURCES/vespa-$VERSION.tar.gz --exclude target --exclude cmake-build-debug --transform "flags=r;s,^,vespa-$VERSION/," * .git +GZIP=-1 tar -zcf ~/rpmbuild/SOURCES/vespa-$VERSION.tar.gz --exclude target --exclude cmake-build-debug --transform "flags=r;s,^,vespa-$VERSION/," * DIST_FILE="dist/vespa.spec" # When checking out relase tags, the vespa.spec is in the source root folder. This is a workaround to be able to build rpms from a release tag. diff --git a/dist/getversion.pl b/dist/getversion.pl index d29e7d12aa3..f3753373d8d 100755 --- a/dist/getversion.pl +++ b/dist/getversion.pl @@ -67,8 +67,8 @@ if ($printmap) { chomp($ostype = `uname -s`); chomp($osver = `uname -r`); chomp($osarch = `uname -m`); - chomp($commit_sha = `sh -c "cd ${srcdir} && git rev-parse HEAD"`); - chomp($commit_date = `sh -c "cd ${srcdir} && git show -s --format=%ct ${commit_sha}"`); + chomp($commit_sha = `sh -c "(cd ${srcdir} && git rev-parse HEAD) || echo ffffffffffffffffffffffffffffffffffffffff "`); + chomp($commit_date = `sh -c "(cd ${srcdir} && git show -s --format=%ct ${commit_sha}) || echo 0"`); $vtag_system_rev = $ostype . "-" . $osver; chomp ($who = `(whoami || logname) 2>/dev/null`); |