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

58 lines
2.0 KiB
Diff

--- gtk-doc-1.33.2/gtkdoc/mkdb.py 2021-01-20 01:08:26.503552400 +0800
+++ gtk-doc-1.33.2_bak/gtkdoc/mkdb.py 2021-07-26 10:50:13.896786712 +0800
@@ -25,7 +25,7 @@
from collections import OrderedDict
import logging
-import os
+import os,sys
import re
import string
@@ -286,7 +286,11 @@
# extract docbook header or define default
doctype_header = GetDocbookHeader(main_sgml_file)
-
+
+ if not os.path.exists(os.path.join(ROOT_DIR, MODULE + "-sections.txt")):
+ print (os.path.join(ROOT_DIR, MODULE + "-sections.txt") + " file is not found")
+ sys.exit()
+
ReadKnownSymbols(os.path.join(ROOT_DIR, MODULE + "-sections.txt"))
ReadSignalsFile(os.path.join(ROOT_DIR, MODULE + ".signals"))
ReadArgsFile(os.path.join(ROOT_DIR, MODULE + ".args"))
@@ -294,9 +298,19 @@
obj_tree = ReadObjectHierarchy(os.path.join(ROOT_DIR, MODULE + ".hierarchy"))
ReadInterfaces(os.path.join(ROOT_DIR, MODULE + ".interfaces"))
ReadPrerequisites(os.path.join(ROOT_DIR, MODULE + ".prerequisites"))
+
+
+ if not os.path.exists(os.path.join(ROOT_DIR, MODULE + "-decl.txt")):
+ print (os.path.join(ROOT_DIR, MODULE + "-decl.txt") + " file is not found")
+ sys.exit()
ReadDeclarationsFile(os.path.join(ROOT_DIR, MODULE + "-decl.txt"), 0)
if os.path.isfile(os.path.join(ROOT_DIR, MODULE + "-overrides.txt")):
+
+ if not os.path.exists(os.path.join(ROOT_DIR, MODULE + "-overrides.txt")):
+ print (os.path.join(ROOT_DIR, MODULE + "-overrides.txt") + " file is not found")
+ sys.exit()
+
ReadDeclarationsFile(os.path.join(ROOT_DIR, MODULE + "-overrides.txt"), 1)
logging.info("Data files read")
@@ -3758,6 +3772,12 @@
# This array holds any subdirectories found.
subdirs = []
+
+
+ if not os.path.isdir(source_dir):
+ print (source_dir + " directory is not found")
+ sys.exit()
+
for ifile in sorted(os.listdir(source_dir)):
logging.debug("... : %s", ifile)
if ifile.startswith('.'):