Add some more debug logging to figure out what's going on with the paths

This commit is contained in:
Raoul Snyman 2016-12-06 21:43:40 +02:00
parent 0a2a90794e
commit 2f7e689c99
1 changed files with 30 additions and 9 deletions

View File

@ -176,38 +176,51 @@ class Builder(object):
self.python = sys.executable
self.script_path = os.path.dirname(os.path.abspath(__file__))
self.config_path = os.path.abspath(self.args.config)
self._print_verbose('System paths:')
self._print_verbose(' {:.<20}: {}'.format('python: ', self.python))
self._print_verbose(' {:.<20}: {}'.format('script: ', self.script_path))
self._print_verbose(' {:.<20}: {}'.format('config: ', self.config_path))
def setup_executables(self):
"""
Set up the paths to the executables we use.
"""
self._print_verbose('Executables:')
for option in self.config.options('executables'):
value = self.config.get('executables', option)
if not value.strip():
value = None
for executable in self.config.options('executables'):
path = self.config.get('executables', executable)
if not path.strip():
path = None
else:
value = _which(value)
setattr(self, '{option}_exe'.format(option=option), value)
self._print_verbose(' {option:.<30}: {value}'.format(option=option + ' ', value=value))
path = _which(path)
setattr(self, '{exe}_exe'.format(exe=executable), path)
self._print_verbose(' {exe:.<20} {path}'.format(exe=executable + ': ', path=path))
def setup_paths(self):
"""
Set up a variety of paths that we use throughout the build process.
"""
for option in self.config.options('paths'):
setattr(self, '{path}_path'.format(path=option), os.path.abspath(self.config.get('paths', option)))
self._print_verbose('Paths:')
for name in self.config.options('paths'):
path = os.path.abspath(self.config.get('paths', name))
setattr(self, '{name}_path'.format(name=name), path)
self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path))
# Make any command line options override the config file
if self.args.branch:
self.branch_path = os.path.abspath(self.args.branch)
self._print_verbose(' {:.<20} {}'.format('branch **: ', self.branch_path))
if self.args.documentation:
self.documentation_path = os.path.abspath(self.args.documentation)
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.branch_path))
if self.args.release:
self.version = self.args.release
self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version))
self._print_verbose(' {:.<20} {}'.format('release: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
else:
self.version = None
self.work_path = self.branch_path
self._print_verbose(' {:.<20} {}'.format('version: ', 'bzr'))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
self.openlp_script = os.path.abspath(os.path.join(self.work_path, 'openlp-run.py'))
self.source_path = os.path.join(self.work_path, 'openlp')
self.manual_path = os.path.join(self.documentation_path, 'manual')
@ -215,6 +228,13 @@ class Builder(object):
self.i18n_utils = os.path.join(self.work_path, 'scripts', 'translation_utils.py')
self.i18n_path = os.path.join(self.work_path, 'resources', 'i18n')
self.build_path = os.path.join(self.work_path, 'build')
self._print_verbose(' {:.<20} {}'.format('openlp script: ', self.openlp_script))
self._print_verbose(' {:.<20} {}'.format('source: ', self.source_path))
self._print_verbose(' {:.<20} {}'.format('manual path: ', self.manual_path))
self._print_verbose(' {:.<20} {}'.format('manual build path: ', self.manual_build_path))
self._print_verbose(' {:.<20} {}'.format('i18n utils: ', self.i18n_utils))
self._print_verbose(' {:.<20} {}'.format('i18n path: ', self.i18n_path))
self._print_verbose(' {:.<20} {}'.format('build path: ', self.build_path))
def setup_extra(self):
"""
@ -259,6 +279,7 @@ class Builder(object):
'-i', self.icon_path,
'-n', 'OpenLP',
self.openlp_script]
self._print_verbose(' {}'.format(cmd))
if not self.args.verbose:
cmd.append('--log-level=ERROR')
else: