build: simpler BUILD_SUBDIR
authorAndrew Tridgell <tridge@samba.org>
Tue, 23 Feb 2010 00:55:28 +0000 (11:55 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:36 +0000 (20:26 +1000)
lib/replace/wafsamba.py

index 46a1ea86af70be56a04346806af001568b5c57bd..737a0580861fbbecee85187922f63b093c5e24a3 100644 (file)
@@ -314,15 +314,10 @@ Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
 
 ###############################################################
 # add a new set of build rules from a subdirectory
+# the @runonce decorator ensures we don't end up
+# with duplicate rules
+@runonce
 def BUILD_SUBDIR(bld, dir):
-    try:
-        cache = bld.cache_build_subdirs
-    except AttributeError:
-        bld.cache_build_subdirs = cache = {}
-    abs_dir=os.path.normpath(bld.curdir + '/' + dir)
-    if abs_dir in cache:
-        return
-    cache[abs_dir] = True
     bld.add_subdirs(dir)
 Build.BuildContext.BUILD_SUBDIR = BUILD_SUBDIR