[gentoo-portage-dev] [PATCH] emerge --info: Always print ::repository

2014-12-12 Thread Arfrever Frehtes Taifersar Arahesis
[[[
emerge --info: Always print ::repository.

1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() 
function
has been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/_emerge/actions.py
+++ pym/_emerge/actions.py
@@ -42,7 +42,7 @@ from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFA
 from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
-from portage.dep import Atom
+from portage.dep import Atom, _repo_separator, _slot_separator
 from portage.eclass_cache import hashed_path
 from portage.exception import InvalidAtom, InvalidData, ParseError
 from portage.output import blue, colorize, create_color_func, darkgreen, \
@@ -1668,9 +1668,6 @@ def action_info(settings, trees, myopts, myfiles):
 
 	myvars = sorted(set(atoms))
 
-	main_repo = portdb.repositories.mainRepo()
-	if main_repo is not None:
-		main_repo = main_repo.name
 	cp_map = {}
 	cp_max_len = 0
 
@@ -1692,12 +1689,10 @@ def action_info(settings, trees, myopts, myfiles):
 if len(matched_cp) > cp_max_len:
 	cp_max_len = len(matched_cp)
 repo = vardb.aux_get(cpv, ["repository"])[0]
-if repo == main_repo:
-	repo_suffix = ""
-elif not repo:
-	repo_suffix = "::"
+if repo:
+	repo_suffix = _repo_separator + repo
 else:
-	repo_suffix = "::" + repo
+	repo_suffix = _repo_separator + ""
 
 if matched_cp == orig_atom.cp:
 	provide_suffix = ""
@@ -1826,13 +1821,13 @@ def action_info(settings, trees, myopts, myfiles):
 
 			if pkg_type == "installed":
 append("\n%s was built with the following:" % \
-	colorize("INFORM", str(pkg.cpv)))
+	colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 			elif pkg_type == "ebuild":
-append("\n%s would be build with the following:" % \
-	colorize("INFORM", str(pkg.cpv)))
+append("\n%s would be built with the following:" % \
+	colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 			elif pkg_type == "binary":
 append("\n%s (non-installed binary) was built with the following:" % \
-	colorize("INFORM", str(pkg.cpv)))
+	colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 
 			append('%s' % pkg_use_display(pkg, myopts))
 			if pkg_type == "installed":
@@ -2015,10 +2010,10 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 		atom = "=" + atom + "-" + \
 			portage.versions.cpv_getversion(cpv)
 	if ext_atom.slot:
-		atom += ":" + ext_atom.slot
+		atom += _slot_separator + ext_atom.slot
 		require_metadata = True
 	if ext_atom.repo:
-		atom += "::" + ext_atom.repo
+		atom += _repo_separator + ext_atom.repo
 		require_metadata = True
 
 	atom = Atom(atom, allow_repo=True)


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-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] Almost always print ::repository

2014-12-12 Thread Brian Dolbec
On Wed, 10 Dec 2014 21:33:06 +0100
Arfrever Frehtes Taifersar Arahesis  wrote:

> [[[
> Almost always print ::repository in list of packages for installation.
> 
> --verbose-main-repo-display option is no longer supported.
> 3 calls to deprecated
> portage.repository.config.RepoConfigLoader.mainRepo() function have
> been deleted. ]]]
> 
> --
> Arfrever Frehtes Taifersar Arahesis


yeah, go ahead, merge.  Thanks
-- 
Brian Dolbec 



signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] Support @profile package set for bug #532224

2014-12-12 Thread Zac Medico
On 12/12/2014 08:01 AM, Rick "Zero_Chaos" Farina wrote:
> On 12/11/2014 03:38 AM, Zac Medico wrote:
>> On 12/11/2014 12:25 AM, Michał Górny wrote:
>>> Dnia 2014-12-10, o godz. 18:08:00
>>> Zac Medico  napisał(a):
>>>
 Add support for a new @profile set which allows the profile to pull
 in additional packages that do not belong to the @system set.

 The motivation to have @profile separate from @system is that
 @system packages may have incomplete dependency specifications
 (due to long-standing Gentoo policy), and incomplete dependency
 specifications have deleterious effects on the ability of emerge
 --jobs to parallelize builds. So, unlike @system, packages added to
 @profile do not hurt emerge --jobs parallelization.

 Packages are added to the @profile set in the same way that they are
 added to the @system set, except that atoms in the @profile set are
 not preceded with a '*' character. Also, the @profile package set
 is only supported when 'profile-set' is listed in the layout.conf
 profile-formats field of the containing repository.
>>>
>>> PMS says PMs ought to ignore atoms without '*'. This means we can't use
>>> it without profile EAPI change, or other PMs will start losing packages.
> 
> I have to agree, any chance we can get this into EAPI 6?

Yes, that would be nice.

>>
>> It's hidden behind a layout.conf profile-formats flag, so it's beyond
>> the scope of PMS. Package managers should reject the profile if they
>> don't recognize the profile-formats flags that it declares.
>>
> Yes, but that still makes this change incompatible with other package
> managers, no?

I'm not sure that "incompatible" is the best word. It's an extension,
and the general nature of extensions is that software needs to be
updated in order to support them. Other package managers are welcome to
implement this extension, but they are under no obligation to.

> If we remove the leading * from a package to signify that
> it can safely be built in parallel that would mean all non-portage
> package managers would just plain lose the package, if they didn't shit
> themselves because the file had an invalid line.

It depends on the package manager's profile-formats implementation. If a
package manager rejects profiles with unrecognized profile-formats
flags, then it should simply give an error message about the profile
having unsupported profile-formats extensions.

Existing releases of portage only produce a warning if profile-formats
has unrecognized extensions. The advantage of this approach is that it's
feasible to enable profile-set on existing profiles, and it's still
possible for existing deployments that use those profiles to upgrade
from older portage to a new version that supports the profile-set extension.

I would not recommend to enable the profile-set extension in the
"gentoo" repository for a couple of reasons:

1) Other supported package managers don't support the profile-set
extension yet.

2) We don't have a stable-keyworded version of sys-apps/portage
supporting the profile-set extension yet, so stable users will not be
able to use the this extension with current versions of stable-keyworded
sys-apps/portage.

