summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-11-26 22:07:26 +0100
committerCarl Hetherington <cth@carlh.net>2024-12-07 21:36:21 +0100
commite613e3c6343f0842f09bd6f19f6ef4656c5c104f (patch)
tree5f86407dedcff3a5457d51ab17462359dff44fd0
parent2539a4e6c03af83c79ba1cc911fdd512ea03fc09 (diff)
Take account of new "good things" reported by libdcp verifier.
-rw-r--r--cscript2
-rw-r--r--doc/manual/.gitignore2
-rw-r--r--doc/manual/Makefile6
-rw-r--r--doc/manual/dcpomatic.xml9
-rw-r--r--doc/manual/verifier.py27
5 files changed, 35 insertions, 11 deletions
diff --git a/cscript b/cscript
index acb29f180..7be04915e 100644
--- a/cscript
+++ b/cscript
@@ -531,7 +531,7 @@ def make_spec(filename, version, target, options, requires=None):
print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
def dependencies(target, options):
- deps = [('libdcp', 'v1.9.24', {'c++17': target.platform.startswith('osx')})]
+ deps = [('libdcp', 'v1.9.25', {'c++17': target.platform.startswith('osx')})]
deps.append(('libsub', 'v1.6.52'))
deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
deps.append(('rtaudio', 'f619b76'))
diff --git a/doc/manual/.gitignore b/doc/manual/.gitignore
index bc9331596..c4decec05 100644
--- a/doc/manual/.gitignore
+++ b/doc/manual/.gitignore
@@ -2,3 +2,5 @@ screenshots/*.pdf
verify_bv21_errors.xml
verify_errors.xml
verify_warnings.xml
+verify_ok.xml
+
diff --git a/doc/manual/Makefile b/doc/manual/Makefile
index 03f3db87e..ab8a7f398 100644
--- a/doc/manual/Makefile
+++ b/doc/manual/Makefile
@@ -118,12 +118,14 @@ verify_bv21_errors.xml: verifier.py $(LIBDCP_DEPS)
verify_warnings.xml: verifier.py $(LIBDCP_DEPS)
python3 verifier.py $(LIBDCP) WARNING > $@
+verify_ok.xml: verifier.py $(LIBDCP_DEPS)
+ python3 verifier.py $(LIBDCP) OK > $@
#
# HTML
#
-html: $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
+html: $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml verify_ok.xml \
dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
$(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \
$(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
@@ -144,7 +146,7 @@ html: $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml v
# PDF
#
-pdf: $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
+pdf: $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml verify_ok.xml \
dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
$(addprefix screenshots/,$(SCREENSHOTS)) \
$(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
diff --git a/doc/manual/dcpomatic.xml b/doc/manual/dcpomatic.xml
index 9608d7bc2..df4bc75f5 100644
--- a/doc/manual/dcpomatic.xml
+++ b/doc/manual/dcpomatic.xml
@@ -3935,6 +3935,10 @@ are changed.
</itemizedlist>
<para>
+ It will also report some &lsquo;good&rsquo; things, which have been checked and found to be in order.
+ </para>
+
+ <para>
The following sections list what the verifier checks for in each category.
</para>
@@ -3953,6 +3957,11 @@ are changed.
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="verify_warnings.xml"/>
</section>
+ <section>
+ <title>Good things</title>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="verify_ok.xml"/>
+ </section>
+
</chapter>
diff --git a/doc/manual/verifier.py b/doc/manual/verifier.py
index 877a118a1..f39a00e2e 100644
--- a/doc/manual/verifier.py
+++ b/doc/manual/verifier.py
@@ -1,4 +1,7 @@
#!/usr/bin/python3
+#
+# Return DocBook markup for all the verification warnings/errors/"ok" notes of a given
+# type in verify.h
from pathlib import Path
import re
@@ -6,32 +9,39 @@ import sys
import subprocess
if len(sys.argv) < 3:
- print(f"Syntax: {sys.argv[0]} <path-to-libdcp-source-tree> <ERROR|BV21_ERROR|WARNING>")
+ print(f"Syntax: {sys.argv[0]} <path-to-libdcp-source-tree> <ERROR|BV21_ERROR|WARNING|OK>")
sys.exit(1)
libdcp = Path(sys.argv[1])
type = sys.argv[2]
header = libdcp / "src" / "verify.h"
-types = ("BV21_ERROR", "ERROR", "WARNING")
+# The types of note we have, and the strings to look for in order to recognise them
+types = {
+ "BV21_ERROR": ("BV21_ERROR", "bv21_error("),
+ "ERROR": ("ERROR", "error("),
+ "WARNING": ("WARNING", "warning("),
+ "OK": ("ok(",),
+}
def find_type(name):
"""
Search source code to find where a given code is used and hence find out whether
- it represents an error, Bv2.1 "error" or warning.
+ it represents an error, Bv2.1 "error", warning or "this is OK" note.
"""
previous = ''
- for source in ["verify_j2k.cc", "dcp.cc", "verify.cc"]:
+ for source in ["verify_j2k.cc", "dcp.cc", "verify.cc", "cpl.cc"]:
path = libdcp / "src" / source
with open(path) as s:
for line in s:
if line.find(name) != -1:
line_with_previous = previous + line
- for t in types:
- if line_with_previous.find(t) != -1:
- return t
- assert False
+ for type, signatures in types.items():
+ for s in signatures:
+ if line_with_previous.find(s) != -1:
+ return type
previous = line
+ assert False
print('<itemizedlist>')
@@ -49,6 +59,7 @@ with open(header) as h:
text = strip.replace('/**', '').replace('*/', '').strip()
elif not strip.startswith('/*') and not strip.startswith('*') and strip.endswith(','):
this_type = find_type(strip[:-1])
+ # print("find", strip[:-1], this_type)
if this_type == type:
text = re.sub(r"\[.*?\]", lambda m: f'(Bv2.1 {m[0][7:-1]})', text)
text = text.replace('<', '&lt;')