1 |
commit: e27762011461e8fb4761412a96ede630740684eb |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 30 16:39:58 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 30 19:15:55 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e2776201 |
7 |
|
8 |
rsync: Support overriding number of jobs for verification |
9 |
|
10 |
Requested-by: Ulrich Müller <ulm <AT> gentoo.org> |
11 |
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org> |
12 |
|
13 |
man/portage.5 | 4 ++++ |
14 |
pym/portage/sync/modules/rsync/__init__.py | 1 + |
15 |
pym/portage/sync/modules/rsync/rsync.py | 5 +++++ |
16 |
3 files changed, 10 insertions(+) |
17 |
|
18 |
diff --git a/man/portage.5 b/man/portage.5 |
19 |
index 2d444a86f..84999bd2f 100644 |
20 |
--- a/man/portage.5 |
21 |
+++ b/man/portage.5 |
22 |
@@ -1081,6 +1081,10 @@ Ignore vcs directories that may be present in the repository. It is the |
23 |
user's responsibility to set sync-rsync-extra-opts to protect vcs |
24 |
directories if appropriate. |
25 |
.TP |
26 |
+.B sync\-rsync\-verify\-jobs |
27 |
+Number of parallel jobs to use when verifying nested Manifests. Defaults |
28 |
+to the apparent number of processors. |
29 |
+.TP |
30 |
.B sync\-rsync\-verify\-metamanifest = true|false |
31 |
Require the repository to contain a signed MetaManifest and verify |
32 |
it using \fBapp\-portage/gemato\fR. Defaults to false. |
33 |
|
34 |
diff --git a/pym/portage/sync/modules/rsync/__init__.py b/pym/portage/sync/modules/rsync/__init__.py |
35 |
index df9a1995a..14af2120c 100644 |
36 |
--- a/pym/portage/sync/modules/rsync/__init__.py |
37 |
+++ b/pym/portage/sync/modules/rsync/__init__.py |
38 |
@@ -29,6 +29,7 @@ module_spec = { |
39 |
'sync-rsync-extra-opts', |
40 |
'sync-rsync-openpgp-key-path', |
41 |
'sync-rsync-vcs-ignore', |
42 |
+ 'sync-rsync-verify-jobs', |
43 |
'sync-rsync-verify-metamanifest', |
44 |
), |
45 |
} |
46 |
|
47 |
diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py |
48 |
index 47f0e1ea3..552ac6f6b 100644 |
49 |
--- a/pym/portage/sync/modules/rsync/rsync.py |
50 |
+++ b/pym/portage/sync/modules/rsync/rsync.py |
51 |
@@ -91,6 +91,9 @@ class RsyncSync(NewBase): |
52 |
self.openpgp_key_path = ( |
53 |
self.repo.module_specific_options.get( |
54 |
'sync-rsync-openpgp-key-path', None)) |
55 |
+ # Support overriding job count. |
56 |
+ self.verify_jobs = self.repo.module_specific_options.get( |
57 |
+ 'sync-rsync-verify-jobs', None) |
58 |
|
59 |
# Real local timestamp file. |
60 |
self.servertimestampfile = os.path.join( |
61 |
@@ -275,6 +278,8 @@ class RsyncSync(NewBase): |
62 |
command = ['gemato', 'verify', '-s', self.repo.location] |
63 |
if self.openpgp_key_path is not None: |
64 |
command += ['-K', self.openpgp_key_path] |
65 |
+ if self.verify_jobs is not None: |
66 |
+ command += ['-j', self.verify_jobs] |
67 |
exitcode = portage.process.spawn(command, **self.spawn_kwargs) |
68 |
|
69 |
return (exitcode, updatecache_flg) |