diff mbox series

[U-Boot,1/1] scripts/ld-version.sh: regular expression compile fails

Message ID 20171108200112.32754-1-xypron.glpk@gmx.de
State Superseded
Headers show
Series [U-Boot,1/1] scripts/ld-version.sh: regular expression compile fails | expand

Commit Message

Heinrich Schuchardt Nov. 8, 2017, 8:01 p.m. UTC
ls --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 with the current Linux kernel
version.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 scripts/ld-version.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Tom Rini Nov. 8, 2017, 8:02 p.m. UTC | #1
On Wed, Nov 08, 2017 at 09:01:12PM +0100, Heinrich Schuchardt wrote:

> ls --version | scripts/ld-version.sh

... ld? :)

> fails with
> awk: scripts/ld-version.sh:
> line 4: regular expression compile failed (missing '(')
> .*)
> 
> So let's refresh the script with the current Linux kernel
> version.

Please specify tag or git-hash not just "current", for ease of future
re-syncs, thanks!
diff mbox series

Patch

diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
index 198580d245..d135882e2c 100755
--- a/scripts/ld-version.sh
+++ b/scripts/ld-version.sh
@@ -1,8 +1,10 @@ 
 #!/usr/bin/awk -f
 # 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
 	}