Gentoo Archives: gentoo-alt

From: Zac Medico <zmedico@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] RFC: changing sys-apps/portage python API to use $EROOT instead of $ROOT for keys to portage.db and similar map objects
Date: Sat, 01 Oct 2011 21:56:58
Message-Id: 4E878C9D.4020901@gentoo.org
In Reply to: Re: [gentoo-alt] RFC: changing sys-apps/portage python API to use $EROOT instead of $ROOT for keys to portage.db and similar map objects by Fabian Groffen
1 On 10/01/2011 11:27 AM, Fabian Groffen wrote:
2 > Hi Zac,
3 >
4 > On 01-10-2011 10:34:02 -0700, Zac Medico wrote:
5 >> As I integrate prefix support into mainline portage, I think it will
6 >
7 > Cool! and Thanks!
8 >
9 >> make more sense to use $EROOT instead of $ROOT for keys to portage.db
10 >> and similar map objects. This will also affect the portageq commands
11 >> which take a <root> parameter. The reason that I think $EROOT makes more
12 >> sense for these keys is that it will allow for multiple prefixes to
13 >> exist simultaneously in maps like portage.db.
14 >>
15 >> This won't affect non-prefix users, since $EROOT == $ROOT when $EPREFIX
16 >> is empty. So, I'm asking here because if might affect prefix users who
17 >> use portageq, or any programs installed in a prefix that use the
18 >> sys-apps/portage python API. If necessary, I suppose that python
19 >> programs could have some compatibility code which checks whether or no
20 >> $EROOT is contained in portage.db, and fall back to "/" otherwise.
21 >
22 > What does it actually mean? Does one have to use
23 > portageq envvar CHOST $EPREFIX/
24 > instead when this is implemented?
25 > That would seem not correct to me.
26
27 Well, it wouldn't apply to portageq's envvar command, since that doesn't
28 have a <root> argument. These are the portageq commands that would be
29 affected:
30
31 all_best_visible <root>
32 best_version <root> <category/package>
33 best_visible <root> [pkgtype] <atom>
34 contents <root> <category/package>
35 expand_virtual <root> <atom>
36 filter_protected <root>
37 get_repo_path <root> <repo_id>+
38 get_repos <root>
39 has_version <root> <category/package>
40 is_protected <root> <filename>
41 list_preserved_libs <root>
42 mass_best_version <root> [<category/package>]+
43 mass_best_visible <root> [<category/package>]+
44 match <root> <atom>
45 metadata <root> <pkgtype> <category/package> [<key>]+
46 owners <root> [<filename>]+
47
48 --
49 Thanks,
50 Zac