gtk-doc/fix-fixxref-not-found-file.patch
lyn1001 b2c7afea92 fix not found file
(cherry picked from commit a18967dd424a1f5dbb60dc65025f8aaa45f1d14e)
2021-07-26 14:04:14 +08:00

51 lines
1.6 KiB
Diff

--- gtk-doc-1.33.2/gtkdoc/fixxref.py 2021-01-20 01:08:26.494552400 +0800
+++ gtk-doc-1.33.2_bak/gtkdoc/fixxref.py 2021-07-26 10:52:56.295493736 +0800
@@ -22,7 +22,7 @@
''"Fix cross-references in the HTML documentation.''"
import logging
-import os
+import os,sys
import re
from . import common, highlight
@@ -51,6 +51,12 @@
LoadIndicies(options.module_dir, options.html_dir, options.extra_dir)
ReadSections(options.module)
FixCrossReferences(options.module_dir, options.module, options.src_lang)
+
+
+ if not os.path.exists(os.path.join(options.module_dir, 'style.css')):
+ print (os.path.join(options.module_dir, 'style.css' + " file is not found"))
+ sys.exit()
+
highlight.append_style_defs(os.path.join(options.module_dir, 'style.css'))
@@ -187,6 +193,12 @@
def ReadSections(module):
"""We don't warn on missing links to non-public sysmbols."""
+
+
+ if not os.path.exists(module + '-sections.txt'):
+ print (module + '-sections.txt' + " file is not found")
+ sys.exit()
+
for line in open(module + '-sections.txt', 'r', encoding='utf-8'):
m1 = re.search(r'^<SUBSECTION\s*(.*)>', line)
if line.startswith('#') or line.strip() == '':
@@ -211,6 +223,12 @@
def FixCrossReferences(module_dir, module, src_lang):
# TODO(ensonic): use glob.glob()?
+
+
+ if not os.path.isdir(module_dir):
+ print (module_dir + " directory is not found")
+ sys.exit()
+
for entry in sorted(os.listdir(module_dir)):
full_entry = os.path.join(module_dir, entry)
if os.path.isdir(full_entry):