aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@geanix.com>2023-05-03 12:23:39 +0200
committerTom Rini <trini@konsulko.com>2023-05-15 14:08:44 -0400
commitf07381529bf69f14abd18cd3bd47982f466e179f (patch)
treea7a195ecb46c93006d6466b56ecf18bf76a8f7fa /scripts
parenteaa9efafffaf87e3414db5d21face5e2dad105e4 (diff)
downloadu-boot-f07381529bf69f14abd18cd3bd47982f466e179f.zip
u-boot-f07381529bf69f14abd18cd3bd47982f466e179f.tar.gz
u-boot-f07381529bf69f14abd18cd3bd47982f466e179f.tar.bz2
scripts: dtc-version: support git version strings too
Building dtc from git causes the version number to start with a 'v' (e.g. v1.7.0). printf then fails to parse 'v1' as a decimal value, and prints '000700' instead of '010700'. Subsequently, the build fails, because '000700' is less than the required '010400' version. Signed-off-by: Martin Hundebøll <martin@geanix.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dtc-version.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/dtc-version.sh b/scripts/dtc-version.sh
index bfb514e..53ff868 100755
--- a/scripts/dtc-version.sh
+++ b/scripts/dtc-version.sh
@@ -20,7 +20,7 @@ if ! which $dtc >/dev/null ; then
exit 1
fi
-MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1)
+MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1 | tr -d v)
MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2)
PATCH=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 3 | cut -d - -f 1)