Function create_mtree_file_from_input_dir

Source
pub fn create_mtree_file_from_input_dir(
    path: impl AsRef<Path>,
    bsdtar_options: BsdtarOptions,
) -> Result<PathBuf, Error>
Expand description

Creates an ALPM-MTREE file from a package input directory.

Collects all files in path relative to it in a newline-delimited string. Calls the bsdtar command, using options specific to a version of ALPM-MTREE to create an ALPM-MTREE file in path. Returns the path to the ALPM-MTREE file.

§Errors

Returns an error if

  • calling relative_files on path fails,
  • the bsdtar command can not be spawned in the background,
  • the bsdtar command’s stdin can not be attached to,
  • the bsdtar command’s stdin can not be written to,
  • calling the bsdtar command is not possible,
  • bsdtar returned a non-zero status code,
  • creating the ALPM-MTREE file fails,
  • or gzip compressing the ALPM-MTREE file fails.