Commit 16e5042d authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Store whether --fast was used or not in the cache preamble.

parent 6980955e
......@@ -305,12 +305,17 @@ def main():
def checkIfNoWorkIsNeeded(asnfiles, aadlfile):
oldMD5s = {}
oldBFast = None
for line in open(aadlfile):
if 'MadeInFastMode' in line:
oldBFast = line.split(':')[1] == "True"
if 'InputASN1FileChecksum' in line:
md5sum, asnfile = line.split(':')[1:3]
oldMD5s[asnfile] = md5sum
# if the output AADL file contained MD5 checksums of the input ASN.1 files
if oldMD5s:
# and the file was created using the same "--fast" setup...
if oldMD5s and oldBFast == bFast:
def ok(f):
return os.path.exists(f) and md5(f) == oldMD5s[f]
# ...and all the current input ASN.1 files exist in the 'burned' list
......@@ -326,8 +331,7 @@ def main():
if os.path.exists(aadlFile) and all(os.path.exists(x) for x in inputFiles):
checkIfNoWorkIsNeeded([x for x in inputFiles if not x.lower().endswith(".acn")],
checkIfNoWorkIsNeeded(inputFiles, aadlFile)
# Check if we can skip the work altogether!
......@@ -364,7 +368,8 @@ def main():
o.write('--! File generated by asn2aadl v%s: DO NOT EDIT !\n' % __version__)
for f in [x for x in inputFiles if not x.lower().endswith(".acn")]:
o.write('--! MadeInFastMode:' + str(bFast) + ':\n')
for f in inputFiles:
o.write('--! InputASN1FileChecksum:' + md5(f) + ':' + f + ':\n')
o.write('package DataView\n\npublic\n\n')
......@@ -11,7 +11,7 @@ from setuptools import setup, find_packages
author='Thanassis Tsiodras',
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment