help="Set version for image",
paths=("mkosi.version",),
path_read_text=True,
- scope=SettingScope.universal,
+ scope=SettingScope.inherit,
),
ConfigSetting(
dest="image_id",
section="Output",
specifier="i",
help="Set ID for image",
- scope=SettingScope.universal,
+ scope=SettingScope.inherit,
),
ConfigSetting(
dest="split_artifacts",
- `CacheDirectory=`
- `PackageCacheDirectory=`
- `BuildDirectory=`
-- `ImageId=`
-- `ImageVersion=`
- `SectorSize=`
- `RepartOffline=`
- `UseSubvolumes=`
- `ToolsTree=`
- `ToolsTreeCertificates=`
+There are also settings which are passed down to subimages but can
+be overridden. Currently the following settings are passed down to
+subimages but can be overridden:
+
+- `ImageId=`
+- `ImageVersion=`
+
Images can refer to outputs of images they depend on. Specifically,
for the following options, mkosi will only check whether the inputs
exist just before building the image:
"""
)
+ with (d / "mkosi.images" / "two.conf").open("a") as f:
+ f.write(
+ """
+ [Output]
+ ImageVersion=4.5.6
+ """
+ )
+
with chdir(d):
_, [one, two, config] = parse_config(["--package", "qed", "--build-package", "def", "--repositories", "cli"])
assert one.repositories == ["append", "epel", "epel-next", "cli"]
assert two.repositories == ["append", "epel", "epel-next", "cli"]
+ # Inherited settings should be passed down to subimages but overridable by subimages.
+ assert one.image_version == "1.2.3"
+ assert two.image_version == "4.5.6"
+
def test_parse_includes_once(tmp_path: Path) -> None:
d = tmp_path