aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/gtkdochelper.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-05-06 20:09:49 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-05-06 20:25:16 +0530
commitc1f275bfa644beafab9f8572351d4b64d61c148b (patch)
tree5e426407e55b89d51db50f131e1c29631f0ce5b9 /mesonbuild/scripts/gtkdochelper.py
parentc5865c50c444912afd92c2feb94d8739874a62b2 (diff)
downloadmeson-c1f275bfa644beafab9f8572351d4b64d61c148b.zip
meson-c1f275bfa644beafab9f8572351d4b64d61c148b.tar.gz
meson-c1f275bfa644beafab9f8572351d4b64d61c148b.tar.bz2
gnome.gtkdoc: Allow passing file objects as xml_files
If we pass a source files() object, we will look for it in the build directory, which is wrong. If we pass a build files() object (from configure_file()), we will find it in the build directory, and then try to copy it on top of itself in gtkdochelper.py getting a SameFileError. Add a test for it, and also properly iterate custom target outputs when adding to content files.
Diffstat (limited to 'mesonbuild/scripts/gtkdochelper.py')
-rw-r--r--mesonbuild/scripts/gtkdochelper.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
index 3fe7fb7..2895991 100644
--- a/mesonbuild/scripts/gtkdochelper.py
+++ b/mesonbuild/scripts/gtkdochelper.py
@@ -93,9 +93,12 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
# Copy files to build directory
for f in content_files:
- f_abs = os.path.join(doc_src, f)
- shutil.copyfile(f_abs, os.path.join(
- abs_out, os.path.basename(f_abs)))
+ # FIXME: Use mesonlib.File objects so we don't need to do this
+ if not os.path.isabs(f):
+ f = os.path.join(doc_src, f)
+ elif os.path.commonpath([f, build_root]) == build_root:
+ continue
+ shutil.copyfile(f, os.path.join(abs_out, os.path.basename(f)))
shutil.rmtree(htmldir, ignore_errors=True)
try: