From 8eac20aa2e523678c7426d51acc1ce9d9001d1b9 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 16 Jul 2015 14:41:39 +0200 Subject: [PATCH] Beter uninstalation --- scripts/module/qp_install_module.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index cbd9d934..541fdf9f 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -6,7 +6,7 @@ Usage: qp_install_module.py download -n [...] qp_install_module.py install ... qp_install_module.py list (--installed | --available-local) - qp_install_module.py uninstall ... [--and_ancestor] + qp_install_module.py uninstall ... Options: @@ -163,6 +163,7 @@ if __name__ == '__main__': subprocess.check_call(["qp_create_ninja.py", "update"]) except: raise + print "Done" print "You can now compile as usual" @@ -182,22 +183,21 @@ if __name__ == '__main__': print "* %s" % name sys.exit(1) - if arguments["--and_ancestor"]: + l_name_to_remove = l_name + [module for module in m_instance.l_module for name in l_name if name in d_descendant[module]] - l_name_to_remove = l_name + [module for module in m_instance.l_module for name in l_name if name in d_descendant[module]] - print "You will remove all of:" - print l_name_to_remove - else: - l_name_to_remove = l_name + print "You will remove all of:" + print l_name_to_remove - for module in l_name_to_remove: + for module in set(l_name_to_remove): try: subprocess.check_call(["module_handler.py", "clean", module]) except: raise + for module in set(l_name_to_remove): + try: os.unlink(os.path.join(QP_SRC, module)) except OSError: - print "%s is a core module which can not be renmoved" % x + print "%s is a core module which can not be renmoved" % module