def METHOD_NAME(source, registry, omnijar_name=None):
    """
    Transform a jar chrome or omnijar packaged directory into a flat package.
    The given registry is filled with the flat package.
    """
    finder = UnpackFinder(source, omnijar_name)
    packager = SimplePackager(FlatFormatter(registry))
    for p, f in finder.find("*"):
        packager.add(p, f)
    packager.close()