You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/06/19 15:07:47 UTC

[nuttx] branch master updated: tools: Fix CONFIG_BASE_DEFCONFIG generation

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new bc4266fa48 tools: Fix CONFIG_BASE_DEFCONFIG generation
bc4266fa48 is described below

commit bc4266fa485e02b6e711a385167294d0c9055261
Author: Lucas Saavedra Vaz <lu...@espressif.com>
AuthorDate: Mon Jun 19 09:37:30 2023 -0300

    tools: Fix CONFIG_BASE_DEFCONFIG generation
    
    Modify sed command to avoid appending multiple "-dirty" at the end of the configuration name
---
 tools/Unix.mk | 2 +-
 tools/Win.mk  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Unix.mk b/tools/Unix.mk
index 879ec7b865..62f74b8c6f 100644
--- a/tools/Unix.mk
+++ b/tools/Unix.mk
@@ -250,7 +250,7 @@ tools/mkconfig$(HOSTEXEEXT):
 include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig$(HOSTEXEEXT)
 	$(Q) grep -v "CONFIG_BASE_DEFCONFIG" "$(TOPDIR)/.config" > "$(TOPDIR)/.config.tmp"
 	$(Q) if ! cmp -s "$(TOPDIR)/.config.tmp" "$(TOPDIR)/.config.orig" ; then \
-		sed -i.bak "/CONFIG_BASE_DEFCONFIG/s/\"$$/-dirty\"/" "$(TOPDIR)/.config"; \
+		sed -i.bak "/CONFIG_BASE_DEFCONFIG/ { /-dirty/! s/\"$$/-dirty\"/ }" "$(TOPDIR)/.config"; \
 	else \
 		sed -i.bak "s/-dirty//g" "$(TOPDIR)/.config"; \
 	fi
diff --git a/tools/Win.mk b/tools/Win.mk
index 55e68b767d..483910339c 100644
--- a/tools/Win.mk
+++ b/tools/Win.mk
@@ -238,7 +238,7 @@ include\nuttx\config.h: $(TOPDIR)\.config tools\mkconfig$(HOSTEXEEXT)
 	$(Q) grep -v "CONFIG_BASE_DEFCONFIG" "$(TOPDIR)\.config" > "$(TOPDIR)\.config.tmp"
 # In-place edit can mess up permissions on Windows
 	$(Q) if ! cmp -s "$(TOPDIR)\.config.tmp" "$(TOPDIR)\.config.orig" ; then \
-		sed "/CONFIG_BASE_DEFCONFIG/s/\"$$/-dirty\"/" "$(TOPDIR)\.config" > "$(TOPDIR)\.config-temp"; \
+		sed "/CONFIG_BASE_DEFCONFIG/ { /-dirty/! s/\"$$/-dirty\"/ }" "$(TOPDIR)\.config" > "$(TOPDIR)\.config-temp"; \
 	else \
 		sed "s/-dirty//g" "$(TOPDIR)\.config" > "$(TOPDIR)\.config-temp"; \
 	fi