* [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
@ 2014-12-08 19:04 Arfrever Frehtes Taifersar Arahesis
2014-12-09 0:08 ` Brian Dolbec
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-08 19:04 UTC (permalink / raw
To: Gentoo Portage Development
[-- Attachment #1.1: Type: Text/Plain, Size: 285 bytes --]
[[[
emerge --info: Modernize output of configuration of repositories.
- Always print detailed configuration of repositories.
- Always skip PORTAGE_REPOSITORIES variable.
- Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
]]]
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #1.2: portage.patch --]
[-- Type: text/x-patch, Size: 1519 bytes --]
--- pym/_emerge/actions.py
+++ pym/_emerge/actions.py
@@ -1707,13 +1707,9 @@
((cp + ":").ljust(cp_max_len + 1), versions))
repos = portdb.settings.repositories
- if "--verbose" in myopts:
- append("Repositories:\n")
- for repo in repos:
- append(repo.info_string())
- else:
- append("Repositories: %s" % \
- " ".join(repo.name for repo in repos))
+ append("Repositories:\n")
+ for repo in repos:
+ append(repo.info_string())
installed_sets = sorted(s for s in
root_config.sets['selected'].getNonAtoms() if s.startswith(SETPREFIX))
@@ -1726,8 +1722,8 @@
myvars = list(settings)
else:
myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
- 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
- 'PORTDIR_OVERLAY', 'PORTAGE_BUNZIP2_COMMAND',
+ 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
+ 'PORTAGE_BUNZIP2_COMMAND',
'PORTAGE_BZIP2_COMMAND',
'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES',
@@ -1735,6 +1731,16 @@
myvars.extend(portage.util.grabfile(settings["PORTDIR"]+"/profiles/info_vars"))
+ skipped_vars = ['PORTAGE_REPOSITORIES', '_']
+ # Deprecated variables
+ skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
+
+ for skipped_var in skipped_vars:
+ try:
+ myvars.remove(skipped_var)
+ except ValueError:
+ pass
+
myvars_ignore_defaults = {
'PORTAGE_BZIP2_COMMAND' : 'bzip2',
}
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-08 19:04 [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories Arfrever Frehtes Taifersar Arahesis
@ 2014-12-09 0:08 ` Brian Dolbec
2014-12-09 8:50 ` Alexander Berntsen
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2014-12-09 0:08 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
On Mon, 8 Dec 2014 20:04:11 +0100
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
> [[[
> emerge --info: Modernize output of configuration of repositories.
>
> - Always print detailed configuration of repositories.
> - Always skip PORTAGE_REPOSITORIES variable.
> - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
> ]]]
>
> --
> Arfrever Frehtes Taifersar Arahesis
@team, I want everyone to weigh in on this one before it is merged.
--
Brian Dolbec <dolsen>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 951 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-08 19:04 [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories Arfrever Frehtes Taifersar Arahesis
2014-12-09 0:08 ` Brian Dolbec
@ 2014-12-09 8:50 ` Alexander Berntsen
2014-12-09 10:17 ` Arfrever Frehtes Taifersar Arahesis
2014-12-11 6:51 ` Zac Medico
2014-12-13 6:44 ` Arfrever Frehtes Taifersar Arahesis
3 siblings, 1 reply; 8+ messages in thread
From: Alexander Berntsen @ 2014-12-09 8:50 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 08/12/14 20:04, Arfrever Frehtes Taifersar Arahesis wrote:
> + for skipped_var in skipped_vars: + try: +
> myvars.remove(skipped_var) + except ValueError: + pass +
wat
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlSGt90ACgkQRtClrXBQc7WbPQD9E7Co8kmP5FviWlU0h2262iWj
fNzPMFcCk5vNaj6xGzAA/3RsaZJhDCnDhlkrc1L25HKGbT1gESPjm4Dhu0IDFHZV
=8KHv
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-09 8:50 ` Alexander Berntsen
@ 2014-12-09 10:17 ` Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 8+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-09 10:17 UTC (permalink / raw
To: Gentoo Portage Development
[-- Attachment #1: Type: Text/Plain, Size: 586 bytes --]
2014-12-09 09:50 Alexander Berntsen napisał(a):
> On 08/12/14 20:04, Arfrever Frehtes Taifersar Arahesis wrote:
> > + for skipped_var in skipped_vars: + try: +
> > myvars.remove(skipped_var) + except ValueError: + pass +
> wat
It is deleting elements from a list.
>>> mylist = ["ab", "cd", "ef"]
>>> mylist
['ab', 'cd', 'ef']
>>> mylist.remove("cd")
>>> mylist
['ab', 'ef']
>>> mylist.remove("cd")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>>
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-08 19:04 [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories Arfrever Frehtes Taifersar Arahesis
2014-12-09 0:08 ` Brian Dolbec
2014-12-09 8:50 ` Alexander Berntsen
@ 2014-12-11 6:51 ` Zac Medico
2014-12-11 7:23 ` Alexander Berntsen
2014-12-13 6:44 ` Arfrever Frehtes Taifersar Arahesis
3 siblings, 1 reply; 8+ messages in thread
From: Zac Medico @ 2014-12-11 6:51 UTC (permalink / raw
To: gentoo-portage-dev
On 12/08/2014 11:04 AM, Arfrever Frehtes Taifersar Arahesis wrote:
> [[[
> emerge --info: Modernize output of configuration of repositories.
>
> - Always print detailed configuration of repositories.
> - Always skip PORTAGE_REPOSITORIES variable.
> - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
> ]]]
>
> --
> Arfrever Frehtes Taifersar Arahesis
>
It looks good to me, except for the last part I would prefer that we use
set, difference_update, and sorted as follows:
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c7246a9..e763788 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1739,11 +1739,18 @@ def action_info(settings, trees, myopts, myfiles):
'PORTAGE_BZIP2_COMMAND' : 'bzip2',
}
- myvars = portage.util.unique_array(myvars)
+ skipped_vars = ['PORTAGE_REPOSITORIES', '_']
+ # Deprecated variables
+ skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
+
+ myvars = set(myvars)
+ myvars.difference_update(skipped_vars)
+ myvars = sorted(myvars)
+
use_expand = settings.get('USE_EXPAND', '').split()
use_expand.sort()
unset_vars = []
- myvars.sort()
+
for k in myvars:
v = settings.get(k)
if v is not None:
--
Thanks,
Zac
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-11 6:51 ` Zac Medico
@ 2014-12-11 7:23 ` Alexander Berntsen
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Berntsen @ 2014-12-11 7:23 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 11/12/14 07:51, Zac Medico wrote:
> On 12/08/2014 11:04 AM, Arfrever Frehtes Taifersar Arahesis wrote:
>> [[[
>> emerge --info: Modernize output of configuration of repositories.
>>
>> - Always print detailed configuration of repositories.
>> - Always skip PORTAGE_REPOSITORIES variable.
>> - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
>> ]]]
>>
>> --
>> Arfrever Frehtes Taifersar Arahesis
>>
>
> It looks good to me, except for the last part I would prefer that we use
> set, difference_update, and sorted as follows:
>
>
> diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
> index c7246a9..e763788 100644
> --- a/pym/_emerge/actions.py
> +++ b/pym/_emerge/actions.py
> @@ -1739,11 +1739,18 @@ def action_info(settings, trees, myopts, myfiles):
> 'PORTAGE_BZIP2_COMMAND' : 'bzip2',
> }
>
> - myvars = portage.util.unique_array(myvars)
> + skipped_vars = ['PORTAGE_REPOSITORIES', '_']
> + # Deprecated variables
> + skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
> +
> + myvars = set(myvars)
> + myvars.difference_update(skipped_vars)
> + myvars = sorted(myvars)
> +
> use_expand = settings.get('USE_EXPAND', '').split()
> use_expand.sort()
> unset_vars = []
> - myvars.sort()
> +
> for k in myvars:
> v = settings.get(k)
> if v is not None:
Yes please.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlSJRngACgkQRtClrXBQc7WamgD/T4Vk7YU/pa5hoFWzRF+5CRTz
bF9Dl3yH089BoF5JbXEA/2MAwBYJZXoJDjlLmjRm21116gedXoMEEbO0wuu0SBKy
=4bUq
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-08 19:04 [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories Arfrever Frehtes Taifersar Arahesis
` (2 preceding siblings ...)
2014-12-11 6:51 ` Zac Medico
@ 2014-12-13 6:44 ` Arfrever Frehtes Taifersar Arahesis
2014-12-13 11:50 ` Alexander Berntsen
3 siblings, 1 reply; 8+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-13 6:44 UTC (permalink / raw
To: Gentoo Portage Development
[-- Attachment #1.1: Type: Text/Plain, Size: 285 bytes --]
[[[
emerge --info: Modernize output of configuration of repositories.
- Always print detailed configuration of repositories.
- Always skip PORTAGE_REPOSITORIES variable.
- Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
]]]
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #1.2: portage.patch --]
[-- Type: text/x-patch, Size: 1761 bytes --]
--- pym/_emerge/actions.py
+++ pym/_emerge/actions.py
@@ -1713,13 +1713,9 @@ def action_info(settings, trees, myopts, myfiles):
((cp + ":").ljust(cp_max_len + 1), versions))
repos = portdb.settings.repositories
- if "--verbose" in myopts:
- append("Repositories:\n")
- for repo in repos:
- append(repo.info_string())
- else:
- append("Repositories: %s" % \
- " ".join(repo.name for repo in repos))
+ append("Repositories:\n")
+ for repo in repos:
+ append(repo.info_string())
installed_sets = sorted(s for s in
root_config.sets['selected'].getNonAtoms() if s.startswith(SETPREFIX))
@@ -1732,8 +1728,8 @@ def action_info(settings, trees, myopts, myfiles):
myvars = list(settings)
else:
myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
- 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
- 'PORTDIR_OVERLAY', 'PORTAGE_BUNZIP2_COMMAND',
+ 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
+ 'PORTAGE_BUNZIP2_COMMAND',
'PORTAGE_BZIP2_COMMAND',
'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES',
@@ -1745,11 +1741,18 @@ def action_info(settings, trees, myopts, myfiles):
'PORTAGE_BZIP2_COMMAND' : 'bzip2',
}
- myvars = portage.util.unique_array(myvars)
+ skipped_vars = ['PORTAGE_REPOSITORIES']
+ # Deprecated variables
+ skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
+
+ myvars = set(myvars)
+ myvars.difference_update(skipped_vars)
+ myvars = sorted(myvars)
+
use_expand = settings.get('USE_EXPAND', '').split()
use_expand.sort()
unset_vars = []
- myvars.sort()
+
for k in myvars:
v = settings.get(k)
if v is not None:
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories
2014-12-13 6:44 ` Arfrever Frehtes Taifersar Arahesis
@ 2014-12-13 11:50 ` Alexander Berntsen
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Berntsen @ 2014-12-13 11:50 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Looks OK!
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlSMJ+sACgkQRtClrXBQc7Uh6gEAo6eGu1XNWnE1OpyW0vBapuug
QbWZds7Ey/DORUPiSFQA/0SCv8roRfjsfg0+9odq7xe2Z+zxEV4tMb+A04QquucU
=VZWm
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-12-13 11:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 19:04 [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories Arfrever Frehtes Taifersar Arahesis
2014-12-09 0:08 ` Brian Dolbec
2014-12-09 8:50 ` Alexander Berntsen
2014-12-09 10:17 ` Arfrever Frehtes Taifersar Arahesis
2014-12-11 6:51 ` Zac Medico
2014-12-11 7:23 ` Alexander Berntsen
2014-12-13 6:44 ` Arfrever Frehtes Taifersar Arahesis
2014-12-13 11:50 ` Alexander Berntsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox