Beispiel #1
0
def guess_version_from_upstream(repo, upstream_tag_format, cp):
    """
    Guess the version based on the latest version on the upstream branch
    """
    try:
        version = repo.debian_version_from_upstream(upstream_tag_format, epoch=cp.epoch)
        gbp.log.debug("Found upstream version %s." % version)
        if compare_versions(version, cp.version) > 0:
            return version
    except GitRepositoryError:
        gbp.log.debug("No upstream tag found")
    return None
Beispiel #2
0
def guess_version_from_upstream(repo, upstream_tag_format, cp):
    """
    Guess the version based on the latest version on the upstream branch
    """
    try:
        version = repo.debian_version_from_upstream(upstream_tag_format,
                                                    epoch=cp.epoch)
        gbp.log.debug("Found upstream version %s." % version)
        if compare_versions(version, cp.version) > 0:
            return version
    except GitRepositoryError:
        gbp.log.debug("No upstream tag found")
    return None
Beispiel #3
0
def guess_version_from_upstream(repo, upstream_tag_format, upstream_branch, cp):
    """
    Guess the version based on the latest version on the upstream branch.
    If the version in dch is already higher this function returns None.
    """
    try:
        version = repo.debian_version_from_upstream(upstream_tag_format,
                                                    upstream_branch,
                                                    epoch=cp.epoch,
                                                    debian_release=False)
        gbp.log.debug("Found upstream version %s." % version)
        if compare_versions(version, cp.version) > 0:
            return "%s-1" % version
    except GitRepositoryError as e:
        gbp.log.debug("No upstream tag found: %s" % e)
    return None
Beispiel #4
0
def guess_version_from_upstream(repo, upstream_tag_format, upstream_branch, cp):
    """
    Guess the version based on the latest version on the upstream branch.
    If the version in dch is already higher this function returns None.
    """
    try:
        version = repo.debian_version_from_upstream(upstream_tag_format,
                                                    upstream_branch,
                                                    epoch=cp.epoch,
                                                    debian_release=False)
        gbp.log.debug("Found upstream version %s." % version)
        if compare_versions(version, cp.version) > 0:
            return "%s-1" % version
    except GitRepositoryError as e:
        gbp.log.debug("No upstream tag found: %s" % e)
    return None
Beispiel #5
0
def guess_version_from_upstream(repo, upstream_tag_format, cp):
    """
    Guess the version based on the latest version on the upstream branch
    """
    pattern = upstream_tag_format % dict(version='*')
    try:
        tag = repo.find_tag('HEAD', pattern=pattern)
        version = repo.tag_to_version(tag, upstream_tag_format)
        if version:
            gbp.log.debug("Found upstream version %s." % version)
            if cp.has_epoch():
                version = "%s:%s" % (cp.epoch, version)
            if compare_versions(version, cp.version) > 0:
                return "%s-1" % version
    except GitRepositoryError:
        gbp.log.debug("No tag found matching pattern %s." % pattern)
    return None