From f40225419b6ecfad7d570c67e12a5c90b1d2058a Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Sun, 24 Jun 2012 16:59:45 +0200 Subject: [PATCH] Fix build paths after moving osx build code to packaging branch. --- osx/config.ini.default | 2 +- osx/macosx-builder.py | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/osx/config.ini.default b/osx/config.ini.default index 0fc6792..4445e64 100644 --- a/osx/config.ini.default +++ b/osx/config.ini.default @@ -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 diff --git a/osx/macosx-builder.py b/osx/macosx-builder.py index 5179e9a..c44f9a7 100644 --- a/osx/macosx-builder.py +++ b/osx/macosx-builder.py @@ -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):