def METHOD_NAME(ctx):
    """Core implementation of passwd_tar."""
    f = "".join(["%s:x:%s:%s:%s:%s:%s\n" % (
        entry[PasswdFileContentProviderInfo].username,
        entry[PasswdFileContentProviderInfo].uid,
        entry[PasswdFileContentProviderInfo].gid,
        entry[PasswdFileContentProviderInfo].info,
        entry[PasswdFileContentProviderInfo].home,
        entry[PasswdFileContentProviderInfo].shell,
    ) for entry in ctx.attr.entries])
    passwd_file = ctx.actions.declare_file(ctx.label.name)
    ctx.actions.write(output = passwd_file, content = f)
    _build_homedirs_tar(ctx, passwd_file)
    return DefaultInfo(files = depset([ctx.outputs.passwd_tar]))