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}; fn main() -> testresult::TestResult { 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()); Ok(()) }
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.