daklib.tag2upload

functions related to handling uploads via tag2upload

@contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2025, Ansgar <ansgar@debian.org> @license: GNU General Public License version 2 or later

Functions

get_tag2upload_info_for_upload(upload)

extract tag2upload information for an upload

mangle_version_dep14(version)

mangle version according to DEP-14

parse_git_tag_info(value)

parse Git-Tag-Info field from .changes files

verify_and_parse_git_tag(tag, signature, *, ...)

verify and parse information from Git tag and its detached signature

Classes

GitTagInfo(tag, fp)

Tag(object, type, tag, tagger, message)

TagInfo(tag, metadata, signed_file)

Exceptions

HelperException

raised when the helper program returned an error or wrong information

class daklib.tag2upload.GitTagInfo(tag: 'str', fp: 'str')[source]
fp: str
tag: str
exception daklib.tag2upload.HelperException[source]

raised when the helper program returned an error or wrong information

class daklib.tag2upload.Tag(object: 'str', type: 'str', tag: 'str', tagger: 'str', message: 'str')[source]
message: str
object: str
tag: str
tagger: str
type: str
class daklib.tag2upload.TagInfo(tag: 'Tag', metadata: 'Metadata', signed_file: 'SignedFile')[source]
metadata: dict[str, Union[str, bool]]
signed_file: SignedFile
tag: Tag
daklib.tag2upload._call_helper(path: str) dict[source]
daklib.tag2upload._dgit_metadata(message: str) dict[str, Union[str, bool]][source]

extract dgit metadata from tag message

The metadata can be of the form keyword or keyword=value. For metadata without a value, we store True in the returned dict; otherwise the provided value is stored.

daklib.tag2upload._get_base64(d: Mapping, key: str) bytes[source]

retrieve key from the mapping and decode it as base64

Raises:

KeyError: when the requested key is not in the mapping ValueError: when the requested entry is not a string

daklib.tag2upload._parse_tag(data: bytes) Tag[source]

parse a Git tag

daklib.tag2upload.get_tag2upload_info_for_upload(upload: daklib.archive.ArchiveUpload) tuple[daklib.upload.HashedFile, TagInfo][source]

extract tag2upload information for an upload

daklib.tag2upload.mangle_version_dep14(version: str) str[source]

mangle version according to DEP-14

daklib.tag2upload.parse_git_tag_info(value: str) GitTagInfo[source]

parse Git-Tag-Info field from .changes files

daklib.tag2upload.verify_and_parse_git_tag(tag: bytes, signature: bytes, *, keyrings: Iterable[str]) TagInfo[source]

verify and parse information from Git tag and its detached signature

Raises:

daklib.gpg.GpgException: when signature is invalid ValueError: when passed information is syntactically invalid