public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [fyi] lddtree magic
@ 2013-04-09 19:31 Mike Frysinger
  2013-04-09 20:30 ` Diego Elio Pettenò
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Mike Frysinger @ 2013-04-09 19:31 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

i doubt few people have noticed, but i've rewritten lddtree recently in 
python.  i did for speed, for fun, and to add a lot more functionality that 
would have driven the bash code base to new perverse levels.

i've randomly stumbled across places in our code base (beyond ebuilds) where 
the new python version would be useful.  rather than try and ferret out those 
myself, i'll just announce here and people can sort it out.

if you guys think this can satisfy most of your needs but there's like a small 
edge case that isn't quite handled, let me know.  i can always add another 
option :).

specifically, lddtree (both the shell & python variants) support a --list:
$ lddtree -l /bin/bash
/bin/bash
/lib64/ld-linux-x86-64.so.2
/lib64/libreadline.so.6
/lib64/libhistory.so.6
/lib64/libncurses.so.5
/lib64/libdl.so.2
/lib64/libc.so.6
this way you don't have to resort to grep/awk/sed on the output to try and get 
the names out of `lddtree` (or heaven forbid, `ldd`).

it also supports --root just like you'd expect:
$ lddtree -l /bin/bash --root /mnt/space/distros/x86
/mnt/space/distros/x86/bin/bash
/mnt/space/distros/x86/lib/ld-linux.so.2
/mnt/space/distros/x86/lib/libreadline.so.6
/mnt/space/distros/x86/lib/libncurses.so.5
/mnt/space/distros/x86/lib/libdl.so.2
/mnt/space/distros/x86/lib/libc.so.6

but things get even crazier with the new --copy-to-tree option (python version 
only).  this is useful for scenarios like kernel initramfs where you want to 
copy over one or two ELFs and their dependencies w/out resorting to statically 
linking them.  check out the --help text for more details.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-04-10 17:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 19:31 [gentoo-dev] [fyi] lddtree magic Mike Frysinger
2013-04-09 20:30 ` Diego Elio Pettenò
2013-04-10  3:10   ` Mike Frysinger
2013-04-10 10:04     ` Fabio Erculiani
2013-04-10 16:33       ` Mike Frysinger
2013-04-10 16:42         ` Fabio Erculiani
2013-04-10 17:32           ` Mike Frysinger
2013-04-10 17:40             ` Fabio Erculiani
2013-04-10 17:56               ` Mike Frysinger
2013-04-09 20:41 ` Samuli Suominen
2013-04-09 20:45   ` Samuli Suominen
2013-04-10  2:30     ` Mike Frysinger
2013-04-09 22:22 ` Samuli Suominen

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