MCPcopy Create free account
hub / github.com/archlinux/alpm / get_build_info

Function get_build_info

alpm-package/src/input.rs:287–293  ·  view source on GitHub ↗

Returns a [`BuildInfo`] from a BUILDINFO file in an input directory. # Errors Returns an error if - the file does not exist, - the file contents cannot be read to a buffer, - the hash digest of the file does not match that initially recorded in `mtree`, - or the file contents do not represent valid [`BuildInfo`] data.

(input_dir: &InputDir, mtree: &Mtree)

Source from the content-addressed store, hash-verified

285/// - the hash digest of the file does not match that initially recorded in `mtree`,
286/// - or the file contents do not represent valid [`BuildInfo`] data.
287fn get_build_info(input_dir: &InputDir, mtree: &Mtree) -> Result<BuildInfo, crate::Error> {
288 debug!("Check that a valid BUILDINFO file exists in {input_dir:?}.");
289
290 let (_path, buf) = compare_digests(mtree, input_dir, MetadataFileName::BuildInfo.as_ref())?;
291
292 BuildInfo::from_reader(buf.as_slice()).map_err(crate::Error::AlpmBuildInfo)
293}
294
295/// Returns a [`PackageInfo`] from a PKGINFO file in an input directory.
296///

Callers 1

try_fromMethod · 0.85

Calls 2

compare_digestsFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected