1 |
Volker Armin Hemmann <volkerarmin@××××××××××.com> posted |
2 |
200904251903.22817.volkerarmin@××××××××××.com, excerpted below, on Sat, |
3 |
25 Apr 2009 19:03:22 +0200: |
4 |
|
5 |
> On Samstag 25 April 2009, Frank Peters wrote: |
6 |
>> On Fri, 24 Apr 2009 21:14:21 +0000 (UTC) |
7 |
>> |
8 |
>> What I would really like to have, though, is a way to get portage to |
9 |
>> recognize packages that I have installed myself. |
10 |
> |
11 |
> there is. You have to read the handbook. Or man 5 portage |
12 |
> |
13 |
> package.provided |
14 |
|
15 |
Indeed. I'm sure a lot of folks have a package or two in |
16 |
package.provided. |
17 |
|
18 |
One tip that I've come up with based on my own experience is to use |
19 |
versions in package.provided much like they do for "live" versions of |
20 |
packages.[1] That is, for the kernel as an example, which I had always |
21 |
handled myself but which a few packages do depend on, I put 2.6.999 in |
22 |
package.provided, so nothing (for the foreseeable future) will ever |
23 |
require a newer version than is in package.provided. Had I taken the |
24 |
suggestion VAH quoted from the manpage and used 2.6.7, various packages |
25 |
would have likely required something newer by now. |
26 |
|
27 |
Another package I have listed in package.provided is mail-mta/ssmtp-999, |
28 |
matching a dependency of the @system set. I run kmail and at first |
29 |
didn't have anything setup for "system" mail at all, but a few years ago |
30 |
I came up with a script that can be invoked by cron, for instance, for |
31 |
its local mail, that puts it in a local maildir folder that kmail reads. |
32 |
I had and have no need for a real smtp daemon or application, and didn't |
33 |
particularly want my local sysadmin mail going to my ISP for processing |
34 |
anyway, so a script that simply properly placed it in a local maildir |
35 |
folder for kmail to pick up was appropriate, and before that, having the |
36 |
local mail attempt fail wasn't a big deal since no one was reading it |
37 |
anyway. |
38 |
|
39 |
But the biggest package list in package.provided here, is because I chose |
40 |
to install the xorg-x11 meta-package. The Gentoo X project's |
41 |
recommendation is that people instead install xorg-server and the |
42 |
individual packages they need directly, rather than the meta-package, |
43 |
which lists as dependencies a lot of packages (including an unfree font |
44 |
or two) that upstream xorg likes but that most folks have no real |
45 |
practical use for on their system. But I chose to install the meta- |
46 |
package anyway, but package.provided a bunch of stuff, mostly fonts, that |
47 |
I decided I didn't need. In addition to fonts I have x11-apps/xsm-99 and |
48 |
x11-terms/xterm-999 listed. I use KDE and if it breaks, prefer to fix it |
49 |
at the text console, rather than have a fallback Xsession, so I don't |
50 |
need xsm, and use konsole and therefore don't need xterm. |
51 |
|
52 |
..... |
53 |
|
54 |
Another file to be found in /etc/portage/profile/ is the packages file, |
55 |
as an extension to the cascading set of packages files found in your |
56 |
profile and its parents. You can of course read the portage manpage for |
57 |
the details of purpose and format, but the reason I mention it is because |
58 |
I have a single entry there: |
59 |
|
60 |
-*sys-apps/busybox |
61 |
|
62 |
I don't need busybox (which indeed, I had to bypass on original install |
63 |
back in 2004, as it wouldn't compile, and still wouldn't last time I |
64 |
tried, in maybe 2007, but since I don't need it, it has been easier to |
65 |
tell portage that than to figure out why it wouldn't compile, and I've |
66 |
had no reason to try since) because 1) I don't use an initramfs/initrd, |
67 |
and 2) I keep a tested bootable backup snapshot of my working system |
68 |
around on a different partition, complete with the full versions of all |
69 |
the utilities busybox provides as that's exactly what my backup is, a |
70 |
snapshot of my working system taken periodically, when it was in known |
71 |
good working order. Thus, in the emergency situations when most folks |
72 |
would be trying to repair their system with a limited set of tools as |
73 |
found in busybox and their initramfs/initrd, I simply boot to the backup |
74 |
copy of root and have the fully functional system ready to go just as it |
75 |
was when I took the snapshot of my working system. =:^) Thus, no need |
76 |
for busybox, and I can safely remove it from the @system set as unneeded, |
77 |
which is exactly what the above line in the packages file does. |
78 |
|
79 |
..... |
80 |
|
81 |
As you can see, Gentoo and portage really are very flexible, WAY more |
82 |
flexible than meets the eye on original examination, and in fact, much |
83 |
more flexible than most distributions, certainly than most binary |
84 |
distributions. |
85 |
|
86 |
Of course, there'd be another way to do it too, if the above methods |
87 |
weren't available. Since portage works with overlays and these can |
88 |
contain all sorts of additional ebuilds and assorted support files as |
89 |
necessary, it's always possible and in fact encouraged for those knowing |
90 |
enough bash and etc to do so, to create your own ebuilds. Since all an |
91 |
ebuild really is, is a framework for automating the same installation |
92 |
steps one would take to install a package manually, it's relatively easy |
93 |
to create an ebuild to handle it for you. Not only does this automate |
94 |
the steps one would ordinarily take manually, but it also lets the |
95 |
package tracking system know that you have it installed and track it as |
96 |
it normally would. =:^) |
97 |
|
98 |
But, there's another angle to it as well. If you really do want to |
99 |
handle it manually (or automated but using methods outside of portage), |
100 |
and even if the above package.provided, etc, weren't there, since it's |
101 |
possible to create your own ebuilds, it's possible to create what amounts |
102 |
to "null" or "noop" ebuilds. These wouldn't actually install anything; |
103 |
they'd simply tell portage it's installed. Actually, if you look around, |
104 |
the Gentoo tree itself makes use of this type of package. There's |
105 |
virtual packages and meta-packages. These can depend on other packages |
106 |
and be depended on in turn, but don't actually install anything |
107 |
themselves. The above mentioned xorg-x11 is one example. If you're a |
108 |
KDE person, installing kde-meta installs a whole set of meta-packages |
109 |
(kdebase-meta, kdegraphics-meta...) as dependencies, but itself installs |
110 |
nothing but the name, each of which install a whole set of individual |
111 |
packages (kdebase-meta installs kcontrol, konqueror, etc). |
112 |
|
113 |
Thus, even if package.provided didn't exist, it would be possible to |
114 |
create "empty" ebuilds in your overlay that didn't actually install the |
115 |
package but simply told portage it was installed, so it could use it for |
116 |
dependency tracking and similar purposes. |
117 |
|
118 |
Now tell me this. Had you any /idea/ Gentoo was that flexible? I |
119 |
certainly hadn't the foggiest when I first started, and to this day it |
120 |
continues to amaze me just how flexible it can be! Yet just as Linux |
121 |
itself, it's continually improving, getting even MORE flexible, allowing |
122 |
people to do even more in ever easier ways, with the same set of basic |
123 |
tools. |
124 |
|
125 |
..... |
126 |
|
127 |
Oh, something else to mention. Maybe this is covered in the handbooks |
128 |
now but if so it's new. Gentoo actually has three package managers, |
129 |
portage being only one. Now portage remains the default PM, the one it |
130 |
is assumed people are running unless there is reason to believe |
131 |
otherwise, the one most of the Gentoo documentation covers, and the one |
132 |
recommended for newbies for all those reasons. However, there's an |
133 |
evolving EAPI specification that all ebuilds in the official Gentoo tree |
134 |
must follow (tho there are public overlays available, some officially |
135 |
supported, some not, that use experimental EAPI versions), that has made |
136 |
it possible for other package managers to be built as well. You will at |
137 |
some point come across reference to these, so I might as well explain the |
138 |
idea here. |
139 |
|
140 |
pkgcore is a Gentoo package manager implementation that was intended |
141 |
originally as a portage rewrite, as portage at the time (and to some |
142 |
degree still) had a lot of old crufty "spaghetti code" that had built up |
143 |
over the years and was getting difficult to maintain. But it evolved |
144 |
into its own project. pkgcore is written and maintained by a former |
145 |
portage developer, and like portage, is written in python and bash. |
146 |
|
147 |
paludis is an entirely independent Gentoo package manager written in C |
148 |
(with I believe some bash as well, as parsing bash can be really hard to |
149 |
get right with anything /but/ bash, and the ebuilds are of course bash |
150 |
based). Because it's written in C, it's much faster in some regards (tho |
151 |
of course the actual compiles still take real time). The development |
152 |
team is also quite happy to implement various experimental EAPIs and the |
153 |
like before they're implemented in the other two PMs, so some of the most |
154 |
experimental cutting edge overlays may require it. There are, however, |
155 |
two drawbacks that I'm aware of. First, unless they recently added it, |
156 |
paludis has no binpkg support at all. As should be very obvious from my |
157 |
first reply, I like my binpkg support so that rather eliminates it as a |
158 |
possibility for me. Second, let's just say that the lead developer, |
159 |
while an incredibly gifted coder, doesn't get along so well with some |
160 |
people, both Gentoo devs and users. As such, while paludis is a |
161 |
supported PM, some of the humans dealing with the bugs you might file or |
162 |
the questions you might ask on the lists and forums while using said PM, |
163 |
may be doing that support somewhat less voluntarily cooperatively than |
164 |
they might be with say portage. One hopes they remain professional, |
165 |
especially on bugzilla but also on the forums and lists. However, it's |
166 |
an unfortunate fact that regardless of its technical merits, paludis |
167 |
users do have this history to deal with. It's something that some may |
168 |
prefer not to deal with, in which case, sticking with the default portage |
169 |
is their best bet. (pkgcore is somewhat in the middle. It doesn't have |
170 |
the political negatives paludis has, but it's not the assumed default, |
171 |
either. As they say, YMMV.) |
172 |
|
173 |
Me? I've stuck with portage. It is the assumed Gentoo default which |
174 |
does make things easier at times, and I've found Zac (zmedico), the |
175 |
portage project lead, very easy to work with. I run ~arch and sometimes |
176 |
test still masked for testing versions of various packages as well, so |
177 |
file my share of bugs as well as tracking many more others have filed, |
178 |
including some on portage. For his consistency, cooperativeness, and |
179 |
general respect for all, users and developers alike, Zac has gained my |
180 |
utmost respect. While I've thought about trying pkgcore, I really enjoy |
181 |
watching as portage improves and develops new features along with the |
182 |
bugs they invariably bring, then watching them get fixed. While he's not |
183 |
perfect, Zac's handling of all that is a rare thing, something that |
184 |
simply clicks with me, and as long as he's portage lead, there's a good |
185 |
chance I'll stick with portage. |
186 |
|
187 |
..... |
188 |
|
189 |
[1] A few packages in the tree have "live-vcs" versions, each time you |
190 |
recompile them, they grab the git/svn/bazaar/whatever HEAD code and at |
191 |
least /try/ to compile and install it "live". Thus, unlike most |
192 |
packages, they don't have a real "version", other than perhaps a revision |
193 |
number, but at present, portage itself doesn't track that. For this |
194 |
reason and others, "live" packages are never unmasked so normal users |
195 |
don't see them, only those that specifically use package.unmask and |
196 |
perhaps package.keywords to allow portage to install those specific |
197 |
packages. A convention for such packages is that the version number is |
198 |
9999 or 1.4.9999 (for live branch versions) or similar, so for those |
199 |
choosing to unmask and merge them, they always have a higher version |
200 |
number and therefore take precedence over the normal versions, which is |
201 |
what people normally want. |
202 |
|
203 |
-- |
204 |
Duncan - List replies preferred. No HTML msgs. |
205 |
"Every nonfree program has a lord, a master -- |
206 |
and if you use the program, he is your master." Richard Stallman |