Reference
repopulator package
AlpinePackage
A package in AlpineRepo
fields
property
fields: Mapping[str, str]
Information about package stored in the repository index
The available fields are documented at: https://wiki.alpinelinux.org/wiki/Apk_spec#APKINDEX_Format
AlpineRepo
Generates Alpine apk repositories
description
property
description
Repository description
__init__
__init__(desc: str)
Constructor for AlpineRepo class
Parameters: |
|
---|
add_package
add_package(
path: str | PathLike[str],
force_arch: Optional[str] = None,
) -> AlpinePackage
Adds a package to the repository
Parameters: |
---|
Returns: |
|
---|
del_package
del_package(package: AlpinePackage)
Removes a package from this repository
It is not an error to pass a package that is not in a repository to this function. It will be ignored in such case.
Parameters: |
|
---|
export
export(
root: str | PathLike[str],
signer: PkiSigner,
signer_name: str,
now: Optional[datetime] = None,
keep_expanded: bool = False,
)
Export the repository into a given folder
This actually creates an on-disk repository suitable to serve to apk
clients. If the directory to export to
already exists the export process tries to handle pre-existing content there gracefully. Content that doesn't
conflict with repository content will be left alone. Content that does conflict will be removed or overwritten.
Specifically any existing
Parameters: |
|
---|
AptDistribution
A distribution in AptRepo
Attributes: |
|
---|
__init__
__init__(
path: PurePosixPath,
origin: Optional[str],
label: Optional[str],
suite: Optional[str],
codename: Optional[str],
version: Optional[str],
description: Optional[str],
) -> None
Internal, do not use. Use AptRepo.add_distribution to create instances of this class
packages
packages(component: str, arch: str) -> Sequence[AptPackage]
Architectures for a given component and architecture
AptPackage
A package in AptRepo
AptRepo
Generates APT repositories
__init__
__init__()
Constructor for AptRepo class
add_distribution
add_distribution(
path: PurePosixPath | str,
*,
origin: Optional[str] = None,
label: Optional[str] = None,
suite: Optional[str] = None,
codename: Optional[str] = None,
version: Optional[str] = None,
description: Optional[str] = None
) -> AptDistribution
Adds a new distribution to the repository
Parameters: |
|
---|
Returns: |
|
---|
add_package
add_package(path: str | PathLike[str]) -> AptPackage
Adds a package to the repository
Adding a package to the repository simply adds it to the pool of available packages. After doing that you need to add the returned package to one or more distributions to make it available to repository clients.
Parameters: |
---|
Returns: an AptPackage object for the added package
assign_package
assign_package(
package: AptPackage,
dist: AptDistribution,
component: str,
)
Assigns a repository package to a distribution's component
Parameters: |
|
---|
del_distribution
del_distribution(dist: AptDistribution)
Removes a distribution from the repository.
If the distribution is not in this repo the function ignores it and succeeds
Parameters: |
|
---|
del_package
del_package(package: AptPackage)
Removes a package from this repository
The package is removed from the repository and all distributions in it. It is not an error to pass a package that is not in a repository to this function. It will be ignored in such case.
Parameters: |
|
---|
export
export(
root: str | PathLike[str],
signer: PgpSigner,
now: Optional[datetime] = None,
)
Export the repository into a given folder.
This actually creates an on-disk repository suitable to serve to APT clients. If the directory to export to already exists the export process tries to handle pre-existing content there gracefully. Content that doesn't conflict with repository content will be left alone. Content that does conflict will be removed or overwritten.
Specifically:
- any existing pool/*.deb files will be removed and replaced with the ones from the repository.
- 'dists' subdirectory will be completely erased and replaced with exported content
Parameters: |
|
---|
unassign_package
unassign_package(
package: AptPackage,
dist: AptDistribution,
component: Optional[str] = None,
)
Removes a repository package from a distribution's component
If the package or distribution are not in this repository or the package is not assigned to the distribution's component the call is silently ignored.
Parameters: |
|
---|
FreeBSDPackage
A package in FreeBSDRepo
FreeBSDRepo
Generates FreeBSD pkg repositories
__init__
__init__()
Constructor for FreeBSDRepo class
add_package
add_package(path: str | PathLike[str]) -> FreeBSDPackage
del_package
del_package(package: FreeBSDPackage)
Removes a package from this repository
It is not an error to pass a package that is not in a repository to this function. It will be ignored in such case.
Parameters: |
|
---|
export
export(
root: str | PathLike[str],
signer: PkiSigner,
now: Optional[datetime] = None,
keep_expanded: bool = False,
)
Export the repository into a given folder
This actually creates an on-disk repository suitable to serve to pkg
clients. If the directory to export to
already exists the export process tries to handle pre-existing content there gracefully. Content that doesn't
conflict with repository content will be left alone. Content that does conflict will be removed or overwritten.
Specifically any existing All/*.pkg files will be removed and replaced with the ones from the repository.
Parameters: |
|
---|
PacmanPackage
A package in PacmanRepo
fields
property
fields: Mapping[str, Any]
Information about package stored in the repository index
See https://repod.archlinux.page/repositories/sync_database.html#desc-v2 for information about available fields
PacmanRepo
Generates Pacman repositories
name
property
name
Repository name
__init__
__init__(name: str)
Constructor for AlpineRepo class
Parameters: |
|
---|
add_package
add_package(path: str | PathLike[str]) -> PacmanPackage
del_package
del_package(package: PacmanPackage)
Removes a package from this repository
It is not an error to pass a package that is not in a repository to this function. It will be ignored in such case.
Parameters: |
|
---|
export
export(
root: Path,
signer: PgpSigner,
now: Optional[datetime] = None,
keep_expanded: bool = False,
)
Export the repository into a given folder
This actually creates an on-disk repository suitable to serve to pacman
clients. If the directory to export to
already exists the export process tries to handle pre-existing content there gracefully. Content that doesn't
conflict with repository content will be left alone. Content that does conflict will be removed or overwritten.
Specifically any existing
Parameters: |
|
---|
PgpSigner
Implementation of PGP signing
Many repository formats rely on PGP signing and use this class for it.
This class simply delegates signing to gpg
executable that needs to be present on $PATH.
Unfortunately, currently there seems to be no good way to perform PGP signing in "pure Python".
You are required to supply key name and password for signing. Signing is done non-interactively without any user prompts.
__init__
__init__(
*,
key_name: str,
key_pwd: str,
homedir: Optional[str | PathLike[str]] = None
)
Constructor for PgpSigner class
Parameters: |
---|
export_public_key
export_public_key(path: Path)
Utility method to export the public key of the signing key into a file Args: path: path of the file to write the public key to
PkiSigner
Implementation of private key based signing
Many repository formats rely on private key signing and use this class for it.
The supplied key needs to be in PEM format. Its cryptographic type needs to be appropriate for the repository that it will be used for.
__init__
__init__(
priv_key_path: str | PathLike[str],
priv_key_passwd: Optional[str],
)
Constructor for PkiSigner class
The private key file is read once during the construction and not used again Args: priv_key_path: path to the private key file. The file must be in PEM format. priv_key_passwd: password for the key if it requires one.
get_alpine_signature
get_alpine_signature(path: Path)
Generate file signature in a format required by Alpine apk repositories
Only rsa keys are currently supported
Parameters: |
|
---|
Returns:
Signature as a bytes
object
get_free_bsd_signature
get_free_bsd_signature(path: Path)
Generate file signature in a format required by FreeBSD repositories
Private key type must be one of: rsa, ecdsa or eddsa
Args:
path: path of the file to sign
Returns:
Signature as a bytes
object
RpmPackage
A package in RpmRepo
fields
property
fields: ImmutableDict
Information about package stored in the repository index
RpmRepo
Generates RPM repositories
__init__
__init__()
Constructor for RpmRepo class
add_package
add_package(path: str | PathLike[str]) -> RpmPackage
del_package
del_package(package: RpmPackage)
Removes a package from this repository
It is not an error to pass a package that is not in a repository to this function. It will be ignored in such case.
Parameters: |
|
---|
export
export(
root: str | PathLike[str],
signer: PgpSigner,
now: Optional[datetime] = None,
keep_expanded: bool = False,
)
Export the repository into a given folder
This actually creates an on-disk repository suitable to serve to pacman
clients. If the directory to export to
already exists the export process tries to handle pre-existing content there gracefully. Content that doesn't
conflict with repository content will be left alone. Content that does conflict will be removed or overwritten.
Specifically any existing *.rpm files will be removed and replaced with the ones from the repository.
Parameters: |
|
---|
RpmVersion
Representation of RPM package version
Instances of this class are properly comparable (==
, !=
, <
, <=
, >
, >=
) and hashable.
The string representation of an RpmVersion object is the properly formatted version string
VersionKey
Representation of a package version
Package versions cannot be compared as simple strings. For example "1.10" should be bigger than "1.2". This class allows correct sematic comparisons for versions.
Instances of this class are properly comparable (==
, !=
, <
, <=
, >
, >=
) and hashable.
Logically a version key is a heterogeneous tuple of str
and int
elements.
__init__
__init__(*args)
Constructor for VersionKey class
Arguments are any number of version parts. Each part can be:
- a single
int
for a numeric part - an
str
orbytes
object for a string part
parse
staticmethod
parse(version: str) -> VersionKey
Parses the version key from a string
Parsing is always well defined for any string and never fails
Parameters: |
|
---|
Returns: parsed key
options: summary: modules: false