Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Unified Diff: site_scons/site_tools/gather_inputs.py

Issue 8117: Pulling in latest software construction toolkit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « site_scons/site_tools/distcc.py ('k') | site_scons/site_tools/sdl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site_scons/site_tools/gather_inputs.py
===================================================================
--- site_scons/site_tools/gather_inputs.py (revision 3849)
+++ site_scons/site_tools/gather_inputs.py (working copy)
@@ -64,12 +64,26 @@
for t in tgt:
_FindSources(ptrns, t, all)
else:
+ # Get key to use for tracking whether we've seen this node
+ target_abspath = None
+ if hasattr(tgt, 'abspath'):
+ # Use target's absolute path as the key
+ target_abspath = tgt.abspath
+ target_key = target_abspath
+ else:
+ # Hope node's representation is unique enough (the default repr
+ # contains a pointer to the target as a string). This works for
+ # Alias() nodes.
+ target_key = repr(tgt)
+
# Skip if we have been here before
- if tgt.abspath in all: return
+ if target_key in all: return
# Note that we have been here
- all[tgt.abspath] = True
+ all[target_key] = True
# Skip ones that match an exclude pattern, if we have one.
- if exclude_pattern and exclude_pattern.match(tgt.abspath): return
+ if (exclude_pattern and target_abspath
+ and exclude_pattern.match(target_abspath)):
+ return
# Handle non-leaf nodes recursively
lst = tgt.children(scan=1)
@@ -81,8 +95,9 @@
for pattern, lst in ptrns.items():
# Get real file (backed by repositories).
rfile = tgt.rfile()
- # Add to the list for the first pattern that matches.
- if pattern.match(rfile.path):
+ # Add files to the list for the first pattern that matches (implicitly,
+ # don't add directories).
+ if rfile.isfile() and pattern.match(rfile.path):
lst.append(rfile.abspath)
break
« no previous file with comments | « site_scons/site_tools/distcc.py ('k') | site_scons/site_tools/sdl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698