]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add note to MkosiConfig documentation
authorPyfisch <pyfisch@posteo.org>
Fri, 9 Sep 2022 14:30:29 +0000 (16:30 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 10 Sep 2022 12:25:37 +0000 (14:25 +0200)
mkosi/backend.py
mkosi/machine.py

index 4a783084741248119631fd8aa117e5c6853555c1..25f024513b01854c90be74955b2d4a2862a88d35 100644 (file)
@@ -451,7 +451,12 @@ class PartitionTable:
 
 @dataclasses.dataclass(frozen=True)
 class MkosiConfig:
-    """Type-hinted storage for command line arguments."""
+    """Type-hinted storage for command line arguments.
+
+    Only user configuration is stored here while dynamic state exists in
+    MkosiState. If a field of the same name exists in both classes always
+    access the value from state.
+    """
 
     verb: Verb
     cmdline: List[str]
@@ -506,7 +511,6 @@ class MkosiConfig:
     skeleton_trees: List[Path]
     clean_package_metadata: Union[bool, str]
     remove_files: List[Path]
-    # Environment should not be used directly. Use MkosiState environment instead.
     environment: Dict[str, str]
     build_sources: Optional[Path]
     build_dir: Optional[Path]
index 2dbacd5cae1ce24e70db3f62d80261fccaed130e..ef3c05b841619988cfbaf02b7c8d02227051b97c 100644 (file)
@@ -117,10 +117,6 @@ class Machine:
         if needs_build(self.config):
             check_root()
             check_native(self.config)
-
-            # Useful if testing within Docker
-            if parse_boolean(os.getenv("MKOSI_TEST_NO_NAMESPACE", "0")):
-                raise unittest.SkipTest("Build test skipped due to environment variable.")
             init_namespace()
             build_stuff(self.config)