Gentoo Archives: gentoo-dev

From: Thomas de Grenier de Latour <degrenier@×××××××××××.fr>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Virtuals - required?
Date: Sat, 26 Jun 2004 17:32:06
Message-Id: 20040626193246.2912f18c@eusebe
In Reply to: Re: [gentoo-dev] Virtuals - required? by Jason Stubbs
1 Imho, this change would be a step in the wrong direction, because
2 it makes portage "less declarative and more imperative". Maybe
3 this programing paradigms analogy is a bit weird, so I will try to
4 explain what I mean here.
5
6 For me, ideally, the set of installed packages (and their
7 configurations, versions, etc.) should depend exactly on a set of
8 user specifications, and not on the history of user actions (calls
9 to emerge). With such an ideal portage, it should be possible to
10 clone a system by installing a stage, copying the /etc/portage
11 content, and then doing "emerge world" (or "emerge $(cat
12 /etc/portage/sets/world)" maybe).
13
14 This is not currently true for several reasons (i won't detail
15 them all, that would be offtopic), and will probably never be, but
16 several recent changes in portage have been made that go exactly
17 in that direction. For instance, if one uses package.use and
18 package.keywords files instead of setting some environnement
19 variables on the command line, then the clone system he will
20 get using the above described technic will be closer to the
21 original. It makes things more deterministic and easy to
22 reproduce.
23
24 With that in mind, the introduction of /etc/portage/virtuals seems
25 to be yet another step in the right direction. With this file,
26 user can declare his non-default preferences for virtual packages
27 instanciation. During the initial installation, he can declare
28 very soon that he prefers Xorg to Xfree, and then call an "emerge
29 gnome", and that's Xorg that will be installed as a dependency.
30 Same for cloning a system, if the virtuals file has been copied,
31 then user's choices will be respected.
32
33 With your solution at the contrary, everything depends on the
34 order in which packages get installed. If user prefers Xorg, then
35 he must do an "emerge (--oneshot) xorg-x11" before emerging gnome.
36 Also, if he wants to clone his system, he has to instanciate
37 virtuals (all his non-default choices at least) before emerging
38 world.
39
40 I think that the more portage behavior depends on past calls
41 to emerge history, the less user is in control of his system. At
42 the contrary, the more it depends on explicit declarations of user
43 preferences in config files, the more emerge behavior is
44 predictable and understandable. Now, you may not agree this
45 statements, in which case my point against your proposal is no
46 more valid. As i said, that's just my opinion, nothing more.
47
48
49 As a side note, some more random thoughts about your proposal:
50
51 - it would allow to inject virtuals. That could be a good thing.
52 (I remember that being able to "emerge inject
53 virtual/linux-sources" had been a request i've seen in the past
54 on this list.) I don't know how that would play with the
55 RESTRICT=metaebuild idea tho (depends how you implement it).
56
57 - it would be very handy to have a user tool to list
58 candidates for a given virtual. Something like "equery
59 instanciates virtual-pkg-spec". It is straightforward to implement
60 with current system (now that the information is available in
61 aux_get), but seems harder in the context of your proposal.
62
63 - it may make packages cleaning a bit harder: With the old
64 edb/virtuals system, it was easy to delete a few obsolete
65 duplicates in the virtuals file, and then ask depclean to finish
66 the cleanup a safe way. At the contrary, with your system, assume
67 "virtual/foo" depends on "|| ( bar/pkgA bar/pkgB )", then install
68 something that depends on virtual/foo (here, pkgA gets installed),
69 and then install pkgB. Do an "emerge -p depclean", and see
70 "bar/pkgA" is not listed despite it is not in world nor really
71 needed anymore. Maybe that can be fixed in depclean code tho, i
72 don't know.
73
74 - also, i don't know exactly what would be the behavior of
75 RESTRICT=metaebuild, but if the point is that the package
76 don't appear at all in /var/db/pkg, then there is an issue:
77 it makes impossible to track backward dependencies.
78 We would then have packages that are:
79 * not in world
80 * not depended on by anything according to "qpkg -q"
81 * not candidate for cleaning according to "emerge depclean"
82 That would be a bit disturbing for users who wonder "why is this
83 package there?", and may also be a problem for some external tools
84 that rely on this backward deps.
85
86
87 --
88 TGL.
89
90 --
91 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Virtuals - required? Jason Stubbs <jstubbs@g.o>