10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 12:56:14 +01:00

qp_install uninstall

This commit is contained in:
Anthony Scemama 2015-06-22 10:37:17 +02:00
parent b0515ac93e
commit 9d3d9f45b9

View File

@ -1,10 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Usage: qp_install_module.py list (--installed|--avalaible-local|--avalaible-remote) Usage:
qp_install_module.py install <name>...
qp_install_module.py create -n <name> [<children_module>...] qp_install_module.py create -n <name> [<children_module>...]
qp_install_module.py download -n <name> [<path_folder>...] qp_install_module.py download -n <name> [<path_folder>...]
qp_install_module.py install <name>...
qp_install_module.py list (--installed|--avalaible-local|--avalaible-remote)
qp_install_module.py uninstall <name>...
Options: Options:
@ -150,3 +152,22 @@ if __name__ == '__main__':
raise raise
print "Done" print "Done"
print "You can now compile as usual" print "You can now compile as usual"
elif arguments["uninstall"]:
d_local = get_dict_child([qp_root_src])
l_name = arguments["<name>"]
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)