From 4f4eded59374ff26af4120acb4b51ad426d02b60 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 16 Oct 2014 20:22:52 +0200 Subject: [PATCH] aa-mergeprof: don't ask for includes that are already there Acked-by: Steve Beattie --- utils/aa-mergeprof | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/aa-mergeprof b/utils/aa-mergeprof index baca67ebf..3cfb70229 100755 --- a/utils/aa-mergeprof +++ b/utils/aa-mergeprof @@ -239,7 +239,12 @@ class Merge(object): #Add the file-wide includes from the other profile to the user profile done = False - options = list(map(lambda inc: '#include <%s>' %inc, sorted(other.filelist[other.filename]['include'].keys()))) + + options = [] + for inc in other.filelist[other.filename]['include'].keys(): + if not inc in self.user.filelist[self.user.filename]['include'].keys(): + options.append('#include <%s>' %inc) + default_option = 1 q = aaui.PromptQuestion() @@ -267,7 +272,12 @@ class Merge(object): for hat in sorted(other.aa[profile].keys()): #Add the includes from the other profile to the user profile done = False - options = list(map(lambda inc: '#include <%s>' %inc, sorted(other.aa[profile][hat]['include'].keys()))) + + options = [] + for inc in other.aa[profile][hat]['include'].keys(): + if not inc in self.user.aa[profile][hat]['include'].keys(): + options.append('#include <%s>' %inc) + default_option = 1 q = aaui.PromptQuestion()