From 78048cd2894770e38ab439cd201932d1071757ec Mon Sep 17 00:00:00 2001 From: Piotr Wojtaszczyk Date: Tue, 30 Jul 2024 13:06:52 +0200 Subject: fsl-u-boot-localversion.bbclass: Unify indentations Fixes: d7e13f19fbf9 ("fsl-u-boot-localversion.bbclass: fix SRCREV_machine and AUTOREV use cases") Signed-off-by: Piotr Wojtaszczyk (cherry picked from commit 8c5fbbce4d6260146d6e4c8b8f6f4a032c8f0a4f) --- classes/fsl-u-boot-localversion.bbclass | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass index 94b30c04e..90e867835 100644 --- a/classes/fsl-u-boot-localversion.bbclass +++ b/classes/fsl-u-boot-localversion.bbclass @@ -17,21 +17,21 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}" do_compile:prepend() { if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version - if [ "${SRCREV}" = "INVALID" ]; then - hash=${SRCREV_machine} - else - hash=${SRCREV} - fi - if [ "$hash" = "AUTOINC" ]; then - branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` - head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` - else - head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` - fi - patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` - printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion - printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion - else + if [ "${SRCREV}" = "INVALID" ]; then + hash=${SRCREV_machine} + else + hash=${SRCREV} + fi + if [ "$hash" = "AUTOINC" ]; then + branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` + head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` + else + head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` + fi + patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` + printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion + printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion + else printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion fi -- cgit v1.2.3-54-g00ecf From 358dfab86c3655852f8bd596de8ebf2716fd64c3 Mon Sep 17 00:00:00 2001 From: Piotr Wojtaszczyk Date: Tue, 30 Jul 2024 13:12:07 +0200 Subject: fsl-u-boot-localversion.bbclass: Add back UBOOT_LOCALVERSION to .scmversion This fixes regression done in the mentioned commit. Fixes: d7e13f19fbf9 ("fsl-u-boot-localversion.bbclass: fix SRCREV_machine and AUTOREV use cases") Signed-off-by: Piotr Wojtaszczyk (cherry picked from commit 3a26a0b27ff574188a4a9433b27890f384c89b82) --- classes/fsl-u-boot-localversion.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass index 90e867835..df4ac5fbf 100644 --- a/classes/fsl-u-boot-localversion.bbclass +++ b/classes/fsl-u-boot-localversion.bbclass @@ -29,8 +29,8 @@ do_compile:prepend() { head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` fi patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` - printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion - printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion + printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${S}/.scmversion + printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${B}/.scmversion else printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion -- cgit v1.2.3-54-g00ecf