def METHOD_NAME(handle, filename):
    data = parse_lafile(handle)
    raw_dep_libs = data.get("dependency_libs", False)
    if not raw_dep_libs:
        return False, None
    original_libs = raw_dep_libs.split()
    rpaths, libs, libladirs, inherited_flags = [], [], [], []
    original_inherited_flags = data.get("inherited_linker_flags", [])
    for item in stable_unique(original_libs):
        if item.startswith("-l"):
            libs.append(item)
        elif item.endswith(".la"):
            base = basename(item)
            if base.startswith("lib"):
                # convert to -l; punt .la, and 'lib' prefix
                libs.append("-l" + base[3:-3])
                libladirs.append("-L" + dirname(item))
            else:
                libs.append(item)
        elif item.startswith("-L"):
            # this is heinous, but is what the script did.
            item = x11_sub(item)
            item = local_sub(item)
            item = pkgconfig1_sub(item)
            item = pkgconfig2_sub(item)
            libladirs.append(item)
        elif item.startswith("-R"):
            rpaths.append(item)
        elif flags_match(item):
            if inherited_flags:
                inherited_flags.append(item)
            else:
                libs.append(item)
        else:
            raise UnknownData(raw_dep_libs, item)
    libs = stable_unique(rpaths + libladirs + libs)
    inherited_flags = stable_unique(inherited_flags)
    if libs == original_libs and inherited_flags == original_inherited_flags:
        return False, None
    # must be prefixed with a space
    data["dependency_libs"] = " " + (" ".join(libs))
    if inherited_flags:
        # must be prefixed with a space
        data["inherited_flags"] = " " + (" ".join(inherited_flags))
    content = "\n".join(f"{k}='{v}'" for k, v in sorted(data.items()))
    return True, template % {"content": content, "file": filename}