From: Matt Corallo Date: Mon, 7 Jun 2021 20:38:52 +0000 (+0000) Subject: Avoid git version always appearing as dirty X-Git-Tag: v0.0.98~1^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=a6f3a48f8f3ba39a001b8b55afa5355fd5146abe;p=ldk-java Avoid git version always appearing as dirty --- diff --git a/genbindings.py b/genbindings.py index 43956f43..35a3be01 100755 --- a/genbindings.py +++ b/genbindings.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import sys, re, subprocess +import os, sys, re, subprocess if len(sys.argv) < 7: print("USAGE: /path/to/lightning.h /path/to/bindings/output /path/to/bindings/ /path/to/bindings/output.c debug lang") @@ -33,7 +33,9 @@ else: consts = Consts(DEBUG, target=target) -local_git_version = subprocess.check_output(["git", "describe", '--tag', '--dirty']).decode("utf-8").strip() +local_git_version = os.getenv("LDK_GARBAGECOLLECTED_GIT_OVERRIDE") +if local_git_version is None: + local_git_version = subprocess.check_output(["git", "describe", '--tag', '--dirty']).decode("utf-8").strip() from bindingstypes import * diff --git a/genbindings.sh b/genbindings.sh index b06f9c40..cd549d79 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -18,6 +18,10 @@ fi set -e +if [ "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" = "" ]; then + export LDK_GARBAGECOLLECTED_GIT_OVERRIDE=$(git describe --tag --dirty) +fi + cp "$1/lightning-c-bindings/include/lightning.h" ./ if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then # OSX sed is for some reason not compatible with GNU sed