Gentoo Archives: gentoo-dev

From: Mikael Hallendal <hallski@g.o>
To: gentoo-dev@××××××××××.org
Subject: Re: [gentoo-dev] The new Portage Job System
Date: Sat, 11 Aug 2001 07:39:27
Message-Id: 997537032.5103.20.camel@fry
In Reply to: [gentoo-dev] The new Portage Job System by Dan Armak
1 Den 11 Aug 2001 12:05:01 +0300 skrev Dan Armak:
2 > Hi all,
3
4 Hi!
5
6 As I was in the discussion on IRC #gentoo I agree that we should have
7 something like this, I do howevery disagree on some of the stuff
8 below...
9
10 > Under profiles/jobs, or in a similar location, will be a job dir (Possibly
11 > profiles/default/jobs, and the references may then be redirected through
12 > /etc/make.profile). Developers can place jobs in it for Portage to execute.
13
14 Should it really be possible to redirect this? I guess it should always
15 be in the same place in portage and should be redirected by redirecting
16 the portage-tree.
17
18 > Helper files:
19 > ----------------
20 > Jobs can have misc files, a separate dir should be given to these i.e.
21 > profiles/jobs/files.
22
23 Agreed.
24
25 > Generic scripts:
26 > --------------------
27 > Provide a dir profiles/jobs/scripts and populate it with *generic* scripts.
28 > Under profiles/jobs put job spec files which, in their first few (commented
29 > out) lines, have info about when to run them, and then have a #! line that
30 > specifies one of these generic scripts as the interpreter. For example, a job
31 > spec for moving a package would be called move-koffice.job, and begin:
32 >
33 > # Job spec description: move the koffice package from kde-apps to app-office
34 > # Run Once
35 > # Author: Dan Armak <danarmak@g.o>
36 > # $Header: $
37 > #! /usr/portage/profiles/jobs/scripts/movepackage.sh
38 > move koffice kde-apps app-office
39 > ...
40 > and so on, from here script-specific info would follow. This is the best
41 > model IMHO.
42 > Of course, under this model a job file can still be a script in its own
43 > right, and use none of the generic scripts.
44
45 I really don't like this approach. This way a wrong written script might
46 corrupt a users database. I think it's better if we have a few scripts
47 (i.e. those we have found out we need) and then we use the job-files for
48 giving parameters to the script. Like in the case of moving a package we
49 could have something like:
50
51 In job-file:
52
53 type: rellocate
54 author: Mikael Hallendal <hallski@g.o>
55 version: $Header$
56 control-file: koffice-to-app-office.control
57
58 the control-file is then in files/
59
60 portage takes a look at type, recognizes it as a rellocate-type of job.
61 It excecutes:
62 '/usr/lib/portage/bin/rellocate
63 /usr/portage/profiles/jobs/files/koffice-to-app-office.control'
64
65 Only the system-team may add/approve scripts into portage so that we get
66 some control of what goes in. This way a badly written job-file will
67 result in an error when excecuting the script. A badly written
68 control-file might do more damage but I think this is unavoidable and
69 the control-file should have a really easy syntax.
70
71 > The Portage-handled header: (I don't like this but have no better
72 > ideas)
73
74 Hmm, I'm not sure I follow you here. What is this for?
75
76 > When to run - options:
77 > -----------------------------
78 > 1. The jobs will be executed after each run of emerge, including emerge rsync.
79
80 What types of jobs would be needed to run after each emerge?
81
82 > 2. Before each run of emerge, to accommodate the following scenario: change
83 > in cvs requires job to run before any emerges.
84
85 How will this be of any use. If something changed in the cvs it will
86 break the users tree at the same time he gets the job-descr. the actuall
87 job wouldn't run until next rsync.
88
89 > 4. Provide "emerge jobs" command to run on demand.
90
91 I think that we should have a 'emerge jobs'-kinda a tool which should be
92 used by developers which don't use 'emerge rsync'. I do however think
93 that jobs for users should be run by 'emerge rsync' and no otherwise.
94
95 > Ideas/needs for jobs:
96 > ---------------------------
97 > 1. Move a package to a different category, update /var/db/pkg if the package
98 > was already installed. This is what we're doing with kde/gnome.
99
100 This is indeed a very much needed.
101
102 > 2. Output some info to the user. For example about an important new change in
103 > Portage/emerge/new KDE version etc., for the users who don't read the cvs
104 > logs or gentoo-dev.
105
106 This is also a good feature. But should only be run after an emerge
107 rsync.
108
109 > 3. Merge a new version of sys-apps/portage when this is needed for some
110 > ebuilds' new versions to work, like in the \" story. A user who got the new
111 > ebuilds with non-escaped quotes but didn't update portage would be in big
112 > trouble.
113
114 Perhaps this should be handled either by (2), ie. give the user a
115 message about upgrading there portage-system. Or by actually doing
116 inside of 'emerge rsync'. The problem with automatically do stuff is
117 that there are people (me for one) that don't like when things happend
118 by themself. I like to have control of when I do update a package.
119
120 > 4. After merging a package, output usage intructions. Deprecate the
121 > pkg_postinst usage, emerge outputs info after it anyway.
122 >
123 > 5. As above, run a configuration program.
124 >
125 > 6. Manage a bug report system. A user who got an error running one of uor
126 > ebuilds would get this job executed.
127 > ...
128
129 4-5 should be handled inside the ebuild (imho). I see no reason why it
130 should be in the jobs-system instead. If a package needs to be
131 configured afterwords it should be done in pkg_postinst (). Same for
132 giving the user a notice about the package.
133
134 6: would be a nice feature, but I don't think that it should be a job,
135 it should be in portage system itself. The system should give a question
136 if it fails to merge an ebuild asking if the user would like to report
137 the bug. If so it starts the routines for doing so and puts the results
138 in /var/db/bug-reports or something, then when doing emerge rsync
139 portage looks in /var/db/bug-reports and sends them somewhere.
140
141 Regards,
142 Mikael Hallendal

Replies

Subject Author
Re: [gentoo-dev] The new Portage Job System Dan Armak <danarmak@g.o>