MCPcopy Create free account
hub / github.com/bootc-dev/bootc / bootctl_systemd_version

Function bootctl_systemd_version

crates/lib/src/bootloader.rs:330–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

328
329#[context("Querying bootctl version")]
330pub(crate) fn bootctl_systemd_version() -> Result<u32> {
331 static VERSION: OnceLock<u32> = OnceLock::new();
332
333 if let Some(v) = VERSION.get() {
334 return Ok(*v);
335 };
336
337 let out = Command::new("bootctl").arg("--version").run_get_string()?;
338 let v = parse_systemd_version(&out).context("Failed to parse version to integer")?;
339
340 let version = VERSION.get_or_init(|| v);
341
342 Ok(*version)
343}
344
345/// Parse the systemd major version from `bootctl --version` output, whose first
346/// line looks like `systemd 259 (259.5-0ubuntu3)`.

Callers 2

install_systemd_bootFunction · 0.85
for_bootloaderMethod · 0.85

Calls 3

parse_systemd_versionFunction · 0.85
argMethod · 0.80
run_get_stringMethod · 0.45

Tested by

no test coverage detected