[ros-bloom] 01/03: Imported Upstream version 0.5.21

Jochen Sprickerhof jspricke-guest at moszumanska.debian.org
Sat Jun 18 08:38:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

jspricke-guest pushed a commit to branch master
in repository ros-bloom.

commit 8f3b31991983351a0c02d3d6abd003cb80f0f921
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date:   Sat Jun 18 10:34:30 2016 +0200

    Imported Upstream version 0.5.21
---
 CHANGELOG.rst                                      |  9 ++++++
 bloom/commands/release.py                          | 16 ++++++-----
 bloom/config.py                                    | 10 +++++--
 bloom/generators/debian/generate_cmd.py            |  4 ++-
 bloom/generators/debian/generator.py               | 33 +++++++++++++++++++++-
 bloom/generators/debian/templates/control.em       |  4 +--
 bloom/generators/rosdebian.py                      |  4 ++-
 bloom/generators/rosrelease.py                     |  3 +-
 bloom/generators/rosrpm.py                         |  4 ++-
 bloom/generators/rpm/generate_cmd.py               |  4 ++-
 bloom/generators/rpm/templates/template.spec.em    |  1 +
 bloom/util.py                                      | 10 +++++++
 setup.py                                           |  2 +-
 stdeb.cfg                                          |  2 +-
 .../test_generators/test_debian/test_generator.py  | 19 +++++++++++++
 15 files changed, 105 insertions(+), 20 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f62e62f..144c417 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,12 @@
+0.5.21 (2016-03-04 18:30:00 -0800)
+----------------------------------
+- Debian pkg descriptions are now split into a synopsis and long description.
+- The Conflicts and Replaces fields were moved to the general section in the Debian control file.
+- Generated RPM's now explicitly set the library directory.
+- Added option to allow quiet exit when a given OS has no platforms in the rosdistro.
+- Added new default action item to generate for Debian (e.g. Jessie) in addition to Ubuntu and RPM.
+- Fixed unnecessary ``!!python/unicode`` tags being put in the tracks.yaml.
+
 0.5.20 (2015-04-23 15:00:00 -0800)
 ----------------------------------
 - Updated conditional for special GitHub commit handling logic to include raw.githubusercontent.com.
diff --git a/bloom/commands/release.py b/bloom/commands/release.py
index c3b69fa..5c928e1 100644
--- a/bloom/commands/release.py
+++ b/bloom/commands/release.py
@@ -262,7 +262,7 @@ def get_distribution_file(distro):
 _rosdistro_distribution_file_urls = {}
 
 
-def get_disitrbution_file_url(distro):
+def get_distribution_file_url(distro):
     global _rosdistro_distribution_file_urls
     if distro not in _rosdistro_distribution_file_urls:
         index = get_index()
@@ -309,7 +309,7 @@ def get_repo_uri(repository, distro):
         url = distribution_file.repositories[repository].release_repository.url
     else:
         error("Specified repository '{0}' is not in the distribution file located at '{1}'"
-              .format(repository, get_disitrbution_file_url(distro)))
+              .format(repository, get_distribution_file_url(distro)))
         matches = difflib.get_close_matches(repository, distribution_file.repositories)
         if matches:
             info(fmt("@{yf}Did you mean one of these: '" + "', '".join([m for m in matches]) + "'?"))
@@ -393,7 +393,7 @@ def list_tracks(repository, distro, override_release_repository_url):
 
 
 def get_relative_distribution_file_path(distro):
-    distribution_file_url = urlparse(get_disitrbution_file_url(distro))
+    distribution_file_url = urlparse(get_distribution_file_url(distro))
     index_file_url = urlparse(rosdistro.get_index_url())
     return os.path.relpath(distribution_file_url.path,
                            os.path.commonprefix([index_file_url.path, distribution_file_url.path]))
