From 80f549fde97b35b494db31eb2629d7f2bbe907f2 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 20 Dec 2024 12:24:52 -0500 Subject: [PATCH] Hopefully final fix to setup. --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index a78113d0..fb5ce098 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -#https://python-packaging.readthedocs.io/en/latest/minimal.html import os, glob, sys import os.path from shutil import copyfile @@ -7,9 +6,12 @@ from setuptools import find_namespace_packages from setuptools import setup # handle flags for package manager like aurman and pacaur. -forceSettingsFlag = False +# Allow both environment variable and command line flag +forceSettingsFlag = ( + "--force-settings" in sys.argv or + os.environ.get('FENRIR_FORCE_SETTINGS') == '1' +) if "--force-settings" in sys.argv: - forceSettingsFlag = True sys.argv.remove("--force-settings") dataFiles = [] @@ -34,7 +36,7 @@ for directory in directories: destDir = '/etc/fenrirscreenreader/settings' if not forceSettingsFlag: try: - del(files[files.index('config/settings/settings.conf')]) + files = [f for f in files if not f.endswith('settings.conf')] except: pass elif 'config/scripts' in directory: