diff mbox series

[v2] scripts: setlocalversion: remove quotes around localversion from config

Message ID 05dd9970-7cf4-9780-a834-fe684995b2b8@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show
Series [v2] scripts: setlocalversion: remove quotes around localversion from config | expand

Commit Message

Nikita Maslov Feb. 8, 2022, 9:42 a.m. UTC
From: Nikita Maslov <wkernelteam@gmail.com>
Date: Fri, 14 Jan 2022 00:13:39 +0300
Subject: [PATCH v2] scripts: setlocalversion: remove quotes around localversion from config

After replacing of include/config/auto.conf sourcing with
extraction of CONFIG_LOCALVERSION, resulting version string
contains quotes around localversion part which are always
present in auto.conf (even if localversion is empty).

This patch fixes this script to remove quotes.

Signed-off-by: Nikita Maslov <wkernelteam@gmail.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes for v2:
    - re-post because of messed up word wrapping


  scripts/setlocalversion | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

--

Comments

Tom Rini Feb. 14, 2022, 8:39 p.m. UTC | #1
On Tue, Feb 08, 2022 at 12:42:28PM +0300, Nikita Maslov wrote:

> From: Nikita Maslov <wkernelteam@gmail.com>
> Date: Fri, 14 Jan 2022 00:13:39 +0300
> Subject: [PATCH v2] scripts: setlocalversion: remove quotes around localversion from config
> 
> After replacing of include/config/auto.conf sourcing with
> extraction of CONFIG_LOCALVERSION, resulting version string
> contains quotes around localversion part which are always
> present in auto.conf (even if localversion is empty).
> 
> This patch fixes this script to remove quotes.
> 
> Signed-off-by: Nikita Maslov <wkernelteam@gmail.com>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Tom Rini <trini@konsulko.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index c1c0435267..4a63143706 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -153,8 +153,9 @@  if test -e include/config/auto.conf; then
         # We are interested only in CONFIG_LOCALVERSION and
         # CONFIG_LOCALVERSION_AUTO, so extract these in a safe
         # way (i.e. w/o sourcing auto.conf)
-       CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION=/ {print $2}'`
-       CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}'`
+       # xargs echo removes quotes
+       CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION=/ {print $2}' | xargs echo`
+       CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}' | xargs echo`
  else
         echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
         exit 1