Gentoo Archives: gentoo-portage-dev

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

Replies