diff options
author | 2009-08-17 16:45:58 +0100 | |
---|---|---|
committer | 2009-08-17 16:45:58 +0100 | |
commit | 0bc662a176b7044fd6faba7fabb68f7abe9a2049 (patch) | |
tree | 9b5039006db998c53efdb4fab53efd26f5ee5f48 /umodule.py | |
parent | Added support for targetless links aka *.d/ alike links (diff) | |
download | uselect-0bc662a176b7044fd6faba7fabb68f7abe9a2049.tar.gz uselect-0bc662a176b7044fd6faba7fabb68f7abe9a2049.tar.bz2 uselect-0bc662a176b7044fd6faba7fabb68f7abe9a2049.zip |
Added -global when root. Fixed broken global lynking
Diffstat (limited to 'umodule.py')
-rw-r--r-- | umodule.py | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -13,9 +13,6 @@ from uio import Counter from uio import filesystem from uio import printsystem - - - modules_dir = '/usr/share/uselect/modules/' class Action: @@ -34,10 +31,10 @@ class Action: elif type == 'env': self.__class__ = Env elif type == 'sym': - if filesystem.uid != 'root': - self.__class__ = Path - else: + if filesystem.set_global: self.__class__ = Sym + else: + self.__class__ = Path elif type == 'profile': self.__class__ = ProfileAction else: @@ -268,16 +265,15 @@ class Sym(Action): """ i = target[2] link = target[1] - if clear: - filesystem.delete_file(link.destination) - self.output.append('Unsetting ' + link.destination\ - + ' success!') + if link.target == None: + target = link.targets[i].split('/').pop() else: - - filesystem.create_symlink(link.targets[i], \ - link.destination) - self.output.append('Setting ' + link.targets[i]\ - + ' success!') + target = link.target + filesystem.create_symlink(link.targets[i], \ + '/' + link.target_dir + target) + + self.output.append('Setting ' + link.targets[i]\ + + ' success!') def add_link(self, link = None): """ |