From: Fabian Groffen Date: Sun, 24 Jun 2007 15:46:46 +0000 (-0000) Subject: Merged from trunk 6949:6970 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1ecdd4556fef3901c4f53620779f9ba15870b758;p=portage.git Merged from trunk 6949:6970 +------------------------------------------------------------------------+ | 6950 | Update 2.1.3 news for elog stuff. | | zmedico | | |---------+--------------------------------------------------------------| | 6952 | Add a note about potential for config mixups in elog | | zmedico | finalizers. | |---------+--------------------------------------------------------------| | 6953 | Dump mod_echo elog output inside post_emerge(), just before | | zmedico | the other notifications that happen at exit. | |---------+--------------------------------------------------------------| | 6954 | Document RESTRICT=bindist and add a note about allowance for | | zmedico | conditional syntax. | |---------+--------------------------------------------------------------| | 6955 | Make elog finalize() handling safe for PORTAGE_CONFIGROOT. | | zmedico | | |---------+--------------------------------------------------------------| | 6956 | Remove confcache docs. | | zmedico | | |---------+--------------------------------------------------------------| | 6959 | Show which $ROOT a package was merged to when $ROOT is not | | zmedico | /. | |---------+--------------------------------------------------------------| | 6962 | Add a logrotate config for the save_summary elog module | | zmedico | since it's enabled by default now. | |---------+--------------------------------------------------------------| | 6964 | Remove redundant 'Usage: ' from the usage message. | | zmedico | | |---------+--------------------------------------------------------------| | 6967 | For bug #182964, replace os.rename() with shutil.move() in | | zmedico | order to handle EXDEV errors that are triggered by layered | | | filesystems. | |---------+--------------------------------------------------------------| | 6969 | s/OSError/EnvironmentError/ since shutil.move() generally | | zmedico | raises an IOError. | |---------+--------------------------------------------------------------| | 6970 | Revert r6967 since shutil.move() is broken internally. | | zmedico | | +------------------------------------------------------------------------+ svn path=/main/branches/prefix/; revision=6993 --- diff --git a/NEWS b/NEWS index d7c316d83..113be1719 100644 --- a/NEWS +++ b/NEWS @@ -3,11 +3,9 @@ News (mainly features/major bug fixes) portage-2.2 ------------- -* Allow per-module setting of PORTAGE_ELOG_CLASSES * Namespace sanitizing: move all portage related code into portage.* namespace, rename portage_foo modules to portage.foo (but keep symlinks for compability) * Add license visibility filtering (GLEP 23) -* Add new elog module "echo" to simply display messages when emerge exits * Enable "echo" and "save_summary" elog modules by default * Fix -* handling in package.keywords to work as intended (reset the accepted keywords list), also see RELEASE-NOTES. @@ -19,6 +17,8 @@ portage-2.2 portage-2.1.3 ------------- +* Allow per-module setting of PORTAGE_ELOG_CLASSES +* Add new elog module "echo" to simply display messages when emerge exits * Add ** as new token for package.keywords to bypass the keyword visibility layer * USE_EXPAND variables such as LINGUAS support a * wildcard that will enable all of the corresponding flags that are listed in IUSE for a given package. diff --git a/bin/quickpkg b/bin/quickpkg index 5fc3e7bef..772123763 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -166,7 +166,7 @@ def quickpkg_main(options, args, eout): return os.EX_OK if __name__ == "__main__": - usage = "Usage: quickpkg [options] " + usage = "quickpkg [options] " from optparse import OptionParser parser = OptionParser(usage=usage) parser.add_option("--umask", diff --git a/cnf/logrotate.d/elog-save-summary b/cnf/logrotate.d/elog-save-summary new file mode 100644 index 000000000..282956fc2 --- /dev/null +++ b/cnf/logrotate.d/elog-save-summary @@ -0,0 +1,8 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ +# Rotate the log created by the save_summary elog module. + +/var/log/portage/elog/summary.log { + missingok +} diff --git a/man/ebuild.5 b/man/ebuild.5 index 134a4deb4..148486649 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -320,6 +320,7 @@ You may use the same syntax to vary dependencies as seen above in \fBDEPEND\fR. .TP \fBRESTRICT\fR = \fI[strip,mirror,fetch,userpriv]\fR This should be a space delimited list of portage features to restrict. +You may use conditional syntax to vary restrictions as seen above in DEPEND. .PD 0 .RS .TP @@ -330,8 +331,8 @@ example, can safely be skipped since they have no binaries). If the binary checks need to be skipped for other reasons (such as proprietary binaries), see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions. .TP -.I confcache -Prevent econf from using confcache. +.I bindist +Distribution of binary packages is restricted. .TP .I fetch like \fImirror\fR but the files will not be fetched via \fBSRC_URI\fR either. diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index e150ca49b..d9ea064f0 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -3871,6 +3871,11 @@ def post_emerge(trees, mtimedb, retval): " *** exiting successfully.") from portage.util import normalize_path + # Dump the mod_echo output now so that our other notifications are shown + # last. + from portage.elog import mod_echo + mod_echo.finalize() + if "noinfo" not in settings.features: chk_updated_info_files(normalize_path(target_root + EPREFIX), infodirs, info_mtimes, retval) chk_updated_cfg_files(normalize_path(target_root + EPREFIX), config_protect) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index f3b919fbe..ca7b9f723 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -310,7 +310,7 @@ class vardbapi(dbapi): try: os.rename(os.path.join(newpath, old_pf + ".ebuild"), os.path.join(newpath, new_pf + ".ebuild")) - except OSError, e: + except EnvironmentError, e: if e.errno != errno.ENOENT: raise del e diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py index 5b8ac44c3..cbe9f47fa 100644 --- a/pym/portage/elog/__init__.py +++ b/pym/portage/elog/__init__.py @@ -97,7 +97,7 @@ def elog_process(cpv, mysettings): signal.alarm(0) if hasattr(m, "finalize") and not m.finalize in _elog_atexit_handlers: _elog_atexit_handlers.append(m.finalize) - atexit_register(m.finalize, mysettings) + atexit_register(m.finalize) except (ImportError, AttributeError), e: writemsg("!!! Error while importing logging modules " + \ "while loading \"mod_%s\":\n" % str(s)) diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py index 6dcc65233..a5749a93a 100644 --- a/pym/portage/elog/mod_echo.py +++ b/pym/portage/elog/mod_echo.py @@ -8,18 +8,30 @@ from portage.const import EBUILD_PHASES _items = {} def process(mysettings, key, logentries, fulltext): - _items[key] = logentries + global _items + config_root = mysettings["PORTAGE_CONFIGROOT"] + mysettings, items = _items.setdefault(config_root, (mysettings, {})) + items[key] = logentries -def finalize(mysettings): +def finalize(): + global _items + for mysettings, items in _items.itervalues(): + _finalize(mysettings, items) + _items.clear() + +def _finalize(mysettings, items): printer = EOutput() - for key in _items: + root_msg = "" + if mysettings["ROOT"] != "/": + root_msg = " merged to %s" % mysettings["ROOT"] + for key, logentries in items.iteritems(): print - printer.einfo("Messages for package %s:" % key) + printer.einfo("Messages for package %s%s:" % (key, root_msg)) print for phase in EBUILD_PHASES: - if not phase in _items[key]: + if phase not in logentries: continue - for msgtype, msgcontent in _items[key][phase]: + for msgtype, msgcontent in logentries[phase]: fmap = {"INFO": printer.einfo, "WARN": printer.ewarn, "ERROR": printer.eerror, diff --git a/pym/portage/elog/mod_mail_summary.py b/pym/portage/elog/mod_mail_summary.py index 0a39b17b1..884df40c8 100644 --- a/pym/portage/elog/mod_mail_summary.py +++ b/pym/portage/elog/mod_mail_summary.py @@ -8,14 +8,23 @@ from email.MIMEText import MIMEText as TextMessage _items = {} def process(mysettings, key, logentries, fulltext): + global _items header = ">>> Messages generated for package %s by process %d on %s:\n\n" % \ (key, os.getpid(), time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time()))) - _items[key] = header + fulltext + config_root = mysettings["PORTAGE_CONFIGROOT"] + mysettings, items = _items.setdefault(config_root, (mysettings, {})) + items[key] = header + fulltext -def finalize(mysettings): - if len(_items) == 0: +def finalize(): + global _items + for mysettings, items in _items.itervalues(): + _finalize(mysettings, items) + _items.clear() + +def _finalize(mysettings, items): + if len(items) == 0: return - elif len(_items) == 1: + elif len(items) == 1: count = "one package" else: count = "multiple packages" @@ -31,10 +40,11 @@ def finalize(mysettings): mybody = "elog messages for the following packages generated by " + \ "process %d on host %s:\n" % (os.getpid(), socket.getfqdn()) - for key in _items: + for key in items: mybody += "- %s\n" % key - mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject, mybody, attachments=_items.values()) + mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject, + mybody, attachments=items.values()) portage.mail.send_mail(mysettings, mymessage) return