Skip to content

docs: Fix usage of multiple source dirs

Emanuele Aina requested to merge wip/em/fix-gtkdoc-scan into apertis/v2019pre

Since DOC_SOURCE_DIR actually list two directories, expanding it naively when setting --source-dir caused gtkdoc-scan to treat it as a header file, only to fail when noticing that it is a directory instead.

gtkdoc-scan --module=MILDENHALL-widgets --ignore-headers="mildenhall_speller_five_toggle_entry.h mildenhall_speller_three_toggle_entry.h mildenhall_ui_utility.h view-manager-lib.h" ${_source_dir} --rebuild-types  --source-dir=../../../include ../../../widgets
Traceback (most recent call last):
  File "/usr/bin/gtkdoc-scan", line 59, in <module>
    scan.Run(options)
  File "/usr/share/gtk-doc/python/gtkdoc/scan.py", line 75, in Run
    ScanHeader(file, section_list, decl_list, get_types, options)
  File "/usr/share/gtk-doc/python/gtkdoc/scan.py", line 229, in ScanHeader
    for line in common.open_text(input_file):
  File "/usr/share/gtk-doc/python/gtkdoc/common.py", line 57, in open_text
    return codecs.open(filename, mode, encoding=encoding)
  File "/usr/lib/python2.7/codecs.py", line 898, in open
    file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 21] Is a directory: '../../../widgets'

As it happen, setting --source-dir= manually seems superfluous in this case, so simply drop it rather than fixing the expansion to prepend --source-dir= to each item.

Edited by Emanuele Aina

Merge request reports