do not overwrite settings.conf in setup.py
This commit is contained in:
20
setup.py
20
setup.py
@ -1,10 +1,13 @@
|
||||
#!/bin/python
|
||||
#https://python-packaging.readthedocs.io/en/latest/minimal.html
|
||||
import os, glob
|
||||
import os.path
|
||||
from shutil import copyfile
|
||||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
fenrirVersion = '1.5'
|
||||
packageVersion = 'post5'
|
||||
packageVersion = 'post6'
|
||||
|
||||
data_files = []
|
||||
directories = glob.glob('config/*')
|
||||
@ -17,6 +20,10 @@ for directory in directories:
|
||||
destDir = '/etc/fenrir/keyboard'
|
||||
elif 'config/settings' in directory:
|
||||
destDir = '/etc/fenrir/settings'
|
||||
try:
|
||||
del(files[files.index('config/settings/settings.conf')])
|
||||
except:
|
||||
pass
|
||||
elif 'config/scripts' in directory:
|
||||
destDir = '/usr/share/fenrir/scripts'
|
||||
if destDir != '':
|
||||
@ -85,6 +92,17 @@ setup(
|
||||
],
|
||||
|
||||
)
|
||||
|
||||
print('')
|
||||
# create settings file from example if not exist
|
||||
if not os.path.isfile('/etc/fenrir/settings/settings.conf'):
|
||||
try:
|
||||
copyfile('/etc/fenrir/settings/settings.conf.example', '/etc/fenrir/settings/settings.conf')
|
||||
print('create settings file in /etc/fenrir/settings/settings.conf')
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
print('settings.conf file found. It is not overwritten automatical')
|
||||
print('')
|
||||
print('To have Fenrir start at boot:')
|
||||
print('sudo systemctl enable fenrir')
|
||||
|
Reference in New Issue
Block a user