diff --git a/setup.py b/setup.py index 144bf23f87..aadace5132 100755 --- a/setup.py +++ b/setup.py @@ -149,11 +149,34 @@ def install_manpages(root, prefix): except Exception as e: print("Not installing the man pages:", e) +def remove_old_files(self): + base = os.path.join(self.install_lib, 'nikola') + to_remove = ['data/themes/bootstrap/templates/bootstrap_helper.tmpl', + 'data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl', + 'data/themes/bootstrap3/templates/bootstrap_helper.tmpl', + 'data/themes/bootstrap3/templates/list.tmpl', + 'data/themes/bootstrap3/templates/list_post.tmpl', + 'data/themes/bootstrap3/templates/post.tmpl', + 'data/themes/bootstrap3/templates/tags.tmpl', + 'data/themes/bootstrap3-jinja/templates/bootstrap_helper.tmpl', + 'data/themes/bootstrap3-jinja/templates/list.tmpl', + 'data/themes/bootstrap3-jinja/templates/list_post.tmpl', + 'data/themes/bootstrap3-jinja/templates/post.tmpl', + 'data/themes/bootstrap3-jinja/templates/tags.tmpl', + ] + for f in to_remove: + try: + os.remove(os.path.join(base, f)) + except: + pass + else: + print('removing', os.path.join(base, f)) class nikola_install(install): def run(self): copy_symlinked_for_windows() install.run(self) + remove_old_files(self) install_manpages(self.root, self.prefix)