pub enum Resources {
SourceRepository {
package_build_source_info: SourceInfo,
source_info: SourceInfo,
},
Package {
package_info: PackageInfo,
build_info: BuildInfo,
},
BuildInfo(BuildInfo),
PackageInfo(PackageInfo),
PackageBuild(SourceInfo),
SourceInfo(SourceInfo),
}Expand description
The resources used by lints during a single lint run.
Variants§
SourceRepository
All resources of a package source repository.
Fields
package_build_source_info: SourceInfoThe SRCINFO file generated from the PKGBUILD.
We cannot lint the PKGBUILD directly, hence we have to convert it into a
SourceInfo representation first.
source_info: SourceInfoThe parsed SRCINFO file from the package source repository.
Package
All resources of a single package.
Fields
package_info: PackageInfoThe parsed PKGINFO file.
BuildInfo(BuildInfo)
A singular BUILDINFO file.
PackageInfo(PackageInfo)
A singular PKGINFO file.
PackageBuild(SourceInfo)
A singular PKGBUILD file.
We cannot lint the PKGBUILD directly, hence we have to convert it into a SourceInfo
representation first.
SourceInfo(SourceInfo)
A singular SRCINFO file.
Implementations§
Source§impl Resources
impl Resources
Sourcepub fn gather(path: &Path, scope: LintScope) -> Result<Self, Error>
pub fn gather(path: &Path, scope: LintScope) -> Result<Self, Error>
Creates a Resources from a file path and a LintScope.
Gathers all files and other resources in a path in the context of a scope.
All ALPM related files are detected by their well-known file names.
§Errors
Returns an error if:
- files that are required for a scope don’t exist,
- files cannot be opened or read,
- or files contain invalid data and/or cannot be parsed successfully.
Sourcepub fn gather_file(path: &Path, scope: LintScope) -> Result<Self, Error>
pub fn gather_file(path: &Path, scope: LintScope) -> Result<Self, Error>
Creates a Resources from a single file at a path and a LintScope.
Gathers a single file at path in the context of a scope.
Since the path is direct, the filename is not important for this function.
The type of metadata file is pre-determined by the LintScope.
§Errors
Returns an error if:
- a scope that requires more than a single file is provided,
- the metadata of the file at
pathcannot be retrieved, pathrepresents a directory,- the file cannot be opened or read,
- or the file contains invalid data and/or cannot be parsed.