def get_linked_manifest(path, from_path, from_chrome, from_triple):
    if (path in chrome_recursion_buster):
        err.warning(err_id=('submain', 'populate_chrome_manifest', 'recursion'), warning='Linked manifest recursion detected.', description='A chrome registration file links back to itself. This can cause a multitude of issues.', filename=path)
        return
    if (path not in xpi_package):
        err.notice(err_id=('submain', 'populate_chrome_manifest', 'linkerr'), notice='Linked manifest could not be found.', description=('A linked manifest file could not be found in the package.', ('Path: %s' % path)), filename=from_path, line=from_triple['line'], context=from_chrome.context)
        return
    chrome_recursion_buster.add(path)
    manifest = ChromeManifest(xpi_package.read(path), path)
    for triple in manifest.triples:
        (yield triple)
        if (triple['subject'] == 'manifest'):
            subpath = triple['predicate']
            if (not subpath.startswith('/')):
                subpath = ('%s/%s' % ('/'.join(path.split('/')[:(- 1)]), subpath))
            subpath = subpath.lstrip('/')
            for subtriple in get_linked_manifest(subpath, path, manifest, triple):
                (yield subtriple)
    chrome_recursion_buster.discard(path)
def get_linked_manifest(path, from_path, from_chrome, from_triple):
    if (path in chrome_recursion_buster):
        err.warning(err_id=('submain', 'populate_chrome_manifest', 'recursion'), warning='Linked manifest recursion detected.', description='A chrome registration file links back to itself. This can cause a multitude of issues.', filename=path)
        return
    if (path not in xpi_package):
        err.notice(err_id=('submain', 'populate_chrome_manifest', 'linkerr'), notice='Linked manifest could not be found.', description=('A linked manifest file could not be found in the package.', ('Path: %s' % path)), filename=from_path, line=from_triple['line'], context=from_chrome.context)
        return
    chrome_recursion_buster.add(path)
    manifest = ChromeManifest(xpi_package.read(path), path)
    for triple in manifest.triples:
        (yield triple)
        if (triple['subject'] == 'manifest'):
            subpath = triple['predicate']
            if (not subpath.startswith('/')):
                subpath = ('%s/%s' % ('/'.join(path.split('/')[:(- 1)]), subpath))
            subpath = subpath.lstrip('/')
            for subtriple in get_linked_manifest(subpath, path, manifest, triple):
                (yield subtriple)
    chrome_recursion_buster.discard(path)