mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
setup.py: Remove files shipped in the past
- This only effects development environments where ./setup.py is run but not the shipped product. - Write log messages about removing the files only when actually removing the file. This is so that the log output is quiet when no action is taken (typical). Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
6179d98a07
commit
94883b3c92
20
setup.py
20
setup.py
@ -7,6 +7,7 @@ FreedomBox Service setup file.
|
|||||||
import collections
|
import collections
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -42,6 +43,12 @@ DISABLED_APPS_TO_REMOVE = [
|
|||||||
'xmpp',
|
'xmpp',
|
||||||
'disks',
|
'disks',
|
||||||
'udiskie',
|
'udiskie',
|
||||||
|
'restore',
|
||||||
|
'repro',
|
||||||
|
]
|
||||||
|
|
||||||
|
REMOVED_FILES = [
|
||||||
|
'/etc/apt/preferences.d/50freedombox3.pref',
|
||||||
]
|
]
|
||||||
|
|
||||||
LOCALE_PATHS = ['plinth/locale']
|
LOCALE_PATHS = ['plinth/locale']
|
||||||
@ -121,11 +128,16 @@ class CustomClean(clean):
|
|||||||
class CustomInstall(install):
|
class CustomInstall(install):
|
||||||
"""Override install command."""
|
"""Override install command."""
|
||||||
def run(self):
|
def run(self):
|
||||||
log.info("Removing disabled apps")
|
|
||||||
for app in DISABLED_APPS_TO_REMOVE:
|
for app in DISABLED_APPS_TO_REMOVE:
|
||||||
file_path = os.path.join(ENABLED_APPS_PATH, app)
|
file_path = pathlib.Path(ENABLED_APPS_PATH) / app
|
||||||
log.info("removing '%s'", file_path)
|
if file_path.exists():
|
||||||
subprocess.check_call(['rm', '-f', file_path])
|
log.info("removing '%s'", str(file_path))
|
||||||
|
subprocess.check_call(['rm', '-f', str(file_path)])
|
||||||
|
|
||||||
|
for path in REMOVED_FILES:
|
||||||
|
if pathlib.Path(path).exists():
|
||||||
|
log.info('removing %s', path)
|
||||||
|
subprocess.check_call(['rm', '-f', path])
|
||||||
|
|
||||||
install.run(self)
|
install.run(self)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user