Merged from trunk -r12556:12560
authorFabian Groffen <grobian@gentoo.org>
Fri, 30 Jan 2009 21:29:57 +0000 (21:29 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 30 Jan 2009 21:29:57 +0000 (21:29 -0000)
   | 12557   | When scheduling builds in parallel for --jobs, avoid         |
   | zmedico | potential build dir collisions in cases when the same exact  |
   |         | cpv needs to be merged to multiple $ROOTs (like when         |
   |         | building stages). Thanks for Daniel Robbins for reporting    |
   |         | this issue and troubleshooting it.                           |

   | 12558   | In EbuildFetcher._start(), don't touch the build dir when in |
   | zmedico | prefetch mode. In this case, logging goes to                 |
   |         | emerge-fetch.log and the builddir should not be touched      |
   |         | since otherwise it could interfere with another instance of  |
   |         | the same cpv concurrently being built for a different $ROOT  |
   |         | (currently, builds only cooperate with prefetchers that are  |
   |         | spawned for the same $ROOT). Thanks to Daniel Robbins for    |
   |         | reporting this issue.                                        |

   | 12559   | - hardened gets way to many misfiled bugs related to         |
   | solar   | qa-execstack. Make it clear that bugs go to the maintainers  |
   |         | of the pkg and not hardened for fun and profit               |

   | 12560   | Fix color in merge list [ebuild ] display, so it's the same  |
   | zmedico | regardless of $ROOT.                                         |

svn path=/main/branches/prefix/; revision=12564

bin/misc-functions.sh
pym/_emerge/__init__.py

index d5d71a87345741b5dbc8743b7a1a1cb3a4b08416..52594be6b183290013a4c734f1604aa360bb03de 100644 (file)
@@ -152,6 +152,8 @@ install_qa_check() {
                        eqawarn " at http://bugs.gentoo.org/ to make sure the file is fixed."
                        eqawarn " For more information, see http://hardened.gentoo.org/gnu-stack.xml"
                        eqawarn " Please include the following list of files in your report:"
+                       eqawarn " Note: Bugs should be filed for the respective maintainers"
+                       eqawarn " of the package in question and not hardened@"
                        eqawarn "${f}"
                        vecho -ne '\a\n'
                        die_msg="${die_msg} execstacks"
index 8f10cd3ce8fb9614d44ceee61b93a3a504fcb87a..398fcf776493287f19c270d276cd7cca85482f9b 100644 (file)
@@ -2367,12 +2367,20 @@ class EbuildFetcher(SpawnProcess):
                portdb = root_config.trees["porttree"].dbapi
                ebuild_path = portdb.findname(self.pkg.cpv)
                settings = self.config_pool.allocate()
-               self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings)
-               self._build_dir.lock()
-               self._build_dir.clean()
-               portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0)
-               if self.logfile is None:
-                       self.logfile = settings.get("PORTAGE_LOG_FILE")
+               settings.setcpv(self.pkg)
+
+               # In prefetch mode, logging goes to emerge-fetch.log and the builddir
+               # should not be touched since otherwise it could interfere with
+               # another instance of the same cpv concurrently being built for a
+               # different $ROOT (currently, builds only cooperate with prefetchers
+               # that are spawned for the same $ROOT).
+               if not self.prefetch:
+                       self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings)
+                       self._build_dir.lock()
+                       self._build_dir.clean()
+                       portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0)
+                       if self.logfile is None:
+                               self.logfile = settings.get("PORTAGE_LOG_FILE")
 
                phase = "fetch"
                if self.fetchall:
@@ -8132,7 +8140,7 @@ class depgraph(object):
                                                if not pkg_merge:
                                                        myprint = "[%s] " % pkgprint(pkg_status.ljust(13))
                                                else:
-                                                       myprint = "[" + pkg_type + " " + addl + "] "
+                                                       myprint = "[%s %s] " % (pkgprint(pkg_type), addl)
                                                myprint += indent + pkgprint(pkg_key) + " " + \
                                                        myoldbest + darkgreen("to " + myroot)
                                else:
@@ -9978,6 +9986,7 @@ class Scheduler(PollScheduler):
 
                self._digraph = digraph
                self._prune_digraph()
+               self._prevent_builddir_collisions()
 
        def _prune_digraph(self):
                """
@@ -10000,6 +10009,26 @@ class Scheduler(PollScheduler):
                                break
                        removed_nodes.clear()
 
+       def _prevent_builddir_collisions(self):
+               """
+               When building stages, sometimes the same exact cpv needs to be merged
+               to both $ROOTs. Add edges to the digraph in order to avoid collisions
+               in the builddir. Currently, normal file locks would be inappropriate
+               for this purpose since emerge holds all of it's build dir locks from
+               the main process.
+               """
+               cpv_map = {}
+               for pkg in self._mergelist:
+                       if pkg.installed:
+                               continue
+                       if pkg.cpv not in cpv_map:
+                               cpv_map[pkg.cpv] = [pkg]
+                               continue
+                       for earlier_pkg in cpv_map[pkg.cpv]:
+                               self._digraph.add(earlier_pkg, pkg,
+                                       priority=DepPriority(buildtime=True))
+                       cpv_map[pkg.cpv].append(pkg)
+
        class _pkg_failure(portage.exception.PortageException):
                """
                An instance of this class is raised by unmerge() when