From 471f708ed6f4787813d0656c2457a6fc5738ddfc Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Thu, 16 Aug 2018 14:02:44 +0100 Subject: [PATCH] git_sha1: simplify logic Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov --- bin/git_sha1_gen.py | 6 +----- src/Makefile.am | 2 +- src/git_sha1.h.in | 1 - src/mesa/Android.libmesa_git_sha1.mk | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 src/git_sha1.h.in diff --git a/bin/git_sha1_gen.py b/bin/git_sha1_gen.py index 77c5fa9d295..c6240662df3 100755 --- a/bin/git_sha1_gen.py +++ b/bin/git_sha1_gen.py @@ -47,10 +47,6 @@ args = parser.parse_args() git_sha1 = os.environ.get('MESA_GIT_SHA1_OVERRIDE', get_git_sha1())[:10] if git_sha1: - git_sha1_h_in_path = os.path.join(os.path.dirname(sys.argv[0]), - '..', 'src', 'git_sha1.h.in') - with open(git_sha1_h_in_path, 'r') as git_sha1_h_in: - new_sha1 = git_sha1_h_in.read().replace('@VCS_TAG@', git_sha1) - write_if_different(new_sha1) + write_if_different('#define MESA_GIT_SHA1 "git-' + git_sha1 + '"') else: write_if_different('') diff --git a/src/Makefile.am b/src/Makefile.am index 9de0192b791..396865cbe55 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,7 @@ # IN THE SOFTWARE. .PHONY: git_sha1.h -git_sha1.h: $(top_srcdir)/src/git_sha1.h.in +git_sha1.h: @echo "updating $@" @$(PYTHON2) $(top_srcdir)/bin/git_sha1_gen.py --output $@ diff --git a/src/git_sha1.h.in b/src/git_sha1.h.in deleted file mode 100644 index dc17f5e6614..00000000000 --- a/src/git_sha1.h.in +++ /dev/null @@ -1 +0,0 @@ -#define MESA_GIT_SHA1 "git-@VCS_TAG@" diff --git a/src/mesa/Android.libmesa_git_sha1.mk b/src/mesa/Android.libmesa_git_sha1.mk index d27923074dd..fbbbf2fe094 100644 --- a/src/mesa/Android.libmesa_git_sha1.mk +++ b/src/mesa/Android.libmesa_git_sha1.mk @@ -43,7 +43,7 @@ $(intermediates)/dummy.c: LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, git_sha1.h) -$(intermediates)/git_sha1.h: $(MESA_TOP)/src/git_sha1.h.in $(wildcard $(MESA_TOP)/.git/logs/HEAD) +$(intermediates)/git_sha1.h: $(wildcard $(MESA_TOP)/.git/logs/HEAD) @mkdir -p $(dir $@) @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git" $(hide) $(MESA_PYTHON2) $(MESA_TOP)/bin/git_sha1_gen.py --output $@ -- 2.30.2