def getInstalledPackages():
    #global INSTALLEDPKGS

    # we use the --regexp option to pkgutil to get it to return receipt
    # info for all installed packages.  Huge speed up.
    proc = subprocess.Popen(['/usr/sbin/pkgutil', '--regexp',
                             '--pkg-info-plist', '.*'], bufsize=8192,
                            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (out, dummy_err) = proc.communicate()
    while out:
        (pliststr, out) = munkicommon.getFirstPlist(out)
        if pliststr:
            plist = FoundationPlist.readPlistFromString(pliststr)
            if 'pkg-version' in plist and 'pkgid' in plist:
                INSTALLEDPKGS[plist['pkgid']] = (
                    plist['pkg-version'] or '0.0.0.0.0')
        else:
            break

    # Now check /Library/Receipts
    receiptsdir = '/Library/Receipts'
    if os.path.exists(receiptsdir):
        installitems = munkicommon.listdir(receiptsdir)
        for item in installitems:
            if item.endswith('.pkg'):
                pkginfo = munkicommon.getOnePackageInfo(
                    os.path.join(receiptsdir, item))
                pkgid = pkginfo.get('packageid')
                thisversion = pkginfo.get('version')
                if pkgid:
                    if not pkgid in INSTALLEDPKGS:
                        INSTALLEDPKGS[pkgid] = thisversion
                    else:
                        # pkgid is already in our list. There must be
                        # multiple receipts with the same pkgid.
                        # in this case, we want the highest version
                        # number, since that's the one that's
                        # installed, since presumably
                        # the newer package replaced the older one
                        storedversion = INSTALLEDPKGS[pkgid]
                        if (munkicommon.MunkiLooseVersion(thisversion) >
                                munkicommon.MunkiLooseVersion(storedversion)):
                            INSTALLEDPKGS[pkgid] = thisversion

    #ManagedInstallDir = munkicommon.pref('ManagedInstallDir')
    #receiptsdatapath = os.path.join(ManagedInstallDir, 'FoundReceipts.plist')
    #try:
    #   FoundationPlist.writePlist(INSTALLEDPKGS, receiptsdatapath)
    #except FoundationPlist.NSPropertyListWriteException:
    #   pass
Only one of ``nodes`` and ``changeset`` may be given. Passing both
dataset/ETHPy150Open munki/munki/code/client/munkilib/updatecheck.py/getInstalledPackages--crossover with--dataset/ETHPy150Open codeinn/vcs/vcs/nodes.py/DirNode.__init__