]> xenbits.xensource.com Git - libvirt.git/commitdiff
Unbreak rebuilding docs with release tarballs
authorGuido Günther <agx@sigxcpu.org>
Fri, 4 Nov 2016 17:30:16 +0000 (18:30 +0100)
committerGuido Günther <agx@sigxcpu.org>
Mon, 7 Nov 2016 19:04:28 +0000 (20:04 +0100)
Release tarballs ship the include/libvirt/libvirt-common.h.

when srcdir != builddir we end up including libvirt-common.h twice: from
$top_srcdir/include/libvirt-common.h and from
$builddir/include/libvirt-common.h leading to

  function virTypedParamsGetUInt from /tmp/buildd/libvirt-2.4.0/debian/build/docs/../include/libvirt/libvirt-common.h redeclared in /tmp/buildd/libvirt-2.4.0/docs/../include/libvirt/libvirt-common.h
  function virTypedParamsAddBoolean from /tmp/buildd/libvirt-2.4.0/debian/build/docs/../include/libvirt/libvirt-common.h redeclared in /tmp/buildd/libvirt-2.4.0/docs/../include/libvirt/libvirt-common.h
   …

Only add the builddir to the search list if there is no pregenerated
libvirt-common.h.

Reuse the existing check that predates the libvirt.h → libvirt-common.h
split and that probably was meant for exactly that.

References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842452

docs/apibuild.py

index 8728b270ba620d54746d52797d0b3e6d140e704d..47f340c7d82b520d4129211fd6708654d422a584 100755 (executable)
@@ -2607,10 +2607,9 @@ class app:
             dirs = [srcdir + "/../src",
                     srcdir + "/../src/util",
                     srcdir + "/../include/libvirt"]
-            if builddir:
+            if (builddir and
+                not os.path.exists(srcdir + "/../include/libvirt/libvirt-common.h")):
                 dirs.append(builddir + "/../include/libvirt")
-            if glob.glob(srcdir + "/../include/libvirt/libvirt.h") == [] :
-                dirs.append("../include/libvirt")
             builder = docBuilder(name, srcdir, dirs, [])
         elif glob.glob("src/libvirt.c") != [] :
             if not quiet: