pub struct Package {Show 16 fields
pub name: Name,
pub description: Override<PackageDescription>,
pub url: Override<Url>,
pub changelog: Override<Changelog>,
pub licenses: Override<Vec<License>>,
pub install: Override<Install>,
pub groups: Override<Vec<String>>,
pub options: Override<Vec<MakepkgOption>>,
pub backups: Override<Vec<Backup>>,
pub architectures: Option<Vec<Architecture>>,
pub architecture_properties: BTreeMap<Architecture, PackageArchitecture>,
pub dependencies: Override<Vec<RelationOrSoname>>,
pub optional_dependencies: Override<Vec<OptionalDependency>>,
pub provides: Override<Vec<RelationOrSoname>>,
pub conflicts: Override<Vec<PackageRelation>>,
pub replaces: Override<Vec<PackageRelation>>,
}
Expand description
Package metadata based on a pkgname
section in SRCINFO data.
This struct only contains package specific overrides.
Only in combination with PackageBase
data a full view on a package’s metadata is possible.
All values and nested structs inside this struct, except the name
field, are either nested
Option
s (e.g. Override<Option<String>>
) or optional collections (e.g. Option<Vec>
).
This is due to the fact that all fields are overrides for the defaults set by the
PackageBase
struct.
- If a value is
Override::No
, this indicates that thePackageBase
’s value should be used. - If a value is
Override::Yes<None>
, this means that the value should be empty and thePackageBase
should be ignored. The same goes for collections in the sense ofOverride::Yes(Vec::new())
. - If a value is
Override::Yes(Some(value))
orOverride::Yes(vec![values])
, these values should then be used.
This struct merely contains the overrides that should be applied on top of the PackageBase to get the final definition of this package. Take a look at SourceInfoV1::packages_for_architecture on how to get the merged representation MergedPackage of a package.
Fields§
§name: Name
The alpm-package-name of the package.
description: Override<PackageDescription>
The (potentially overridden) description of the package.
url: Override<Url>
The (potentially overridden) upstream URL of the package.
changelog: Override<Changelog>
The (potentially overridden) relative path to a changelog file of the package.
licenses: Override<Vec<License>>
The (potentially overridden) list of licenses that apply to the package.
install: Override<Install>
The (potentially overridden) relative path to an alpm-install-scriptlet of the package.
groups: Override<Vec<String>>
The (potentially overridden) list of alpm-package-groups the package is part of.
options: Override<Vec<MakepkgOption>>
The (potentially overridden) list of build tool options used when building the package.
backups: Override<Vec<Backup>>
The (potentially overridden) list of relative paths to files in the package that should be backed up.
architectures: Option<Vec<Architecture>>
These are all override fields that may be architecture specific.
Despite being overridable, architectures
field isn’t of the Override
type, as it
cannot be cleared.
architecture_properties: BTreeMap<Architecture, PackageArchitecture>
The map of alpm-architecture specific overrides for package relations of a package.
dependencies: Override<Vec<RelationOrSoname>>
The (potentially overridden) list of run-time dependencies of the package.
optional_dependencies: Override<Vec<OptionalDependency>>
The (potentially overridden) list of optional dependencies of the package.
provides: Override<Vec<RelationOrSoname>>
The (potentially overridden) list of provisions of the package.
conflicts: Override<Vec<PackageRelation>>
The (potentially overridden) list of conflicts of the package.
replaces: Override<Vec<PackageRelation>>
The (potentially overridden) list of replacements of the package.
Implementations§
Source§impl Package
impl Package
Sourcepub fn from_parsed(
line_start: usize,
package_base_architectures: &Vec<Architecture>,
parsed: RawPackage,
errors: &mut Vec<SourceInfoError>,
) -> Self
pub fn from_parsed( line_start: usize, package_base_architectures: &Vec<Architecture>, parsed: RawPackage, errors: &mut Vec<SourceInfoError>, ) -> Self
Creates a new Package
instance from a RawPackage
.
§Parameters
line_start
: The number of preceding lines, so that error/lint messages can reference the correct lines.parsed
: TheRawPackage
representation of the SRCINFO data. The input guarantees that the keyword assignments have been parsed correctly, but not yet that they represent valid SRCINFO data as a whole.errors
: All errors and lints encountered during the creation of thePackage
.
§Errors
This function does not return a Result
, but instead relies on aggregating all lints,
warnings and errors in errors
.
This allows to keep the function call recoverable, so that all errors and lints can
be returned all at once.