mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Fix issue with installing to a different root with --root=
This commit is contained in:
parent
30e36840c2
commit
7f307dc5a2
7
setup.py
7
setup.py
@ -22,6 +22,7 @@ Plinth setup file
|
|||||||
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.command.install_data import install_data
|
from distutils.command.install_data import install_data
|
||||||
|
from distutils.util import change_root
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import setuptools
|
import setuptools
|
||||||
@ -53,12 +54,18 @@ class CustomInstallData(install_data):
|
|||||||
|
|
||||||
# Create empty directories
|
# Create empty directories
|
||||||
for directory in DIRECTORIES_TO_CREATE:
|
for directory in DIRECTORIES_TO_CREATE:
|
||||||
|
if self.root:
|
||||||
|
directory = change_root(self.root, directory)
|
||||||
|
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
log.info("creating directory '%s'", directory)
|
log.info("creating directory '%s'", directory)
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
|
|
||||||
# Recursively copy directories
|
# Recursively copy directories
|
||||||
for target, source in DIRECTORIES_TO_COPY:
|
for target, source in DIRECTORIES_TO_COPY:
|
||||||
|
if self.root:
|
||||||
|
target = change_root(self.root, target)
|
||||||
|
|
||||||
if not os.path.exists(target):
|
if not os.path.exists(target):
|
||||||
log.info("recursive copy '%s' to '%s'", source, target)
|
log.info("recursive copy '%s' to '%s'", source, target)
|
||||||
shutil.copytree(source, target, symlinks=True)
|
shutil.copytree(source, target, symlinks=True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user