@@ -569,7 +569,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_disitrbution_file_url(distro)).read()
+    distro_file_raw = load_url_to_file_handle(get_distribution_file_url(distro)).read()
     if distro_file_raw != distro_dump:
         # Calculate the diff
         udiff = difflib.unified_diff(distro_file_raw.splitlines(), distro_dump.splitlines(),
@@ -765,7 +765,7 @@ def open_pull_request(track, repository, distro, interactive, override_release_r
     version = updated_distribution_file.repositories[repository].release_repository.version
     updated_distro_file_yaml = yaml_from_distribution_file(updated_distribution_file)
     # Determine if the distro file is hosted on github...
-    base_org, base_repo, base_branch, base_path = get_gh_info(get_disitrbution_file_url(distro))
+    base_org, base_repo, base_branch, base_path = get_gh_info(get_distribution_file_url(distro))
     if None in [base_org, base_repo, base_branch, base_path]:
         warning("Automated pull request only available via github.com")
         return
@@ -957,6 +957,7 @@ The packages in the `{repository}` repository were released into the \
         release_repo_url = reps[repository].release_repository.url
     msg += """
 Version of package(s) in repository `{repo}`:
+
 - upstream repository: {upstream_repo_url}
 - release repository: {release_repo_url}
 - rosdistro version: `{rosdistro_pv}`
@@ -964,6 +965,7 @@ Version of package(s) in repository `{repo}`:
 - new version: `{new_pv}`
 
 Versions of tools used:
+
 - bloom version: `{bloom_v}`
 - catkin_pkg version: `{catkin_pkg_v}`
 - rosdep version: `{rosdep_v}`
@@ -1242,7 +1244,7 @@ def perform_release(
         # Propose github pull request
         info(fmt("@{gf}@!==> @|") +
              "Generating pull request to distro file located at '{0}'"
-             .format(get_disitrbution_file_url(distro)))
+             .format(get_distribution_file_url(distro)))
         try:
             pull_request_url = open_pull_request(
                 track, repository, distro, interactive, override_release_repository_url
@@ -1254,7 +1256,7 @@ def perform_release(
             else:
                 info("The release of your packages was successful, but the pull request failed.")
                 info("Please manually open a pull request by editing the file here: '{0}'"
-                     .format(get_disitrbution_file_url(distro)))
+                     .format(get_distribution_file_url(distro)))
                 info(fmt(_error) + "No pull request opened.")
         except Exception as e:
             debug(traceback.format_exc())
diff --git a/bloom/config.py b/bloom/config.py
index d290ee9..f4a0b47 100644
--- a/bloom/config.py
+++ b/bloom/config.py
@@ -56,6 +56,7 @@ from bloom.logging import sanitize
 
 from bloom.util import execute_command
 from bloom.util import my_copytree
+from bloom.util import get_distro_list_prompt
 
 BLOOM_CONFIG_BRANCH = 'master'
 PLACEHOLDER_FILE = 'CONTENT_MOVED_TO_{0}_BRANCH'.format(BLOOM_CONFIG_BRANCH.upper())
@@ -116,7 +117,8 @@ This is used only when version is set to ':{auto}'.
 ''',
     },
     'ros_distro': {
-        '<ROS distro>': 'This can be any valid ROS distro, e.g. groovy, hydro'
+        '<ROS distro>': "This can be any valid ROS distro, e.g. %s" %
+                        get_distro_list_prompt()
     },
     'patches': {
         '<path in bloom branch>': '''\
@@ -198,7 +200,9 @@ DEFAULT_TEMPLATE = {
         'git-bloom-generate -y rosrelease :{ros_distro}'
         ' --source upstream -i :{release_inc}',
         'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
-        ' :{ros_distro} -i :{release_inc}',
+        ' :{ros_distro} -i :{release_inc} --os-name ubuntu',
+        'git-bloom-generate -y rosdebian --prefix release/:{ros_distro}'
+        ' :{ros_distro} -i :{release_inc} --os-name debian --os-not-required',
         'git-bloom-generate -y rosrpm --prefix release/:{ros_distro}'
         ' :{ros_distro} -i :{release_inc}'
     ]
@@ -238,7 +242,7 @@ def write_tracks_dict_raw(tracks_dict, cmt_msg=None, directory=None):
     cmt_msg = cmt_msg if cmt_msg is not None else 'Modified tracks.yaml'
     with inbranch(BLOOM_CONFIG_BRANCH):
         with open('tracks.yaml', 'w') as f:
-            f.write(yaml.dump(tracks_dict, indent=2, default_flow_style=False))
+            f.write(yaml.safe_dump(tracks_dict, indent=2, default_flow_style=False))
         execute_command('git add tracks.yaml', cwd=directory)
         execute_command('git commit --allow-empty -m "{0}"'.format(cmt_msg),
                         cwd=directory)
diff --git a/bloom/generators/debian/generate_cmd.py b/bloom/generators/debian/generate_cmd.py
index 019cee9..19d036d 100644
--- a/bloom/generators/debian/generate_cmd.py
+++ b/bloom/generators/debian/generate_cmd.py
@@ -46,6 +46,8 @@ from bloom.generators.debian.generator import generate_substitutions_from_packag
 from bloom.generators.debian.generator import place_template_files
 from bloom.generators.debian.generator import process_template_files
 
+from bloom.util import get_distro_list_prompt
+
 try:
     from rosdep2 import create_default_installer_context
 except ImportError:
@@ -72,7 +74,7 @@ def prepare_arguments(parser):
     add = parser.add_argument
     add('--os-name', help='OS name, e.g. ubuntu, debian')
     add('--os-version', help='OS version or codename, e.g. precise, wheezy')
-    add('--ros-distro', help='ROS distro, e.g. groovy, hydro (used for rosdep)')
+    add('--ros-distro', help="ROS distro, e.g. %s (used for rosdep)" % get_distro_list_prompt())
     return parser
 
 
diff --git a/bloom/generators/debian/generator.py b/bloom/generators/debian/generator.py
index dda8f43..f4f27e5 100644
--- a/bloom/generators/debian/generator.py
+++ b/bloom/generators/debian/generator.py
@@ -207,6 +207,29 @@ def format_depends(depends, resolved_deps):
     return formatted
 
 
+def format_description(value):
+    """
+    Format proper <synopsis, long desc> string following Debian control file
+    formatting rules. Treat first line in given string as synopsis, everything
+    else as a single, large paragraph.
+
+    Future extensions of this function could convert embedded newlines and / or
+    html into paragraphs in the Description field.
+
+    https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
+    """
+    value = debianize_string(value)
+    # NOTE: bit naive, only works for 'properly formatted' pkg descriptions (ie:
+    #       'Text. Text'). Extra space to avoid splitting on arbitrary sequences
+    #       of characters broken up by dots (version nrs fi).
+    parts = value.split('. ', 1)
+    if len(parts) == 1 or len(parts[1]) == 0:
+        # most likely single line description
+        return value
+    # format according to rules in linked field documentation
+    return "{0}.\n {1}".format(parts[0], parts[1].strip())
+
+
 def get_changelogs(package, releaser_history=None):
     if releaser_history is None:
         warning("No historical releaser history, using current maintainer name "
@@ -262,7 +285,7 @@ def generate_substitutions_from_package(
     # Name, Version, Description
     data['Name'] = package.name
     data['Version'] = package.version
-    data['Description'] = debianize_string(package.description)
+    data['Description'] = format_description(package.description)
     # Websites
     websites = [str(url) for url in package.urls if url.type == 'website']
     homepage = websites[0] if websites else ''
@@ -502,6 +525,9 @@ class DebianGenerator(BloomGenerator):
             help="overrides the default installation prefix (/usr)")
         add('--os-name', default='ubuntu',
             help="overrides os_name, set to 'ubuntu' by default")
+        add('--os-not-required', default=False, action="store_true",
+            help="Do not error if this os is not in the platforms "
+                 "list for rosdistro")
 
     def handle_arguments(self, args):
         self.interactive = args.interactive
@@ -512,6 +538,11 @@ class DebianGenerator(BloomGenerator):
             index = rosdistro.get_index(rosdistro.get_index_url())
             distribution_file = rosdistro.get_distribution_file(index, self.rosdistro)
             if self.os_name not in distribution_file.release_platforms:
+                if args.os_not_required:
+                    warning("No platforms defined for os '{0}' in release file for the "
+                            "'{1}' distro. This os was not required; continuing without error."
+                            .format(self.os_name, self.rosdistro))
+                    sys.exit(0)
                 error("No platforms defined for os '{0}' in release file for the '{1}' distro."
                       .format(self.os_name, self.rosdistro), exit=True)
             self.distros = distribution_file.release_platforms[self.os_name]
diff --git a/bloom/generators/debian/templates/control.em b/bloom/generators/debian/templates/control.em
index 175af20..7cbf65a 100644
--- a/bloom/generators/debian/templates/control.em
+++ b/bloom/generators/debian/templates/control.em
@@ -3,12 +3,12 @@ Section: misc
 Priority: extra
 Maintainer: @(Maintainer)
 Build-Depends: debhelper (>= @(debhelper_version).0.0), @(', '.join(BuildDepends))
-@[if Conflicts]Conflicts: @(', '.join(Conflicts))@\n@[end if]@
-@[if Replaces]Replaces: @(', '.join(Replaces))@\n@[end if]@
 Homepage: @(Homepage)
 Standards-Version: 3.9.2
 
 Package: @(Package)
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, @(', '.join(Depends))
+@[if Conflicts]Conflicts: @(', '.join(Conflicts))@\n@[end if]@
+@[if Replaces]Replaces: @(', '.join(Replaces))@\n@[end if]@
 Description: @(Description)
diff --git a/bloom/generators/rosdebian.py b/bloom/generators/rosdebian.py
index 6366693..6192502 100644
--- a/bloom/generators/rosdebian.py
+++ b/bloom/generators/rosdebian.py
@@ -44,6 +44,8 @@ from bloom.generators.debian.generate_cmd import prepare_arguments
 
 from bloom.logging import info
 
+from bloom.util import get_distro_list_prompt
+
 
 class RosDebianGenerator(DebianGenerator):
     title = 'rosdebian'
@@ -53,7 +55,7 @@ class RosDebianGenerator(DebianGenerator):
     def prepare_arguments(self, parser):
         # Add command line arguments for this generator
         add = parser.add_argument
-        add('rosdistro', help="ROS distro to target (groovy, hydro, etc...)")
+        add('rosdistro', help="ROS distro to target (%s, etc.)" % get_distro_list_prompt())
         return DebianGenerator.prepare_arguments(self, parser)
 
     def handle_arguments(self, args):
diff --git a/bloom/generators/rosrelease.py b/bloom/generators/rosrelease.py
index 00771b0..f7f09ac 100644
--- a/bloom/generators/rosrelease.py
+++ b/bloom/generators/rosrelease.py
@@ -9,6 +9,7 @@ from bloom.logging import warning
 from bloom.packages import get_package_data
 
 from bloom.util import execute_command
+from bloom.util import get_distro_list_prompt
 
 
 class RosReleaseGenerator(ReleaseGenerator):
@@ -24,7 +25,7 @@ prefix set to 'release'.
     def prepare_arguments(self, parser):
         # Add command line arguments for this generator
         add = parser.add_argument
-        add('rosdistro', help="ROS distro to target (groovy, hydro, etc...)")
+        add('rosdistro', help="ROS distro to target (%s, etc.)" % get_distro_list_prompt())
         return ReleaseGenerator.prepare_arguments(self, parser)
 
     def handle_arguments(self, args):
diff --git a/bloom/generators/rosrpm.py b/bloom/generators/rosrpm.py
index 18d05a7..ad8ae70 100644
--- a/bloom/generators/rosrpm.py
+++ b/bloom/generators/rosrpm.py
@@ -44,6 +44,8 @@ from bloom.generators.rpm.generate_cmd import prepare_arguments
 
 from bloom.logging import info
 
+from bloom.util import get_distro_list_prompt
+
 
 class RosRpmGenerator(RpmGenerator):
     title = 'rosrpm'
@@ -53,7 +55,7 @@ class RosRpmGenerator(RpmGenerator):
     def prepare_arguments(self, parser):
         # Add command line arguments for this generator
         add = parser.add_argument
-        add('rosdistro', help="ROS distro to target (groovy, hydro, etc...)")
+        add('rosdistro', help="ROS distro to target (%s, etc.)" % get_distro_list_prompt())
         return RpmGenerator.prepare_arguments(self, parser)
 
     def handle_arguments(self, args):
diff --git a/bloom/generators/rpm/generate_cmd.py b/bloom/generators/rpm/generate_cmd.py
index ce162c8..b219d4c 100644
--- a/bloom/generators/rpm/generate_cmd.py
+++ b/bloom/generators/rpm/generate_cmd.py
@@ -46,6 +46,8 @@ from bloom.generators.rpm.generator import generate_substitutions_from_package
 from bloom.generators.rpm.generator import place_template_files
 from bloom.generators.rpm.generator import process_template_files
 
+from bloom.util import get_distro_list_prompt
+
 try:
     from rosdep2 import create_default_installer_context
 except ImportError:
@@ -72,7 +74,7 @@ def prepare_arguments(parser):
     add = parser.add_argument
     add('--os-name', help='OS name, e.g. fedora, rhel')
     add('--os-version', help='OS version or codename, e.g. heisenbug, santiago')
-    add('--ros-distro', help='ROS distro, e.g. groovy, hydro (used for rosdep)')
+    add('--ros-distro', help="ROS distro, e.g. %s (used for rosdep)" % get_distro_list_prompt())
     return parser
 
 
diff --git a/bloom/generators/rpm/templates/template.spec.em b/bloom/generators/rpm/templates/template.spec.em
index 6fb5033..a65a2a8 100644
--- a/bloom/generators/rpm/templates/template.spec.em
+++ b/bloom/generators/rpm/templates/template.spec.em
@@ -26,6 +26,7 @@ mkdir -p obj-%{_target_platform} && cd obj-%{_target_platform}
         -USYSCONF_INSTALL_DIR \
         -USHARE_INSTALL_PREFIX \
         -ULIB_SUFFIX \
+        -DCMAKE_INSTALL_LIBDIR="lib" \
         -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
         -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
         -DSETUPTOOLS_DEB_LAYOUT=OFF \
diff --git a/bloom/util.py b/bloom/util.py
index 4c702ab..7a874fa 100755
--- a/bloom/util.py
+++ b/bloom/util.py
@@ -262,6 +262,11 @@ _pdb = False
 _quiet = False
 _disable_git_clone = False
 _disable_git_clone_quiet = False
+_distro_list_prompt = [
+    'hydro',
+    'indigo',
+    'jade',
+]
 
 
 def disable_git_clone(state=True):
@@ -287,6 +292,11 @@ def get_git_clone_state():
     return _disable_git_clone
 
 
+def get_distro_list_prompt():
+    global _distro_list_prompt
+    return ', '.join(_distro_list_prompt)
+
+
 def get_git_clone_state_quiet():
     global _disable_git_clone_quiet
     return _disable_git_clone_quiet
diff --git a/setup.py b/setup.py
index 2545ad3..d643e19 100755
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ if sys.version_info[0] == 2 and sys.version_info[1] <= 6:
 
 setup(
     name='bloom',
-    version='0.5.20',
+    version='0.5.21',
     packages=find_packages(exclude=['test']),
     package_data={
         'bloom.generators.debian': [
diff --git a/stdeb.cfg b/stdeb.cfg
index 2205498..3de9310 100755
--- a/stdeb.cfg
+++ b/stdeb.cfg
@@ -3,5 +3,5 @@ Depends: python-yaml, python-empy, python-argparse, python-rosdep (>= 0.10.25),
 Depends3: python3-yaml, python3-empy, python3-rosdep (>= 0.10.25), python3-rosdistro (>= 0.4.0), python3-vcstools (>= 0.1.22), python3-setuptools, python3-catkin-pkg (>= 0.2.2)
 Conflicts: python3-bloom
 Conflicts3: python-bloom
-Suite: oneiric precise quantal raring saucy trusty utopic vivid wheezy jessie
+Suite: oneiric precise quantal raring saucy trusty utopic vivid wily xenial wheezy jessie
 X-Python3-Version: >= 3.2
diff --git a/test/unit_tests/test_generators/test_debian/test_generator.py b/test/unit_tests/test_generators/test_debian/test_generator.py
index 1317b78..d0eb272 100644
--- a/test/unit_tests/test_generators/test_debian/test_generator.py
+++ b/test/unit_tests/test_generators/test_debian/test_generator.py
@@ -4,6 +4,7 @@ from ....utils.common import redirected_stdio
 
 from bloom.generators.debian.generator import em
 from bloom.generators.debian.generator import get_changelogs
+from bloom.generators.debian.generator import format_description
 
 from catkin_pkg.packages import find_packages
 
@@ -24,3 +25,21 @@ def test_unicode_templating():
         chlogs = get_changelogs(packages['bad_changelog_pkg'])
         template = "@(changelog)"
         em.expand(template, {'changelog': chlogs[0][2]})
+
+
+def test_format_description():
+    assert '' == format_description('')
+    assert '.' == format_description('.')
+    assert 'Word.' == format_description('Word.')
+    assert 'Word' == format_description('Word')
+    assert '.' == format_description(' .')
+    assert '.' == format_description(' . ')
+    assert 'Word.\n Other words.' == format_description('Word. Other words.')
+    assert 'The first sentence, or synopsis.\n The second sentence. Part of the long description, but all in a single paragraph.' == format_description('The first sentence, or synopsis. The second sentence. Part of the long description, but all in a single paragraph.')
+    assert '..' == format_description('..')
+    assert 'The my_package package' == format_description('The my_package package')
+    assert 'First sentence with a version nr: 2.4.5, some other text.\n And then some other text.' == format_description('First sentence with a version nr: 2.4.5, some other text. And then some other text.')
+    assert 'More punctuation! This will split here.\n And the rest.' == format_description('More punctuation! This will split here. And the rest.')
+    assert 'v1.2.3 with v5.3.7 and ! Split after this.\n Long description here.' == format_description('v1.2.3 with v5.3.7 and ! Split after this. Long description here.\n\n')
+    # no whitespace between <p>'s, no split
+    assert 'some embedded html markup.the other sentence.' == format_description('<h1>some embedded</h1>\n<p>html markup.</p><p>the other sentence.</p>')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/ros-bloom.git



More information about the debian-science-commits mailing list