From f61ceb12933a56f36228d8f56f9043d9042b9810 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 29 Jul 2015 15:09:01 -0500 Subject: [PATCH] Support a per-aircraft exclude file. - needed to make the P51D not be crazy large. --- package.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/package.py b/package.py index 68f0a3a..263e95a 100644 --- a/package.py +++ b/package.py @@ -170,9 +170,16 @@ class PackageData: os.chdir(os.path.dirname(self.path)) print "Creating zip", zipFilePath - # TODO: exclude certain files # anything we can do to make this faster? - subprocess.call(['zip', '--quiet', '-r', zipFilePath, self.id]) + + zipArgs = ['zip', '--quiet', '-r'] + excludePath = os.path.join(self.path, 'package-exclude.lst') + if (os.path.exists(excludePath)): + print self.id, "has zip exclude list" + zipArgs += ["-x@" + excludePath] + + zipArgs += [zipFilePath, self.id] + subprocess.call(zipArgs) zipFile = open(zipFilePath, 'r') self._md5 = hashlib.md5(zipFile.read()).hexdigest()