diff options
author | cvkbtzx <cvkbtzx@users.noreply.github.com> | 2018-09-16 15:51:04 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2019-08-18 20:40:03 -0700 |
commit | 1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb (patch) | |
tree | 56958d71d01c91e1b8e150e7efe1fcb5c73c9303 | |
parent | filter_flags: handle default IUSE correctly with reduce_flag (diff) | |
download | gentoolkit-1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb.tar.gz gentoolkit-1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb.tar.bz2 gentoolkit-1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb.zip |
revdep-rebuild: Fix pass_through_options to handle args containing spaces
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | pym/gentoolkit/revdep_rebuild/rebuild.py | 21 | ||||
-rw-r--r-- | 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 |