mirror of
https://github.com/munki/munki.git
synced 2026-04-23 13:29:26 -05:00
Additional cleanup/reorg of compareBundleVersion(). Thanks to Aaron Hall.
git-svn-id: http://munki.googlecode.com/svn/trunk@507 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -416,21 +416,23 @@ def compareBundleVersion(item):
|
||||
-2 if there's an error in the input
|
||||
"""
|
||||
if 'path' in item and 'CFBundleShortVersionString' in item:
|
||||
filepath = os.path.join(item['path'], 'Contents', 'Info.plist')
|
||||
vers = item['CFBundleShortVersionString']
|
||||
else:
|
||||
munkicommon.display_error("Missing bundle path or version!")
|
||||
return -2
|
||||
|
||||
munkicommon.display_debug1("Checking %s for version %s..." %
|
||||
(filepath, vers))
|
||||
munkicommon.display_debug1("Checking bundle %s for version %s..." %
|
||||
(item['path'], vers))
|
||||
filepath = os.path.join(item['path'], 'Contents', 'Info.plist')
|
||||
if not os.path.exists(filepath):
|
||||
munkicommon.display_debug1("\tNo Info.plist found at %s" % filepath)
|
||||
filepath = os.path.join(item['path'], 'Resources', 'Info.plist')
|
||||
if not os.path.exists(filepath):
|
||||
munkicommon.display_debug1(
|
||||
"\tNo Info.plist found at %s" % filepath)
|
||||
return 0
|
||||
|
||||
|
||||
munkicommon.display_debug1("\tFound Info.plist at %s" % filepath)
|
||||
try:
|
||||
pl = FoundationPlist.readPlist(filepath)
|
||||
except FoundationPlist.NSPropertyListSerializationException:
|
||||
|
||||
Reference in New Issue
Block a user