1
0
Fork 0

Support a global exclude file for zip creation.

This commit is contained in:
James Turner 2015-07-30 12:04:17 -05:00
parent f61ceb1293
commit 479a175587
2 changed files with 6 additions and 2 deletions

View file

@ -186,6 +186,7 @@ for p in packages.values():
else:
p.useExistingCatalogData()
excludeFilePath = os.path.join(rootDir, "zip-excludes.lst")
# def f(x):
# x.generateZip(outPath)
@ -196,7 +197,7 @@ for p in packages.values():
# print(p.map(f,packagesToGenerate))
for p in packagesToGenerate:
p.generateZip(outPath)
p.generateZip(outPath, excludeFilePath)
p.extractThumbnails(thumbnailPath)
print "Creating catalog"

View file

@ -161,7 +161,7 @@ class PackageData:
if not os.path.exists(os.path.join(self._path, t)):
raise RuntimeError("missing thumbnail:" + t);
def generateZip(self, outDir):
def generateZip(self, outDir, globalExcludePath):
self._revision = self._previousRevision + 1
zipName = self.id + ".zip"
@ -173,6 +173,9 @@ class PackageData:
# anything we can do to make this faster?
zipArgs = ['zip', '--quiet', '-r']
if os.path.exists(globalExcludePath):
zipArgs += [ "-x@" + globalExcludePath]
excludePath = os.path.join(self.path, 'package-exclude.lst')
if (os.path.exists(excludePath)):
print self.id, "has zip exclude list"