From 4a0ea15d1ef1270707678e49d5ec981c723ba059 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 14 Oct 2009 19:41:43 +0000 Subject: [PATCH] Merged from trunk -r14587:14601 | 14589 | Add a reference to GLEP 23. | | zmedico | | | 14591 | Update ACCEPT_LICENSE and ACCEPT_PROPERTIES docs. | | zmedico | | | 14593 | Add a note about ACCEPT_LICENSE. | | zmedico | | | 14597 | Implement FetchlistDict.__len__, in order to avoid infinite | | zmedico | recursion in some cases. | | 14598 | Implement __len__. | | zmedico | | | 14599 | When --depclean pulls in the provider of a library because | | zmedico | of installed consumers, display the soname(s) of the | | | consumed libraries. | | 14600 | Bug #288906 - Fix Scheduler._dblink_elog() to always append | | zmedico | messages to the build log if available (regardless whether | | | or not message goes to stdout). | | 14601 | Add some examples for ACCEPT_LICENSE and ACCEPT_PROPERTIES. | | zmedico | | svn path=/main/branches/prefix/; revision=14605 --- RELEASE-NOTES | 4 ++++ man/make.conf.5 | 29 +++++++++++++++++++++++++++-- man/portage.5 | 6 ++++-- pym/_emerge/BlockerCache.py | 5 +++++ pym/_emerge/Scheduler.py | 33 +++++++++++++++++++-------------- pym/_emerge/actions.py | 9 ++++++++- pym/portage/__init__.py | 5 +++++ 7 files changed, 72 insertions(+), 19 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 57274f942..81ac86682 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -31,6 +31,10 @@ portage-2.1.7 require a tty device (like the wget progress bar) will be disabled. This is due to an upstream python issue: http://bugs.python.org/issue5380. See bug #287648 for more information. +* Licenses in the @EULA license group are now masked by the default + ACCEPT_LICENSE setting. You can unmask all licenses by setting + ACCEPT_LICENSE="*" in /etc/make.conf. See the make.conf(5) man page for + more information about ACCEPT_LICENSE. portage-2.1.6.12 ================================== diff --git a/man/make.conf.5 b/man/make.conf.5 index 0e7ebf888..b9e5c516d 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -37,17 +37,42 @@ set this to '~ppc'. This is an incremental variable. Only define a Defaults to the value of $ARCH. .TP \fBACCEPT_LICENSE\fR = \fI[space delimited list of licenses or groups]\fR -This variable is used to mask packages based on licensing restrictions. +This variable is used to mask packages based on licensing restrictions. It +make contain both license and group names, where group names are prefixed +with the '@' symbol. License groups are defined in the \fIlicense_groups\fR +file (see \fBportage\fR(5)). In addition to license and group names, the +\fI*\fR and \fI-*\fR wildcard tokens are also supported. Refer to GLEP 23 +for further information: +\fIhttp://www.gentoo.org/proj/en/glep/glep-0023.html\fR. .br Defaults to the value of * -@EULA. +.br +.I Examples: +.nf +# Accept any license +ACCEPT_LICENSE="*" +# Accept any license except the "public-domain" license +ACCEPT_LICENSE="* -public-domain" +# Only accept licenses in the FSF-APPROVED license group +ACCEPT_LICENSE="-* @FSF-APPROVED" +.fi .TP \fBACCEPT_PROPERTIES\fR = \fI[space delimited list of properties]\fR This variable is used to mask packages based on PROPERTIES restrictions. -This varable can be temporarily overridden using the the +In addition to property names, the \fI*\fR and \fI-*\fR wildcard tokens are +also supported. This varable can be temporarily overridden using the \fB\-\-accept\-properties\fR option of \fBemerge\fR(1). See \fBebuild\fR(5) for more information about PROPERTIES. .br Defaults to the value of *. +.br +.I Examples: +.nf +# Accept any properties +ACCEPT_PROPERTIES="*" +# Accept any properties except the "interactive" property +ACCEPT_PROPERTIES="* -interactive" +.fi .TP .B CBUILD This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR diff --git a/man/portage.5 b/man/portage.5 index ae5f7f1f8..963a9d4f9 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -685,13 +685,15 @@ A list of all the packages which will be displayed when you run `emerge info`. .TP .BR license_groups This contains groups of licenses that may be specifed in the -\fBACCEPT_LICENSE\fR variable (see \fBmake.conf\fR(5)). +\fBACCEPT_LICENSE\fR variable (see \fBmake.conf\fR(5)). Refer +to GLEP 23 for further information: +\fIhttp://www.gentoo.org/proj/en/glep/glep-0023.html\fR. .I Format: .nf \- comments begin with # (no inline comments) \- one group name, followed by list of licenses and nested groups -\- nested groups are prefixed with the @ symbol +\- nested groups are prefixed with the '@' symbol .fi .I Example: diff --git a/pym/_emerge/BlockerCache.py b/pym/_emerge/BlockerCache.py index f88a7c43f..de3b65e22 100644 --- a/pym/_emerge/BlockerCache.py +++ b/pym/_emerge/BlockerCache.py @@ -165,6 +165,11 @@ class BlockerCache(portage.cache.mappings.MutableMapping): return iter([]) return iter(self._cache_data["blockers"]) + def __len__(self): + """This needs to be implemented in order to avoid + infinite recursion in some cases.""" + return len(self._cache_data["blockers"]) + def __delitem__(self, cpv): del self._cache_data["blockers"][cpv] diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index f2247578b..eb2f89497 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -10,6 +10,15 @@ import sys import textwrap import time import weakref + +try: + from io import StringIO +except ImportError: + # Needed for python-2.6 with USE=build since + # io imports threading which imports thread + # which is unavailable. + from StringIO import StringIO + import portage from portage import os from portage import _encodings @@ -495,23 +504,19 @@ class Scheduler(PollScheduler): def _dblink_elog(self, pkg_dblink, phase, func, msgs): log_path = pkg_dblink.settings.get("PORTAGE_LOG_FILE") - log_file = None - out = sys.stdout background = self._background + out = StringIO() - if background and log_path is not None: - log_file = codecs.open(_unicode_encode(log_path, - encoding=_encodings['fs'], errors='strict'), - mode='a', encoding=_encodings['content'], - errors='backslashreplace') - out = log_file + for msg in msgs: + func(msg, phase=phase, key=pkg_dblink.mycpv, out=out) - try: - for msg in msgs: - func(msg, phase=phase, key=pkg_dblink.mycpv, out=out) - finally: - if log_file is not None: - log_file.close() + out_str = out.getvalue() + + if not background: + portage.util.writemsg_stdout(out_str, noiselevel=-1) + + if log_path is not None: + self._append_to_log_path(log_path, out_str) def _dblink_emerge_log(self, msg): self._logger.log(msg) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 6c897a1ab..d9117be9e 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1032,13 +1032,20 @@ def calc_depclean(settings, trees, ldpath_mtimes, msg = [] for pkg in sorted(consumer_map, key=cmp_sort_key(cmp_pkg_cpv)): consumers = consumer_map[pkg] + consumer_libs = {} + for lib, lib_consumers in consumers.items(): + for consumer in lib_consumers: + consumer_libs.setdefault( + consumer.mycpv, set()).add(linkmap.getSoname(lib)) unique_consumers = set(chain(*consumers.values())) unique_consumers = sorted(consumer.mycpv \ for consumer in unique_consumers) msg.append("") msg.append(" %s pulled in by:" % (pkg.cpv,)) for consumer in unique_consumers: - msg.append(" %s" % (consumer,)) + libs = consumer_libs[consumer] + msg.append(" %s needs %s" % \ + (consumer, ', '.join(sorted(libs)))) msg.append("") writemsg_level("".join(prefix + "%s\n" % line for line in msg), level=logging.WARNING, noiselevel=-1) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 98965a28c..32656dd58 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -8630,6 +8630,11 @@ class FetchlistDict(portage.cache.mappings.Mapping): def __iter__(self): return iter(self.portdb.cp_list(self.cp, mytree=self.mytree)) + def __len__(self): + """This needs to be implemented in order to avoid + infinite recursion in some cases.""" + return len(self.portdb.cp_list(self.cp, mytree=self.mytree)) + def keys(self): """Returns keys for all packages within pkgdir""" return self.portdb.cp_list(self.cp, mytree=self.mytree) -- 2.26.2