Skip to content
Snippets Groups Projects
Commit 609740e6 authored by Шастун Екатерина (ИСП РАН)'s avatar Шастун Екатерина (ИСП РАН)
Browse files

added fossil vcs support for sbom-checker.py

parent 54a9e845
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ try:
if type(ref) == dict and ref.get('type', '') == 'vcs':
url = ref.get('url', '')
res = parse_repo_url(url)
if res:
if res and res[1]:
url = res[0]
ex_str = ''
if not url in repo_dict:
......
......@@ -88,6 +88,20 @@ def check_repo(url, git_instance):
except Exception as e:
exc_list.append(f'ERROR/HG: {e}')
result = False
if not result:
try:
res3 = subprocess.run(f'curl --silent {url} 2>&1 | grep -iPzo "<footer>\sthis\spage\swas\sgenerated\sin\sabout\s(\d+\.\d+)s\sby\sfossil"', shell=True, capture_output=True, text=True)
if res3.stdout.startswith('<footer>'):
result = True
elif res3.stderr:
exc_list.append(f'ERROR/FOSSIL: {res3.stderr}')
result = False
else:
exc_list.append(f'ERROR/FOSSIL: didn\'t find autogenerated fossil footer on this page')
result = False
except Exception as e:
exc_list.append(f'ERROR/FOSSIL: {e}')
result = False
return result, '\n'.join(exc_list)
def validate_no_duplicate_keys(list_of_pairs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment