Skip to contentSkip to conversation

scripts: setlocalversion: remove quotes around localversion from config

PATCH Superseded Nikita Maslov 3 participants 3 messages Jan 14, 2022 – Jan 24, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: setlocalversion: remove quotes around localversion from config

From: Nikita Maslov <[email protected]>
Date: Fri, 14 Jan 2022 00:13:39 +0300
Subject: [PATCH] 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 so it removes quotes now.

Cc Philipp Tomsich <[email protected]>
Cc Tom Rini <[email protected]>

---

 scripts/setlocalversion | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/setlocalversion +3 -2
index c1c0435267..4a63143706 100755
@@ -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
--

Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Nikita Maslov

From: Nikita Maslov <[email protected]>
Date: Fri, 14 Jan 2022 00:13:39 +0300
Subject: [PATCH] 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 so it removes quotes now.

Quoted 7 lines
Cc Philipp Tomsich <[email protected]>
Cc Tom Rini <[email protected]>

---

  scripts/setlocalversion | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
#2 lore raw
In reply to Nikita Maslov
Quoted 42 lines · Nikita Maslov

From: Nikita Maslov <[email protected]>
Date: Fri, 14 Jan 2022 00:13:39 +0300
Subject: [PATCH] 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 so it removes quotes now.

---

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

'=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}' | xargs echo`
else
echo "Error: kernelrelease not valid - run 'make prepare' to
update it" >&2
exit 1
--

scripts/setlocalversion +0 -1
index c1c0435267..4a63143706 100755
@@ -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}'`

scripts/setlocalversion +2 -0
+       # xargs echo removes quotes
+       CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' 
Quoted 2 lines

'/^CONFIG_LOCALVERSION=/ {print $2}' | xargs echo`
+ CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F

Can you please re-post this? The whitespace was rather badly destroyed, thanks.

Signature · 1 line
Tom