Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12564 - in main/branches/prefix: bin pym/_emerge
Date: Fri, 30 Jan 2009 21:30:00
Message-Id: E1LT0w2-00032S-0X@stork.gentoo.org
1 Author: grobian
2 Date: 2009-01-30 21:29:57 +0000 (Fri, 30 Jan 2009)
3 New Revision: 12564
4
5 Modified:
6 main/branches/prefix/bin/misc-functions.sh
7 main/branches/prefix/pym/_emerge/__init__.py
8 Log:
9 Merged from trunk -r12556:12560
10
11 | 12557 | When scheduling builds in parallel for --jobs, avoid |
12 | zmedico | potential build dir collisions in cases when the same exact |
13 | | cpv needs to be merged to multiple $ROOTs (like when |
14 | | building stages). Thanks for Daniel Robbins for reporting |
15 | | this issue and troubleshooting it. |
16
17 | 12558 | In EbuildFetcher._start(), don't touch the build dir when in |
18 | zmedico | prefetch mode. In this case, logging goes to |
19 | | emerge-fetch.log and the builddir should not be touched |
20 | | since otherwise it could interfere with another instance of |
21 | | the same cpv concurrently being built for a different $ROOT |
22 | | (currently, builds only cooperate with prefetchers that are |
23 | | spawned for the same $ROOT). Thanks to Daniel Robbins for |
24 | | reporting this issue. |
25
26 | 12559 | - hardened gets way to many misfiled bugs related to |
27 | solar | qa-execstack. Make it clear that bugs go to the maintainers |
28 | | of the pkg and not hardened for fun and profit |
29
30 | 12560 | Fix color in merge list [ebuild ] display, so it's the same |
31 | zmedico | regardless of $ROOT. |
32
33
34 Modified: main/branches/prefix/bin/misc-functions.sh
35 ===================================================================
36 --- main/branches/prefix/bin/misc-functions.sh 2009-01-30 21:26:11 UTC (rev 12563)
37 +++ main/branches/prefix/bin/misc-functions.sh 2009-01-30 21:29:57 UTC (rev 12564)
38 @@ -152,6 +152,8 @@
39 eqawarn " at http://bugs.gentoo.org/ to make sure the file is fixed."
40 eqawarn " For more information, see http://hardened.gentoo.org/gnu-stack.xml"
41 eqawarn " Please include the following list of files in your report:"
42 + eqawarn " Note: Bugs should be filed for the respective maintainers"
43 + eqawarn " of the package in question and not hardened@"
44 eqawarn "${f}"
45 vecho -ne '\a\n'
46 die_msg="${die_msg} execstacks"
47
48 Modified: main/branches/prefix/pym/_emerge/__init__.py
49 ===================================================================
50 --- main/branches/prefix/pym/_emerge/__init__.py 2009-01-30 21:26:11 UTC (rev 12563)
51 +++ main/branches/prefix/pym/_emerge/__init__.py 2009-01-30 21:29:57 UTC (rev 12564)
52 @@ -2367,13 +2367,21 @@
53 portdb = root_config.trees["porttree"].dbapi
54 ebuild_path = portdb.findname(self.pkg.cpv)
55 settings = self.config_pool.allocate()
56 - self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings)
57 - self._build_dir.lock()
58 - self._build_dir.clean()
59 - portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0)
60 - if self.logfile is None:
61 - self.logfile = settings.get("PORTAGE_LOG_FILE")
62 + settings.setcpv(self.pkg)
63
64 + # In prefetch mode, logging goes to emerge-fetch.log and the builddir
65 + # should not be touched since otherwise it could interfere with
66 + # another instance of the same cpv concurrently being built for a
67 + # different $ROOT (currently, builds only cooperate with prefetchers
68 + # that are spawned for the same $ROOT).
69 + if not self.prefetch:
70 + self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings)
71 + self._build_dir.lock()
72 + self._build_dir.clean()
73 + portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0)
74 + if self.logfile is None:
75 + self.logfile = settings.get("PORTAGE_LOG_FILE")
76 +
77 phase = "fetch"
78 if self.fetchall:
79 phase = "fetchall"
80 @@ -8132,7 +8140,7 @@
81 if not pkg_merge:
82 myprint = "[%s] " % pkgprint(pkg_status.ljust(13))
83 else:
84 - myprint = "[" + pkg_type + " " + addl + "] "
85 + myprint = "[%s %s] " % (pkgprint(pkg_type), addl)
86 myprint += indent + pkgprint(pkg_key) + " " + \
87 myoldbest + darkgreen("to " + myroot)
88 else:
89 @@ -9978,6 +9986,7 @@
90
91 self._digraph = digraph
92 self._prune_digraph()
93 + self._prevent_builddir_collisions()
94
95 def _prune_digraph(self):
96 """
97 @@ -10000,6 +10009,26 @@
98 break
99 removed_nodes.clear()
100
101 + def _prevent_builddir_collisions(self):
102 + """
103 + When building stages, sometimes the same exact cpv needs to be merged
104 + to both $ROOTs. Add edges to the digraph in order to avoid collisions
105 + in the builddir. Currently, normal file locks would be inappropriate
106 + for this purpose since emerge holds all of it's build dir locks from
107 + the main process.
108 + """
109 + cpv_map = {}
110 + for pkg in self._mergelist:
111 + if pkg.installed:
112 + continue
113 + if pkg.cpv not in cpv_map:
114 + cpv_map[pkg.cpv] = [pkg]
115 + continue
116 + for earlier_pkg in cpv_map[pkg.cpv]:
117 + self._digraph.add(earlier_pkg, pkg,
118 + priority=DepPriority(buildtime=True))
119 + cpv_map[pkg.cpv].append(pkg)
120 +
121 class _pkg_failure(portage.exception.PortageException):
122 """
123 An instance of this class is raised by unmerge() when