class documentation

class RpmGitRepository(PkgGitRepository):

View In Hierarchy

A git repository that holds the source of an RPM package

Static Method version_to_tag Generate a tag from a given format and a version
Method __init__ Undocumented
Method find_version Check if a certain version is stored in this repo and return the SHA1 of the related commit. That is, an annotated tag is dereferenced to the commit object it points to.
Method has_pristine_tar_branch Whether the repo has a pristine-tar branch.
Instance Variable pristine_tar Undocumented
Property pristine_tar_branch The name of the pristine-tar branch, whether it already exists or not.
Static Method _sanitize_tag sanitize a version so git accepts it as a tag

Inherited from PkgGitRepository:

Static Method sanitize_prefix Make sure git-archive prefix ends with a slash
Method archive_comp Create a compressed source tree archive with the given options
Method _archive_comp_single Create a compressed source tree archive without submodules
Method _archive_comp_submodules Create a compressed source tree archive with submodules.
@staticmethod
def version_to_tag(format, str_fields):

Generate a tag from a given format and a version

Parameters
format:strtag pattern
str_fields:dict of strarguments for format string ('upstreamversion', 'release', 'vendor'...)
Returns

version tag

>>> RpmGitRepository.version_to_tag("packaging/%(version)s", dict(epoch='0', upstreamversion='0~0'))
'packaging/0%0_0'
>>> RpmGitRepository.version_to_tag("%(vendor)s/v%(version)s", dict(upstreamversion='1.0', release='2', vendor="myvendor"))
'myvendor/v1.0-2'
def __init__(self, path):

Undocumented

def find_version(self, format, str_fields):

Check if a certain version is stored in this repo and return the SHA1 of the related commit. That is, an annotated tag is dereferenced to the commit object it points to.

Parameters
format:strtag pattern
str_fields:dict of strarguments for format string ('upstreamversion', 'release', 'vendor'...)
Returns
sha1 of the commit the tag references to
def has_pristine_tar_branch(self):

Whether the repo has a pristine-tar branch.

Returns
BoolTrue if the repo has pristine-tar commits already, False otherwise
pristine_tar =
@property
pristine_tar_branch =

The name of the pristine-tar branch, whether it already exists or not.

@staticmethod
def _sanitize_tag(tag):

sanitize a version so git accepts it as a tag

>>> RpmGitRepository._sanitize_tag("0.0.0")
'0.0.0'
>>> RpmGitRepository._sanitize_tag("0.0~0")
'0.0_0'
>>> RpmGitRepository._sanitize_tag("0:0.0")
'0%0.0'
>>> RpmGitRepository._sanitize_tag("0%0~0")
'0%0_0'