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)
| 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. |
| 287 | fn 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 | /// |
no test coverage detected