diff options
-rw-r--r-- | cerbero/utils/shell.py | 10 | ||||
-rw-r--r-- | setup.py | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index 2dbb83db..0cc6e898 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -497,12 +497,10 @@ def ls_dir(dirpath, prefix): return files -def find_newer_files(prefix, compfile, include_link=False): - include_links = include_link and '-L' or '' - cmd = 'find %s * -type f -cnewer %s' % (include_links, compfile) - sfiles = check_call(cmd, prefix, True, False, False).split('\n') - sfiles.remove('') - return sfiles +def find_newer_files(prefix, compfile): + cmd = ['find', '.', '-type', 'f', '-cnewer', compfile] + out = check_call(cmd, cmd_dir=prefix, fail=False) + return out.strip().split('\n') def replace(filepath, replacements): @@ -18,10 +18,10 @@ def read(fname): # Utility function to parse directories def parse_dir(dirpath, extension=None): if os.path.exists('.git'): - files = shell.check_call('git ls-files %s' % dirpath).split('\n') + files = shell.check_output(['git', 'ls-files', dirpath]).split('\n') files.remove('') else: - files = shell.check_call('find %s -type f' % dirpath).split('\n') + files = shell.check_output(['find', dirpath, '-type', 'f']).split('\n') files.remove('') if extension is None: return files |