swh.loader.package.arch.loader module#

class swh.loader.package.arch.loader.ArchPackageInfo(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 ArchPackageInfo.

name#

Name of the package

version#

Current version

last_modified#

File last modified date as release date

swh.loader.package.arch.loader.extract_intrinsic_metadata(dir_path: Path) Dict[str, Any][source]#

Extract intrinsic metadata from .PKGINFO file at dir_path.

Each Arch linux package has a .PKGINFO 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.arch.loader.ArchLoader(storage: StorageInterface, url: str, artifacts: List[Dict[str, Any]], arch_metadata: List[Dict[str, Any]], **kwargs)[source]#

Bases: PackageLoader[ArchPackageInfo]

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

visit_type: str = 'arch'#
get_versions() Sequence[str][source]#

Get all released versions of an Arch Linux 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 Arch Linux package

Returns:

A string representing a version

Example:

"0.1.2"

get_package_info(version: str) Iterator[Tuple[str, ArchPackageInfo]][source]#

Get release name and package information from version.

Note: This drops the length property which is provided as an approximated length in previous lister version. If provided that information must be exact otherwise the download step will fail.

Parameters:

version – arch version (e.g: “0.1.0”)

Returns:

Iterator of tuple (release_name, p_info)

build_release(p_info: ArchPackageInfo, 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