build: replace exclude with filter during source tar creation

Replace the deprecated exclude argument with filter in build.py
allowing users of Python 3.7 to use the fdroid CLI

Closes #531
This commit is contained in:
Areeb Jamal 2018-07-25 19:01:28 +05:30
parent e8306fbde0
commit 7bdffde804
1 changed files with 3 additions and 3 deletions

View File

@ -568,9 +568,9 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
tarname = common.getsrcname(app, build)
tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz")
def tarexc(f):
return any(f.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr'])
tarball.add(build_dir, tarname, exclude=tarexc)
def tarexc(t):
return None if any(t.name.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr']) else t
tarball.add(build_dir, tarname, filter=tarexc)
tarball.close()
# Run a build command if one is required...