Fix build paths after moving osx build code to packaging branch.

This commit is contained in:
Martin Zibricky 2012-06-24 16:59:45 +02:00
parent 7043629baf
commit f40225419b
2 changed files with 17 additions and 10 deletions

View File

@ -1,6 +1,6 @@
[executables]
sphinx = sphinx-build
pyinstaller = %(here)s/../pyinstaller/pyinstaller.py
pyinstaller = %(projects)s/pyinstaller/pyinstaller.py
lrelease = lrelease
diskutil = diskutil
hdiutil = hdiutil

View File

@ -205,14 +205,13 @@ class MacosxBuilder(object):
"""
parser = ArgumentParser()
parser.add_argument('-b', '--branch', metavar='BRANCH', dest='branch',
help='Specify the path to the branch you wish to build.',
default='../trunk')
help='Specify the path to the branch you wish to build.')
parser.add_argument('--devel', dest='devel',
action='store_true', default=False,
help='Development build does not have set icons for .dmg file '
'and .dmg filename contains bzr revision number.')
parser.add_argument('-d', '--documentation', metavar='DOCS',
dest='docs', default=os.path.join('..', 'documentation'),
dest='docs',
help='Specify the path to the documentation branch.')
parser.add_argument('-c', '--config', metavar='CONFIG', dest='config',
help='Specify the path to the configuration file.',
@ -236,7 +235,9 @@ class MacosxBuilder(object):
Read the configuration from the configuration file.
"""
self.config = ConfigParser(defaults={
u'here': self.script_path
u'here': self.script_path,
u'projects': os.path.abspath(os.path.join(self.script_path,
'..', '..')),
})
self.config.read(os.path.abspath(self.args.config))
@ -264,15 +265,15 @@ class MacosxBuilder(object):
Set up a variety of paths that we use throughout the build process.
"""
if self.args.branch:
branch_path = self.args.branch
branch_path = os.path.abspath(self.args.branch)
else:
branch_path = self.config.get(u'paths', u'branch')
self.branch_path = os.path.abspath(branch_path)
self.branch_path = branch_path
if self.args.docs:
docs_path = self.args.docs
docs_path = os.path.abspath(self.args.docs)
else:
docs_path = self.config.get(u'paths', u'documentation')
self.docs_path = os.path.abspath(docs_path)
self.docs_path = docs_path
self.openlp_script = os.path.abspath(
os.path.join(branch_path, u'openlp.pyw'))
@ -374,6 +375,7 @@ class MacosxBuilder(object):
version_string = latest == revision and tag or \
u'%s-bzr%s' % (tag, latest)
self.version_string = version_string
self.version_tag = tag
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
version_file.write(version_string)
version_file.close()
@ -513,7 +515,12 @@ class MacosxBuilder(object):
"""
self._print(u'Creating dmg file...')
dmg_name = 'OpenLP-' + self.version_string + '.dmg'
# Release version does not contain revision in .dmg name.
if self.args.devel:
dmg_name = 'OpenLP-' + self.version_string + '.dmg'
else:
dmg_name = 'OpenLP-' + self.version_tag + '.dmg'
dmg_file = os.path.join(self.branch_path, 'build', dmg_name)
# Remove dmg if it exists.
if os.path.exists(dmg_file):