diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-07 15:17:46 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-06 20:26:42 +1000 |
commit | 39807fd091e8feffb5d6ec089409d36e35ef7f28 (patch) | |
tree | 75d0078a27e89b313c7e16e86ae25f1b2a7a7e65 /buildtools/wafsamba/samba_utils.py | |
parent | dd05b6512ab2d5c8fc2d0fe18fcd19b62fee6f01 (diff) | |
download | samba-39807fd091e8feffb5d6ec089409d36e35ef7f28.tar.gz samba-39807fd091e8feffb5d6ec089409d36e35ef7f28.tar.bz2 samba-39807fd091e8feffb5d6ec089409d36e35ef7f28.zip |
build: smarter list splitting
Diffstat (limited to 'buildtools/wafsamba/samba_utils.py')
-rw-r--r-- | buildtools/wafsamba/samba_utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 333477e499..6fef84f2da 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -6,6 +6,7 @@ from TaskGen import feature, before from Configure import conf from Logs import debug from TaskGen import extension +import shlex LIB_PATH="shared" @@ -109,7 +110,7 @@ Build.BuildContext.ASSERT = ASSERT # create a list of files by pre-pending each with a subdir name def SUBDIR(bld, subdir, list): ret = '' - for l in list.split(): + for l in to_list(list): ret = ret + subdir + '/' + l + ' ' return ret Build.BuildContext.SUBDIR = SUBDIR @@ -117,7 +118,7 @@ Build.BuildContext.SUBDIR = SUBDIR ############################################## # remove .. elements from a path list def NORMPATH(bld, ilist): - return " ".join([os.path.normpath(p) for p in ilist.split(" ")]) + return " ".join([os.path.normpath(p) for p in to_list(ilist)]) Build.BuildContext.NORMPATH = NORMPATH ####################################################### @@ -229,3 +230,9 @@ def dbg(self): if self.target == 'HEIMDAL_HEIM_ASN1': print "@@@@@@@@@@@@@@2", self.includes, self.env._CCINCFLAGS + +def to_list(str): + '''Split a list, preserving quoted strings and existing lists''' + if isinstance(str, list): + return str + return shlex.split(str) |