Skip to content

Commit

Permalink
Don't add receipt info for payload-free flat pkgs to pkginfo since th…
Browse files Browse the repository at this point in the history
…ey do not leave receipts in the pkgutil receipts database.
  • Loading branch information
gregneagle committed Feb 24, 2015
1 parent f42af65 commit c43a1e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/client/munkilib/munkicommon.py
Expand Up @@ -1444,6 +1444,7 @@ def parsePkgRefs(filename, path_to_pkg=None):
dom = minidom.parse(filename)
pkgrefs = dom.getElementsByTagName('pkg-info')
if pkgrefs:
# this is a PackageInfo file
for ref in pkgrefs:
keys = ref.attributes.keys()
if 'identifier' in keys and 'version' in keys:
Expand All @@ -1459,11 +1460,14 @@ def parsePkgRefs(filename, path_to_pkg=None):
pkginfo['installed_size'] = int(
payloads[0].attributes[
'installKBytes'].value.encode('UTF-8'))
if not pkginfo in info:
info.append(pkginfo)
if not pkginfo in info:
info.append(pkginfo)
# if there isn't a payload, no receipt is left by a flat
# pkg, so don't add this to the info array
else:
pkgrefs = dom.getElementsByTagName('pkg-ref')
if pkgrefs:
# this is a Distribution or .dist file
pkgref_dict = {}
for ref in pkgrefs:
keys = ref.attributes.keys()
Expand Down

0 comments on commit c43a1e6

Please sign in to comment.