Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@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 06:51:12
Message-Id: 54893EDB.20407@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories by Arfrever Frehtes Taifersar Arahesis
1 On 12/08/2014 11:04 AM, Arfrever Frehtes Taifersar Arahesis wrote:
2 > [[[
3 > emerge --info: Modernize output of configuration of repositories.
4 >
5 > - Always print detailed configuration of repositories.
6 > - Always skip PORTAGE_REPOSITORIES variable.
7 > - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
8 > ]]]
9 >
10 > --
11 > Arfrever Frehtes Taifersar Arahesis
12 >
13
14 It looks good to me, except for the last part I would prefer that we use
15 set, difference_update, and sorted as follows:
16
17
18 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
19 index c7246a9..e763788 100644
20 --- a/pym/_emerge/actions.py
21 +++ b/pym/_emerge/actions.py
22 @@ -1739,11 +1739,18 @@ def action_info(settings, trees, myopts, myfiles):
23 'PORTAGE_BZIP2_COMMAND' : 'bzip2',
24 }
25
26 - myvars = portage.util.unique_array(myvars)
27 + skipped_vars = ['PORTAGE_REPOSITORIES', '_']
28 + # Deprecated variables
29 + skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
30 +
31 + myvars = set(myvars)
32 + myvars.difference_update(skipped_vars)
33 + myvars = sorted(myvars)
34 +
35 use_expand = settings.get('USE_EXPAND', '').split()
36 use_expand.sort()
37 unset_vars = []
38 - myvars.sort()
39 +
40 for k in myvars:
41 v = settings.get(k)
42 if v is not None:
43
44
45 --
46 Thanks,
47 Zac

Replies