summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-17 23:03:06 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-17 23:03:06 +0000
commitb0faa4daa88ff8532626b506821cccf16fde0a1e (patch)
treeb04e25aebbfad4835ada62a88d607c805b76f36d
parent249f75c929dcb1c62c982ca82e9853d45bae92db (diff)
downloadportage-b0faa4daa88ff8532626b506821cccf16fde0a1e.tar.gz
portage-b0faa4daa88ff8532626b506821cccf16fde0a1e.tar.bz2
portage-b0faa4daa88ff8532626b506821cccf16fde0a1e.zip
If dep calculation time exceeds 20 seconds then automatically
enable "complete" mode since any performance difference is not as likely to be noticed by the user after this much time has passed. (trunk r10773) svn path=/main/branches/2.1.2/; revision=11429
-rwxr-xr-xbin/emerge21
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/emerge b/bin/emerge
index 51bcdcad6..b90501314 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2015,7 +2015,14 @@ class depgraph(object):
_dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
+ # If dep calculation time exceeds this value then automatically
+ # enable "complete" mode since any performance difference is
+ # not as likely to be noticed by the user after this much time
+ # has passed.
+ _complete_thresold = 20
+
def __init__(self, settings, trees, myopts, myparams, spinner):
+ self._creation_time = time.time()
self.settings = settings
self.target_root = settings["ROOT"]
self.myopts = myopts
@@ -3444,16 +3451,20 @@ class depgraph(object):
intially satisfied.
Since this method can consume enough time to disturb users, it is
- currently only enabled by the --complete-graph option.
+ currently only enabled by the --complete-graph option, or when
+ dep calculation time exceeds self._complete_thresold.
"""
- if "complete" not in self.myparams:
- # Skip this to avoid consuming enough time to disturb users.
- return 1
-
if "--buildpkgonly" in self.myopts or \
"recurse" not in self.myparams:
return 1
+ if "complete" not in self.myparams:
+ if time.time() - self._creation_time > self._complete_thresold:
+ self.myparams.add("complete")
+ else:
+ # Skip this to avoid consuming enough time to disturb users.
+ return 1
+
# Put the depgraph into a mode that causes it to only
# select packages that have already been added to the
# graph or those that are installed and have not been