Skip to contentSkip to conversation

scripts/ld-version.sh: regular expression compile fails

PATCH Superseded Heinrich Schuchardt 2 participants 4 messages Nov 8, 2017 – Nov 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/ld-version.sh: regular expression compile fails

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.

---
 scripts/ld-version.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/ld-version.sh +4 -2
index 198580d245..d135882e2c 100755
@@ -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
 	}
Signature · 1 line
2.14.2
#1 lore raw

PATCH 1/1 scripts/ld-version.sh: regular expression compile fails

Quoted 1 line · Heinrich Schuchardt

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

... ld? :)

Quoted 7 lines

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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171108/c6d78069/attachment.sig>
#2 lore raw

PATCH v2 1/1 scripts/ld-version.sh: regular expression compile fails

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.

---
v2
Add license identifier.
Update commit message.

---
 scripts/ld-version.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/ld-version.sh +5 -2
index 198580d245..f2be0ff9a7 100755
@@ -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
 	}
Signature · 1 line
2.14.2
#3 lore raw

PATCH v2 1/1 scripts/ld-version.sh: regular expression compile fails

Quoted 9 lines · Heinrich Schuchardt

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/ebd7c8e1/attachment.sig>