Merged from trunk 6949:6970
authorFabian Groffen <grobian@gentoo.org>
Sun, 24 Jun 2007 15:46:46 +0000 (15:46 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 24 Jun 2007 15:46:46 +0000 (15:46 -0000)
   +------------------------------------------------------------------------+
   | 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

NEWS
bin/quickpkg
cnf/logrotate.d/elog-save-summary [new file with mode: 0644]
man/ebuild.5
pym/emerge/__init__.py
pym/portage/dbapi/vartree.py
pym/portage/elog/__init__.py
pym/portage/elog/mod_echo.py
pym/portage/elog/mod_mail_summary.py

diff --git a/NEWS b/NEWS
index d7c316d83895a2d5585caae8ec21ee045d817bc0..113be17193a9cf7ec1bc7ea61a1c5859718c5f1c 100644 (file)
--- 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.
index 5fc3e7bef7ab516045f7cd6a65e97f4fd56d2188..77212376306aa7b5d293150d1d6879ea21c62f0e 100755 (executable)
@@ -166,7 +166,7 @@ def quickpkg_main(options, args, eout):
        return os.EX_OK
 
 if __name__ == "__main__":
-       usage = "Usage: quickpkg [options] <list of package atoms>"
+       usage = "quickpkg [options] <list of package atoms>"
        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 (file)
index 0000000..282956f
--- /dev/null
@@ -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
+}
index 134a4deb46882938c784e49e1bf411723b381f3a..148486649b66ffe1d1fe3b4b1d6972778190d00f 100644 (file)
@@ -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.
index e150ca49bd2265c623bd2a0367b3583d0b7cba95..d9ea064f087da7e271289437cbc3cd52162d6e2f 100644 (file)
@@ -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)
index f3b919fbe6b838a0df8cfacdb804f6f3058b572b..ca7b9f723d2a0c1aecd8c6d586674ace125271f0 100644 (file)
@@ -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
index 5b8ac44c3aa92da2d67d810af8a8383d4641d47e..cbe9f47fa0a37a924e14f170a91c2b3eda593c2a 100644 (file)
@@ -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))
index 6dcc652338b4253193db3a1b871b53a2b10fcc4d..a5749a93a9b327a1fc323a15e7c2a8c660e4b070 100644 (file)
@@ -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,
index 0a39b17b13770d1fe72deb022a361a82593669a4..884df40c839e83927067a61aba10ccb0df9474cd 100644 (file)
@@ -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