]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
build: parsing "git log" breaks with gpg signature verification 20127/head
authorBjørn Mork <bjorn@mork.no>
Fri, 27 Dec 2024 11:43:18 +0000 (12:43 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 23 Sep 2025 19:49:54 +0000 (21:49 +0200)
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 <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/20127
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/download.mk
rules.mk
scripts/getver.sh
toolchain/Makefile

index be0c9a31f17e9ca860014b31229295c844a9549b..e87501563aa07f427a555065295e96b4b7e474b3 100644 (file)
@@ -238,7 +238,7 @@ define DownloadMethod/rawgit
        [ \! -d $(SUBDIR) ] && \
        git clone $(OPTS) $(URL) $(SUBDIR) && \
        (cd $(SUBDIR) && git checkout $(SOURCE_VERSION)) && \
-       export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
+       export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --no-show-signature --format='@%ct'` && \
        echo "Generating formal git archive (apply .gitattributes rules)" && \
        (cd $(SUBDIR) && git config core.abbrev 8 && \
        git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \
index 929d8e00e8d02a393a9fbc1a488ea40c379e30a2..47c5f5de62a4601122b57ba7827fc7797665703b 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -514,9 +514,9 @@ ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))
 ##
 define commitcount
 $(shell \
-  if git log -1 >/dev/null 2>/dev/null; then \
+  if git log -1 --no-show-signature >/dev/null 2>/dev/null; then \
     if [ -n "$(1)" ]; then \
-      last_bump="$$(git log --pretty=format:'%h %s' . | \
+      last_bump="$$(git log --no-show-signature --pretty=format:'%h %s' . | \
         grep -m 1 -e ': [uU]pdate to ' -e ': [bB]ump to ' | \
         cut -f 1 -d ' ')"; \
     fi; \
index e9a5cca0740d0b61e7fab3c37e99ae64f26813ea..bf21f77feb3439a7b5013291c84cf5f915a452fa 100755 (executable)
@@ -43,7 +43,7 @@ try_git() {
                        REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
                fi
 
-               REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}"
+               REV="${REV:+r$REV-$(git log -n 1 --no-show-signature --format="%h" $UPSTREAM_BASE)}"
 
                ;;
        esac
index 09c16f72a780875f5cc8f9425192fee2eb2ad61b..67b1540117cdaf8c58472b176a8ec0d48420a45c 100644 (file)
@@ -65,7 +65,7 @@ endif
 ifdef CONFIG_BUILDBOT
 ifneq ($(wildcard $(TOPDIR)/.git),)
   $(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build
-       cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check
+       cd "$(TOPDIR)"; git log --no-show-signature --format=%h -1 toolchain > $(TMP_DIR)/.ver_check
        cmp -s $(TMP_DIR)/.ver_check $@ || { \
                rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \
                mkdir -p $(TOOLCHAIN_DIR)/stamp; \