Skip to content

Commit ae9c9d0

Browse files
bmorkrobimarko
authored andcommitted
build: parsing "git log" breaks with gpg signature verification
Parsing "git log" is fragile. The actual output depends on both global and local configuration files. Enabling "log.showSignature" makes "git log" prefix signed commits with multiple lines of gpg verify output, regardless of the configured log format. Add "--no-show-signature" to "git log" commands to work around this particular issue. Signed-off-by: Bjørn Mork <[email protected]> Link: openwrt/openwrt#20127 Signed-off-by: Robert Marko <[email protected]>
1 parent 347d546 commit ae9c9d0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

include/download.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ define DownloadMethod/rawgit
238238
[ \! -d $(SUBDIR) ] && \
239239
git clone $(OPTS) $(URL) $(SUBDIR) && \
240240
(cd $(SUBDIR) && git checkout $(SOURCE_VERSION)) && \
241-
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
241+
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --no-show-signature --format='@%ct'` && \
242242
echo "Generating formal git archive (apply .gitattributes rules)" && \
243243
(cd $(SUBDIR) && git config core.abbrev 8 && \
244244
git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \

rules.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))
514514
##
515515
define commitcount
516516
$(shell \
517-
if git log -1 >/dev/null 2>/dev/null; then \
517+
if git log -1 --no-show-signature >/dev/null 2>/dev/null; then \
518518
if [ -n "$(1)" ]; then \
519-
last_bump="$$(git log --pretty=format:'%h %s' . | \
519+
last_bump="$$(git log --no-show-signature --pretty=format:'%h %s' . | \
520520
grep -m 1 -e ': [uU]pdate to ' -e ': [bB]ump to ' | \
521521
cut -f 1 -d ' ')"; \
522522
fi; \

scripts/getver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ try_git() {
4343
REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
4444
fi
4545

46-
REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}"
46+
REV="${REV:+r$REV-$(git log -n 1 --no-show-signature --format="%h" $UPSTREAM_BASE)}"
4747

4848
;;
4949
esac

toolchain/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ endif
6565
ifdef CONFIG_BUILDBOT
6666
ifneq ($(wildcard $(TOPDIR)/.git),)
6767
$(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build
68-
cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check
68+
cd "$(TOPDIR)"; git log --no-show-signature --format=%h -1 toolchain > $(TMP_DIR)/.ver_check
6969
cmp -s $(TMP_DIR)/.ver_check $@ || { \
7070
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \
7171
mkdir -p $(TOOLCHAIN_DIR)/stamp; \

0 commit comments

Comments
 (0)