From 918feccf51976e43aaaa158133ec1b144c60598d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 1 Feb 2023 09:04:27 -0800 Subject: [PATCH 1/2] use shlex.split on $EXTRA* --- cue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cue.py b/cue.py index decd0af..91ca003 100644 --- a/cue.py +++ b/cue.py @@ -4,7 +4,7 @@ from __future__ import print_function -import sys, os, stat, shutil +import sys, os, stat, shlex, shutil import fileinput import logging import re @@ -778,7 +778,7 @@ def setup_for_build(args): for tag in ['EXTRA', 'EXTRA1', 'EXTRA2', 'EXTRA3', 'EXTRA4', 'EXTRA5']: val = os.environ.get(tag, "") if len(val)>0: - extra_makeargs.append(val) + extra_makeargs.extend(shlex.split(val)) def fix_etc_hosts(): From f47280547b011d6c7f2937f9eb0693cb090ab797 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 9 Mar 2023 09:40:45 +0000 Subject: [PATCH 2/2] Fix unit tests to allow shlex.split() on EXTRA* --- cue-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cue-test.py b/cue-test.py index 4f82c33..b0edbcf 100644 --- a/cue-test.py +++ b/cue-test.py @@ -841,7 +841,7 @@ class TestSetupForBuild(unittest.TestCase): def test_ExtraMakeArgs(self): os.environ['EXTRA'] = 'bla' for ind in range(1,5): - os.environ['EXTRA{0}'.format(ind)] = 'bla {0}'.format(ind) + os.environ['EXTRA{0}'.format(ind)] = '"bla {0}"'.format(ind) cue.setup_for_build(self.args) self.assertTrue(cue.extra_makeargs[0] == 'bla', 'Extra make arg [0] not set') for ind in range(1,5):