Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10845 - main/trunk/pym/portage
Date: Sun, 29 Jun 2008 08:10:05
Message-Id: E1KCryx-0004Lh-Eb@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-06-29 08:09:58 +0000 (Sun, 29 Jun 2008)
3 New Revision: 10845
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Split out a _spawn_misc_sh() function from spawnebuild().
9
10
11 Modified: main/trunk/pym/portage/__init__.py
12 ===================================================================
13 --- main/trunk/pym/portage/__init__.py 2008-06-29 06:46:13 UTC (rev 10844)
14 +++ main/trunk/pym/portage/__init__.py 2008-06-29 08:09:58 UTC (rev 10845)
15 @@ -4289,37 +4289,52 @@
16 apply_secpass_permissions(fpath, uid=myuid, gid=mygid,
17 mode=mystat.st_mode, stat_cached=mystat,
18 follow_links=False)
19 - # Note: PORTAGE_BIN_PATH may differ from the global
20 - # constant when portage is reinstalling itself.
21 - portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
22 - misc_sh_binary = os.path.join(portage_bin_path,
23 - os.path.basename(MISC_SH_BINARY))
24 - mycommand = " ".join([_shell_quote(misc_sh_binary),
25 - "install_qa_check", "install_symlink_html_docs"])
26 - _doebuild_exit_status_unlink(
27 - mysettings.get("EBUILD_EXIT_STATUS_FILE"))
28 - filter_calling_env_state = mysettings._filter_calling_env
29 - if os.path.exists(os.path.join(mysettings["T"], "environment")):
30 - mysettings._filter_calling_env = True
31 - try:
32 - qa_retval = spawn(mycommand, mysettings, debug=debug,
33 - logfile=logfile, **kwargs)
34 - finally:
35 - mysettings._filter_calling_env = filter_calling_env_state
36 - msg = _doebuild_exit_status_check(mydo, mysettings)
37 - if msg:
38 - qa_retval = 1
39 - from textwrap import wrap
40 - from portage.elog.messages import eerror
41 - for l in wrap(msg, 72):
42 - eerror(l, phase=mydo, key=mysettings.mycpv)
43 + qa_retval = _spawn_misc_sh(mysettings, ["install_qa_check",
44 + "install_symlink_html_docs"], **kwargs)
45 if qa_retval != os.EX_OK:
46 writemsg("!!! install_qa_check failed; exiting.\n",
47 noiselevel=-1)
48 - return qa_retval
49 + return qa_retval
50 return phase_retval
51
52 +def _spawn_misc_sh(mysettings, commands, **kwargs):
53 + """
54 + @param mysettings: the ebuild config
55 + @type mysettings: config
56 + @param commands: a list of function names to call in misc-functions.sh
57 + @type commands: list
58 + @rtype: int
59 + @returns: the return value from the spawn() call
60 + """
61
62 + # Note: PORTAGE_BIN_PATH may differ from the global
63 + # constant when portage is reinstalling itself.
64 + portage_bin_path = mysettings["PORTAGE_BIN_PATH"]
65 + misc_sh_binary = os.path.join(portage_bin_path,
66 + os.path.basename(MISC_SH_BINARY))
67 + mycommand = " ".join([_shell_quote(misc_sh_binary)] + commands)
68 + _doebuild_exit_status_unlink(
69 + mysettings.get("EBUILD_EXIT_STATUS_FILE"))
70 + filter_calling_env_state = mysettings._filter_calling_env
71 + if os.path.exists(os.path.join(mysettings["T"], "environment")):
72 + mysettings._filter_calling_env = True
73 + debug = mysettings.get("PORTAGE_DEBUG") == "1"
74 + logfile = mysettings.get("PORTAGE_LOG_FILE")
75 + mydo = mysettings["EBUILD_PHASE"]
76 + try:
77 + rval = spawn(mycommand, mysettings, debug=debug,
78 + logfile=logfile, **kwargs)
79 + finally:
80 + mysettings._filter_calling_env = filter_calling_env_state
81 + msg = _doebuild_exit_status_check(mydo, mysettings)
82 + if msg:
83 + rval = 1
84 + from textwrap import wrap
85 + from portage.elog.messages import eerror
86 + for l in wrap(msg, 72):
87 + eerror(l, phase=mydo, key=mysettings.mycpv)
88 + return rval
89 +
90 def eapi_is_supported(eapi):
91 try:
92 eapi = int(str(eapi).strip())
93
94 --
95 gentoo-commits@l.g.o mailing list