pub struct RepoDescFileV2 {Show 22 fields
pub file_name: PackageFileName,
pub name: Name,
pub base: PackageBaseName,
pub version: FullVersion,
pub description: PackageDescription,
pub groups: Vec<Group>,
pub compressed_size: CompressedSize,
pub installed_size: InstalledSize,
pub sha256_checksum: Sha256Checksum,
pub pgp_signature: Option<Base64OpenPGPSignature>,
pub url: Option<Url>,
pub license: Vec<License>,
pub arch: Architecture,
pub build_date: BuildDate,
pub packager: Packager,
pub replaces: Vec<PackageRelation>,
pub conflicts: Vec<PackageRelation>,
pub provides: Vec<RelationOrSoname>,
pub dependencies: Vec<RelationOrSoname>,
pub optional_dependencies: Vec<OptionalDependency>,
pub make_dependencies: Vec<PackageRelation>,
pub check_dependencies: Vec<PackageRelation>,
}Expand description
Representation of files following the alpm-repo-descv2 specification.
This file format is used to describe a single package entry within an alpm-repo-db.
It includes information such as the package’s name, version, architecture, and dependency relationships.
§Examples
use std::str::FromStr;
use alpm_repo_db::desc::RepoDescFileV2;
let desc_data = r#"%FILENAME%
example-meta-1.0.0-1-any.pkg.tar.zst
%NAME%
example-meta
%BASE%
example-meta
%VERSION%
1.0.0-1
%DESC%
An example meta package
%CSIZE%
4634
%ISIZE%
0
%SHA256SUM%
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
%URL%
https://example.org/
%LICENSE%
GPL-3.0-or-later
%ARCH%
any
%BUILDDATE%
1729181726
%PACKAGER%
Foobar McFooface <foobar@mcfooface.org>
"#;
// Parse a REPO DESC file in version 2 format.
let repo_desc = RepoDescFileV2::from_str(desc_data)?;
// Convert back to its canonical string representation.
assert_eq!(repo_desc.to_string(), desc_data);Fields§
§file_name: PackageFileNameThe file name of the package.
name: NameThe name of the package.
base: PackageBaseNameThe name of the package base, from which this package originates.
version: FullVersionThe version of the package.
description: PackageDescriptionThe description of the package.
Can be 0 or more characters.
groups: Vec<Group>The groups this package belongs to.
If the package does not belong to any group, this will be an empty list.
compressed_size: CompressedSizeThe compressed size of the package in bytes.
installed_size: InstalledSizeThe size of the uncompressed and unpacked package contents in bytes.
Multiple hard-linked files are only counted once.
sha256_checksum: Sha256ChecksumThe SHA256 checksum of the package file.
pgp_signature: Option<Base64OpenPGPSignature>The base64 encoded OpenPGP detached signature of the package file.
Optional in version 2.
url: Option<Url>The optional URL associated with the package.
license: Vec<License>Set of licenses under which the package is distributed.
Can be empty.
arch: ArchitectureThe architecture of the package.
build_date: BuildDateThe date at wchich the build of the package started.
packager: PackagerThe User ID of the entity, that built the package.
replaces: Vec<PackageRelation>Virtual components or packages that this package replaces upon installation.
Can be empty.
conflicts: Vec<PackageRelation>Virtual components or packages that this package conflicts with.
Can be empty.
provides: Vec<RelationOrSoname>Virtual components or packages that this package provides.
Can be empty.
dependencies: Vec<RelationOrSoname>Run-time dependencies required by the package.
Can be empty.
optional_dependencies: Vec<OptionalDependency>Optional dependencies that are not strictly required by the package.
Can be empty.
make_dependencies: Vec<PackageRelation>Dependencies for building the upstream software of the package.
Can be empty.
check_dependencies: Vec<PackageRelation>A dependency for running tests of the package’s upstream project.
Can be empty.
Trait Implementations§
Source§impl Clone for RepoDescFileV2
impl Clone for RepoDescFileV2
Source§impl Debug for RepoDescFileV2
impl Debug for RepoDescFileV2
Source§impl<'de> Deserialize<'de> for RepoDescFileV2
impl<'de> Deserialize<'de> for RepoDescFileV2
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for RepoDescFileV2
impl Display for RepoDescFileV2
Source§impl From<RepoDescFileV1> for RepoDescFileV2
impl From<RepoDescFileV1> for RepoDescFileV2
Source§fn from(v1: RepoDescFileV1) -> Self
fn from(v1: RepoDescFileV1) -> Self
Converts a RepoDescFileV1 into a RepoDescFileV2.
§Note
This drops the md5_checksum field of the RepoDescFileV1.
Source§impl FromStr for RepoDescFileV2
impl FromStr for RepoDescFileV2
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a RepoDescFileV2 from a string slice.
Parses the input according to the alpm-repo-descv2 specification and constructs a
structured RepoDescFileV2 representation.
§Examples
use std::str::FromStr;
use alpm_repo_db::desc::RepoDescFileV2;
let desc_data = r#"%FILENAME%
example-meta-1.0.0-1-any.pkg.tar.zst
%NAME%
example-meta
%BASE%
example-meta
%VERSION%
1.0.0-1
%DESC%
An example meta package
%CSIZE%
4634
%ISIZE%
0
%SHA256SUM%
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
%URL%
https://example.org/
%LICENSE%
GPL-3.0-or-later
%ARCH%
any
%BUILDDATE%
1729181726
%PACKAGER%
Foobar McFooface <foobar@mcfooface.org>
"#;
let repo_desc = RepoDescFileV2::from_str(desc_data)?;
assert_eq!(repo_desc.name.to_string(), "example-meta");§Errors
Returns an error if:
- the input cannot be parsed into valid sections,
- or required fields are missing or malformed.