1 |
Hi Gentoo Team, |
2 |
|
3 |
As some of you may noticed i started to clean up some old patches in the |
4 |
gentoo portage tree. I did so already a while ago, and like before I'm |
5 |
using a small script in order to identify unused patches. |
6 |
|
7 |
I few days ago i started to hack again on that script and thought about |
8 |
to make it easier to use the output. The result is following: |
9 |
|
10 |
http://gentoo.levelnine.at |
11 |
|
12 |
This is my homepage, were you can see the output of my patchtest and |
13 |
other scripts (gonna explain below). The scripts gonna run once a day |
14 |
and sort the findings by package and maintainer. |
15 |
The scripts itself are hosted on github, you can find them on: |
16 |
|
17 |
https://github.com/mm1ke/gentoo-scripts |
18 |
|
19 |
The scripts aren't very polish and probably lacks a lot of |
20 |
comments and cleanups. However, for now they working as expected and do |
21 |
help me to find a lot of unused patches. |
22 |
|
23 |
|
24 |
The scripts: |
25 |
|
26 |
As mentioned, the homepage actually has 3 scripts running once a day. I |
27 |
gonna give you a short description of what every script is doing and |
28 |
what are its limitations. |
29 |
|
30 |
patchtest: |
31 |
This is my oldest script, and my main source of lists with unused |
32 |
patches. I won't go into detail how it exactly works, but it basically |
33 |
checks every package if there is a "files" dir, creates a list of |
34 |
pachtes/files included in this dir and greps every ebuild if it can find |
35 |
any of the patches or files. |
36 |
As you know this isn't very easy as patches aren't usually written with |
37 |
their filename in the ebuild, so it has some limitations, which are: |
38 |
* asterisk: |
39 |
patching using an asterisk to get the files to patch (like epatch |
40 |
packagename-vers-patch*.patch) will give false positives. |
41 |
* special variables (like ${MY_PN}) |
42 |
when scripts use such variables in patchnames it will give false |
43 |
positives. |
44 |
* patching like epatch patchname-vers-patch{1,2,3,4}.patch will give |
45 |
"some" false positives. Just some because I've already added a feature |
46 |
to identify such naming, but it's still not 100% perfect. |
47 |
* eclasses which uses files in FILESDIR. Not many do that, but it will |
48 |
give still a false positive. |
49 |
|
50 |
I probably forget something, but apart from those limitations it works |
51 |
quite well. Just have a look at the results. |
52 |
|
53 |
|
54 |
patchcheck: |
55 |
This is a spinoff of patchtest. The idea was to identify packages who |
56 |
have a "files" directory, but no ebuild has the keywords |
57 |
"FILESDIR,.patch,.diff" and a few eclasses in it. |
58 |
The result is much smaller then with patchtest, but in this case the |
59 |
results are more useful as there are just a few false-positives. |
60 |
|
61 |
wwwtest: |
62 |
This is a new scirpt, which, as the name might suggest, checks the |
63 |
homepages of every ebuild. Apart from sorting the output by package and |
64 |
maintainer it also creates lists by httpcode. That way it's quite easy |
65 |
to check which homepage aren't available anymore (just look at the |
66 |
404.txt file). |
67 |
The other sortings however doesn't include "good" http codes, which are |
68 |
for now: 200,302,307,400,503 (this can be changed anytime) |
69 |
Also links to ftp sites aren't included and are in a separate file |
70 |
(FTP.txt). |
71 |
Furthermore, there is another file called VAR.txt. This one includes |
72 |
packages who use variables in the homepage fild (which i really |
73 |
don't like). I think i gonna update my script someday to replace the |
74 |
vars and be able to check them, however special vars like ${MY_PN} gonna |
75 |
be still a problem... |
76 |
The 000.txt file contains usually homepages who timed out. Usually i try |
77 |
10 seconds to get an httpcode before giving up. |
78 |
|
79 |
|
80 |
Comments, suggestions and even patches are welcomed. :) |
81 |
I hope someone can use these findings. |
82 |
|
83 |
Kind regards, |
84 |
Michael Mair-Keimberger |