Skip to content

Commit

Permalink
close #324
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Mar 31, 2018
1 parent 76ab69e commit 07f1947
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ def run(self):
dir_util.mkpath(os.path.join(self.build_base, 'share'))

if not self.single_version_externally_managed:
print 'before installing new egg, remove old ones!'
site_packages = os.path.join(self.install_data, 'lib', 'python2.7', 'site-packages')
old_egg_dirs = [i for i in os.listdir(site_packages)
if i.endswith('.egg')
and (i.startswith('bauble-') or i.startswith('ghini.desktop-'))]
for oed in old_egg_dirs:
dir_util.remove_tree(os.path.join(site_packages, oed))
self.do_egg_install()
else:
_install.run(self)
Expand Down Expand Up @@ -414,10 +421,11 @@ def delete(p):
dir_util.remove_tree('build')
if os.path.exists(DOC_BUILD_PATH):
dir_util.remove_tree(DOC_BUILD_PATH)
# .egg info
egg_info_dir = 'ghini.desktop.egg-info'
if os.path.exists(egg_info_dir):
dir_util.remove_tree(egg_info_dir)
# older eggs, possibly going under previous name
egg_info_dirs = ['ghini.desktop.egg-info', 'bauble.egg-info']
for eid in egg_info_dirs:
if os.path.exists(eid):
dir_util.remove_tree(eid)

# deb_dist - used by stdeb
deb_dist = 'deb_dist'
Expand All @@ -438,6 +446,7 @@ def run(self):
cwd = os.getcwd()
os.system(os.path.join(cwd, 'ghini.sh'))


# require pysqlite if not using python2.5 or greater
needs_sqlite = []
try:
Expand All @@ -451,8 +460,6 @@ def run(self):
scripts = ["scripts/ghini", "scripts/ghini.bat", "scripts/ghini.vbs",
"scripts/ghini-update.bat"]

# TODO: images in bauble/images should really be in data and copied as
# package_data or data_files
setuptools.setup(name="ghini.desktop",
cmdclass={'build': build, 'install': install,
'py2exe': py2exe_cmd, 'nsis': NsisCmd,
Expand Down

0 comments on commit 07f1947

Please sign in to comment.