Expand description
§alpm-files
A specification, library and command line tool for the handling of Arch Linux Package Management (ALPM) files files (alpm-files).
§Documentation
- https://alpm.archlinux.page/rustdoc/alpm_files/ for development version of the crate.
- https://docs.rs/alpm-files/latest/alpm_files/ for released version of the crate.
§Examples
§Library
use std::{path::PathBuf, str::FromStr};
use alpm_files::{Files, FilesV1};
let data = r#"%FILES%
usr/
usr/bin/
usr/bin/foo
"#;
let paths = vec![
PathBuf::from("usr/"),
PathBuf::from("usr/bin/"),
PathBuf::from("usr/bin/foo"),
];
// Create a Files from a string.
let files_from_str = Files::V1(FilesV1::from_str(data)?);
// Create a Files from list of paths.
let files_from_paths = Files::V1(FilesV1::try_from(paths)?);
assert_eq!(files_from_str.as_ref(), files_from_paths.as_ref());§Command line interface
# Create an alpm-files file from an input directory.
alpm-files create "$ALPM_FILES_CREATE_INPUT_DIR"# Format an alpm-files file as JSON.
alpm-files format --input-file "$ALPM_FILES_FORMAT_INPUT_FILE" --pretty# Validate an alpm-files file.
alpm-files validate --input-file "$ALPM_FILES_VALIDATE_INPUT_FILE"§Contributing
Please refer to the contribution guidelines to learn how to contribute to this project.
§License
This project can be used under the terms of the Apache-2.0 or MIT. Contributions to this project, unless noted otherwise, are automatically licensed under the terms of both of those licenses.
Modules§
- error 🔒
- Error handling for alpm-files.
- files 🔒
- The representation of alpm-files files.
- schema 🔒
- Schema definition for the alpm-files format.
Structs§
- FilesV1
- The representation of alpm-files data (version 1).
Enums§
- Error
- The error that can occur when working with the alpm-files format.
- Files
- The representation of alpm-files data.
- Files
Schema - A schema for the alpm-files format.
- Files
Style - The different styles of the alpm-files format.
Statics§
- LOCALES 🔒
Traits§
- Files
Style ToString - An interface to guarantee the creation of a
Stringbased on aFilesStyle.