Blank patterns are invalid patterns to be copying and causes lftools
to incorrectly copy the entire current working directory. This patch
detects that pattern and skips the pattern as a pattern to archive.
Issue: RELENG-1512
Change-Id: Ia7b0ae4a5b1d6996919bfc2a10deea4c9db84f17
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
paths = []
for p in pattern:
+ if p == '': # Skip empty patterns as they are invalid
+ continue
+
search = os.path.join(workspace, p)
paths.extend(glob2.glob(search, recursive=True))
log.debug('Files found: {}'.format(paths))