Commit 41032e02 authored by Jochen Sprickerhof's avatar Jochen Sprickerhof

Update upstream source from tag 'upstream/0.7.1'

Update to upstream version '0.7.1'
with Debian dir b11bfc4ba4472387e2c7ad2f7a9f7bd0c1731ed1
parents c492027a b0eddc9d
0.7.1 (2019-01-11 16:05:00 -0800)
---------------------------------
- Fix some bugs from python3 compatibility. `#505 <https://github.com/ros-infrastructure/bloom/pull/505>`_
0.7.0 (2019-01-10 09:45:00 -0800)
---------------------------------
- Quote files removed with `git rm -rf`. `#491 <https://github.com/ros-infrastructure/bloom/pull/491>`_
- Only consider rosdistros of the same type when looking for a repo name in recent distros. `#501 <https://github.com/ros-infrastructure/bloom/pull/501>`_
- Fix python 3 support for pull request generation. `#489 <https://github.com/ros-infrastructure/bloom/pull/489>`_
0.6.9 (2018-11-15 08:45:00 -0800)
---------------------------------
- Added Crystal Clemmys (crystal) to the list of ROS 2 rosdistros. `#495 <https://github.com/ros-infrastructure/bloom/pull/495>`_
......
......@@ -104,7 +104,7 @@ def _trim(config, force, directory):
items.append(item)
# Remove and .* files missed by 'git rm -rf *'
if len(items) > 0:
execute_command('git rm -rf ' + ' '.join(items), cwd=directory)
execute_command('git rm -rf ' + ' '.join(["'{}'".format(i) for i in items if i]), cwd=directory)
# Copy the sub directory back
for item in os.listdir(storage):
src = os.path.join(storage, item)
......
......@@ -228,7 +228,12 @@ def list_distributions():
return sorted(get_index().distributions.keys())
def get_most_recent(thing_name, repository):
def get_distribution_type(distro):
return get_index().distributions[distro].get('distribution_type')
def get_most_recent(thing_name, repository, reference_distro):
reference_distro_type = get_distribution_type(reference_distro)
distros_with_entry = {}
get_things = {
'release': lambda r: None if r.release_repository is None else r.release_repository,
......@@ -237,6 +242,10 @@ def get_most_recent(thing_name, repository):
}
get_thing = get_things[thing_name]
for distro in list_distributions():
# skip distros with a different type if the information is available
if reference_distro_type is not None:
if get_distribution_type(distro) != reference_distro_type:
continue
distro_file = get_distribution_file(distro)
if repository in distro_file.repositories:
thing = get_thing(distro_file.repositories[repository])
......@@ -345,7 +354,7 @@ def get_repo_uri(repository, distro):
info("Here is the url for a typical release repository on GitHub: https://github.com/ros-gbp/rviz-release.git")
# Calculate a reasonable default from the list of previous distros
info(fmt("@{gf}@!==> @|") + "Looking for a release of this repository in a different distribution...")
default_distro, default_release = get_most_recent('release', repository)
default_distro, default_release = get_most_recent('release', repository, distro)
default_release_repo_url = default_release.url if default_release else "press enter to abort"
if default_distro is not None:
warning("A different distribution, '{0}', released this repository.".format(default_distro))
......@@ -423,10 +432,24 @@ def get_relative_distribution_file_path(distro):
def generate_release_tag(distro):
return ('release/%s/{package}/{version}' % distro).encode('utf-8')
tag = ('release/%s/{package}/{version}' % distro)
if sys.version_info[0] < 3:
tag == tag.encode('utf-8')
return tag
def generate_ros_distro_diff(track, repository, distro, override_release_repository_url):
def convert_unicode_dict_to_str(d):
for key, value in d.items():
if type(key) == unicode:
del d[key]
key = key.encode('utf-8')
if type(value) == unicode:
value = value.encode('utf-8')
if type(value) == dict:
convert_unicode_dict_to_str(value)
d[key] = value
global _user_provided_release_url
distribution_dict = get_distribution_file(distro).get_data()
# Get packages
......@@ -437,28 +460,28 @@ def generate_ros_distro_diff(track, repository, distro, override_release_reposit
track_dict = get_tracks_dict_raw()['tracks'][track]
last_version = track_dict['last_version']
release_inc = track_dict['release_inc']
version = '{0}-{1}'.format(last_version, release_inc).encode('utf-8')
version = '{0}-{1}'.format(last_version, release_inc)
# Create a repository if there isn't already one
if repository not in distribution_dict['repositories']:
distribution_dict['repositories'][repository] = {}
# Create a release entry if there isn't already one
if 'release' not in distribution_dict['repositories'][repository]:
distribution_dict['repositories'][repository]['release'.encode('utf-8')] = {
'url'.encode('utf-8'): override_release_repository_url or _user_provided_release_url
distribution_dict['repositories'][repository]['release'] = {
'url': override_release_repository_url or _user_provided_release_url
}
# Update the repository
repo = distribution_dict['repositories'][repository]['release']
# Consider the override
if override_release_repository_url is not None:
repo['url'.encode('utf-8')] = override_release_repository_url
repo['url'] = override_release_repository_url
if 'tags' not in repo:
repo['tags'.encode('utf-8')] = {}
repo['tags']['release'.encode('utf-8')] = generate_release_tag(distro)
repo['version'.encode('utf-8')] = version
repo['tags'] = {}
repo['tags']['release'] = generate_release_tag(distro)
repo['version'] = version
if 'last_release' in track_dict:
repo['upstream_tag'.encode('utf-8')] = track_dict['last_release']
repo['upstream_tag'] = track_dict['last_release']
if 'packages' not in repo:
repo['packages'.encode('utf-8')] = []
repo['packages'] = []
for path, pkg in packages.items():
if pkg.name not in repo['packages']:
repo['packages'].append(pkg.name)
......@@ -468,6 +491,8 @@ def generate_ros_distro_diff(track, repository, distro, override_release_reposit
if pkg_name not in packages_being_released:
repo['packages'].remove(pkg_name)
repo['packages'].sort()
if sys.version_info[0] < 3:
convert_unicode_dict_to_str(repo)
def get_repository_info_from_user(url_type, defaults=None):
data = {}
......@@ -521,7 +546,7 @@ def generate_ros_distro_diff(track, repository, distro, override_release_reposit
if not docs and maybe_continue(msg='Would you like to add documentation information for this repository?'):
defaults = None
info(fmt("@{gf}@!==> @|") + "Looking for a doc entry for this repository in a different distribution...")
default_distro, default_doc = get_most_recent('doc', repository)
default_distro, default_doc = get_most_recent('doc', repository, distro)
if default_distro is None:
warning("No existing doc entries found for use as defaults.")
else:
......@@ -544,7 +569,7 @@ def generate_ros_distro_diff(track, repository, distro, override_release_reposit
defaults = None
info(fmt("@{gf}@!==> @|") +
"Looking for a source entry for this repository in a different distribution...")
default_distro, default_source = get_most_recent('source', repository)
default_distro, default_source = get_most_recent('source', repository, distro)
if default_distro is None:
warning("No existing source entries found for use as defaults.")
else:
......@@ -604,7 +629,7 @@ def generate_ros_distro_diff(track, repository, distro, override_release_reposit
distro_file_name = get_relative_distribution_file_path(distro)
updated_distribution_file = rosdistro.DistributionFile(distro, distribution_dict)
distro_dump = yaml_from_distribution_file(updated_distribution_file)
distro_file_raw = load_url_to_file_handle(get_distribution_file_url(distro)).read()
distro_file_raw = load_url_to_file_handle(get_distribution_file_url(distro)).read().decode('utf-8')
if distro_file_raw != distro_dump:
# Calculate the diff
udiff = difflib.unified_diff(distro_file_raw.splitlines(), distro_dump.splitlines(),
......
......@@ -884,7 +884,7 @@ class DebianGenerator(BloomGenerator):
# Template files
template_files = process_template_files('.', subs)
# Remove any residual template files
execute_command('git rm -rf ' + ' '.join(template_files))
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
# Add changes to the debian folder
execute_command('git add debian')
# Commit changes
......
......@@ -763,7 +763,7 @@ class RpmGenerator(BloomGenerator):
# Template files
template_files = process_template_files('.', subs)
# Remove any residual template files
execute_command('git rm -rf ' + ' '.join(template_files))
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
# Add changes to the rpm folder
execute_command('git add ' + rpm_dir)
# Commit changes
......
......@@ -41,6 +41,7 @@ import base64
import datetime
import json
import socket
import sys
try:
......@@ -87,7 +88,10 @@ def do_github_post_req(path, data=None, auth=None, site='api.github.com'):
if data is None:
request = Request(url, headers=headers) # GET
else:
request = Request(url, data=json.dumps(data), headers=headers) # POST
data = json.dumps(data)
if sys.version_info[0] >= 3:
data = data.encode('utf-8')
request = Request(url, data=data, headers=headers) # POST
try:
response = urlopen(request, timeout=120)
......
......@@ -22,7 +22,7 @@ if sys.version_info[0] == 2 and sys.version_info[1] <= 6:
setup(
name='bloom',
version='0.6.9',
version='0.7.1',
packages=find_packages(exclude=['test', 'test.*']),
package_data={
'bloom.generators.debian': [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment