pub struct Package {Show 16 fields
pub name: Name,
pub description: Option<Option<PackageDescription>>,
pub url: Option<Option<Url>>,
pub changelog: Option<Option<RelativePath>>,
pub licenses: Option<Vec<License>>,
pub install: Option<Option<RelativePath>>,
pub groups: Option<Vec<String>>,
pub options: Option<Vec<MakepkgOption>>,
pub backups: Option<Vec<RelativePath>>,
pub architectures: Option<HashSet<Architecture>>,
pub architecture_properties: HashMap<Architecture, PackageArchitecture>,
pub dependencies: Option<Vec<RelationOrSoname>>,
pub optional_dependencies: Option<Vec<OptionalDependency>>,
pub provides: Option<Vec<RelationOrSoname>>,
pub conflicts: Option<Vec<PackageRelation>>,
pub replaces: Option<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. Option<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
None
, this indicates that thePackageBase
’s value should be used. - If a value is
Some<None>
, this means that the value should be empty and thePackageBase
should be ignored. The same goes for collections in the sense ofSome(Vec::new())
. - If a value is
Some(Some(value))
orSome(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 SourceInfo::packages_for_architecture on how to get the merged representation MergedPackage of a package.
Fields§
§name: Name
§description: Option<Option<PackageDescription>>
§url: Option<Option<Url>>
§changelog: Option<Option<RelativePath>>
§licenses: Option<Vec<License>>
§install: Option<Option<RelativePath>>
§groups: Option<Vec<String>>
§options: Option<Vec<MakepkgOption>>
§backups: Option<Vec<RelativePath>>
§architectures: Option<HashSet<Architecture>>
These are all override fields that may be architecture specific.
architecture_properties: HashMap<Architecture, PackageArchitecture>
§dependencies: Option<Vec<RelationOrSoname>>
§optional_dependencies: Option<Vec<OptionalDependency>>
§provides: Option<Vec<RelationOrSoname>>
§conflicts: Option<Vec<PackageRelation>>
§replaces: Option<Vec<PackageRelation>>
Implementations§
Source§impl Package
impl Package
Sourcepub fn from_parsed(
line_start: usize,
package_base_architectures: &HashSet<Architecture>,
parsed: RawPackage,
errors: &mut Vec<SourceInfoError>,
) -> Self
pub fn from_parsed( line_start: usize, package_base_architectures: &HashSet<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.