On Thu, Dec 29, 2011 at 04:43:30PM -0600, Bruce Dubbs wrote:
> Ken Moffat wrote:
> > On Thu, Dec 29, 2011 at 03:56:39PM -0600, Bruce Dubbs wrote:
> >> I think that idea is fine, but wonder about the use of awk.  It may not 
> >> be available.  Perhaps:
> >>
> >> ldd /bin/ls | grep '/libc.*so'
> >>
> >> I don't think stripping the cruft is really necessary.
> >>
> >> LFS 32-bit:  libc.so.6 => /lib/libc.so.6 (0xb7e46000)
> >> Ubuntu    :  libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e24000)
> >> LFS 64-bit:  libc.so.6 => /lib/libc.so.6 (0x00007fa7f6920000)
> >> RHEL      :  libc.so.6 => /lib/tls/libc.so.6 (0x0025e000)
> >>
> >>    -- Bruce
> > 
> >  In LFS we already require that /usr/bin/awk should exist.  In
> > version-check.sh it's 2 lines before we test the version of libc.
> > Dunno if jhalfs differs, but it seems a pretty essential
> > requirement.
> 
> Sure, it's a requirement, but if it isn't there, then the check for libc 
> fails.  Right now, the resources needed are head, cut, echo, readlink, 
> and cat; other than the resources being directly tested.
> 
> I just don't want to see a cascading failure.

Yeah, that's a good point.  Perhaps using cut, as was posted elsewhere
in the thread, would work.  The output of ldd is prefixed with a tab,
which I thought was spaces, which is why I was using awk -- but it's a
tab, so cut should work too; it just requires an extra grep:

ldd /bin/ls | grep libc\\.so | cut -d' ' -f3

(The awk address-range operator might be good for education, but I
wouldn't be surprised to find that elsewhere in the book already, so
either way.)

Attachment: pgptoDQVofzxj.pgp
Description: PGP signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to