Moznost vynechat 'data' adresar

This commit is contained in:
Pavel Brychta 2020-07-03 09:03:33 +02:00
parent 37bdcdaf24
commit 9b41ebdc97

View File

@ -204,6 +204,7 @@ def getgitversion():
if __name__ == "__main__": if __name__ == "__main__":
version = getgitversion() version = getgitversion()
datadir = None
templatevars['version'] = version templatevars['version'] = version
print("Web version " + version) print("Web version " + version)
with open(PROJECT_FILE) as fd: with open(PROJECT_FILE) as fd:
@ -214,12 +215,14 @@ if __name__ == "__main__":
approotdir = build["approotdir"] approotdir = build["approotdir"]
outputdir = build["outputdir"] outputdir = build["outputdir"]
if "datadir" in build:
datadir = build["datadir"] datadir = build["datadir"]
if "flist" in build: if "flist" in build:
flist = build["flist"] flist = build["flist"]
# Vycistime vystupni adresare # Vycistime vystupni adresare
cleanup(outputdir) cleanup(outputdir)
if datadir is not None:
cleanup(datadir) cleanup(datadir)
# Zacneme kombinaci soubou # Zacneme kombinaci soubou
@ -236,6 +239,7 @@ if __name__ == "__main__":
copyfiles(copy, approotdir, outputdir) copyfiles(copy, approotdir, outputdir)
# .. a koncime prekopirovanim souboru do vystupniho adresare s prubeznou kompresi pozadovanych souboru a vytvareni flist.txt # .. a koncime prekopirovanim souboru do vystupniho adresare s prubeznou kompresi pozadovanych souboru a vytvareni flist.txt
if datadir is not None:
deploy = [] deploy = []
if flist is not None: if flist is not None:
flistcontent = ":" + version + "\r\n" flistcontent = ":" + version + "\r\n"
@ -244,5 +248,5 @@ if __name__ == "__main__":
copycompresstree(outputdir, datadir, deploy, datadir) copycompresstree(outputdir, datadir, deploy, datadir)
if flist is not None: if flist is not None:
with open(os.path.normpath(os.path.join(datadir, flist)), 'wb') as outfile: with open(os.path.normpath(os.path.join(datadir, flist)), 'wb') as outfile:
outfile.write(flistcontent.encode('utf-8')) outfile.write(flistcontent.encode('ascii', 'ignore'))
outfile.close() outfile.close()