setup: cleaning also handles egg filenames not containing the python version

This commit is contained in:
souliane 2014-08-13 18:39:46 +02:00
commit 35047550e4

View file

@ -128,10 +128,13 @@ class CustomInstall(install):
message = "Cleaning previous installation directories"
if to_remove is None:
to_remove = []
to_remove.extend([os.path.join(self.install_lib, NAME),
os.path.join(self.install_data, 'share', 'doc', NAME),
os.path.join(self.install_lib, "%s-py%s.egg-info" % (self.config_vars['dist_fullname'], self.config_vars['py_version_short'])),
])
for path in [os.path.join(self.install_lib, NAME),
os.path.join(self.install_data, 'share', 'doc', NAME),
os.path.join(self.install_lib, "%s.egg-info" % self.config_vars['dist_fullname']),
os.path.join(self.install_lib, "%s-py%s.egg-info" % (self.config_vars['dist_fullname'], self.config_vars['py_version_short'])),
]:
if os.path.isdir(path):
to_remove.append(path)
for source, dest in self.sh_script_links:
if os.path.islink(dest):
to_remove.append(dest)