← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~matthiashub/openlp/osx-build-scripts into lp:openlp

 

Matthias Hub has proposed merging lp:~matthiashub/openlp/osx-build-scripts into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~matthiashub/openlp/osx-build-scripts/+merge/54977

- using raouls get_version script from http://wiki.openlp.org/Packaging:Version_Script to create the .version file during the build process
- fixed the language configuration save/load issue on OS X
-- 
https://code.launchpad.net/~matthiashub/openlp/osx-build-scripts/+merge/54977
Your team OpenLP Core is requested to review the proposed merge of lp:~matthiashub/openlp/osx-build-scripts into lp:openlp.
=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py	2011-03-25 15:51:28 +0000
+++ openlp/core/utils/languagemanager.py	2011-03-26 19:15:52 +0000
@@ -91,7 +91,7 @@
         """
         Retrieve a saved language to use from settings
         """
-        settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
+        settings = QtCore.QSettings()
         language = unicode(settings.value(
             u'general/language', QtCore.QVariant(u'[en]')).toString())
         log.info(u'Language file: \'%s\' Loaded from conf file' % language)

=== modified file 'resources/osx/build.py'
--- resources/osx/build.py	2011-03-10 01:47:54 +0000
+++ resources/osx/build.py	2011-03-26 19:15:52 +0000
@@ -394,10 +394,7 @@
         --template Info.plist.master \
         --expandto %(target_directory)s/Info.plist' \
         % { 'config_file' : options.config, 'target_directory' : os.getcwd() })
-    os.system('python expander.py --config %(config_file)s \
-        --template version.master \
-        --expandto %(target_directory)s/.version' \
-        % { 'config_file' : options.config, 'target_directory' : os.getcwd() })
+    os.system('python get_version.py > .version')
 
     # prepare variables
     app_name_lower = settings['openlp_appname'].lower()

=== added file 'resources/osx/get_version.py'
--- resources/osx/get_version.py	1970-01-01 00:00:00 +0000
+++ resources/osx/get_version.py	2011-03-26 19:15:52 +0000
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import sys
+import os
+from bzrlib.branch import Branch
+ 
+def get_version(path):
+    b = Branch.open_containing(path)[0]
+    b.lock_read()
+    result = '0.0.0'
+    try:
+        # Get the branch's latest revision number.
+        revno = b.revno()
+        # Convert said revision number into a bzr revision id.
+        revision_id = b.dotted_revno_to_revision_id((revno,))
+        # Get a dict of tags, with the revision id as the key.
+        tags = b.tags.get_reverse_tag_dict()
+        # Check if the latest
+        if revision_id in tags:
+            result = tags[revision_id][0]
+        else:
+            result = '%s-bzr%s' % (sorted(b.tags.get_tag_dict().keys())[-1], revno)
+    finally:
+        b.unlock()
+        return result
+ 
+def get_path():
+    if len(sys.argv) > 1:
+        return os.path.abspath(sys.argv[1])
+    else:
+        return os.path.abspath('.')
+ 
+if __name__ == u'__main__':
+    path = get_path()
+    print get_version(path)
+

=== modified file 'resources/osx/openlp.cfg'
--- resources/osx/openlp.cfg	2011-02-14 18:18:51 +0000
+++ resources/osx/openlp.cfg	2011-03-26 19:15:52 +0000
@@ -2,7 +2,6 @@
 openlp_appname = OpenLP
 openlp_dmgname = OpenLP-1.9.4-bzrXXXX
 openlp_version = XXXX
-openlp_full_version = 1.9.4-latest
 openlp_basedir = /Users/openlp/trunk
 openlp_icon_file = openlp-logo-with-text.icns
 openlp_dmg_icon_file = openlp-logo-420x420.png

=== removed file 'resources/osx/version.master'
--- resources/osx/version.master	2011-02-14 18:18:51 +0000
+++ resources/osx/version.master	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-%(openlp_full_version)s


Follow ups