Strip build-time dependencies when they're ignored and we're not in --rebuild mode.
authorDavid James <davidjames@chromium.org>
Tue, 10 May 2011 20:41:06 +0000 (13:41 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 10 May 2011 23:47:50 +0000 (16:47 -0700)
This should improve depgraph calculation performance.

TEST=Ran test suite.
BUG=chromium-os:15144

Change-Id: I9e06817201d7a17ae9b44b424d01c1a2bd89210a

pym/_emerge/depgraph.py

index 22a603e81f317ae4ffa41b05b97514ccacc6ec84..f7ea6863d35245ac1a9a271039f42352ca57846b 100644 (file)
@@ -1342,6 +1342,11 @@ class depgraph(object):
                                elif root_deps == "rdeps":
                                        ignore_build_time_deps = True
 
+               # If rebuild mode is not enabled, it's safe to discard ignored
+               # build-time dependencies.
+               if ignore_build_time_deps and not self._rebuild.rebuild:
+                       edepend["DEPEND"] = ""
+
                deps = (
                        (depend_root, edepend["DEPEND"],
                                self._priority(buildtime=True,