However, the above issues are not necessarily relevant to repositories
other than "gentoo", so it may be feasible for them to utilize the
profile-set extension immediately.

> We need to make this EAPI dependant or we are going to break things, and
> QA doesn't like it when things this big break.  I love where this is
> going, but I do not see a better solution here than making it EAPI
> dependent.

Making it EAPI dependent is not mutually exclusive from the
profile-formats approach. We can certainly do both. I would recommend to
use the EAPI approach for the "gentoo" repository. Other repositories
can enable the profile-set extension immediately, as long as the
mentioned issues are irrelevant to their consumers.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] Support @profile package set for bug #532224

2014-12-12 Thread Rick "Zero_Chaos" Farina
On 12/11/2014 03:38 AM, Zac Medico wrote:
> On 12/11/2014 12:25 AM, Michał Górny wrote:
>> Dnia 2014-12-10, o godz. 18:08:00
>> Zac Medico  napisał(a):
>>
>>> Add support for a new @profile set which allows the profile to pull
>>> in additional packages that do not belong to the @system set.
>>>
>>> The motivation to have @profile separate from @system is that
>>> @system packages may have incomplete dependency specifications
>>> (due to long-standing Gentoo policy), and incomplete dependency
>>> specifications have deleterious effects on the ability of emerge
>>> --jobs to parallelize builds. So, unlike @system, packages added to
>>> @profile do not hurt emerge --jobs parallelization.
>>>
>>> Packages are added to the @profile set in the same way that they are
>>> added to the @system set, except that atoms in the @profile set are
>>> not preceded with a '*' character. Also, the @profile package set
>>> is only supported when 'profile-set' is listed in the layout.conf
>>> profile-formats field of the containing repository.
>>
>> PMS says PMs ought to ignore atoms without '*'. This means we can't use
>> it without profile EAPI change, or other PMs will start losing packages.

I have to agree, any chance we can get this into EAPI 6?
> 
> It's hidden behind a layout.conf profile-formats flag, so it's beyond
> the scope of PMS. Package managers should reject the profile if they
> don't recognize the profile-formats flags that it declares.
> 
Yes, but that still makes this change incompatible with other package
managers, no?  If we remove the leading * from a package to signify that
it can safely be built in parallel that would mean all non-portage
package managers would just plain lose the package, if they didn't shit
themselves because the file had an invalid line.

We need to make this EAPI dependant or we are going to break things, and
QA doesn't like it when things this big break.  I love where this is
going, but I do not see a better solution here than making it EAPI
dependent.

-Zero



signature.asc
Description: OpenPGP digital signature