Skip to content

Commit 9d15f1d

Browse files
committedJul 12, 2024
Makefile: reproducible .gitcommit
1 parent b08688f commit 9d15f1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎.gitcommit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
$Format:%h$
1+
$Format:%H$

‎Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ YOSYS_VER := 0.43+3
150150
# will have this file in its unexpanded form tough, in which case we fall
151151
# back to calling git directly.
152152
TARBALL_GIT_REV := $(shell cat $(YOSYS_SRC)/.gitcommit)
153-
ifeq ($(TARBALL_GIT_REV),$$Format:%h$$)
153+
ifneq ($(findstring "Format:",$(TARBALL_GIT_REV)),)
154154
GIT_REV := $(shell GIT_DIR=$(YOSYS_SRC)/.git git rev-parse --short=9 HEAD || echo UNKNOWN)
155155
else
156156
GIT_REV := $(TARBALL_GIT_REV)
@@ -773,10 +773,10 @@ check-git-abc:
773773
exit 1; \
774774
elif git -C "$(YOSYS_SRC)" submodule status abc 2>/dev/null | grep -q '^ '; then \
775775
exit 0; \
776-
elif [ -f "$(YOSYS_SRC)/abc/.gitcommit" ] && ! grep -q '\$$Format:%h\$$' "$(YOSYS_SRC)/abc/.gitcommit"; then \
776+
elif [ -f "$(YOSYS_SRC)/abc/.gitcommit" ] && ! grep -q '\$$Format:%[hH]\$$' "$(YOSYS_SRC)/abc/.gitcommit"; then \
777777
echo "'abc' comes from a tarball. Continuing."; \
778778
exit 0; \
779-
elif [ -f "$(YOSYS_SRC)/abc/.gitcommit" ] && grep -q '\$$Format:%h\$$' "$(YOSYS_SRC)/abc/.gitcommit"; then \
779+
elif [ -f "$(YOSYS_SRC)/abc/.gitcommit" ] && grep -q '\$$Format:%[hH]\$$' "$(YOSYS_SRC)/abc/.gitcommit"; then \
780780
echo "Error: 'abc' is not configured as a git submodule."; \
781781
echo "To resolve this:"; \
782782
echo "1. Back up your changes: Save any modifications from the 'abc' directory to another location."; \

0 commit comments

Comments
 (0)
Please sign in to comment.