[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/devtools/waf/wafadmin
From:       Thomas Nagy <tnagyemail-mail () yahoo ! fr>
Date:       2006-06-30 19:05:17
Message-ID: 1151694317.832429.26455.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 556587 by tnagy:

More refactoring.


 M  +16 -6     Build.py  
 M  +5 -1      Node.py  


--- trunk/playground/devtools/waf/wafadmin/Build.py #556586:556587
@@ -123,6 +123,9 @@
 		# map a name to an environment, the 'default' must be defined
 		self.m_allenvs = {}
 
+		# build dir variants (release, debug, ..)
+		self.m_variants = []
+
 		# there should be only one build dir in use at a time
 		Params.g_build = self
 
@@ -284,23 +287,30 @@
 
 
 	# ======================================= #
-	def rescan(self, src_node):
-		pass
+	def rescan(self, src_dir_node):
 		# first list the files in the src dir and update the nodes
-		# for each build dir (multiple build dirs):
+		# for each variant build dir (multiple build dirs):
 		#     list the files in the build dir, update the nodes
 		#
 		# this makes (n bdirs)+srdir to scan (at least 2 folders)
-		# so we might want to do it in parallel
+		# so we might want to do it in parallel in the future
 
 		# list the files in the src directory
 		files = scan_path(src_node, src_node.abspath(), src_node.m_files)
 		src_node.m_files = files
 
 		# now list the files in the build dirs
-		# TODO
+		lst = self.m_src_node.difflst(src_dir_node)
+		for dir in self.m_variants:
+			# obtain the path: '/path/to/build', 'release', ['src', 'dir1']
+			sub_path = os.sep.join([self.m_bld_node.abspath(), dir] + lst)
+			try:
+				files = scan_path(src_node, sub_path, src_node.get_variant(dir))
+				src_node.m_variants[dir] = files
+			except:
+				os.makedirs(sub_path)
+				src_node.m_variants[dir] = []
 
-
 	# tell if a node has changed, to update the cache
 	def needs_rescan(self, node):
 		#print "needs_rescan for ", node, node.m_tstamp
--- trunk/playground/devtools/waf/wafadmin/Node.py #556586:556587
@@ -18,7 +18,7 @@
 		# these lists contain nodes too
 		self.m_dirs     = [] # sub-folders
 		self.m_files    = [] # files existing in the src dir
-		self.m_results  = [] # files produced in the build dir
+		self.m_variants = {} # nodes produced in the build dirs
 
 		# debugging only - a node is supposed to represent exactly one folder
 		if os.sep in name: print "error in name ? "+name
@@ -37,6 +37,10 @@
 	def __repr__(self):
 		return "<%s>"%self.abspath()
 
+	def get_variant(self, name):
+		try: return self.m_variants[name]
+		except: return []
+
 	# tells if this node triggers a rebuild
 	def haschanged(self):
 		return (self.m_oldstamp != self.m_newstamp)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic