From fea6ab1624cb0b4f24e783e2e125954a4aa07aca Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 14 Mar 2017 11:33:01 +1100 Subject: [PATCH] Use sphinx warning-is-error Sphix 1.5 (I9e7261c4124b71eeb6bddd9e21747b61bbdc16fa) includes "warning-is-error" which supersedes pbr's warnerrors. Enable this and fix up the resulting failures - trailing lines for lists in element_deps directive - missing README's that are linked - syntax error and highlighting in building instructions Change-Id: I6549551b4a9bf47076c9811a7a38a666cbea2a50 --- .gitignore | 2 + .../elements/debian-minimal/README.rst | 1 - diskimage_builder/elements/debian/README.rst | 5 ++- .../elements/dib-run-parts/README.rst | 7 ++++ .../elements/ubuntu-signed/README.rst | 9 ++++ doc/lib/element_deps.py | 17 ++++---- doc/source/user_guide/building_an_image.rst | 41 ++++++++++--------- setup.cfg | 5 +-- 8 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 diskimage_builder/elements/dib-run-parts/README.rst create mode 100644 diskimage_builder/elements/ubuntu-signed/README.rst diff --git a/.gitignore b/.gitignore index d2238b44..b2dc99e2 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ build AUTHORS ChangeLog bin/diskimage_builder +*.bak +*.orig diff --git a/diskimage_builder/elements/debian-minimal/README.rst b/diskimage_builder/elements/debian-minimal/README.rst index ac2591af..28e190fa 100644 --- a/diskimage_builder/elements/debian-minimal/README.rst +++ b/diskimage_builder/elements/debian-minimal/README.rst @@ -13,7 +13,6 @@ There are two ways to configure apt-sources: * ``DIB_DISTRIBUTION_MIRROR``: the mirror to use (default: ``__) - * ``DIB_DEBIAN_COMPONENTS``: (default: ``main``) a comma separated list of components. For Debian this can be e.g. ``main,contrib,non-free``. diff --git a/diskimage_builder/elements/debian/README.rst b/diskimage_builder/elements/debian/README.rst index e158ae95..ec391aae 100644 --- a/diskimage_builder/elements/debian/README.rst +++ b/diskimage_builder/elements/debian/README.rst @@ -1,8 +1,9 @@ ====== debian ====== -Create an image based on Debian. We default to unstable but DIB_RELEASE -is mapped to any series of Debian. + +Create an image based on Debian. We default to unstable but +``DIB_RELEASE`` is mapped to any series of Debian. Note that the default Debian series is `unstable`, and the default mirrors for Debian can be problematic for `unstable`. Because apt does diff --git a/diskimage_builder/elements/dib-run-parts/README.rst b/diskimage_builder/elements/dib-run-parts/README.rst new file mode 100644 index 00000000..8c2fa36c --- /dev/null +++ b/diskimage_builder/elements/dib-run-parts/README.rst @@ -0,0 +1,7 @@ +============= +dib-run-parts +============= + +Install ``dib-run-parts`` into the chroot environment + + diff --git a/diskimage_builder/elements/ubuntu-signed/README.rst b/diskimage_builder/elements/ubuntu-signed/README.rst new file mode 100644 index 00000000..aee61211 --- /dev/null +++ b/diskimage_builder/elements/ubuntu-signed/README.rst @@ -0,0 +1,9 @@ +============= +ubuntu-signed +============= + +The ``ubuntu-signed`` element installs ``linux-signed-image-generic`` +that provides signed kernel that can be used for deploy in UEFI secure +boot mode. + +.. element_deps:: diff --git a/doc/lib/element_deps.py b/doc/lib/element_deps.py index c9b3b9c5..b9ca0bb3 100644 --- a/doc/lib/element_deps.py +++ b/doc/lib/element_deps.py @@ -29,13 +29,14 @@ import os all_elements = _find_all_elements(get_path("elements")) -def append_dependency_list(lines, title, element, deps): - if not deps: - return +def make_dep_list(title, deps): + lines = [] lines.append(title) lines.append("+" * len(title)) for dep in deps: - lines.append("* :doc:`../%s/README`\n" % dep) + lines.append("* :doc:`../%s/README`" % dep) + lines.append('') # careful to end with a blank line + return lines class ElementDepsDirective(Directive): @@ -56,11 +57,13 @@ class ElementDepsDirective(Directive): # This should not fail -- sphinx would be finding an element # that dib doesn't know about? element = all_elements[element_name] - - append_dependency_list(lines, "Uses", element, element.depends) - append_dependency_list(lines, "Used by", element, element.r_depends) + if element.depends: + lines.extend(make_dep_list("Uses", element.depends)) + if element.r_depends: + lines.extend(make_dep_list("Used by", element.r_depends)) self.state_machine.insert_input(lines, source) + return [] diff --git a/doc/source/user_guide/building_an_image.rst b/doc/source/user_guide/building_an_image.rst index 2c886734..6811f5a5 100644 --- a/doc/source/user_guide/building_an_image.rst +++ b/doc/source/user_guide/building_an_image.rst @@ -238,27 +238,28 @@ size Example: -:: - - partitioning: - base: image0 - label: mbr - partitions: - - name: part-01 - flags: [ boot ] - size: 1GiB - - name: part-02 - size: 100% +.. code-block:: yaml - - partitioning: - base: data_image - label: mbr - partitions: - - name: data0 - size: 33% - - name: data1 - size: 50% - - name: data2 - size: 100% + - partitioning: + base: image0 + label: mbr + partitions: + - name: part-01 + flags: [ boot ] + size: 1GiB + - name: part-02 + size: 100% + + - partitioning: + base: data_image + label: mbr + partitions: + - name: data0 + size: 33% + - name: data1 + size: 50% + - name: data2 + size: 100% On the `image0` two partitions are created. The size of the first is 1GiB, the second uses the remaining free space. On the `data_image` diff --git a/setup.cfg b/setup.cfg index ef82ce7b..5eac8745 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,7 @@ classifier = all_files = 1 build-dir = doc/build source-dir = doc/source +warning-is-error = 1 [files] packages = @@ -36,10 +37,6 @@ keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = diskimage_builder/locale/diskimage_builder.pot -[pbr] -# TODO(jaegerandi): Set to True once pbr 1.11.0 is out. -warnerrors = False - [update_catalog] domain = diskimage_builder output_dir = diskimage_builder/locale