diff --git a/0002-Remove-cornice-from-the-Sphinx-project.patch b/0002-Remove-cornice-from-the-Sphinx-project.patch new file mode 100644 index 0000000..a9b9db8 --- /dev/null +++ b/0002-Remove-cornice-from-the-Sphinx-project.patch @@ -0,0 +1,73 @@ +From b3f80b1b27e4b7ff2913d77fbae8bfb352d73e2e Mon Sep 17 00:00:00 2001 +From: Randy Barlow +Date: Wed, 10 Aug 2016 15:57:09 -0400 +Subject: [PATCH 1/2] Remove cornice from the Sphinx project. + +The docs project currently does not build with a mysterious error +message. Removing cornice from the project seems to remove this +error message, though currently the entirety of the Sphinx project +is the cornice generated documentation. However, I am working on +using Sphinx to build a man page for the new bodhi 2 CLI, and so +the docs failing to build is a blocker for the work I need to do. + +I will file an issue to re-examine cornice in the future when we +have time to determine what the issue was. +--- + docs/conf.py | 6 +----- + docs/services.rst | 16 ---------------- + 2 files changed, 1 insertion(+), 21 deletions(-) + +diff --git a/docs/conf.py b/docs/conf.py +index ba5967c..12c6746 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -23,13 +23,9 @@ import sys, os + # If your documentation needs a minimal Sphinx version, state it here. + #needs_sphinx = '1.0' + +-import cornice +- +-sys.path.insert(0, os.path.abspath(cornice.__file__)) +- + # Add any Sphinx extension module names here, as strings. They can be extensions + # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +-extensions = ['sphinx.ext.autodoc', 'cornice.ext.sphinxext', ++extensions = ['sphinx.ext.autodoc', + #'sphinx.ext.intersphinx', + 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode'] + +diff --git a/docs/services.rst b/docs/services.rst +index a932ef0..7e149ec 100644 +--- a/docs/services.rst ++++ b/docs/services.rst +@@ -4,27 +4,11 @@ Bodhi API + /updates + -------- + +-.. cornice-autodoc:: +- :modules: bodhi.services.updates +- :services: updates, update, update_request +- + /releases + --------- + +-.. cornice-autodoc:: +- :modules: bodhi.services.releases +- :services: releases, release +- + /builds + ------- + +-.. cornice-autodoc:: +- :modules: bodhi.services.builds +- :services: builds, build +- + /users + ------ +- +-.. cornice-autodoc:: +- :modules: bodhi.services.user +- :services: users, user +-- +2.7.4 + diff --git a/0003-Add-a-basic-man-page-for-the-bodhi-2-cli.patch b/0003-Add-a-basic-man-page-for-the-bodhi-2-cli.patch new file mode 100644 index 0000000..2e0efca --- /dev/null +++ b/0003-Add-a-basic-man-page-for-the-bodhi-2-cli.patch @@ -0,0 +1,314 @@ +From 95574831e700bd481d5dbe918fde305585411535 Mon Sep 17 00:00:00 2001 +From: Randy Barlow +Date: Thu, 11 Aug 2016 16:16:01 -0400 +Subject: [PATCH 2/2] Add a basic man page for the bodhi 2 cli. + +--- + docs/conf.py | 6 +- + docs/index.rst | 1 + + docs/man_bodhi.rst | 250 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 255 insertions(+), 3 deletions(-) + create mode 100644 docs/man_bodhi.rst + +diff --git a/docs/conf.py b/docs/conf.py +index 12c6746..9f2b49b 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -11,6 +11,7 @@ + # All configuration values have a default; values that are commented out + # serve to show the default. + ++import datetime + import sys, os + + # If extensions (or modules to document with autodoc) are in another directory, +@@ -43,7 +44,7 @@ master_doc = 'index' + + # General information about the project. + project = u'bodhi' +-copyright = u'2007-2014, Red Hat, Inc.' ++copyright = u'2007-{}, Red Hat, Inc.'.format(datetime.datetime.utcnow().year) + + # The version info for the project you're documenting, acts as replacement for + # |version| and |release|, also used in various other places throughout the +@@ -215,8 +216,7 @@ latex_documents = [ + # One entry per manual page. List of tuples + # (source start file, name, description, authors, manual section). + man_pages = [ +- ('index', 'bodhi', u'bodhi Documentation', +- [u'Luke Macken'], 1) ++ ('man_bodhi', 'bodhi', u'manage Fedora updates', ['Randy Barlow', 'Luke Macken'], 1) + ] + + # If true, show URL addresses after external links. +diff --git a/docs/index.rst b/docs/index.rst +index b233638..fb2a3d9 100644 +--- a/docs/index.rst ++++ b/docs/index.rst +@@ -11,6 +11,7 @@ Contents: + .. toctree:: + :maxdepth: 2 + ++ man_bodhi + services + + +diff --git a/docs/man_bodhi.rst b/docs/man_bodhi.rst +new file mode 100644 +index 0000000..7cc368b +--- /dev/null ++++ b/docs/man_bodhi.rst +@@ -0,0 +1,250 @@ ++================== ++bodhi CLI man page ++================== ++ ++Synopsis ++======== ++ ++``bodhi`` COMMAND SUBCOMMAND [OPTIONS] [ARGS]... ++ ++ ++Description ++=========== ++ ++``bodhi`` is the command line interface to bodhi, Fedora's update release management system. It can ++be used to create or modify updates and overrides. ++ ++ ++Options ++======= ++ ++Most of the commands will accept these three options: ++ ++``--help`` ++ ++ Show help text and exit. ++ ++``--password `` ++ ++ A password to authenticate as the user given by ``--user``. ++ ++``--staging`` ++ ++ Use the staging bodhi instance instead of the production instance. ++ ++``--user `` ++ ++ Many commands accept this flag to specify which user's updates should be operated upon. ++ ++ ++Commands ++======== ++ ++There are two commands, ``overrides`` and ``updates``. They are described in more detail in their ++own sections below. ++ ++``bodhi overrides [options] [args]`` ++ ++ Provides commands to aid in management of build overrides. Supports subcommands ``query`` and ++ ``save``, described below. ++ ++``bodhi updates [options] [args]`` ++ ++ Provides an interface to manage updates. Supports subcommands ``comment``, ``download``, ++ ``new``, ``query``, and ``request``, described below. ++ ++ ++Overrides ++========= ++ ++The ``overrides`` command allows users to manage build overrides. ++ ++``bodhi overrides query [options]`` ++ ++ The ``query`` subcommand provides an interface for users to query the bodhi server for existing ++ overrides. ++ ++``bodhi overrides save [options] `` ++ ++ Save the build root given by ```` as a buildroot override. The ``save`` subcommand supports ++ the following options: ++ ++ ``--duration `` ++ ++ The number of days the override should exist, given as an integer. ++ ++ ``--notes `` ++ ++ Notes on why this override is in place. ++ ++ ++Updates ++======= ++ ++The ``updates`` command allows users to interact with bodhi updates. ++ ++``bodhi updates comment [options] `` ++ ++ Leave the given text as a comment on a bodhi update. The ``comment`` subcommand ++ supports the following options: ++ ++ ``--karma [+1 | 0 | -1]`` ++ ++ The karma value you wish to contribute to the update. ++ ++``bodhi updates download [options]`` ++ ++ Download update(s) given by CVE(s), ID(s), or NVR(s). One of ``--cves``, ``--updateid``, or ++ ``builds`` is required. The download subcommand supports the following options: ++ ++ ``--cves `` ++ ++ A comma-separated list of CVEs that identify updates you would like to download. ++ ++ ``--updateid `` ++ ++ A comman-separated list of update IDs you would like to download. ++ ++ ``--builds `` ++ ++ Create a new bodhi update containing the builds, given as a space separated list of NVRs. The ++ ``new`` subcommand supports the following options: ++ ++ ``--type [security | bugfix | enhancement | newpackage]`` ++ ++ The type of the new update. ++ ++ ``--notes `` ++ ++ The description of the update. ++ ++ ``--notes-file `` ++ ++ A path to a file containing a description of the update. ++ ++ ``--bugs `` ++ ++ A comma separated list of bugs to associate with this update. ++ ++ ``--close-bugs`` ++ ++ If given, this flag will cause bodhi to close the referenced bugs automatically when the ++ update reaches stable. ++ ++ ``--request [testing | stable | upush]`` ++ ++ The repository requested for this update. ++ ++ ``--autokarma`` ++ ++ Enable autokarma for this update. ++ ++ ``--stable-karma `` ++ ++ Configure the stable karma threshold for the given value. ++ ++ ``--unstable-karma `` ++ ++ Configure the unstable karma threshold for the given value. ++ ++ ``--suggest [logout | reboot]`` ++ ++ Suggest that the user logout or reboot upon applying the update. ++ ++ ``--file `` ++ ++ A path to a file containing all the update details. ++ ++``bodhi updates query [options]`` ++ ++ Query the bodhi server for updates. The ``query`` subcommand supports the following options: ++ ++ ``--updateid `` ++ ++ Query for the update given by id. ++ ++ ``--approved-since `` ++ ++ Query for updates approved after the given timestamp. ++ ++ ``--modified-since `` ++ ++ Query for updates modified after the given timestamp. ++ ++ ``--builds `` ++ ++ Query for updates containing the given builds, given as a comma-separated list. ++ ++ ``--bugs `` ++ ++ Query for updates related to the given bugs, given as a comma-separated list. ++ ++ ``--critpath`` ++ ++ Query for updates submitted for the critical path. ++ ++ ``--cves `` ++ ++ Query for updates related to the given CVEs, given as a comma-separated list. ++ ++ ``--packages `` ++ ++ Query for updates related to the given packages, given as a comma-separated list. ++ ++ ``--pushed`` ++ ++ Query for updates that have been pushed. ++ ++ ``--pushed-since `` ++ ++ Query for updates that have been pushed after the given timestamp. ++ ++ ``--releases `` ++ ++ Query for updates related to a list of releases, given as a comma-separated list. ++ ++ ``--locked`` ++ ++ Query for updates that are currently locked. ++ ++ ``--request [testing | stable | unpush]`` ++ ++ Query for updates marked with the given request type. ++ ++ ``--submitted-since `` ++ ++ Query for updates that were submitted since the given timestamp. ++ ++ ``--status [pending | testing | stable | obsolete | unpushed | processing]`` ++ ++ Filter by status. ++ ++ ``--suggest [logout | reboot]`` ++ ++ Filter for updates that suggest logout or reboot to the user. ++ ++ ``--type [newpackage | security | bugfix | enhancement]`` ++ ++ Filter by update type. ++ ++ ``--user `` ++ ++ Request that the given update be changed to the given state. ``update`` should be given by ++ update id, and ``state`` should be one of testing, stable, unpush, obsolete, or revoke. ++ ++ ++Bugs ++==== ++ ++If you find bugs in bodhi (or in the mage page), please feel free to file a bug report or a pull ++request:: ++ ++ https://github.com/fedora-infra/bodhi +-- +2.7.4 + diff --git a/bodhi.spec b/bodhi.spec index 1e5d3c0..3154767 100644 --- a/bodhi.spec +++ b/bodhi.spec @@ -10,6 +10,8 @@ License: GPLv2+ URL: https://github.com/fedora-infra/bodhi Source0: https://github.com/fedora-infra/bodhi/archive/%{version}.tar.gz Patch0: 0001-Set-the-version-in-the-setup.py-to-the-next-release.patch +Patch1: 0002-Remove-cornice-from-the-Sphinx-project.patch +Patch2: 0003-Add-a-basic-man-page-for-the-bodhi-2-cli.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch ExcludeArch: ppc64 ppc @@ -178,6 +180,8 @@ updates for a software distribution. %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 # Kill some dev deps sed -i '/pyramid_debugtoolbar/d' setup.py @@ -191,6 +195,8 @@ sed -i '/click/d' setup.py %build %{__python} setup.py build #--install-data=%{_datadir} +make %{?_smp_mflags} -C docs man + %install %{__rm} -rf %{buildroot} @@ -218,6 +224,9 @@ cp -rf alembic/ %{buildroot}%{_datadir}/%{name}/alembic # We used to copy in things like this for bodhi1 #%{__install} -m 640 %{name}/config/*mash* %{buildroot}%{_sysconfdir}/%{name}/ +install -d %{buildroot}%{_mandir}/man1 +install -pm0644 docs/_build/man/bodhi.1 %{buildroot}%{_mandir}/man1/ + %check PYTHONPATH=. %{__python} setup.py test @@ -254,14 +263,14 @@ PYTHONPATH=. %{__python} setup.py test %doc README.rst CHANGES.txt %license COPYING %{_bindir}/bodhi -# TODO .. get the man page back with help2man or something -# %{_mandir}/man1/bodhi.1.gz +%{_mandir}/man1/bodhi.1* %changelog * Fri Jul 29 2016 Randy Barlow - 2.1.8-1 - Update to 2.1.8. The spec file was largely taken from lmacken's COPR repository. - Fixed some bogus dates in the changelog. +- Backport patch to add man page from the develop branch. * Tue Jul 19 2016 Fedora Release Engineering - 0.9.12.2-5 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages