Gentoo Archives: gentoo-dev

From: Dan Armak <danarmak@g.o>
To: gentoo-dev@××××××××××.org
Subject: Re: [gentoo-dev] The new Portage Job System
Date: Sat, 11 Aug 2001 09:22:35
Message-Id: 01081118233701.00661@desktop.dan.net
In Reply to: Re: [gentoo-dev] The new Portage Job System by Mikael Hallendal
1 On Saturday 11 August 2001 16:37, you wrote:
2 > Den 11 Aug 2001 12:05:01 +0300 skrev Dan Armak:
3 > > Hi all,
4 >
5 > Hi!
6 >
7 > As I was in the discussion on IRC #gentoo I agree that we should have
8 > something like this, I do howevery disagree on some of the stuff
9 > below...
10 >
11 > > Under profiles/jobs, or in a similar location, will be a job dir
12 > > (Possibly profiles/default/jobs, and the references may then be
13 > > redirected through /etc/make.profile). Developers can place jobs in it
14 > > for Portage to execute.
15 >
16 > Should it really be possible to redirect this? I guess it should always
17 > be in the same place in portage and should be redirected by redirecting
18 > the portage-tree.
19 No, you didn't understand. My use of "redirect" was ambigous.
20 /etc/make.profile is a symlink to /usr/portage/profiles/deafult (check your
21 system, it's there). So I said a user might redirect references to
22 /etc/make.profile with the same result as if he used
23 /usr/portage/profiles/default directly. It's not a very important point.
24
25
26 >
27 > > Helper files:
28 > > ----------------
29 > > Jobs can have misc files, a separate dir should be given to these i.e.
30 > > profiles/jobs/files.
31 >
32 > Agreed.
33 >
34 > > Generic scripts:
35 > > --------------------
36 > > Provide a dir profiles/jobs/scripts and populate it with *generic*
37 > > scripts. Under profiles/jobs put job spec files which, in their first few
38 > > (commented out) lines, have info about when to run them, and then have a
39 > > #! line that specifies one of these generic scripts as the interpreter.
40 > > For example, a job spec for moving a package would be called
41 > > move-koffice.job, and begin:
42 > >
43 > > # Job spec description: move the koffice package from kde-apps to
44 > > app-office # Run Once
45 > > # Author: Dan Armak <danarmak@g.o>
46 > > # $Header: $
47 > > #! /usr/portage/profiles/jobs/scripts/movepackage.sh
48 > > move koffice kde-apps app-office
49 > > ...
50 > > and so on, from here script-specific info would follow. This is the best
51 > > model IMHO.
52 > > Of course, under this model a job file can still be a script in its own
53 > > right, and use none of the generic scripts.
54 >
55 > I really don't like this approach. This way a wrong written script might
56 > corrupt a users database. I think it's better if we have a few scripts
57 > (i.e. those we have found out we need) and then we use the job-files for
58 > giving parameters to the script. Like in the case of moving a package we
59 > could have something like:
60 >
61 > In job-file:
62 >
63 > type: rellocate
64 > author: Mikael Hallendal <hallski@g.o>
65 > version: $Header$
66 > control-file: koffice-to-app-office.control
67 >
68 > the control-file is then in files/
69 >
70 > portage takes a look at type, recognizes it as a rellocate-type of job.
71 > It excecutes:
72 > '/usr/lib/portage/bin/rellocate
73 > /usr/portage/profiles/jobs/files/koffice-to-app-office.control'
74 >
75 > Only the system-team may add/approve scripts into portage so that we get
76 > some control of what goes in. This way a badly written job-file will
77 > result in an error when excecuting the script. A badly written
78 > control-file might do more damage but I think this is unavoidable and
79 > the control-file should have a really easy syntax.
80 That's just what I meant!! The "generic" scripts are what you want trhe
81 system team to approve, I agree with that. Then, any developer may add what I
82 called "job spec files", which you called control-files - that's just what I
83 meant. We just said the same thing in different terms.
84
85 >
86 > > The Portage-handled header: (I don't like this but have no better
87 > > ideas)
88 >
89 > Hmm, I'm not sure I follow you here. What is this for?
90 I'm not sure I followed your comments either, I've tried to answer them:
91
92 >
93 > > When to run - options:
94 > > -----------------------------
95 > > 1. The jobs will be executed after each run of emerge, including emerge
96 > > rsync.
97 >
98 > What types of jobs would be needed to run after each emerge?
99 I don't knwo -
100
101 >
102 > > 2. Before each run of emerge, to accommodate the following scenario:
103 > > change in cvs requires job to run before any emerges.
104 >
105 > How will this be of any use. If something changed in the cvs it will
106 > break the users tree at the same time he gets the job-descr. the actuall
107 > job wouldn't run until next rsync.
108 I don't follow, sorry.
109
110 >
111 > > 4. Provide "emerge jobs" command to run on demand.
112 >
113 > I think that we should have a 'emerge jobs'-kinda a tool which should be
114 > used by developers which don't use 'emerge rsync'. I do however think
115 > that jobs for users should be run by 'emerge rsync' and no otherwise.
116 No, I didn't mean "emerge jobs" to download new jobs. I meant "emergre jobs"
117 to execute currently present jobs, or a specific job. For example, a job that
118 runs a configure script or interface for some package, and you want to
119 reconfigure it. You don't want to remerge it, so you run the job yourself.
120
121 >
122 > > Ideas/needs for jobs:
123 > > ---------------------------
124 > > 1. Move a package to a different category, update /var/db/pkg if the
125 > > package was already installed. This is what we're doing with kde/gnome.
126 >
127 > This is indeed a very much needed.
128 >
129 > > 2. Output some info to the user. For example about an important new
130 > > change in Portage/emerge/new KDE version etc., for the users who don't
131 > > read the cvs logs or gentoo-dev.
132 >
133 > This is also a good feature. But should only be run after an emerge
134 > rsync.
135 A job can specify when it should be run.
136
137 >
138 > > 3. Merge a new version of sys-apps/portage when this is needed for some
139 > > ebuilds' new versions to work, like in the \" story. A user who got the
140 > > new ebuilds with non-escaped quotes but didn't update portage would be in
141 > > big trouble.
142 >
143 > Perhaps this should be handled either by (2), ie. give the user a
144 > message about upgrading there portage-system. Or by actually doing
145 > inside of 'emerge rsync'. The problem with automatically do stuff is
146 > that there are people (me for one) that don't like when things happend
147 > by themself. I like to have control of when I do update a package.
148 You can change the automatic/manual control of these things of course. A user
149 who only uses Portage to emerge new apps he needs doesn't need to keep track
150 of updates to Portage itself, just emerge rsync once in a while.
151
152 >
153 > > 4. After merging a package, output usage intructions. Deprecate the
154 > > pkg_postinst usage, emerge outputs info after it anyway.
155 > >
156 > > 5. As above, run a configuration program.
157 > >
158 > > 6. Manage a bug report system. A user who got an error running one of uor
159 > > ebuilds would get this job executed.
160 > > ...
161 >
162 > 4-5 should be handled inside the ebuild (imho). I see no reason why it
163 > should be in the jobs-system instead. If a package needs to be
164 > configured afterwords it should be done in pkg_postinst (). Same for
165 > giving the user a notice about the package.
166 Well, pkg_postinst comes before annoying portage messages that move it off
167 the screen. Also currently ebuilds are supposed to be always non-interactive,
168 not even e.g. displaying a help message with most but only with echo. Jobs
169 can be interactive.
170
171 >
172 > 6: would be a nice feature, but I don't think that it should be a job,
173 > it should be in portage system itself. The system should give a question
174 > if it fails to merge an ebuild asking if the user would like to report
175 > the bug. If so it starts the routines for doing so and puts the results
176 > in /var/db/bug-reports or something, then when doing emerge rsync
177 > portage looks in /var/db/bug-reports and sends them somewhere.
178
179 I was only making suggestions, trying to think up ideas. I'm not saying all
180 these things should be made jobs, or only them.
181
182
183
184
185 --
186
187 Dan Armak
188 Gentoo Linux Developer, Desktop Team
189 Matan, Israel