Gentoo Archives: gentoo-portage-dev

From: Alexander Berntsen <bernalex@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
Date: Thu, 11 Dec 2014 07:23:43
Message-Id: 54894678.8020209@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories by Zac Medico
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 11/12/14 07:51, Zac Medico wrote:
5 > On 12/08/2014 11:04 AM, Arfrever Frehtes Taifersar Arahesis wrote:
6 >> [[[
7 >> emerge --info: Modernize output of configuration of repositories.
8 >>
9 >> - Always print detailed configuration of repositories.
10 >> - Always skip PORTAGE_REPOSITORIES variable.
11 >> - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
12 >> ]]]
13 >>
14 >> --
15 >> Arfrever Frehtes Taifersar Arahesis
16 >>
17 >
18 > It looks good to me, except for the last part I would prefer that we use
19 > set, difference_update, and sorted as follows:
20 >
21 >
22 > diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
23 > index c7246a9..e763788 100644
24 > --- a/pym/_emerge/actions.py
25 > +++ b/pym/_emerge/actions.py
26 > @@ -1739,11 +1739,18 @@ def action_info(settings, trees, myopts, myfiles):
27 > 'PORTAGE_BZIP2_COMMAND' : 'bzip2',
28 > }
29 >
30 > - myvars = portage.util.unique_array(myvars)
31 > + skipped_vars = ['PORTAGE_REPOSITORIES', '_']
32 > + # Deprecated variables
33 > + skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
34 > +
35 > + myvars = set(myvars)
36 > + myvars.difference_update(skipped_vars)
37 > + myvars = sorted(myvars)
38 > +
39 > use_expand = settings.get('USE_EXPAND', '').split()
40 > use_expand.sort()
41 > unset_vars = []
42 > - myvars.sort()
43 > +
44 > for k in myvars:
45 > v = settings.get(k)
46 > if v is not None:
47 Yes please.
48
49 - --
50 Alexander
51 bernalex@g.o
52 https://secure.plaimi.net/~alexander
53 -----BEGIN PGP SIGNATURE-----
54 Version: GnuPG v2
55 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
56
57 iF4EAREIAAYFAlSJRngACgkQRtClrXBQc7WamgD/T4Vk7YU/pa5hoFWzRF+5CRTz
58 bF9Dl3yH089BoF5JbXEA/2MAwBYJZXoJDjlLmjRm21116gedXoMEEbO0wuu0SBKy
59 =4bUq
60 -----END PGP SIGNATURE-----