scons: Make scenario packer re-entrant and skip hidden files
This is the second attempt to fix Travis build failure
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
from __future__ import print_function
|
||||
import os.path as path
|
||||
import subprocess, tarfile
|
||||
from os import walk as walk_dir, chdir
|
||||
from os import walk as walk_dir
|
||||
|
||||
Import("env platform data_dir install_dir")
|
||||
|
||||
@@ -24,13 +24,12 @@ def pack_scenario(target, source, env):
|
||||
for i in range(min(len(target), len(source))):
|
||||
abspath = path.dirname(source[i].abspath)
|
||||
with tarfile.open(target[i].abspath, 'w:gz') as tar:
|
||||
for dir, subdirs, files in walk_dir('.'):
|
||||
cur_dir = 'scenario' + dir[1:]
|
||||
for dir, subdirs, files in walk_dir(abspath):
|
||||
cur_dir = dir.replace(abspath, 'scenario')
|
||||
for fname in files:
|
||||
if fname.startswith('.'): continue
|
||||
cur_file = path.join(cur_dir, fname)
|
||||
chdir(abspath)
|
||||
tar.add(path.join(dir, fname), arcname = cur_file)
|
||||
chdir(prev_dir)
|
||||
|
||||
env.Append(BUILDERS={"BuildScenario": Builder(action=pack_scenario, suffix=".boes", src_suffix="")})
|
||||
|
||||
|
Reference in New Issue
Block a user