summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'umodule.py')
-rw-r--r--umodule.py26
1 files changed, 11 insertions, 15 deletions
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):
"""