pkgsrc tips (Was Re: Proper choice of package management strategy)

Zeb Packard cyphercell4 at gmail.com
Sun Jan 21 00:41:28 PST 2007


On 1/20/07, Nadav Vinik <nadavvin at gmail.com> wrote:
> Do you have script like that?
>
> since It user readable but it harder to parse in simple regular expression:
>
> $ ldd /bin/bash
>        linux-gate.so.1 =>  (0xffffe000)
>        libreadline.so.5 => /lib/libreadline.so.5 (0xb7f6c000)
>        libhistory.so.5 => /lib/libhistory.so.5 (0xb7f64000)
>        libncurses.so.5 => /lib/libncurses.so.5 (0xb7f22000)
>        libdl.so.2 => /lib/libdl.so.2 (0xb7f1e000)
>        libc.so.6 => /lib/libc.so.6 (0xb7df4000)
>        /lib/ld-linux.so.2 (0xb7fb7000)

No I don't but,
I'm thinking you can grab everything between "/" and the first " ("
assign it to a variable (add the first slash back in), then if the
variable is "   " you can grab everything up until the first " =". If
after this you still have a value that doesn't work you can spit out
an error. This is pretty rough and requires reading the output line by
line, but I think a dynamic dependency tree sounds pretty cool.

Output would look like this:

linux-gate.so.1  ( I don't know what this one is, maybe a dep in the
source? If so, we wouldn't need it anyway.)
/lib/libreadline.so.5
/lib/libhistory.so.5
/lib/libncurses.so.5
/lib/libdl.so.2
/lib/libc.so.6
/lib/ld-linux.so.2



More information about the lfs-support mailing list