Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbom-checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sdl-tools
sbom-checker
Commits
079e90a2
Commit
079e90a2
authored
2 months ago
by
Шастун Екатерина (ИСП РАН)
Browse files
Options
Downloads
Patches
Plain Diff
added hg.openjdk.org to vcs patterns
parent
1a9a2f33
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbom_utils.py
+11
-5
11 additions, 5 deletions
sbom_utils.py
with
11 additions
and
5 deletions
sbom_utils.py
+
11
−
5
View file @
079e90a2
...
...
@@ -17,6 +17,7 @@ pattern_dict = {
'
hg.code.sf.net
'
:
((),
(
'
file
'
,
'
rev
'
,
'
shortlog
'
),
3
),
'
opendev.org
'
:
(((
'
src
'
,
'
branch
'
),
(
'
src
'
,
'
commit
'
),
(
'
src
'
,
'
tag
'
),
(
'
releases
'
,
'
tag
'
)),
(
'
commit
'
,),
2
),
'
src.libcode.org
'
:
((),
(
'
src
'
,
'
commit
'
),
2
),
'
hg.openjdk.org
'
:
((),
(
'
file
'
,
'
rev
'
,
'
shortlog
'
),
2
),
}
def
parse_repo_url
(
url
):
...
...
@@ -65,11 +66,16 @@ def parse_repo_url(url):
prefix
=
2
if
parsed_url
.
netloc
in
pattern_dict
:
prefix
=
pattern_dict
[
parsed_url
.
netloc
][
2
]
if
len
(
path_pair_list
)
>
prefix
and
path_pair_list
[
prefix
]
in
pattern_dict
[
parsed_url
.
netloc
][
0
]:
idx
=
prefix
flag
=
1
elif
len
(
path_split
)
>
prefix
and
path_split
[
prefix
]
in
pattern_dict
[
parsed_url
.
netloc
][
1
]:
idx
=
prefix
for
s
in
pattern_dict
[
parsed_url
.
netloc
][
0
]:
if
len
(
path_pair_list
)
>
prefix
and
s
in
path_pair_list
[
prefix
:]:
idx
=
path_pair_list
[
prefix
:].
index
(
s
)
+
prefix
flag
=
1
break
else
:
for
s
in
pattern_dict
[
parsed_url
.
netloc
][
1
]:
if
len
(
path_split
)
>
prefix
and
s
in
path_split
[
prefix
:]:
idx
=
path_split
[
prefix
:].
index
(
s
)
+
prefix
break
else
:
for
s
in
[(
'
-
'
,
'
commit
'
),
(
'
-
'
,
'
commits
'
),
(
'
-
'
,
'
tags
'
),
(
'
-
'
,
'
tree
'
),
(
'
-
'
,
'
blob
'
),
(
'
-
'
,
'
releases
'
),
(
'
releases
'
,
'
tag
'
)]:
if
s
in
path_pair_list
[
prefix
:]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment