1 |
On Sunday 02 March 2003 11:44 am, Andy Arbon wrote: |
2 |
> Has anyone written something like this, and does anyone have any reason |
3 |
> why something like this wouldn't work or be useful? |
4 |
|
5 |
I was bored so I quickly hacked this together, just to see how it would do. |
6 |
|
7 |
time sh script-cruft.sh |
8 |
...lots of output.... |
9 |
real 0m48.147s |
10 |
user 0m33.010s |
11 |
sys 0m3.810s |
12 |
|
13 |
My first attempt was more like "real 125m48.147s", but I just wasn't very |
14 |
intelligent about that. This version actually exploits sed's capabilities. A |
15 |
15577% increase in performance for a few minutes of work isn't too shabby, if |
16 |
I may say so myself. ;-) |
17 |
|
18 |
The script produced far more output than I would have naively expected, about |
19 |
4300 lines. There might be too much noise for the tool to be useful. On the |
20 |
other hand.... |
21 |
|
22 |
It did catch some things that surprised me. On my system there are lots of |
23 |
libraries and perl related files that aren't known to portage (though they |
24 |
correspond to software I've installed via an ebuild). For example, on my |
25 |
system there are several programs in /usr/bin which portage doesn't know |
26 |
about. |
27 |
|
28 |
/usr/bin/amstex -> tex |
29 |
/usr/bin/cont-cz -> pdfetex |
30 |
/usr/bin/cont-de -> pdfetex |
31 |
/usr/bin/cont-en -> pdfetex |
32 |
/usr/bin/cont-nl -> pdfetex |
33 |
/usr/bin/cont-uk -> pdfetex |
34 |
/usr/bin/cpp |
35 |
/usr/bin/cpp.orig |
36 |
/usr/bin/elatex -> etex |
37 |
/usr/bin/eplain -> tex |
38 |
/usr/bin/frlatex -> tex |
39 |
/usr/bin/lambda -> omega |
40 |
/usr/bin/latex -> tex |
41 |
/usr/bin/pdfelatex -> pdfetex |
42 |
/usr/bin/pdflatex -> pdftex |
43 |
/usr/bin/rec -> /usr/bin/play |
44 |
|
45 |
Makes me think the app-text/tetex-1.0.7-r11 ebuild was broken; don't know if |
46 |
the current stable 1.0.7-r12 does the same thing, I'll have to look into |
47 |
that. The /usr/bin/cpp looks like a script related to sys-devel/gcc-config, |
48 |
you'd think portage would know about this too. |
49 |
|
50 |
---script-cruft.sh--- |
51 |
#!/bin/sh |
52 |
|
53 |
find / '(' -path /proc \ |
54 |
-or -path /dev \ |
55 |
-or -path /boot \ |
56 |
-or -path /mnt \ |
57 |
-or -path /tmp \ |
58 |
-or -path /var/tmp \ |
59 |
-or -path /root \ |
60 |
-or -path /home \ |
61 |
-or -path /lib/dev-state \ |
62 |
-or -path /lib/modules \ |
63 |
-or -path /usr/portage \ |
64 |
-or -path /var/cache/edb \ |
65 |
-or -path /var/db/pkg \ |
66 |
')' -prune -or -print \ |
67 |
| sort >/tmp/allfiles |
68 |
|
69 |
qpkg -nc -l \ |
70 |
| sed -n -e 's/ -> .*//' -e '1,2 d' -e '/^$/,+2! p' \ |
71 |
| sort \ |
72 |
| uniq >/tmp/portagefiles |
73 |
|
74 |
comm -2 -3 /tmp/allfiles /tmp/portagefiles |
75 |
---script-cruft.sh--- |
76 |
|
77 |
|
78 |
|
79 |
-- |
80 |
gentoo-dev@g.o mailing list |