1 |
On 09/04/13 22:31, Mike Frysinger wrote: |
2 |
> i doubt few people have noticed, but i've rewritten lddtree recently in |
3 |
> python. i did for speed, for fun, and to add a lot more functionality that |
4 |
> would have driven the bash code base to new perverse levels. |
5 |
> |
6 |
> i've randomly stumbled across places in our code base (beyond ebuilds) where |
7 |
> the new python version would be useful. rather than try and ferret out those |
8 |
> myself, i'll just announce here and people can sort it out. |
9 |
> |
10 |
> if you guys think this can satisfy most of your needs but there's like a small |
11 |
> edge case that isn't quite handled, let me know. i can always add another |
12 |
> option :). |
13 |
> |
14 |
> specifically, lddtree (both the shell & python variants) support a --list: |
15 |
> $ lddtree -l /bin/bash |
16 |
|
17 |
$ qfile -v /usr/bin/lddtree |
18 |
app-misc/pax-utils-0.6 (/usr/bin/lddtree) |
19 |
|
20 |
$ python --version |
21 |
Python 3.2.3 |
22 |
|
23 |
$ lddtree -l /bin/bash |
24 |
Traceback (most recent call last): |
25 |
File "/usr/bin/lddtree", line 450, in <module> |
26 |
sys.exit(main(sys.argv)) |
27 |
File "/usr/bin/lddtree", line 437, in main |
28 |
elf = ParseELF(path, options.root, ldpaths) |
29 |
File "/usr/bin/lddtree", line 235, in ParseELF |
30 |
elf = ELFFile(f) |
31 |
File "/usr/lib64/python3.2/site-packages/elftools/elf/elffile.py", |
32 |
line 47, in __init__ |
33 |
self._identify_file() |
34 |
File "/usr/lib64/python3.2/site-packages/elftools/elf/elffile.py", |
35 |
line 177, in _identify_file |
36 |
magic = self.stream.read(4) |
37 |
File "/usr/lib64/python3.2/codecs.py", line 300, in decode |
38 |
(result, consumed) = self._buffer_decode(data, self.errors, final) |
39 |
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 25: |
40 |
invalid start byte |
41 |
|
42 |
$ locale |
43 |
LANG=en_US.UTF-8 |
44 |
LC_CTYPE=fi_FI.UTF-8 |
45 |
LC_NUMERIC="en_US.UTF-8" |
46 |
LC_TIME=en_GB.UTF-8 |
47 |
LC_COLLATE="en_US.UTF-8" |
48 |
LC_MONETARY="en_US.UTF-8" |
49 |
LC_MESSAGES="en_US.UTF-8" |
50 |
LC_PAPER="en_US.UTF-8" |
51 |
LC_NAME="en_US.UTF-8" |
52 |
LC_ADDRESS="en_US.UTF-8" |
53 |
LC_TELEPHONE="en_US.UTF-8" |
54 |
LC_MEASUREMENT="en_US.UTF-8" |
55 |
LC_IDENTIFICATION="en_US.UTF-8" |
56 |
LC_ALL= |
57 |
|
58 |
- Samuli |