[virt-tools-list] [PATCH v2 2/2] build: One more fix for clean builds

Martin Kletzander mkletzan at redhat.com
Fri Dec 14 15:57:55 UTC 2012


Generating manpages within build phase is OK (when building rpm),
unless we don't update the list of OSes on a cleanly installed
machine.  That fails due to lots of dependencies being pulled in.

Instead of adding all of those dependecies into BuildRequires, I
propose (with this patch) a solution by splitting _update_manpages()
into two parts:

  1) First part is updating the list of OSes (requires osdict and all
     the other countless dependencies) and then calls the second part

  2) Second part (called _regenerate_manpages()) just creates manpages
     from podfiles as it was done at the end of the _update_manpages()

This enables us calling the _update_manpages within the sdist phase
(nothing has changed there), and being able to call the
_regenerate_manpages() to update the contents with everybuild, but
without depending on anything else than pod2man binary.
---
 setup.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 43b0e4e..81827c1 100755
--- a/setup.py
+++ b/setup.py
@@ -82,7 +82,9 @@ def _update_manpages():
         outfd.write(outp)
         outfd.close()

-    # Generate new manpages
+    _regenerate_manpages()
+
+def _regenerate_manpages():
     if os.system("make -C man/en"):
         raise RuntimeError("Couldn't generate man pages.")

@@ -338,8 +340,7 @@ class mybuild(build):

         build.run(self)

-        # Update and generate man pages, but not before the build is done!
-        _update_manpages()
+        _regenerate_manpages()

 setup(
     name='virtinst',
-- 
1.8.0.2




More information about the virt-tools-list mailing list