From 0bc662a176b7044fd6faba7fabb68f7abe9a2049 Mon Sep 17 00:00:00 2001 From: Sérgio Almeida Date: Mon, 17 Aug 2009 16:45:58 +0100 Subject: Added -global when root. Fixed broken global lynking --- umodule.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'umodule.py') diff --git a/umodule.py b/umodule.py index 26ab137..7014c82 100644 --- a/umodule.py +++ b/umodule.py @@ -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): """ -- cgit v1.2.3-65-gdbad