From 9d3d9f45b9a34f300b1dbcb1180540adc5547bcd Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 22 Jun 2015 10:37:17 +0200 Subject: [PATCH] qp_install uninstall --- scripts/module/qp_install_module.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index 6bf588a8..03460052 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -1,10 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Usage: qp_install_module.py list (--installed|--avalaible-local|--avalaible-remote) - qp_install_module.py install ... +Usage: qp_install_module.py create -n [...] qp_install_module.py download -n [...] + qp_install_module.py install ... + qp_install_module.py list (--installed|--avalaible-local|--avalaible-remote) + qp_install_module.py uninstall ... Options: @@ -150,3 +152,22 @@ if __name__ == '__main__': raise print "Done" print "You can now compile as usual" + + elif arguments["uninstall"]: + + d_local = get_dict_child([qp_root_src]) + l_name = arguments[""] + + l_failed = [ name for name in l_name if name not in d_local ] + if l_failed: + print "Modules not installed:" + for name in sorted(l_failed): + print "* %s"%name + sys.exit(1) + else: + def unlink(x): + try: + os.unlink(os.path.join(qp_root_src,x)) + except OSError: + print "%s is a core module which can not be renmoved"%x + map(unlink,l_name)