mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Better test for skipping project creation: the project file should also exist and be newer than the xml file, and the .exp should exist.
This commit is contained in:
		
							parent
							
								
									a120ffcf12
								
							
						
					
					
						commit
						af4c942b8a
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
					@ -30,12 +30,19 @@ def mkproject(outputfile, modulename, settings, force=0):
 | 
				
			||||||
	xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy)
 | 
						xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy)
 | 
				
			||||||
	xmlbuilder.generate()
 | 
						xmlbuilder.generate()
 | 
				
			||||||
	if not force:
 | 
						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']):
 | 
							if os.path.exists(dictcopy['mac_projectxmlname']):
 | 
				
			||||||
			fp = open(dictcopy['mac_projectxmlname'])
 | 
								fp = open(dictcopy['mac_projectxmlname'])
 | 
				
			||||||
			data = fp.read()
 | 
								data = fp.read()
 | 
				
			||||||
			fp.close()
 | 
								fp.close()
 | 
				
			||||||
			if data == dictcopy["tmp_projectxmldata"]:
 | 
								if data == dictcopy["tmp_projectxmldata"]:
 | 
				
			||||||
 | 
									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
 | 
											return
 | 
				
			||||||
	fp = open(dictcopy['mac_projectxmlname'], "w")
 | 
						fp = open(dictcopy['mac_projectxmlname'], "w")
 | 
				
			||||||
	fp.write(dictcopy["tmp_projectxmldata"])
 | 
						fp.write(dictcopy["tmp_projectxmldata"])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue