public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH v2 1/9] rsync: Verify the value of sync-rsync-verify-jobs
@ 2018-02-02 20:42 Michał Górny
  2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 2/9] rsync: Use gemato routines directly instead of calling the CLI tool Michał Górny
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Michał Górny @ 2018-02-02 20:42 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 pym/portage/sync/modules/rsync/rsync.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py
index 4471f5bbe..ec28af366 100644
--- a/pym/portage/sync/modules/rsync/rsync.py
+++ b/pym/portage/sync/modules/rsync/rsync.py
@@ -92,6 +92,15 @@ class RsyncSync(NewBase):
 		# Support overriding job count.
 		self.verify_jobs = self.repo.module_specific_options.get(
 				'sync-rsync-verify-jobs', None)
+		if self.verify_jobs is not None:
+			try:
+				self.verify_jobs = int(self.verify_jobs)
+				if self.verify_jobs <= 0:
+					raise ValueError(self.verify_jobs)
+			except ValueError:
+				writemsg_level("!!! sync-rsync-verify-jobs not a positive integer: %s\n" % (self.verify_jobs,),
+					level=logging.WARNING, noiselevel=-1)
+				self.verify_jobs = None
 
 		# Real local timestamp file.
 		self.servertimestampfile = os.path.join(
@@ -280,7 +289,7 @@ class RsyncSync(NewBase):
 			if self.repo.sync_openpgp_key_path is not None:
 				command += ['-K', self.repo.sync_openpgp_key_path]
 			if self.verify_jobs is not None:
-				command += ['-j', self.verify_jobs]
+				command += ['-j', str(self.verify_jobs)]
 			try:
 				exitcode = portage.process.spawn(command, **self.spawn_kwargs)
 			except CommandNotFound as e:
-- 
2.16.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-05 18:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-02 20:42 [gentoo-portage-dev] [PATCH v2 1/9] rsync: Verify the value of sync-rsync-verify-jobs Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 2/9] rsync: Use gemato routines directly instead of calling the CLI tool Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 3/9] rsync: Verify the Manifest signature even if tree is unchanged Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 4/9] rsync: Pre-indent the try-finally block for gemato key scope Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 5/9] rsync: Load and update keys early Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 6/9] rsync: Issue an explicit warning if Manifest timestamp is >24hr old Michał Górny
2018-02-04 13:48   ` M. J. Everitt
2018-02-05 18:44     ` Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 7/9] git: Support verifying commit signature post-sync Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 8/9] git: Support running the verification against sync-openpgp-key-path Michał Górny
2018-02-02 20:42 ` [gentoo-portage-dev] [PATCH v2 9/9] max-age fixup Michał Górny
2018-02-04 13:43   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox