#arch-linux #alpm #arch #packaging #linux

bin+lib alpm-mtree

Library and commandline toolkit for the specification, writing and parsing of ALPM .MTREE files

1 unstable release

new 0.1.0 Feb 28, 2025

#803 in Parser implementations

Apache-2.0 OR MIT and LGPL-3.0-or-later

45KB
738 lines

alpm-mtree

Documentation

Examples

Library

use alpm_mtree::mtree_v2::parse_mtree_v2;

let data = r#"#mtree
/set mode=644 uid=0 gid=0 type=file
./some_file time=1700000000.0 size=1337 sha256digest=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
./some_link type=link link=some_file time=1700000000.0
./some_dir type=dir time=1700000000.0
"#.to_string();

assert!(parse_mtree_v2(data).is_ok());

Commandline

Validate an .MTREE file.

alpm-mtree validate path/to/file

Parse an .MTREE file and output its contents as structured data.

alpm-mtree format ~/.cache/alpm/testing/packages/core/argon2-20190702-6-x86_64/.MTREE --output-format json --pretty

Features

  • cli adds the commandline handling needed for the almp-mtree binary (enabled by default).
  • winnow-debug enables the winnow/debug feature, which shows the exact parsing process of winnow.

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.

Dependencies

~8–19MB
~283K SLoC