From 90d8e62db0896492170c828dd03391ba740bff68 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 20 Dec 2024 11:09:32 -0500 Subject: [PATCH] Fixed a bug in setup.py. --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index c46fe774..381a3155 100755 --- a/setup.py +++ b/setup.py @@ -5,8 +5,9 @@ import glob from shutil import copyfile from setuptools import setup -def get_data_files(force_settings=False): +def get_data_files(): data_files = [] + force_settings = os.environ.get('FENRIR_FORCE_SETTINGS') == '1' # Handle locale files locale_files = glob.glob('locale/*/LC_MESSAGES/*.mo') @@ -45,7 +46,8 @@ def get_data_files(force_settings=False): return data_files def post_install_actions(): - if '--force-settings' not in sys.argv: + force_settings = os.environ.get('FENRIR_FORCE_SETTINGS') == '1' + if not force_settings: print('') # create settings file from example if not exist if not os.path.isfile('/etc/fenrirscreenreader/settings/settings.conf'): @@ -70,12 +72,8 @@ def post_install_actions(): print('- sox: is a player for the generic sound driver') if __name__ == "__main__": - force_settings = '--force-settings' in sys.argv - if force_settings: - sys.argv.remove('--force-settings') - setup( - data_files=get_data_files(force_settings), + data_files=get_data_files(), ) post_install_actions()