swh.loader.package.aur.loader module#
- class swh.loader.package.aur.loader.AurPackageInfo(url: str, filename: str | None, name: str, version: str, last_modified: str, *, directory_extrinsic_metadata: List[RawExtrinsicMetadataCore] = [], checksums: Dict[str, str] = {})[source]#
Bases:
BasePackageInfo
Method generated by attrs for class AurPackageInfo.
- name#
Name of the package
- version#
Current version
- last_modified#
File last modified date as release date
- swh.loader.package.aur.loader.extract_intrinsic_metadata(dir_path: Path) Dict[str, Any] [source]#
Extract intrinsic metadata from .SRCINFO file at dir_path.
Each Aur package has a .SRCINFO file at the root of the archive.
- Parameters:
dir_path – A directory on disk where a package has been extracted
- Returns:
A dict mapping
- class swh.loader.package.aur.loader.AurLoader(storage: StorageInterface, url: str, artifacts: List[Dict[str, Any]], aur_metadata: List[Dict[str, Any]], **kwargs)[source]#
Bases:
PackageLoader
[AurPackageInfo
]- Loader’s constructor. This raises exception if the minimal required
configuration is missing (cf. fn:check method).
- Parameters:
storage – Storage instance
url – Origin url to load data from
- get_versions() Sequence[str] [source]#
Get all released versions of an Aur package
- Returns:
A sequence of versions
Example:
["0.1.1", "0.10.2"]
- get_default_version() str [source]#
Get the newest release version of an Aur package
- Returns:
A string representing a version
Example:
"0.1.2"
- get_package_info(version: str) Iterator[Tuple[str, AurPackageInfo]] [source]#
Get release name and package information from version
- Parameters:
version – aur version (e.g: “0.1.0”)
- Returns:
Iterator of tuple (release_name, p_info)
- build_release(p_info: AurPackageInfo, uncompressed_path: str, directory: bytes) Release | None [source]#
Build the release from the archive metadata (extrinsic artifact metadata) and the intrinsic metadata.
- Parameters:
p_info – Package information
uncompressed_path – Artifact uncompressed path on disk