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 v2 1/9] rsync: Verify the value of sync-rsync-verify-jobs
Date: Fri, 02 Feb 2018 20:42:35
Message-Id: 20180202204223.9003-1-mgorny@gentoo.org
1 ---
2 pym/portage/sync/modules/rsync/rsync.py | 11 ++++++++++-
3 1 file changed, 10 insertions(+), 1 deletion(-)
4
5 diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py
6 index 4471f5bbe..ec28af366 100644
7 --- a/pym/portage/sync/modules/rsync/rsync.py
8 +++ b/pym/portage/sync/modules/rsync/rsync.py
9 @@ -92,6 +92,15 @@ class RsyncSync(NewBase):
10 # Support overriding job count.
11 self.verify_jobs = self.repo.module_specific_options.get(
12 'sync-rsync-verify-jobs', None)
13 + if self.verify_jobs is not None:
14 + try:
15 + self.verify_jobs = int(self.verify_jobs)
16 + if self.verify_jobs <= 0:
17 + raise ValueError(self.verify_jobs)
18 + except ValueError:
19 + writemsg_level("!!! sync-rsync-verify-jobs not a positive integer: %s\n" % (self.verify_jobs,),
20 + level=logging.WARNING, noiselevel=-1)
21 + self.verify_jobs = None
22
23 # Real local timestamp file.
24 self.servertimestampfile = os.path.join(
25 @@ -280,7 +289,7 @@ class RsyncSync(NewBase):
26 if self.repo.sync_openpgp_key_path is not None:
27 command += ['-K', self.repo.sync_openpgp_key_path]
28 if self.verify_jobs is not None:
29 - command += ['-j', self.verify_jobs]
30 + command += ['-j', str(self.verify_jobs)]
31 try:
32 exitcode = portage.process.spawn(command, **self.spawn_kwargs)
33 except CommandNotFound as e:
34 --
35 2.16.1

Replies