Exemplo n.º 1
0
def buildpackage(os_release=None, name=None, upload=True, ubuntu_release=None):
    """Build a package for the current repository."""
    git.assert_in_repository()
    version = git_version()
    current_branch = git.current_branch()
    if os_release is None:
        os_release = parse_openstack_release(current_branch)
    deb_branch = discover_debian_branch(current_branch, version, os_release)
    with git.temporary_merge(deb_branch) as merge:
        source_package = dpkg_parsechangelog()
        current_version = source_package["Version"]
        version['debian'] = get_debian_commit_number()
        if ubuntu_release:
            dist = ubuntu_release
        else:
            dist = pbuilder.dist_from_release(os_release)
        dist_release = pbuilder.get_build_env(os_release, ubuntu_release)
        version['distribution'] = dist
        release_version = debian_version(current_version, version)
        local("dch -v {0} -D {1} --force-distribution 'Released'"
              .format(release_version, dist_release))
        local("git add debian/changelog")
        local("git commit -m \"{0}\"".format("Updated Changelog"))
        git_buildpackage(current_branch, upstream_tree=merge.old_head,
                         release=os_release, name=name,
                         ubuntu_release=ubuntu_release)
        # Regenerate the source package information since it's changed
        # since we updated the changelog.
        source_package = dpkg_parsechangelog()
        changes = changes_filepath(source_package)
    if upload:
        execute(uploadpackage, changes)
Exemplo n.º 2
0
def buildpackage(os_release=None, upload=True):
    """Build a package for the current repository."""
    git.assert_in_repository()
    version = git_version()
    current_branch = git.current_branch()
    if os_release is None:
        os_release = parse_openstack_release(current_branch)
    deb_branch = discover_debian_branch(current_branch, version, os_release)
    with git.temporary_merge(deb_branch) as merge:
        source_package = dpkg_parsechangelog()
        current_version = source_package["Version"]
        version['debian'] = get_debian_commit_number()
        dist = dist_from_release(os_release)
        version['distribution'] = dist
        release_version = debian_version(current_version, version)
        local("dch -v {0} -D {1}-{2} --force-distribution 'Released'".format(
            release_version, dist, os_release))
        local("git add debian/changelog")
        local("git commit -m \"{0}\"".format("Updated Changelog"))
        git_buildpackage(current_branch,
                         upstream_tree=merge.old_head,
                         release=os_release)
        # Regenerate the source package information since it's changed
        # since we updated the changelog.
        source_package = dpkg_parsechangelog()
        changes = changes_filepath(source_package)
    if upload:
        execute(uploadpackage, changes)
Exemplo n.º 3
0
def buildbackport(os_release=None, name=None, revision=1, upload=True):
    """Build a package from a downloaded deb source."""
    assert os.path.exists('debian/'), "can't find debian directory."
    source_package = dpkg_parsechangelog()
    current_version = source_package["Version"]
    if not os_release:
        os_release = pbuilder.STABLE_RELEASE
    dist = pbuilder.dist_from_release(os_release)
    release_version = backport_version(current_version, revision)
    if 'nectar' not in current_version:
        local("dch -v {0} -D {1}-{2} --force-distribution 'Backported'"
              .format(release_version, dist, os_release))
    pbuilder_buildpackage(release=os_release, name=name)
    if upload:
        # Regenerate the source package information since it's changed
        # since we updated the changelog.
        source_package = dpkg_parsechangelog()
        changes = changes_filepath(source_package)
        execute(uploadpackage, changes)
Exemplo n.º 4
0
def buildbackport(os_release=None, revision=1, upload=True):
    """Build a package from a downloaded deb source."""
    assert os.path.exists('debian/'), "can't find debian directory."
    source_package = dpkg_parsechangelog()
    current_version = source_package["Version"]
    if not os_release:
        os_release = STABLE_RELEASE
    dist = dist_from_release(os_release)
    release_version = backport_version(current_version, revision)
    if 'nectar' not in current_version:
        local("dch -v {0} -D {1}-{2} --force-distribution 'Backported'".format(
            release_version, dist, os_release))
    pbuilder_buildpackage(release=os_release)
    if upload:
        # Regenerate the source package information since it's changed
        # since we updated the changelog.
        source_package = dpkg_parsechangelog()
        changes = changes_filepath(source_package)
        execute(uploadpackage, changes)
Exemplo n.º 5
0
def promote(package_name,
            release='%s-%s' % (
                pbuilder.dist_from_release(pbuilder.STABLE_RELEASE),
                pbuilder.STABLE_RELEASE)):
    execute(repo.cp_package, package_name, release + '-testing', release)
Exemplo n.º 6
0
def promote(package_name,
            release='%s-%s' %
            (dist_from_release(STABLE_RELEASE), STABLE_RELEASE)):
    execute(repo.cp_package, package_name, release + '-testing', release)