From fa4511f61bf27d6728a406b24a61d75a7bc172c4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 9 May 2013 03:29:53 +0200 Subject: [PATCH] AddDriversToContainer: Handle duplicate invocations Since the same driver can be added in more than one category, in a few cases AddDriversToContainer was invoked twice for the same target. Avoid adding the driver twice to add-ons/kernel/drivers/bin in such a case. Didn't really cause any problem, but no need to copy the file twice. --- build/jam/ImageRules | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build/jam/ImageRules b/build/jam/ImageRules index be029ca0c7..6652201485 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -429,9 +429,23 @@ rule AddDriversToContainer container : relativeDirectoryTokens : targets targets = [ FFilterByBuildFeatures $(targets) ] ; + # A driver can be in multiple categories. Avoid adding it to the bin/ + # directory more than once. + local binTargets ; + local target ; + for target in $(targets) { + local containers + = [ on $(target) return $(HAIKU_DRIVER_IN_CONTAINERS) ] ; + if ! $(container) in $(containers) { + HAIKU_DRIVER_IN_CONTAINERS on $(target) + = $(containers) $(container) ; + binTargets += $(target) ; + } + } + AddFilesToContainer $(container) : $(systemDirTokens) add-ons kernel drivers bin - : $(targets) ; + : $(binTargets) ; # If the image shall only be updated, we don't add any symlinks. if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]