From eb2d9326af9d0483bb9e0c702c60e6fe615ed16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 15 Jan 2014 10:09:53 +0100 Subject: [PATCH] More pythonic tarexc function --- fdroidserver/build.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index fa0250b2..7204d57d 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -450,10 +450,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d tarname = common.getsrcname(app,thisbuild) tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz") def tarexc(f): - for vcs_dir in ['.svn', '.git', '.hg', '.bzr']: - if f.endswith(vcs_dir): - return True - return False + return any(f.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr']) tarball.add(build_dir, tarname, exclude=tarexc) tarball.close()