emerge: support post_emerge hook like post_sync
authorGokdeniz Karadag <gokdenizk@gmail.com>
Fri, 18 Feb 2011 15:57:25 +0000 (07:57 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 20 Feb 2011 00:02:47 +0000 (16:02 -0800)
This will fix bug #355447.

pym/_emerge/main.py

index 40266943f00172499cbbf915c598802d0aeb1c7a..0267f11e63063dc044a62f6e5da3889d6e752bad 100644 (file)
@@ -367,6 +367,14 @@ def post_emerge(root_config, myopts, mtimedb, retval):
        if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
                display_preserved_libs(vardbapi, myopts)        
 
+       from portage.output import red, bold
+       postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
+                               portage.USER_CONFIG_PATH, "bin", "post_emerge")
+       if os.access(postemerge, os.X_OK):
+               retval = portage.process.spawn(
+                                               [postemerge], env=settings.environ())
+               if retval != os.EX_OK:
+                       print(red(" * ") + bold("spawn failed of " + postemerge))
        sys.exit(retval)
 
 def multiple_actions(action1, action2):