1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

More pythonic tarexc function

This commit is contained in:
Daniel Martí 2014-01-15 10:09:53 +01:00
parent 0600044f3a
commit eb2d9326af

View File

@ -450,10 +450,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
tarname = common.getsrcname(app,thisbuild) tarname = common.getsrcname(app,thisbuild)
tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz") tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz")
def tarexc(f): def tarexc(f):
for vcs_dir in ['.svn', '.git', '.hg', '.bzr']: return any(f.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr'])
if f.endswith(vcs_dir):
return True
return False
tarball.add(build_dir, tarname, exclude=tarexc) tarball.add(build_dir, tarname, exclude=tarexc)
tarball.close() tarball.close()