Gentoo Archives: gentoo-portage-dev

From: Mike Kelly <pioto@×××××.org>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Re: Portage phase hooks patch
Date: Mon, 24 Jul 2006 22:33:22
Message-Id: 20060724183158.7f9b31cb@mk65-desktop.pioto.org
In Reply to: Re: [gentoo-portage-dev] Re: Portage phase hooks patch by Marius Mauch
1 On Mon, 24 Jul 2006 23:59:09 +0200
2 Marius Mauch <genone@g.o> wrote:
3
4 > On Mon, 24 Jul 2006 16:41:26 -0400
5 > Mike Kelly <pioto@×××××.org> wrote:
6 > > Basically, what I need to do is:
7 > >
8 > > - Run a script to intelligently add / manage package manager-added
9 > > users. At the moment, it would seem this should just be run
10 > > before or during the pkg_setup phase, but this may well be
11 > > sub-optimal, particularly in the case if binary packages or
12 > > non-standard ROOTs.
13 >
14 > can be done within an eclass.
15
16 Agreed. I don't think that I said this couldn't be.
17
18 > > - Properly let that set of scripts know when an added user or group
19 > > is safe to remove. This code is intimately tied with the
20 > > implementation-specific details of the above scripts, which may
21 > > change from version to version, hence my trepidation about adding
22 > > this code directly into portage itself.
23 >
24 > can be done with an eclass too. Also that eclass can depend on your
25 > scripts or whatever package it needs to do this, seems better than to
26 > add dependencies in every package using this functionality.
27 > Also should be able to have a generic interface for this.
28
29 Also agreed. And, I am going to try to thin down what code needs to be
30 run directly by the package manager. However, there is still the
31 limitation of the below.
32
33 > > - Have the ability to clean up from myself if a build goes awry, or
34 > > is aborted by the operator. As far as I know, this particular
35 > > requirement would exclude the use of eclasses, but I could well
36 > > be wrong.
37 >
38 > Don't see how the proposed hook system would allow that either without
39 > additional mods in abort_handler.
40
41 Yeah, the patch I wrote last week won't do this. I'm working on such a
42 patch at the moment. However, am I correct in understanding that this
43 cannot be done from within an eclass? If so, I see that as one of the
44 stronger reasons for not using one. Having incomplete / unnecessary
45 user and group additions on a system is a bad thing for the package
46 manager to leave around.
47
48 > > - Have this user addition handled in an intelligent way when we're
49 > > only building/installing a binary package. I'm not really sure on
50 > > what would be a logical way to do this.
51 >
52 > Yeah, that one is tricky.
53
54 Indeed. I'm still trying to figure out a reasonable way to handle it.
55 It seems at the moment that the user would need to be added on the
56 build system, and then later be added identically on the system where
57 it is ultimately installed on. Once building is done, the user could be
58 purged from the build system by something like an eselect module.
59
60 > > So, if the answer to the above is to not use some sort of hooks,
61 > > then I would appreciate pointers on where to look to achieve all of
62 > > the above with portage.
63 >
64 > Well, I'm not saying to not use hooks, just trying to find the (IMHO)
65 > best solution to the problem (and being a bit resistant against an
66 > generic unprotected hook system).
67 > From my POV this project should work like you provide a service (your
68 > management scripts) and portage/paludis/whatever use this service by
69 > calling the scripts. This would mean you wouldn't really have to care
70 > about the glue code but just provide an interface, and the pkgmanager
71 > has to conform to that interface.
72 > Right now it sounds like you want to work on the glue code, might be
73 > better to define the interface first.
74
75 At the moment, I think my interface is pretty well defined, although I
76 agree it could use a little more definition. I really want to try to
77 get some stable glue code set up, though, so that I can start testing
78 things out. Also, I want to have an idea of what the glue code is like,
79 as that dictates what sort of information my scripts can expect to have
80 available to them.
81
82 > Btw, you haven't really answered my question, what benefits do you/we
83 > get by having implementation specific hooks instead of using an
84 > eclass/repo level hook system (that "unique features" bit)?
85
86 Well, the main benefit I get by not using an eclass hook is that I can
87 properly clean up after myself if a build fails, and, I think, better
88 handle the addition of users in the case where the build and install
89 machines are different.
90
91 The more I look at this and discuss it with folks, I think that the
92 general hooks I suggested may not be adequate. Rather, I may just want
93 to prepare a patch which contains specific calls to my code at the
94 proper points.
95
96 My backend code isn't ready for prime time yet, so this stuff shouldn't
97 be in portage proper yet. Should I just be maintaining a patch in an
98 overlay for the time being and then work on getting this added in fully
99 at a later date?
100
101 Thanks all for the suggestions and for pointing out a few important
102 things to me.
103
104 --
105 Mike Kelly

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-portage-dev] Re: Portage phase hooks patch "Kevin F. Quinn" <kevquinn@g.o>