Merge pull request #23442 from clan/file_directory_require

add directory itself to keep list
This commit is contained in:
Thomas S Hatch 2015-05-08 08:36:59 -06:00
commit 57f6c72843

View File

@ -337,6 +337,7 @@ def _gen_keep_files(name, require):
ret = set()
if os.path.isdir(name):
for root, dirs, files in os.walk(name):
ret.add(name)
for name in files:
ret.add(os.path.join(root, name))
for name in dirs:
@ -348,7 +349,7 @@ def _gen_keep_files(name, require):
required_files = [comp for comp in require if 'file' in comp]
for comp in required_files:
for low in __lowstate__:
if low['__id__'] == comp['file']:
if low['name'] == comp['file']:
fn = low['name']
if os.path.isdir(comp['file']):
if _is_child(comp['file'], name):