Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] perl eclass review - EAPI=3 + new helper eclass
Date: Sun, 25 Apr 2010 06:17:11
Message-Id: 4BD3DE48.1050306@gentoo.org
In Reply to: Re: [gentoo-dev] perl eclass review - EAPI=3 + new helper eclass by James Cloos
1 On 04/23/2010 08:14 AM, James Cloos wrote:
2 >>>>>> "HvD" == Harald van Dijk <truedfx@g.o> writes:
3 >
4 > HvD> Let's say this is in the tree:
5 >
6 > HvD> foo.eclass:
7 > HvD> DEPEND="dev-lang/python:2.6"
8 >
9 > HvD> bar-1.ebuild:
10 > HvD> inherit foo
11 >
12 > HvD> Let's say this is in your overlay:
13 >
14 > HvD> foo.eclass:
15 > HvD> DEPEND="|| ( dev-lang/python:3.1 dev-lang/python:2.6 )"
16 >
17 > HvD> Now you install bar. How should portage know that it must regenerate the
18 > HvD> metadata cache, to see that it doesn't need to install python 2.6 if you
19 > HvD> already have 3.1?
20 >
21 > It shouldn't bother. :)
22 >
23 > Really, that isn't the kind of change that I find I need to make.
24
25 Different users have different needs. The user who reported this bug
26 needed the opposite behavior:
27
28 http://bugs.gentoo.org/show_bug.cgi?id=276264
29
30 > And it should never regenerate the metadata cache (ie portage/metadata/cache).
31
32 Again, different users have different needs and the user in bug
33 #276264 really needed to regenerate the cache.
34
35 > The docs used to -- and probably still do -- recommend regenerating that
36 > cache after certain changes. Which is a drasticly bogus suggestion unless
37 > you have a *very* fast system.
38
39 It's a somewhat bogus suggestion if you are not modifying eclasses
40 in the same way as the user from bug #276264. Note that it's
41 possible to enable eclass-overrides without discarding
42 $PORTDIR/metadata/cache. It seems like that might work for your use
43 case (don't forget that this won't necessarily be appropriate for
44 every user).
45
46 For the user in bug #276264, it's more appropriate to discard
47 $PORTDIR/metadata/cache and run emerge --regen (with --jobs if he
48 wants to use multiple cpu cores in parallel).
49
50 > Even across a dialup straw, an emerge --sync
51 > is orders of magnitude faster.
52
53 Different things give different results. It may work for your use
54 case but not for others.
55
56 > If the ebuild calls a class which has been overridden by a local class, and
57 > the original class set DEPENDs or the like, then as it reads in the new class
58 > file it should just use those values in place of the ones in the cache.
59
60 And that's the behavior that you'll get if you don't discard
61 $PORTDIR/metadata/cache (which would be inappropriate for the user
62 in bug #276264).
63
64 >
65 > -JimC
66
67
68 --
69 Thanks,
70 Zac