Logic simplification

This commit is contained in:
Thomas Nagy 2016-05-18 21:34:23 +02:00
parent 3c5be88550
commit 3f38b9d2b8
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 4 additions and 4 deletions

View File

@ -1084,7 +1084,10 @@ class inst(Task.Task):
:param tgt: file destination, as absolute path
:type tgt: string
"""
if not os.path.islink(tgt) or os.readlink(tgt) != src:
if os.path.islink(tgt) and os.readlink(tgt) == src:
if not self.generator.bld.progress_bar:
Logs.info('- symlink %s (to %s)' % (tgt, src))
else:
try:
os.remove(tgt)
except OSError:
@ -1092,9 +1095,6 @@ class inst(Task.Task):
if not self.generator.bld.progress_bar:
Logs.info('+ symlink %s (to %s)' % (tgt, src))
os.symlink(src, tgt)
else:
if not self.generator.bld.progress_bar:
Logs.info('- symlink %s (to %s)' % (tgt, src))
def do_uninstall(self, src, tgt, lbl, **kw):
if not self.generator.bld.progress_bar: