except KeyError:
return Compression.zst if parse_boolean(value) else Compression.none
+def config_parse_seed(value: Optional[str], old: Optional[str]) -> Optional[uuid.UUID]:
+ if not value or value == "random":
+ return None
+
+ try:
+ return uuid.UUID(value)
+ except ValueError:
+ die(f"{value} is not a valid UUID")
+
+
- def config_default_release(namespace: argparse.Namespace) -> str:
- # If we encounter Release in [Match] and no distribution has been set yet, configure the default
- # distribution as well since the default release depends on the selected distribution.
- if "distribution" not in namespace:
- setattr(namespace, "distribution", detect_distribution()[0])
+ def config_default_compression(namespace: argparse.Namespace) -> Compression:
+ if namespace.output_format == OutputFormat.cpio:
+ return Compression.xz if namespace.distribution.is_centos_variant() and int(namespace.release) <= 8 else Compression.zst
+ else:
+ return Compression.none
- d = getattr(namespace, "distribution")
+ def config_default_release(namespace: argparse.Namespace) -> str:
# If the configured distribution matches the host distribution, use the same release as the host.
hd, hr = detect_distribution()
- if d == hd and hr is not None:
+ if namespace.distribution == hd and hr is not None:
return hr
return {
are removed. Values prefixed with `!` can be globs to remove more than
one value.
+ If a setting's name in the configuration file is prefixed with `@`, it
+ configures the default value used for that setting if no explicit
+ default value is set. This can be used to set custom default values in
+ configuration files that can still be overridden by specifying the
+ setting explicitly via the CLI.
+
To conditionally include configuration files, the `[Match]` section can
-be used. Matches can use a pipe symbol ("|") after the equals sign
-("…=|…"), which causes the match to become a triggering match. The
+be used. Matches can use a pipe symbol (`|`) after the equals sign
+(`…=|…`), which causes the match to become a triggering match. The
config file will be included if the logical AND of all non-triggering
matches and the logical OR of all triggering matches is satisfied. To
negate the result of a match, prefix the argument with an exclamation