File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -283,19 +283,26 @@ def _gen_keep_files(name, require):
283
283
Generate the list of files that need to be kept when a dir based function
284
284
like directory or recurse has a clean.
285
285
'''
286
+ def _process (name ):
287
+ ret = set ()
288
+ ret .add (name .rstrip ('/' ))
289
+ if os .path .isdir (name ):
290
+ for root , dirs , files in os .walk (name ):
291
+ for name in files :
292
+ ret .add (os .path .join (root , name ))
293
+ for name in dirs :
294
+ ret .add (os .path .join (root , name ))
295
+ return ret
286
296
keep = set ()
287
297
# Remove last slash if exists for all path
288
298
keep .add (name .rstrip ('/' ))
289
299
if isinstance (require , list ):
290
300
for comp in require :
291
301
if 'file' in comp :
292
- keep .add (comp ['file' ].rstrip ('/' ))
293
- if os .path .isdir (comp ['file' ]):
294
- for root , dirs , files in os .walk (comp ['file' ]):
295
- for name in files :
296
- keep .add (os .path .join (root , name ))
297
- for name in dirs :
298
- keep .add (os .path .join (root , name ))
302
+ keep .update (_process (comp ['file' ]))
303
+ for low in __lowstate__ :
304
+ if low ['__id__' ] == comp ['file' ]:
305
+ keep .update (_process (low ['name' ]))
299
306
return list (keep )
300
307
301
308
You can’t perform that action at this time.
0 commit comments