From 4f63e64d9c8782987c2fc1fafe3ada2f8762e809 Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Sun, 27 Nov 2022 10:07:19 -0300 Subject: [PATCH] support/scripts/generate-gitlab-ci-yml: improve test-pkg support Following the example of test-pkg config described in commit "12c7a05da1 utils/test-pkg: add gitlab-ci support" to test a defconfig fragment that contains a disabled option is currently possible, but it do requires one to change the git config core.commentChart so the lines starting with "#" are not discarded by git when creating/editing the commit message. For instance, without the indentation the 3rd line below would be excluded from the commit message when the editor is closed: test-pkg config: SOME_OPTION=y # OTHER_OPTION is not set SOME_VARIABLE="some value" Requiring to change git configs is not very nice. So make the developer's life easier by changing the sed expression to remove indentation with spaces from a defconfig fragment found on a commit message. For instance these lines become valid and generate a defconfig fragment without the indentation of one space to be tested in GitLab CI: test-pkg config: SOME_OPTION=y # OTHER_OPTION is not set SOME_VARIABLE="some value" Signed-off-by: Ricardo Martincoski Signed-off-by: Peter Korsgaard (cherry picked from commit 0ad3ae14c52ed0aac872875ca7f87cdcf6942128) Signed-off-by: Peter Korsgaard --- support/scripts/generate-gitlab-ci-yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/generate-gitlab-ci-yml b/support/scripts/generate-gitlab-ci-yml index aa43aac019..27f586f1b6 100755 --- a/support/scripts/generate-gitlab-ci-yml +++ b/support/scripts/generate-gitlab-ci-yml @@ -91,7 +91,7 @@ gen_tests() { # Retrieve defconfig for test-pkg from the git commit message (if any) if grep -q -E '^test-pkg config:$' <<<"${CI_COMMIT_DESCRIPTION}"; then - sed -r -n -e '/^test-pkg config:$/{:a;n;p;ba;}' \ + sed -r -n -e '/^test-pkg config:$/{:a;n;s/^ +//;p;ba;}' \ <<<"${CI_COMMIT_DESCRIPTION}" \ >defconfig.frag if [ ! -s defconfig.frag ]; then