Update check-packages.py

This commit is contained in:
Richard Berger 2020-08-03 13:49:37 -04:00
parent 4549493145
commit f9d1a914fb
No known key found for this signature in database
GPG Key ID: A9E83994E0BA0CAB
1 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ counter = 0
with open(os.path.join(doc_dir, 'Packages_standard.rst')) as fp:
text = fp.read()
matches = re.findall(':ref:`([A-Z0-9-]+) <[A-Z0-9-]+>`', text, re.MULTILINE)
matches = set(re.findall(':ref:`([A-Z0-9-]+) <[A-Z0-9-]+>`', text, re.MULTILINE))
for p in stdpkg:
if not p in matches:
counter += 1
@ -75,7 +75,7 @@ for p in stdpkg:
with open(os.path.join(doc_dir, 'Packages_user.rst')) as fp:
text = fp.read()
matches = re.findall(':ref:`([A-Z0-9-]+) <[A-Z0-9-]+>`', text, re.MULTILINE)
matches = set(re.findall(':ref:`([A-Z0-9-]+) <[A-Z0-9-]+>`', text, re.MULTILINE))
for p in usrpkg:
if not p in matches:
counter += 1
@ -84,13 +84,13 @@ for p in usrpkg:
with open(os.path.join(doc_dir, 'Packages_details.rst')) as fp:
text = fp.read()
matches = re.findall(':ref:`([A-Z0-9]+) <PKG-\\1>`', text, re.MULTILINE)
matches = set(re.findall(':ref:`([A-Z0-9]+) <PKG-\\1>`', text, re.MULTILINE))
for p in stdpkg:
if not p in matches:
counter += 1
print(f"Standard package {p} missing in Packages_details.rst")
matches = re.findall(':ref:`(USER-[A-Z0-9]+) <PKG-\\1>`', text, re.MULTILINE)
matches = set(re.findall(':ref:`(USER-[A-Z0-9]+) <PKG-\\1>`', text, re.MULTILINE))
for p in usrpkg:
if not p in matches:
counter +=1