diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-22 15:38:40 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-22 15:38:40 (GMT) |
commit | af4c942b8a96f9d4bc5ae90c24f66c491ba915f8 (patch) | |
tree | 960a0ca13cb772416c83b22192b437aafb81255a /Mac/Lib/mkcwproject | |
parent | a120ffcf1245d8abb8ecc6984a8f4aad61ab5af4 (diff) | |
download | cpython-af4c942b8a96f9d4bc5ae90c24f66c491ba915f8.zip cpython-af4c942b8a96f9d4bc5ae90c24f66c491ba915f8.tar.gz cpython-af4c942b8a96f9d4bc5ae90c24f66c491ba915f8.tar.bz2 |
Better test for skipping project creation: the project file should also exist and be newer than the xml file, and the .exp should exist.
Diffstat (limited to 'Mac/Lib/mkcwproject')
-rw-r--r-- | Mac/Lib/mkcwproject/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Mac/Lib/mkcwproject/__init__.py b/Mac/Lib/mkcwproject/__init__.py index 387108d..c4064d7 100644 --- a/Mac/Lib/mkcwproject/__init__.py +++ b/Mac/Lib/mkcwproject/__init__.py @@ -30,13 +30,20 @@ def mkproject(outputfile, modulename, settings, force=0): xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy) xmlbuilder.generate() if not force: - # check whether it is the same as it was + # We do a number of checks and all must succeed before we decide to + # skip the build-project step: + # 1. the xml file must exist, and its content equal to what we've generated + # 2. the project file must exist and be newer than the xml file + # 3. the .exp file must exist if os.path.exists(dictcopy['mac_projectxmlname']): fp = open(dictcopy['mac_projectxmlname']) data = fp.read() fp.close() if data == dictcopy["tmp_projectxmldata"]: - return + if os.path.exists(outputfile) and \ + os.stat(outputfile)[os.path.ST_MTIME] > os.stat(dictcopy['mac_projectxmlname'])[os.path.ST_MTIME]: + if os.path.exists(outputfile + '.exp'): + return fp = open(dictcopy['mac_projectxmlname'], "w") fp.write(dictcopy["tmp_projectxmldata"]) fp.close() |