mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +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 glob
|
||||||
import os
|
import os
|
||||||
import setuptools
|
import setuptools
|
||||||
|
from setuptools.command.install import install
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from plinth import __version__
|
from plinth import __version__
|
||||||
from plinth.tests.coverage import coverage
|
from plinth.tests.coverage import coverage
|
||||||
|
|
||||||
|
|
||||||
DIRECTORIES_TO_CREATE = [
|
DIRECTORIES_TO_CREATE = [
|
||||||
'/var/lib/plinth',
|
'/var/lib/plinth',
|
||||||
'/var/lib/plinth/sessions',
|
'/var/lib/plinth/sessions',
|
||||||
@ -48,6 +48,15 @@ DIRECTORIES_TO_COPY = [
|
|||||||
('/usr/share/plinth/static', 'static'),
|
('/usr/share/plinth/static', 'static'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
ENABLED_APPS_PATH = "/etc/plinth/modules-enabled/"
|
||||||
|
|
||||||
|
DISABLED_APPS_TO_REMOVE = [
|
||||||
|
'apps',
|
||||||
|
'system',
|
||||||
|
'xmpp',
|
||||||
|
'owncloud'
|
||||||
|
]
|
||||||
|
|
||||||
LOCALE_PATHS = [
|
LOCALE_PATHS = [
|
||||||
'plinth/locale'
|
'plinth/locale'
|
||||||
]
|
]
|
||||||
@ -109,6 +118,7 @@ class CustomBuild(build):
|
|||||||
|
|
||||||
class CustomClean(clean):
|
class CustomClean(clean):
|
||||||
"""Override clean command to clean doc, locales, and egg-info."""
|
"""Override clean command to clean doc, locales, and egg-info."""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Execute clean command"""
|
"""Execute clean command"""
|
||||||
subprocess.check_call(['rm', '-rf', 'Plinth.egg-info/'])
|
subprocess.check_call(['rm', '-rf', 'Plinth.egg-info/'])
|
||||||
@ -124,6 +134,19 @@ class CustomClean(clean):
|
|||||||
clean.run(self)
|
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):
|
class CustomInstallData(install_data):
|
||||||
"""Override install command to allow directory creation and copy"""
|
"""Override install command to allow directory creation and copy"""
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -237,6 +260,7 @@ setuptools.setup(
|
|||||||
['data/var/lib/polkit-1/localauthority/10-vendor.d/'
|
['data/var/lib/polkit-1/localauthority/10-vendor.d/'
|
||||||
'org.freedombox.NetworkManager.pkla'])],
|
'org.freedombox.NetworkManager.pkla'])],
|
||||||
cmdclass={
|
cmdclass={
|
||||||
|
'install': CustomInstall,
|
||||||
'build': CustomBuild,
|
'build': CustomBuild,
|
||||||
'clean': CustomClean,
|
'clean': CustomClean,
|
||||||
'compile_translations': CompileTranslations,
|
'compile_translations': CompileTranslations,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user