Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/
Date: Tue, 22 Feb 2011 00:38:02
Message-Id: f69707ae4b344f77b36569a01494bfd11db78353.zmedico@gentoo
1 commit: f69707ae4b344f77b36569a01494bfd11db78353
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 22 00:35:14 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 22 00:35:14 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f69707ae
7
8 post_emerge: pass in more info
9
10 This makes it possible to do things like give special suggestions after
11 world updates.
12
13 ---
14 pym/_emerge/main.py | 21 +++++++++++++++------
15 1 files changed, 15 insertions(+), 6 deletions(-)
16
17 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
18 index 0ddda85..e1ea33a 100644
19 --- a/pym/_emerge/main.py
20 +++ b/pym/_emerge/main.py
21 @@ -292,7 +292,8 @@ def display_preserved_libs(vardbapi, myopts):
22 print(colorize("WARN", " * ") + " used by %d other files" % (len(consumers) - MAX_DISPLAY))
23 print("Use " + colorize("GOOD", "emerge @preserved-rebuild") + " to rebuild packages using these libraries")
24
25 -def post_emerge(root_config, myopts, mtimedb, retval):
26 +def post_emerge(myaction, myopts, myfiles,
27 + target_root, trees, mtimedb, retval):
28 """
29 Misc. things to run at the end of a merge session.
30
31 @@ -303,6 +304,14 @@ def post_emerge(root_config, myopts, mtimedb, retval):
32 Display preserved libs warnings
33 Exit Emerge
34
35 + @param myaction: The action returned from parse_opts()
36 + @type myaction: String
37 + @param myopts: emerge options
38 + @type myopts: dict
39 + @param myfiles: emerge arguments
40 + @type myfiles: list
41 + @param target_root: The target ROOT for myaction
42 + @type target_root: String
43 @param trees: A dictionary mapping each ROOT to it's package databases
44 @type trees: dict
45 @param mtimedb: The mtimeDB to store data needed across merge invocations
46 @@ -314,8 +323,7 @@ def post_emerge(root_config, myopts, mtimedb, retval):
47 1. Calls sys.exit(retval)
48 """
49
50 - target_root = root_config.root
51 - trees = { target_root : root_config.trees }
52 + root_config = trees[target_root]["root_config"]
53 vardbapi = trees[target_root]["vartree"].dbapi
54 settings = vardbapi.settings
55 info_mtimes = mtimedb["info"]
56 @@ -1637,7 +1645,8 @@ def emerge_main():
57 rval = action_uninstall(settings, trees, mtimedb["ldpath"],
58 myopts, myaction, myfiles, spinner)
59 if not (myaction == 'deselect' or buildpkgonly or fetchonly or pretend):
60 - post_emerge(root_config, myopts, mtimedb, rval)
61 + post_emerge(myaction, myopts, myfiles, settings["ROOT"],
62 + trees, mtimedb, rval)
63 return rval
64
65 elif myaction == 'info':
66 @@ -1708,7 +1717,7 @@ def emerge_main():
67 display_news_notification(root_config, myopts)
68 retval = action_build(settings, trees, mtimedb,
69 myopts, myaction, myfiles, spinner)
70 - root_config = trees[settings["ROOT"]]["root_config"]
71 - post_emerge(root_config, myopts, mtimedb, retval)
72 + post_emerge(myaction, myopts, myfiles, settings["ROOT"],
73 + trees, mtimedb, retval)
74
75 return retval