mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
A nicer way to isolate config files created during the build process
This commit is contained in:
parent
15cbf73fc5
commit
21e1c5842b
@ -122,10 +122,14 @@ class Develop(Command):
|
||||
raise SystemExit(1)
|
||||
|
||||
if os.geteuid() == 0:
|
||||
# We drop privileges for security, regaining them when installing
|
||||
# files. Also ensures that any config files created as a side
|
||||
# effect of the build process are not owned by root.
|
||||
self.drop_privileges()
|
||||
# Ensure any calibre config files are created as correct user
|
||||
import calibre.utils.config as c
|
||||
c
|
||||
|
||||
# Ensure any config files created as a side effect of importing calibre
|
||||
# during the build process are in /tmp
|
||||
os.environ['CALIBRE_CONFIG_DIRECTORY'] = os.environ.get('CALIBRE_CONFIG_DIRECTORY', '/tmp/calibre-install-config')
|
||||
|
||||
def run(self, opts):
|
||||
self.manifest = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user