From e3dca1412b687bb91c21501801ded63afd665ef4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 23 Feb 2010 11:55:28 +1100 Subject: build: simpler BUILD_SUBDIR --- lib/replace/wafsamba.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/replace/wafsamba.py b/lib/replace/wafsamba.py index 46a1ea86af..737a058086 100644 --- a/lib/replace/wafsamba.py +++ b/lib/replace/wafsamba.py @@ -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 -- cgit