default=[],
help="Build the specified preset",
)
+ parser.add_argument(
+ "--nspawn-keep-unit",
+ action="store_true",
+ help=argparse.SUPPRESS,
+ )
+ parser.add_argument(
+ "--default",
+ help=argparse.SUPPRESS,
+ )
+ parser.add_argument(
+ "--cache",
+ metavar="PATH",
+ help=argparse.SUPPRESS,
+ )
last_section = None
return parser
+ def backward_compat_stubs(self, namespace: argparse.Namespace) -> None:
+ # These can be removed once mkosi v15 is available in LTS distros and compatibility with <= v14
+ # is no longer needed in build infrastructure (e.g.: OBS).
+ if getattr(namespace, "nspawn_keep_unit", None):
+ delattr(namespace, "nspawn_keep_unit")
+ print("Warning: --nspawn-keep-unit is no longer supported")
+
+ if getattr(namespace, "default", None):
+ delattr(namespace, "default")
+ print("Warning: --default is no longer supported")
+
+ if getattr(namespace, "cache", None):
+ delattr(namespace, "cache")
+ print("Warning: --cache is no longer supported")
+
def parse(self, argv: Optional[Sequence[str]] = None) -> tuple[MkosiArgs, tuple[MkosiConfig, ...]]:
presets = []
namespace = argparse.Namespace()
setattr(ns, s.dest, default)
+ # Manipulate some old settings to make them work with the new settings, for those typically used in
+ # infrastructure scripts rather than image-specific configuration.
+ self.backward_compat_stubs(namespace)
+
return args, tuple(load_config(ns) for ns in presets)