Skip to content

Commit cc9eefd

Browse files
Jesper JuhlSam Ravnborg
authored andcommitted
kbuild: scripts/ver_linux : correct printing of binutils version
Currently scripts/ver_linux prints "Binutils" or other random information for the version number in the "binutils" output line on some distributions. This patch corrects that. When I initially submitted a patch to correct that, I was not aware that the output from "ld -v" could differ as much as it turned out it can, so my original fix turned out to not cover all bases. This patch works correctly with all the different "ld -v" output that people posted in replys to my first patch, so it should be a clear win over what we have currently. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 9cc3ef3 commit cc9eefd

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎scripts/ver_linux‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ gcc --version 2>&1| grep gcc | awk \
2121
make --version 2>&1 | awk -F, '{print $1}' | awk \
2222
'/GNU Make/{print "Gnu make ",$NF}'
2323

24-
ld -v | awk -F\) '{print $1}' | awk \
25-
'/BFD/{print "binutils ",$NF} \
26-
/^GNU/{print "binutils ",$4}'
24+
echo "binutils $(ld -v | egrep -o '[0-9]+\.[0-9\.]+')"
2725

2826
echo -n "util-linux "
2927
fdformat --version | awk '{print $NF}' | sed -e s/^util-linux-// -e s/\)$//

0 commit comments

Comments
 (0)