]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
scripts/ld-version.sh: regular expression compile fails
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 8 Nov 2017 22:44:55 +0000 (23:44 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 21 Nov 2017 01:18:37 +0000 (20:18 -0500)
ld --version | scripts/ld-version.sh
fails with
awk: scripts/ld-version.sh:
line 4: regular expression compile failed (missing '(')
.*)

So let's refresh the script from Linux kernel v4.14-rc8.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
scripts/ld-version.sh

index 198580d245e033b8b674fdad3d1aa1cb21f0fd2e..f2be0ff9a738aca75c014c80b7535833d1eeb1a1 100755 (executable)
@@ -1,8 +1,11 @@
 #!/usr/bin/awk -f
+# SPDX-License-Identifier: GPL-2.0
 # extract linker version number from stdin and turn into single number
        {
-       gsub(".*)", "");
+       gsub(".*\\)", "");
+       gsub(".*version ", "");
+       gsub("-.*", "");
        split($1,a, ".");
-       print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+       print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
        exit
        }