fixed scons 0.96.94 compatibility
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4852 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
216afb19a3
commit
60a6ec28cb
2 changed files with 24 additions and 10 deletions
30
SConstruct
30
SConstruct
|
@ -188,16 +188,30 @@ defenv.Execute(Delete('$ZIPDISTDIR'))
|
|||
defenv.Execute(Delete('$INSTDISTDIR'))
|
||||
defenv.Execute(Delete('$TESTDISTDIR'))
|
||||
|
||||
def Distribute(files, names, component, path, subpath, alias, install_alias=None):
|
||||
if isinstance(files, (str, type(File('SConstruct')))):
|
||||
files = [files]
|
||||
files = map(File, files)
|
||||
def SafeFile(f):
|
||||
from types import StringType
|
||||
|
||||
if isinstance(names, str):
|
||||
if isinstance(f, StringType):
|
||||
return File(f)
|
||||
|
||||
return f
|
||||
|
||||
def MakeFileList(files):
|
||||
from types import ListType, TupleType
|
||||
|
||||
if isinstance(files, (ListType, TupleType)):
|
||||
return map(SafeFile, files)
|
||||
|
||||
return Flatten([SafeFile(files)])
|
||||
|
||||
def Distribute(files, names, component, path, subpath, alias, install_alias=None):
|
||||
from types import StringType
|
||||
|
||||
files = MakeFileList(files)
|
||||
|
||||
names = names or map(lambda x: x.name, files)
|
||||
if isinstance(names, StringType):
|
||||
names = [names]
|
||||
if not names:
|
||||
names = map(str, files)
|
||||
names = map(os.path.basename, names)
|
||||
|
||||
for d in ('$ZIPDISTDIR', '$INSTDISTDIR', '$TESTDISTDIR'):
|
||||
paths = map(lambda file: os.path.join(d, path, subpath, file), names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue