Crate alpm_buildinfo

Source
Expand description

§alpm-buildinfo

A library and commandline toolkit for the specification, writing and parsing of Arch Linux Package Management (ALPM) BUILDINFO files.

BUILDINFO files describe the build environment of a package and carry various datasets, that help in reproducing the same package bit-by-bit.

§Documentation

§Examples

§Library

use std::str::FromStr;
use alpm_buildinfo::BuildInfoV2;
let buildinfo_data = r#"format = 2
pkgname = foo
pkgbase = foo
pkgver = 1:1.0.0-1
pkgarch = any
pkgbuild_sha256sum = b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
packager = Foobar McFooface <foobar@mcfooface.org>
builddate = 1
builddir = /build
buildenv = ccache
buildenv = color
options = lto
options = !strip
installed = bar-1.2.3-1-any
installed = beh-2.2.3-4-any
startdir = /startdir/
buildtool = devtools
buildtoolver = 1:1.2.1-1-any
"#;

assert!(BuildInfoV2::from_str(buildinfo_data).is_ok());

§Commandline

Create a BUILDINFO version 1 file using alpm-buildinfo:

alpm-buildinfo create v2 \
    --builddate 1 \
    --builddir /build \
    --buildenv ccache \
    --buildenv '!color' \
    --installed 'bar-1:1.0.1-15-any' \
    --installed 'beh-2.3-1-any' \
    --options lto \
    --options '!strip' \
    --packager 'Foobar McFooface <foobar@mcfooface.org>' \
    --pkgarch any \
    --pkgbase foo \
    --pkgbuild-sha256sum b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c \
    --pkgname foo \
    --pkgver 1.0.0-1 \
    --startdir /startdir/ \
    --buildtool devtools \
    --buildtoolver '1:1.2.1-1-any'

All options for alpm-buildinfo can also be provided as environment variables. The following is equivalent to the above:

BUILDINFO_BUILDDATE="1" \
BUILDINFO_BUILDDIR="/build" \
BUILDINFO_BUILDENV='ccache !color' \
BUILDINFO_INSTALLED="bar-1:1.0.1-15-any beh-2.3-1-any" \
BUILDINFO_OPTIONS='lto !strip' \
BUILDINFO_PACKAGER="Foobar McFooface <foobar@mcfooface.org>" \
BUILDINFO_PKGARCH="any" \
BUILDINFO_PKGBASE="foo" \
BUILDINFO_PKGBUILD_SHA256SUM="b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c" \
BUILDINFO_PKGNAME="foo" \
BUILDINFO_PKGVER="1.0.0-1" \
BUILDINFO_STARTDIR="/startdir/" \
BUILDINFO_BUILDTOOL="devtools" \
BUILDINFO_BUILDTOOLVER="1:1.2.1-1-any" \
alpm-buildinfo create v2

§Features

  • cli adds the commandline handling needed for the alpm-buildinfo 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.

Modules§

build_info 🔒
Handling of BuildInfo versions.
cli
Commandline argument handling. This is most likely not interesting for you.
commands
Commandline functions, that’re called by the alpm-buildinfo executable.
error 🔒
schema 🔒

Structs§

BuildInfoV1
BUILDINFO version 1
BuildInfoV2
BUILDINFO version 2

Enums§

BuildInfo
A representation of the BUILDINFO file format.
BuildInfoSchema
An enum describing all valid BUILDINFO schemas
Error
The Error that can occur when working with BUILDINFO files