1 |
commit: 2a90c6f5debe3f18da3317f47dfb144c559fb920 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 8 03:29:27 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 8 04:35:18 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a90c6f5 |
7 |
|
8 |
Add FEATURES=parallel-install for finer locks. |
9 |
|
10 |
--- |
11 |
man/make.conf.5 | 7 ++++++- |
12 |
pym/_emerge/Scheduler.py | 3 ++- |
13 |
pym/portage/const.py | 3 ++- |
14 |
pym/portage/dbapi/vartree.py | 10 ++++++++++ |
15 |
4 files changed, 20 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/man/make.conf.5 b/man/make.conf.5 |
18 |
index 389bab1..067f706 100644 |
19 |
--- a/man/make.conf.5 |
20 |
+++ b/man/make.conf.5 |
21 |
@@ -267,7 +267,7 @@ when a problem arises (normally due to a crash or disconnect). |
22 |
.TP |
23 |
.B ebuild\-locks |
24 |
Use locks to ensure that unsandboxed ebuild phases never execute |
25 |
-concurrently. |
26 |
+concurrently. Also see \fIparallel\-install\fR. |
27 |
.TP |
28 |
.B fakeroot |
29 |
Enable fakeroot for the install and package phases when a non-root user runs |
30 |
@@ -373,6 +373,11 @@ Fetch in the background while compiling. Run |
31 |
`tail \-f /var/log/emerge\-fetch.log` in a |
32 |
terminal to view parallel-fetch progress. |
33 |
.TP |
34 |
+.B parallel\-install |
35 |
+Use finer\-grained locks when installing packages, allowing for greater |
36 |
+parallelization. For additional parallelization, disable |
37 |
+\fIebuild\-locks\fR. |
38 |
+.TP |
39 |
.B parse\-eapi\-ebuild\-head |
40 |
Parse \fBEAPI\fR from the head of the ebuild (first 30 lines). This feature |
41 |
is only intended for experimental purposes and should not be enabled under |
42 |
|
43 |
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py |
44 |
index fc69d48..182ad87 100644 |
45 |
--- a/pym/_emerge/Scheduler.py |
46 |
+++ b/pym/_emerge/Scheduler.py |
47 |
@@ -387,7 +387,8 @@ class Scheduler(PollScheduler): |
48 |
def _set_max_jobs(self, max_jobs): |
49 |
self._max_jobs = max_jobs |
50 |
self._task_queues.jobs.max_jobs = max_jobs |
51 |
- self._task_queues.merge.max_jobs = max_jobs |
52 |
+ if "parallel-install" in self.settings.features: |
53 |
+ self._task_queues.merge.max_jobs = max_jobs |
54 |
|
55 |
def _background_mode(self): |
56 |
""" |
57 |
|
58 |
diff --git a/pym/portage/const.py b/pym/portage/const.py |
59 |
index 0bd56b2..98f3dac 100644 |
60 |
--- a/pym/portage/const.py |
61 |
+++ b/pym/portage/const.py |
62 |
@@ -93,7 +93,8 @@ SUPPORTED_FEATURES = frozenset([ |
63 |
"installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", |
64 |
"metadata-transfer", "mirror", "multilib-strict", "news", |
65 |
"noauto", "noclean", "nodoc", "noinfo", "noman", |
66 |
- "nostrip", "notitles", "parallel-fetch", "parse-eapi-ebuild-head", |
67 |
+ "nostrip", "notitles", "parallel-fetch", "parallel-install", |
68 |
+ "parse-eapi-ebuild-head", |
69 |
"prelink-checksums", "preserve-libs", |
70 |
"protect-owned", "python-trace", "sandbox", |
71 |
"selinux", "sesandbox", "severe", "sfperms", |
72 |
|
73 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
74 |
index 2708e43..92c467d 100644 |
75 |
--- a/pym/portage/dbapi/vartree.py |
76 |
+++ b/pym/portage/dbapi/vartree.py |
77 |
@@ -3914,6 +3914,9 @@ class dblink(object): |
78 |
""" |
79 |
myroot = None |
80 |
retval = -1 |
81 |
+ parallel_install = "parallel-install" in self.settings.features |
82 |
+ if not parallel_install: |
83 |
+ self.lockdb() |
84 |
self.vartree.dbapi._bump_mtime(self.mycpv) |
85 |
try: |
86 |
retval = self.treewalk(mergeroot, myroot, inforoot, myebuild, |
87 |
@@ -3966,6 +3969,8 @@ class dblink(object): |
88 |
else: |
89 |
self.vartree.dbapi._linkmap._clear_cache() |
90 |
self.vartree.dbapi._bump_mtime(self.mycpv) |
91 |
+ if not parallel_install: |
92 |
+ self.unlockdb() |
93 |
return retval |
94 |
|
95 |
def getstring(self,name): |
96 |
@@ -4066,6 +4071,9 @@ def unmerge(cat, pkg, myroot=None, settings=None, |
97 |
mylink = dblink(cat, pkg, settings=settings, treetype="vartree", |
98 |
vartree=vartree, scheduler=scheduler) |
99 |
vartree = mylink.vartree |
100 |
+ parallel_install = "parallel-install" in self.settings.features |
101 |
+ if not parallel_install: |
102 |
+ self.lockdb() |
103 |
try: |
104 |
if mylink.exists(): |
105 |
retval = mylink.unmerge(ldpath_mtimes=ldpath_mtimes) |
106 |
@@ -4083,6 +4091,8 @@ def unmerge(cat, pkg, myroot=None, settings=None, |
107 |
pass |
108 |
else: |
109 |
vartree.dbapi._linkmap._clear_cache() |
110 |
+ if not parallel_install: |
111 |
+ self.unlockdb() |
112 |
|
113 |
def write_contents(contents, root, f): |
114 |
""" |