Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10773 - main/trunk/pym/_emerge
Date: Tue, 24 Jun 2008 22:53:32
Message-Id: E1KBHOA-0005o1-GQ@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-06-24 22:53:25 +0000 (Tue, 24 Jun 2008)
3 New Revision: 10773
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 If dep calculation time exceeds 20 seconds then automatically
9 enable "complete" mode since any performance difference is
10 not as likely to be noticed by the user after this much time
11 has passed.
12
13
14 Modified: main/trunk/pym/_emerge/__init__.py
15 ===================================================================
16 --- main/trunk/pym/_emerge/__init__.py 2008-06-24 22:30:48 UTC (rev 10772)
17 +++ main/trunk/pym/_emerge/__init__.py 2008-06-24 22:53:25 UTC (rev 10773)
18 @@ -1881,7 +1881,14 @@
19
20 _dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
21
22 + # If dep calculation time exceeds this value then automatically
23 + # enable "complete" mode since any performance difference is
24 + # not as likely to be noticed by the user after this much time
25 + # has passed.
26 + _complete_thresold = 20
27 +
28 def __init__(self, settings, trees, myopts, myparams, spinner):
29 + self._creation_time = time.time()
30 self.settings = settings
31 self.target_root = settings["ROOT"]
32 self.myopts = myopts
33 @@ -3378,16 +3385,20 @@
34 intially satisfied.
35
36 Since this method can consume enough time to disturb users, it is
37 - currently only enabled by the --complete-graph option.
38 + currently only enabled by the --complete-graph option, or when
39 + dep calculation time exceeds self._complete_thresold.
40 """
41 - if "complete" not in self.myparams:
42 - # Skip this to avoid consuming enough time to disturb users.
43 - return 1
44 -
45 if "--buildpkgonly" in self.myopts or \
46 "recurse" not in self.myparams:
47 return 1
48
49 + if "complete" not in self.myparams:
50 + if time.time() - self._creation_time > self._complete_thresold:
51 + self.myparams.add("complete")
52 + else:
53 + # Skip this to avoid consuming enough time to disturb users.
54 + return 1
55 +
56 # Put the depgraph into a mode that causes it to only
57 # select packages that have already been added to the
58 # graph or those that are installed and have not been
59
60 --
61 gentoo-commits@l.g.o mailing list