When an Apple-style package is installed, generates a receipt on the machine. Metapackages generate multiple receipts. The VMware AirWatch Admin Assistant adds the names and versions of those receipts to a receipts array in the pkginfo for a package. Following is a receipts array for the Avid LE QuickTime codecs, version 2.3.4.

                  
                  
    
<key>receipts</key>
<array>
<dict>
<key>filename</key>
<string>AvidCodecsLE.pkg</string>
<key>installed_size</key>
<integer>1188</integer>
<key>name</key>
<string>AvidCodecsLE</string>
<key>packageid</key>
<string>com.avid.avidcodecsle</string>
<key>version</key>
<string>2.3.4</string>
</dict>
</array>

If Munki is using the receipts array to determine installation status, it checks for the existence and the version of each receipt in the array. If any receipt is missing or has a lower version number than the version specified for that receipt in the receipts array, the item is considered not installed. Only if every receipt is present and all versions are the same as the ones in the pkginfo (or higher) is the item considered installed. To troubleshoot issues, use the pkgutil tool to examine the installed receipts.

                  
                  
    
# pkgutil --pkg-info com.avid.avidcodecsle
No receipt for 'com.avid.avidcodecsle' found at '/'.

In this case, the receipt for the Avid LE QuickTime codecs was not found on this machine. A common complication with receipts is, with many metapackages, the installation logic results in only a subset of the subpackages being installed. Generally, the receipts list contains a receipt for every subpackage in a metapackage (and needs this info if Munki is asked to remove the software item based on package receipts). But if it is normal and expected that not every subpackage will actually be installed, Munki will continually mark the item as not currently installed and offer to install it again and again. One solution for this issue is to add an optional key with the value of true to the receipts that are optionally installed. Munki will then not consider these receipts when determining installation status.

                  
                  
    
<key>receipts</key>
<array>
<dict>
<key>filename</key>
<string>mandatory.pkg</string>
<key>installed_size</key>
<integer>1188</integer>
<key>name</key>
<string>Mandatory</string>
<key>packageid</key>
<string>com.foo.mandatory</string>
<key>version</key>
<string>1.0</string>
</dict>
<dict>
<key>filename</key>
<string>optional.pkg</string>
<key>installed_size</key>
<integer>1188</integer>
<key>name</key>
<string>Optional</string>
<key>optional</key>
<true/>
<key>packageid</key>
<string>com.foo.optional</string>
<key>version</key>
<string>1.0</string>
</dict>
</array>

Another solution for this situation is to provide an installs array that lists items that are installed by the package. Munki can use installs array information instead of the receipts to determine installation status.