1 |
Instead of -rY-localX, I do -rX0Y the following in my local overlays. |
2 |
This gets the same effect and maintains both version numbers. And if |
3 |
you are worried about a revision number exceeding 99, then just do |
4 |
-rX00Y. This works without requiring code change to portage. |
5 |
|
6 |
malverian@g.o wrote: [Fri Oct 20 2006, 07:05:22PM EDT] |
7 |
> Hello all, |
8 |
> |
9 |
> In designing an enterprise infrastructure around Gentoo at my place of |
10 |
> employment, I have discovered a feature that would improve Gentoo's |
11 |
> usefulness greatly in this field. |
12 |
> |
13 |
> I'm writing to ask for your opinion on a change to sys-apps/portage that |
14 |
> would allow users to maintain local revisions of ebuilds, such as |
15 |
> "net-www/apache-2.0.58-r2-local1". This would require a modification to |
16 |
> the ebuild version specifications and a patch to two portage source |
17 |
> files which you can review here: |
18 |
> |
19 |
> http://dev.gentoo.org/~malverian/portage_local_version.patch |
20 |
> |
21 |
> (Please don't complain about the code quality, I cleaned up areas where |
22 |
> it was desparately needed such as the string.atof() areas, but for the |
23 |
> sake of code coherence, I tried to use the same methodology used elsewhere |
24 |
> in the code as much as possible, such as unqualified except statements :P) |
25 |
> |
26 |
> There are a number of scenarios where such a feature is useful, most of |
27 |
> which revolve around the need for a local version bump: |
28 |
> |
29 |
> 1) You have machines using apache-2.0.58-r2 with an unpatched security |
30 |
> hole which you would like to immediately patch locally until a fix is |
31 |
> committed to the portage tree. |
32 |
> |
33 |
> 2) You are using binary packages and need to simulate a version bump to |
34 |
> force re-installation of a binary package with modified USE flags. |
35 |
> |
36 |
> 3) You are using binary packages and need to simulate a version bump to |
37 |
> force re-installation of binary packages that were rebuilt during |
38 |
> revdep-rebuild |
39 |
> |
40 |
> In all of the above cases, one could simply bump the package up one |
41 |
> revision by creating an ebuild in an overlay for apache-2.0.58-r3. |
42 |
> However, using this solution will result in apache not being upgraded |
43 |
> when apache-2.0.58-r3 is actually committed to the portage tree unless |
44 |
> you perpetuate this bad habit ad nauseum. |
45 |
> |
46 |
> To give a better explanation of #3, consider the following scenario: |
47 |
> |
48 |
> - You have 60 servers with mysql-4.0.28 and php-5.1.6-r2 |
49 |
> - You want to upgrade to mysql-5.0.30 and continue to use php-5.1.6-r2 |
50 |
> - You use binary packages which are built on a staging machine |
51 |
> - Your servers know to upgrade via a "pull" method with the help of |
52 |
> cfengine which tells each server what packages SHOULD be installed on |
53 |
> it. This also makes it very easy later to build another copy of a |
54 |
> machine in the case of hardware failure by using the same description |
55 |
> files (cfengine config programs) |
56 |
> |
57 |
> To accomplish the above in an enterprise environment, you would need to |
58 |
> perform the following steps: |
59 |
> |
60 |
> 1) Install mysql-5.0.30 on the staging machine and build binary packages |
61 |
> |
62 |
> 2) Perform a revdep-rebuild on all packages using libmysql client |
63 |
> libraries, building new binary packages for each of them |
64 |
> |
65 |
> 3) Tell your other 60 servers that it is time to upgrade mysql (and in |
66 |
> this case, reinstall php) |
67 |
> |
68 |
> Assuming you have a description file such as the following: |
69 |
> |
70 |
> __CUT__ |
71 |
> |
72 |
> webserver_packages = |
73 |
> ( |
74 |
> dev-db/mysql-4.0.28 |
75 |
> dev-lang/php-5.1.6-r2 |
76 |
> ) |
77 |
> |
78 |
> ... |
79 |
> |
80 |
> __CUT__ |
81 |
> |
82 |
> It is obvious what change must be made to install the new version of |
83 |
> MySQL, but how do you update PHP without bumping the version of PHP? You |
84 |
> would need some extra metadata to tell the servers if they are upgrading |
85 |
> from mysql-4.0.28 to mysql-5.0.30 that they should reinstall PHP. This is |
86 |
> fine for a few packages, but it can quickly become a maintanence |
87 |
> nightmare. |
88 |
> |
89 |
> Having local revision numbers solves this problem very simply, and |
90 |
> provides quite a bit of flexibility as a side-effect. |
91 |
> |
92 |
> |
93 |
> NOTES: |
94 |
> |
95 |
> - The "-local#" revisions MUST NOT be used in the main portage tree. It |
96 |
> is something that system administrators would have exclusively for their |
97 |
> own purposes such as those described above. This SHOULD probably be |
98 |
> enforced by repoman in addition to policy changes. |
99 |
> |
100 |
> - The new (completely backward compatible) version priority order would be: |
101 |
> |
102 |
> apache-2.0.58 |
103 |
> apache-2.0.58-r1 |
104 |
> apache-2.0.58-r2 |
105 |
> apache-2.0.58-r2-local1 |
106 |
> apache-2.0.58-r2-local2 |
107 |
> apache-2.0.58-r3 |
108 |
> apache-2.0.59 |
109 |
> |
110 |
> -- |
111 |
> gentoo-dev@g.o mailing list |
112 |
> |
113 |
Joel Martin (kanaka) |
114 |
Open Source |
115 |
no BILL . no GATES |
116 |
Costs nothing . Open to all |