misc (install): fixed self.root access when it's not used

This commit is contained in:
Goffi 2014-09-03 17:55:05 +02:00
commit 1976b05d33

View file

@ -137,9 +137,12 @@ class CustomInstall(install):
os.symlink(source, dest)
def run(self):
ignore_idx = 0 if self.root is None else len(self.root)
if self.root[-1] == '/':
ignore_idx-=1 # we dont want to remove the first '/' in _final paths
if not self.root:
ignore_idx = 0
else:
ignore_idx = len(self.root)
if self.root[-1] == '/':
ignore_idx-=1 # we dont want to remove the first '/' in _final paths
# _final suffixed attributes are the ones without the self.root prefix path
# it's used at least on Arch linux installation as install is made on a local $pkgdir
# which is later moved to user's FS root