Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] new portageq metadata function to wrap dbapi.aux_get()
Date: Fri, 14 Jul 2006 04:07:18
Message-Id: 44B717FF.7020403@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Hi everyone,
5
6 It's come to my attention that the built_with_use function in eutils.eclass accesses the installed package database directly. This is a major problem because it prevents us from being able to have an alternative installed package database implementation without breaking that function. How about if we add a new portageq function that simply acts as a wrapper to the dbapi.aux_get() function? If we provide this function, then eutils.eclass can simply use the package that is returned from best_version to do another call that gets the USE flags. Here's an example of the usage:
7
8 portageq metadata / installed sys-apps/portage-2.1-r1 USE
9
10 That command would print 1 line with all the USE flags. If additional metadata keys are specified, it will print each value on a new line. Does the behavior described above seem good or are there any suggestions to improve it? Please see the attached patch.
11
12 Zac
13 -----BEGIN PGP SIGNATURE-----
14 Version: GnuPG v1.4.4 (GNU/Linux)
15
16 iD8DBQFEtxf+/ejvha5XGaMRAkaKAKCAi/WHt6GIIoW0HqyaFbTmKLHTeQCeIN/d
17 rJUMKUs7OK9Z3tS9Ms0f0a4=
18 =3+Gh
19 -----END PGP SIGNATURE-----

Attachments

File name MIME type
portageq_metadata.patch text/x-patch