pzip: use Python zlib module to perform pzip step

This is more useful when cross-compiling, not requiring a functional pzip binary on the host.
This commit is contained in:
rdb 2020-12-19 01:59:36 +01:00
parent 7ae72cd880
commit 1a5fd04499

View File

@ -30,6 +30,11 @@ import time
import os
import sys
try:
import zlib
except:
zlib = None
########################################################################
##
## PARSING THE COMMAND LINE OPTIONS
@ -1904,6 +1909,10 @@ def CompileEgg(eggfile, src, opts):
oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
if pz:
if zlib:
WriteBinaryFile(eggfile + '.pz', zlib.compress(ReadBinaryFile(eggfile)))
os.remove(eggfile)
else:
oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
##########################################################################################