def METHOD_NAME(text, solver):
    parser = argparse.ArgumentParser()
    parser.add_argument("--optional", action="store_true", default=False)
    parser.add_argument("--except", dest="excludes", action="append")
    parser.add_argument("packages", help="The template to process", nargs="*")
    packages = []
    for line in text:
        cmd, args = line[0], parser.parse_args(line[1:])
        if cmd != "installpkg":
            print(f"{cmd} ignored", file=sys.stderr)
            continue
        pkgs = solver.install(args.packages, None, args.optional)
        packages += pkgs
    return packages