public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ver_linux is [censored]
@ 2007-08-21  7:19 Alexey Dobriyan
  2007-08-21  9:56 ` Jesper Juhl
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Dobriyan @ 2007-08-21  7:19 UTC (permalink / raw)
  To: sam, akpm; +Cc: jesper.juhl, linux-kernel

Commit 4a645d5ea65baaa5736bcb566673bf4a351b2ad8 broke ver_linux
on etch which glibc has 3-digit version number. Patch replaces awk
wanking with more robust sed wanking.

Tested on gentoo, etch, centos 4.2.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 scripts/ver_linux |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -65,9 +65,9 @@ isdnctrl 2>&1 | grep version | awk \
 showmount --version 2>&1 | grep nfs-utils | awk \
 'NR==1{print "nfs-utils             ", $NF}'
 
-ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
--e 's/\.so$//' | sed -e 's/>//' | \
-awk -F'[.-]' '{print "Linux C Library        "$(NF-1)"."$NF}'
+echo -n "Linux C Library        "
+ls -l `ldd /bin/sh | awk '/libc/{print $3}'` 	| \
+	sed -e 's/.*libc-//' -e 's/\.so$//'
 
 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
 'NR==1{print "Dynamic linker (ldd)  ", $NF}'



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-21  7:19 [PATCH] ver_linux is [censored] Alexey Dobriyan
@ 2007-08-21  9:56 ` Jesper Juhl
  2007-08-21 23:15   ` Al Viro
  0 siblings, 1 reply; 8+ messages in thread
From: Jesper Juhl @ 2007-08-21  9:56 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: sam, akpm, linux-kernel

On 21/08/07, Alexey Dobriyan <adobriyan@sw.ru> wrote:
> Commit 4a645d5ea65baaa5736bcb566673bf4a351b2ad8 broke ver_linux
> on etch which glibc has 3-digit version number.

Whoops, sorry about that.

> Patch replaces awk
> wanking with more robust sed wanking.
>
> Tested on gentoo, etch, centos 4.2.
>
I tested your patch on Slackware 12.0, Debian 3.1 & Gentoo Base System
release 1.12.9 and it works fine on those as well.

> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Tested-by: Jesper Juhl <jesper.juhl@gmail.com>

> ---
>
>  scripts/ver_linux |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-21  9:56 ` Jesper Juhl
@ 2007-08-21 23:15   ` Al Viro
  2007-08-22  0:02     ` Jesper Juhl
  0 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2007-08-21 23:15 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Alexey Dobriyan, sam, akpm, linux-kernel

On Tue, Aug 21, 2007 at 11:56:32AM +0200, Jesper Juhl wrote:
> On 21/08/07, Alexey Dobriyan <adobriyan@sw.ru> wrote:
> > Commit 4a645d5ea65baaa5736bcb566673bf4a351b2ad8 broke ver_linux
> > on etch which glibc has 3-digit version number.
> 
> Whoops, sorry about that.
> 
> > Patch replaces awk
> > wanking with more robust sed wanking.
> >
> > Tested on gentoo, etch, centos 4.2.
> >
> I tested your patch on Slackware 12.0, Debian 3.1 & Gentoo Base System
> release 1.12.9 and it works fine on those as well.

