Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-12 Thread Arfrever Frehtes Taifersar Arahesis
[[[
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
--- 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:


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-10 Thread Zac Medico
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



Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-10 Thread Alexander Berntsen
-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
berna...@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-



Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-09 Thread Alexander Berntsen
-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
berna...@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-



Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-09 Thread Arfrever Frehtes Taifersar Arahesis
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


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-08 Thread Arfrever Frehtes Taifersar Arahesis
[[[
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
--- 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',
 	}


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-08 Thread Brian Dolbec
On Mon, 8 Dec 2014 20:04:11 +0100
Arfrever Frehtes Taifersar Arahesis arfrever@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



signature.asc
Description: PGP signature