Changed from #!/usr/bin/env python to #!/usr/bin/python because we need to use Apple's installed Python, and not whatever python the user happens to be using...

Added support for CFBundleVersion when CFBundleShortVersionString is missing.

git-svn-id: http://munki.googlecode.com/svn/trunk@209 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-09-14 16:51:32 +00:00
parent 3af81c7dcf
commit 75a1f96f9f
+7 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/python
# encoding: utf-8
#
# Copyright 2009 Greg Neagle.
@@ -126,6 +126,8 @@ def getiteminfo(itempath):
infodict['CFBundleIdentifier'] = pl['CFBundleIdentifier']
if 'CFBundleShortVersionString' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleShortVersionString']
elif 'CFBundleVersion' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleVersion']
if 'LSMinimumSystemVersion' in pl:
infodict['minosversion'] = pl['LSMinimumSystemVersion']
elif 'SystemVersionCheck:MinimumSystemVersion' in pl:
@@ -137,6 +139,8 @@ def getiteminfo(itempath):
pl = getBundleInfo(itempath)
if 'CFBundleShortVersionString' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleShortVersionString']
elif 'CFBundleVersion' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleVersion']
elif itempath.endswith("Info.plist") or itempath.endswith("version.plist"):
infodict['type'] = 'plist'
@@ -145,6 +149,8 @@ def getiteminfo(itempath):
pl = FoundationPlist.readPlist(itempath)
if 'CFBundleShortVersionString' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleShortVersionString']
elif 'CFBundleVersion' in pl:
infodict['CFBundleShortVersionString'] = pl['CFBundleVersion']
except:
pass