mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
[#846] Remove disabled apps as part of install
This commit is contained in:
parent
729dc4b5a5
commit
09f3f23e10
26
setup.py
26
setup.py
@ -30,13 +30,13 @@ from distutils.util import change_root
|
||||
import glob
|
||||
import os
|
||||
import setuptools
|
||||
from setuptools.command.install import install
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from plinth import __version__
|
||||
from plinth.tests.coverage import coverage
|
||||
|
||||
|
||||
DIRECTORIES_TO_CREATE = [
|
||||
'/var/lib/plinth',
|
||||
'/var/lib/plinth/sessions',
|
||||
@ -48,6 +48,15 @@ DIRECTORIES_TO_COPY = [
|
||||
('/usr/share/plinth/static', 'static'),
|
||||
]
|
||||
|
||||
ENABLED_APPS_PATH = "/etc/plinth/modules-enabled/"
|
||||
|
||||
DISABLED_APPS_TO_REMOVE = [
|
||||
'apps',
|
||||
'system',
|
||||
'xmpp',
|
||||
'owncloud'
|
||||
]
|
||||
|
||||
LOCALE_PATHS = [
|
||||
'plinth/locale'
|
||||
]
|
||||
@ -109,6 +118,7 @@ class CustomBuild(build):
|
||||
|
||||
class CustomClean(clean):
|
||||
"""Override clean command to clean doc, locales, and egg-info."""
|
||||
|
||||
def run(self):
|
||||
"""Execute clean command"""
|
||||
subprocess.check_call(['rm', '-rf', 'Plinth.egg-info/'])
|
||||
@ -124,6 +134,19 @@ class CustomClean(clean):
|
||||
clean.run(self)
|
||||
|
||||
|
||||
class CustomInstall(install):
|
||||
"""Override install command."""
|
||||
|
||||
def run(self):
|
||||
log.info("Removing disabled apps")
|
||||
for app in DISABLED_APPS_TO_REMOVE:
|
||||
file_path = os.path.join(ENABLED_APPS_PATH, app)
|
||||
log.info("removing '%s'", file_path)
|
||||
subprocess.check_call(['rm', '-f', file_path])
|
||||
|
||||
install.run(self)
|
||||
|
||||
|
||||
class CustomInstallData(install_data):
|
||||
"""Override install command to allow directory creation and copy"""
|
||||
def run(self):
|
||||
@ -237,6 +260,7 @@ setuptools.setup(
|
||||
['data/var/lib/polkit-1/localauthority/10-vendor.d/'
|
||||
'org.freedombox.NetworkManager.pkla'])],
|
||||
cmdclass={
|
||||
'install': CustomInstall,
|
||||
'build': CustomBuild,
|
||||
'clean': CustomClean,
|
||||
'compile_translations': CompileTranslations,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user