Changes to getInstalledPackageVersion(pkgid) to deal with Leopard and later's package database, which does not always preserve the full five-part version number.

git-svn-id: http://munki.googlecode.com/svn/trunk@181 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-08-25 16:17:05 +00:00
parent 8b512d7351
commit 802acfc376
+5 -1
View File
@@ -613,7 +613,11 @@ def getInstalledPackageVersion(pkgid):
if pkgid == foundbundleid:
display_debug2("\tThis machine has %s, version %s" % (pkgid, foundvers))
return padVersionString(foundvers,5)
components = str(foundvers).split(".")
if len(components) > 2:
return foundvers
else:
return padVersionString(foundvers,3)
# This package does not appear to be currently installed
display_debug2("\tThis machine does not have %s" % pkgid)