How about simply doing
sh -c 'cat /proc/$$/maps'|sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}'
and to hell with parsing ls -l output?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-21 23:15   ` Al Viro
@ 2007-08-22  0:02     ` Jesper Juhl
  2007-08-22  0:52       ` Al Viro
  0 siblings, 1 reply; 8+ messages in thread
From: Jesper Juhl @ 2007-08-22  0:02 UTC (permalink / raw)
  To: Al Viro; +Cc: Alexey Dobriyan, sam, akpm, linux-kernel

On 22/08/07, Al Viro <viro@ftp.linux.org.uk> wrote:
> On Tue, Aug 21, 2007 at 11:56:32AM +0200, Jesper Juhl wrote:
> > On 21/08/07, Alexey Dobriyan <adobriyan@sw.ru> wrote:
> > > Commit 4a645d5ea65baaa5736bcb566673bf4a351b2ad8 broke ver_linux
> > > on etch which glibc has 3-digit version number.
> >
> > Whoops, sorry about that.
> >
> > > Patch replaces awk
> > > wanking with more robust sed wanking.
> > >
> > > Tested on gentoo, etch, centos 4.2.
> > >
> > I tested your patch on Slackware 12.0, Debian 3.1 & Gentoo Base System
> > release 1.12.9 and it works fine on those as well.
>
> How about simply doing
> sh -c 'cat /proc/$$/maps'|sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}'
> and to hell with parsing ls -l output?
>
Works for me.

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-22  0:02     ` Jesper Juhl
@ 2007-08-22  0:52       ` Al Viro
  2007-08-22  1:11         ` Jesper Juhl
  2007-08-22  9:28         ` Dick Streefland
  0 siblings, 2 replies; 8+ messages in thread
From: Al Viro @ 2007-08-22  0:52 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Alexey Dobriyan, sam, akpm, linux-kernel

On Wed, Aug 22, 2007 at 02:02:44AM +0200, Jesper Juhl wrote:
> > How about simply doing
> > sh -c 'cat /proc/$$/maps'|sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}'
> > and to hell with parsing ls -l output?
> >
> Works for me.

or, simpler yet,

sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' </proc/self/maps

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-22  0:52       ` Al Viro
@ 2007-08-22  1:11         ` Jesper Juhl
  2007-08-28 19:21           ` Sam Ravnborg
  2007-08-22  9:28         ` Dick Streefland
  1 sibling, 1 reply; 8+ messages in thread
From: Jesper Juhl @ 2007-08-22  1:11 UTC (permalink / raw)
  To: Al Viro; +Cc: Alexey Dobriyan, sam, akpm, linux-kernel


Fix ver_linux glibc version printing (for real this time)

Alexey Dobriyan reported that commit 
4a645d5ea65baaa5736bcb566673bf4a351b2ad8
broke ver_linux when glibc has a 3 digit 
version number, and proposed a patch.
Al Viro then suggested a simpler way to 
solve the problem which I've then simply 
put into patch form.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 scripts/ver_linux |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 8f8df93..5a16bad 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -65,9 +65,8 @@ isdnctrl 2>&1 | grep version | awk \
 showmount --version 2>&1 | grep nfs-utils | awk \
 'NR==1{print "nfs-utils             ", $NF}'
 
-ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
--e 's/\.so$//' | sed -e 's/>//' | \
-awk -F'[.-]' '{print "Linux C Library        "$(NF-1)"."$NF}'
+echo -n "Linux C Library        "
+sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps
 
 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
 'NR==1{print "Dynamic linker (ldd)  ", $NF}'



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-22  0:52       ` Al Viro
  2007-08-22  1:11         ` Jesper Juhl
@ 2007-08-22  9:28         ` Dick Streefland
  1 sibling, 0 replies; 8+ messages in thread
From: Dick Streefland @ 2007-08-22  9:28 UTC (permalink / raw)
  To: linux-kernel

Al Viro <viro@ftp.linux.org.uk> wrote:
| or, simpler yet,
| 
| sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' </proc/self/maps

Or:

sed -n 's/^.*\/libc-\([^/]*\)\.so$/\1/p; T; q' < /proc/self/maps

-- 
Dick Streefland                      ////                      Altium BV
dick.streefland@altium.nl           (@ @)          http://www.altium.com
--------------------------------oOO--(_)--OOo---------------------------


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ver_linux is [censored]
  2007-08-22  1:11         ` Jesper Juhl
@ 2007-08-28 19:21           ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2007-08-28 19:21 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Al Viro, Alexey Dobriyan, akpm, linux-kernel

On Wed, Aug 22, 2007 at 03:11:56AM +0200, Jesper Juhl wrote:
> 
> Fix ver_linux glibc version printing (for real this time)
> 
> Alexey Dobriyan reported that commit 
> 4a645d5ea65baaa5736bcb566673bf4a351b2ad8
> broke ver_linux when glibc has a 3 digit 
> version number, and proposed a patch.
> Al Viro then suggested a simpler way to 
> solve the problem which I've then simply 
> put into patch form.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
> Signed-off-by: Al Viro <viro@ftp.linux.org.uk>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
> 
>  scripts/ver_linux |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/ver_linux b/scripts/ver_linux
> index 8f8df93..5a16bad 100755
> --- a/scripts/ver_linux
> +++ b/scripts/ver_linux
> @@ -65,9 +65,8 @@ isdnctrl 2>&1 | grep version | awk \
>  showmount --version 2>&1 | grep nfs-utils | awk \
>  'NR==1{print "nfs-utils             ", $NF}'
>  
> -ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
> --e 's/\.so$//' | sed -e 's/>//' | \
> -awk -F'[.-]' '{print "Linux C Library        "$(NF-1)"."$NF}'
> +echo -n "Linux C Library        "
> +sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps
>  
>  ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
>  'NR==1{print "Dynamic linker (ldd)  ", $NF}'
> 

Applied.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-08-28 19:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21  7:19 [PATCH] ver_linux is [censored] Alexey Dobriyan
2007-08-21  9:56 ` Jesper Juhl
2007-08-21 23:15   ` Al Viro
2007-08-22  0:02     ` Jesper Juhl
2007-08-22  0:52       ` Al Viro
2007-08-22  1:11         ` Jesper Juhl
2007-08-28 19:21           ` Sam Ravnborg
2007-08-22  9:28         ` Dick Streefland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox