diff --git a/scripts/gen_config.py b/scripts/gen_config.py index e5755ab358..3de714ec03 100755 --- a/scripts/gen_config.py +++ b/scripts/gen_config.py @@ -73,6 +73,11 @@ def load_yaml(fname: str, profile: dict): if not f.get("feed") or not f.get("packages"): die(f"Found bad additional_packages {f}") profile["additional_packages"].extend(new.get(n)) + elif n in {"include"}: + profile["include"].extend(new.get(n)) + elif n in {"packages_remove"}: + profile["packages_remove"].extend(new.get(n)) + return profile if not profile_file.is_file(): @@ -157,11 +162,16 @@ profile = { "feeds": {}, "packages": [], "profiles": [], + "include": [], + "packages_remove": [], } for p in sys.argv[1:]: profile = load_yaml(p, profile) +for p in profile.get("include", []): + profile = load_yaml(p, profile) + if getenv("GENCONFIG_VERBOSE"): print(yaml.dump(profile)) @@ -236,6 +246,10 @@ for ap in profile.get("additional_packages"): config_output += f"{profile.get('diffconfig', '')}" +for package in profile.get("packages_remove", []): + print(f"Remove package from .config: {package}") + config_output += f"# CONFIG_PACKAGE_{package} is not set\n" + Path(".config").write_text(config_output) print("Configuration written to .config")