mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688.
This commit is contained in:
		
							parent
							
								
									e406ef41b1
								
							
						
					
					
						commit
						da668ff24f
					
				
					 4 changed files with 61 additions and 9 deletions
				
			
		|  | @ -335,8 +335,21 @@ def write_manifest(self): | |||
|         by 'add_defaults()' and 'read_template()') to the manifest file | ||||
|         named by 'self.manifest'. | ||||
|         """ | ||||
|         self.execute(file_util.write_file, | ||||
|                      (self.manifest, self.filelist.files), | ||||
|         if os.path.isfile(self.manifest): | ||||
|             fp = open(self.manifest) | ||||
|             try: | ||||
|                 first_line = fp.readline() | ||||
|             finally: | ||||
|                 fp.close() | ||||
| 
 | ||||
|             if first_line != '# file GENERATED by distutils, do NOT edit\n': | ||||
|                 log.info("not writing to manually maintained " | ||||
|                          "manifest file '%s'" % self.manifest) | ||||
|                 return | ||||
| 
 | ||||
|         content = self.filelist.files[:] | ||||
|         content.insert(0, '# file GENERATED by distutils, do NOT edit') | ||||
|         self.execute(file_util.write_file, (self.manifest, content), | ||||
|                      "writing manifest file '%s'" % self.manifest) | ||||
| 
 | ||||
|     def read_manifest(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Éric Araujo
						Éric Araujo