sbsv2/raptor/python/plugins/filter_checksource.py
branchwip
changeset 20 d1f6767eec1a
parent 3 e1eecf4d390d
child 29 ee00c00df073
equal deleted inserted replaced
19:830586221171 20:d1f6767eec1a
   219 				
   219 				
   220 				# Make a set of the prerequisites listed in the dependency files
   220 				# Make a set of the prerequisites listed in the dependency files
   221 				# so we only check each one once
   221 				# so we only check each one once
   222 				depset = set(deps)
   222 				depset = set(deps)
   223 				deplistnodups = list(depset)
   223 				deplistnodups = list(depset)
   224 				
       
   225 				# Do the check for each file 	
   224 				# Do the check for each file 	
       
   225 
   226 				for dep in deplistnodups:
   226 				for dep in deplistnodups:
   227 					dep = os.path.normpath(dep).replace('\\', '/')
   227 					dep = os.path.abspath(dep).replace('\\', '/')
   228 					self.checksource(dep)
   228 					self.checksource(dep)
   229 					
   229 					
   230 			except Exception, e:
   230 			except Exception, e:
   231 				sys.stderr.write("sbs: could not access temporary file for FilterClean\n")
   231 				sys.stderr.write("sbs: FilterCheckSource failed: %s\n" % str(e))
   232 				
   232 				
   233 			if self.errors == 0:
   233 			if self.errors == 0:
   234 				sys.stdout.write("No checksource errors found\n")
   234 				sys.stdout.write("No checksource errors found\n")
   235 			else:
   235 			else:
   236 				sys.stdout.write("\n %d checksource errors found in the build\n" % self.errors)
   236 				sys.stdout.write("\n %d checksource errors found in the build\n" % self.errors)
   261 			self.__dirsCache = {} # a hash containing the directory structure, in the same case as the file system
   261 			self.__dirsCache = {} # a hash containing the directory structure, in the same case as the file system
   262 		
   262 		
   263 		def checkcase(self, path):
   263 		def checkcase(self, path):
   264 			"""Checks the path matches the file system"""
   264 			"""Checks the path matches the file system"""
   265 			
   265 			
   266 			path = os.path.normpath(path)
   266 			path = os.path.abspath(path)
   267 			path = path.replace('\\', '/')
   267 			path = path.replace('\\', '/')
   268 			
   268 			
   269 			if not os.path.exists(path):
   269 			if not os.path.exists(path):
   270 				raise IOError, path + " does not exist"
   270 				raise IOError, path + " does not exist"
   271 				
   271 				
   275 			
   275 			
   276 			cacheItem = self.__dirsCache
   276 			cacheItem = self.__dirsCache
   277 			
   277 			
   278 			for part in parts:
   278 			for part in parts:
   279 				if not self.checkkeyignorecase(cacheItem, part):
   279 				if not self.checkkeyignorecase(cacheItem, part):
   280 				
   280 
   281 					dirItems = os.listdir(dirBeingChecked)
   281 					dirItems = os.listdir(dirBeingChecked)
   282 					
   282 					
   283 					found = False
   283 					found = False
   284 					
   284 					
   285 					for dirItem in dirItems:
   285 					for dirItem in dirItems: