commit: 8b773727f009e63fbaecf937701d7f9f1a97f112 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Wed Jan 31 22:20:55 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Wed Jan 31 22:20:55 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8b773727
rsync: handle CommandNotFound for gemato (bug 646184) Bug: https://bugs.gentoo.org/646184 pym/portage/sync/modules/rsync/rsync.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py index 7c020a563..69e4be734 100644 --- a/pym/portage/sync/modules/rsync/rsync.py +++ b/pym/portage/sync/modules/rsync/rsync.py @@ -13,6 +13,7 @@ import tempfile import portage from portage import os from portage import _unicode_decode +from portage.exception import CommandNotFound from portage.util import writemsg_level from portage.output import create_color_func, yellow, blue, bold good = create_color_func("GOOD") @@ -277,7 +278,12 @@ class RsyncSync(NewBase): command += ['-K', self.repo.openpgp_key_path] if self.verify_jobs is not None: command += ['-j', self.verify_jobs] - exitcode = portage.process.spawn(command, **self.spawn_kwargs) + try: + exitcode = portage.process.spawn(command, **self.spawn_kwargs) + except CommandNotFound as e: + writemsg_level("!!! Command not found: %s\n" % (command[0],), + level=logging.ERROR, noiselevel=-1) + exitcode = 127 return (exitcode, updatecache_flg)
