scripts/aglsetup: remove duplicate features before generating config 83/8383/2
authorStephane Desneux <stephane.desneux@iot.bzh>
Thu, 26 Jan 2017 17:15:38 +0000 (18:15 +0100)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 27 Jan 2017 01:04:01 +0000 (01:04 +0000)
With features dependencies, it may happen that the final list of features
to handle contains duplicates. With recent changes on configuration fragments, this
produces some WARNINGS due to multiple inclusions of the same file in the
generated local.conf
.
This commit cleans up the features list resolved internally by removing duplicates
before generating local.conf

Change-Id: I009c41108086e76b76272e62c8ba9101fcc45437
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
scripts/.aglsetup_genconfig.bash

index 285ecee..af2b747 100755 (executable)
@@ -324,8 +324,8 @@ for FEATURE in $FEATURES;do
     TMP_FEATURES="$TMP_FEATURES $FEATURE"
     TMP_FEATURES="$TMP_FEATURES $(find_feature_dependency $FEATURE $TMP_FEATURES)"
 done
-FEATURES=$TMP_FEATURES
-echo "Features used: $FEATURES"
+# remove duplicate features if any
+FEATURES=$(for x in $TMP_FEATURES; do echo $x; done | sort -u | awk '{printf("%s ",$1);}')
 
 # validate the features
 for f in $FEATURES; do