From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E55F2138334 for ; Mon, 19 Aug 2019 03:41:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17918E0880; Mon, 19 Aug 2019 03:41:25 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B768AE0882 for ; Mon, 19 Aug 2019 03:41:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4FEC7349DED for ; Mon, 19 Aug 2019 03:41:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B44C8266 for ; Mon, 19 Aug 2019 03:41:20 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1566186003.1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb.zmedico@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/revdep_rebuild/rebuild.py pym/gentoolkit/revdep_rebuild/settings.py X-VCS-Directories: pym/gentoolkit/revdep_rebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb X-VCS-Branch: master Date: Mon, 19 Aug 2019 03:41:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: baf83566-fa9e-412c-97e1-b181a820f6fa X-Archives-Hash: 29541f32e248968736e3465a7266a3ce commit: 1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb Author: cvkbtzx users noreply github com> AuthorDate: Sun Sep 16 13:51:04 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Aug 19 03:40:03 2019 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1bc0206d revdep-rebuild: Fix pass_through_options to handle args containing spaces Signed-off-by: Zac Medico gentoo.org> pym/gentoolkit/revdep_rebuild/rebuild.py | 21 ++++++++++----------- pym/gentoolkit/revdep_rebuild/settings.py | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py index 5408298..3f152e7 100644 --- a/pym/gentoolkit/revdep_rebuild/rebuild.py +++ b/pym/gentoolkit/revdep_rebuild/rebuild.py @@ -65,34 +65,33 @@ def init_logger(settings): def rebuild(logger, assigned, settings): """rebuilds the assigned pkgs""" - args = settings['pass_through_options'] + args = list(settings['pass_through_options']) if settings['EXACT']: _assigned = filter_masked(assigned, logger) - emerge_command = '=' + ' ='.join(_assigned) + emerge_command = ['='+a for a in _assigned] else: _assigned = get_slotted_cps(assigned, logger) - emerge_command = ' '.join(_assigned) + emerge_command = [a for a in _assigned] if settings['PRETEND']: - args += ' --pretend' + args.append('--pretend') if settings['VERBOSITY'] >= 2: - args += ' --verbose' + args.append('--verbose') elif settings['VERBOSITY'] < 1: - args += ' --quiet' + args.append('--quiet') if settings['nocolor']: - args += ' --color n' + args.extend(['--color', 'n']) if len(emerge_command) == 0: logger.warning(bold('\nThere is nothing to emerge. Exiting.')) return 0 logger.warning(yellow( - '\nemerge') + args + + '\nemerge') + ' ' + ' '.join(args) + ' --oneshot --complete-graph=y ' + - bold(emerge_command)) + bold(' '.join(emerge_command))) stime = current_milli_time() - _args = 'emerge ' + args + ' --oneshot --complete-graph=y ' + emerge_command - _args = _args.split() + _args = ['emerge'] + args + ['--oneshot', '--complete-graph=y'] + emerge_command success = subprocess.call(_args) ftime = current_milli_time() logger.debug("\trebuild(); emerge call for %d ebuilds took: %s seconds" diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py index 81e9c64..b0a9f61 100644 --- a/pym/gentoolkit/revdep_rebuild/settings.py +++ b/pym/gentoolkit/revdep_rebuild/settings.py @@ -46,7 +46,7 @@ DEFAULTS = { 'debug': False, 'no-ld-path': False, 'no-order': False, - 'pass_through_options': '', + 'pass_through_options': [], 'stdout': sys.stdout, 'stdin': sys.stdin, 'stderr': sys.stderr @@ -121,7 +121,7 @@ def parse_options(): if args.library: settings['library'].update(set(args.library)) settings['USE_TMP_FILES'] = not args.ignore - settings['pass_through_options'] = " " + " ".join(args.portage_options) + settings['pass_through_options'].extend(args.portage_options) return settings