Mercurial > libervia-backend
comparison setup.py @ 1156:cc022c1cc09f
misc (install): fixed self.root access when it's not used
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Sep 2014 17:55:05 +0200 |
parents | a1d47760df3f |
children | ca15fb1abbc4 |
comparison
equal
deleted
inserted
replaced
1155:a1d47760df3f | 1156:cc022c1cc09f |
---|---|
135 if os.path.islink(dest): | 135 if os.path.islink(dest): |
136 os.remove(dest) # symlink doesn't force the link update | 136 os.remove(dest) # symlink doesn't force the link update |
137 os.symlink(source, dest) | 137 os.symlink(source, dest) |
138 | 138 |
139 def run(self): | 139 def run(self): |
140 ignore_idx = 0 if self.root is None else len(self.root) | 140 if not self.root: |
141 if self.root[-1] == '/': | 141 ignore_idx = 0 |
142 ignore_idx-=1 # we dont want to remove the first '/' in _final paths | 142 else: |
143 ignore_idx = len(self.root) | |
144 if self.root[-1] == '/': | |
145 ignore_idx-=1 # we dont want to remove the first '/' in _final paths | |
143 # _final suffixed attributes are the ones without the self.root prefix path | 146 # _final suffixed attributes are the ones without the self.root prefix path |
144 # it's used at least on Arch linux installation as install is made on a local $pkgdir | 147 # it's used at least on Arch linux installation as install is made on a local $pkgdir |
145 # which is later moved to user's FS root | 148 # which is later moved to user's FS root |
146 self.install_lib_final = self.install_lib[ignore_idx:] | 149 self.install_lib_final = self.install_lib[ignore_idx:] |
147 self.sh_script_path = os.path.join(self.install_lib, NAME, 'sat.sh') | 150 self.sh_script_path = os.path.join(self.install_lib, NAME, 'sat.sh') |