Skip to content

Commit

Permalink
Update packagist package building function #74
Browse files Browse the repository at this point in the history
    * Update expected test results

Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed May 11, 2023
1 parent f8007c0 commit 7c198a1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
8 changes: 4 additions & 4 deletions minecode/mappers/packagist.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def build_packages_with_json(metadata, purl=None):
common['parties'] = []
common['parties'].append(scan_models.Party(name=author.get('name'), role='author', url=author.get('homepage'), email=author.get('email')))

declared_licenses = set([])
extracted_license_statement = set([])
for lic in version_content.get('license'):
declared_licenses.add(lic)
if declared_licenses:
common['declared_license'] = '\n'.join(declared_licenses)
extracted_license_statement.add(lic)
if extracted_license_statement:
common['extracted_license_statement'] = list(extracted_license_statement)

dependencies = []
for name, version in version_content.get('require', {}).items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,34 @@
"code_view_url":null,
"vcs_url":"git+https://github.com/00F100/cakephp-opauth.git",
"copyright":null,
"license_expression":null,
"declared_license":"MIT",
"holder":null,
"declared_license_expression":"mit",
"declared_license_expression_spdx":"MIT",
"license_detections":[
{
"license_expression":"mit",
"matches":[
{
"score":100.0,
"start_line":1,
"end_line":1,
"matched_length":1,
"match_coverage":100.0,
"matcher":"1-spdx-id",
"license_expression":"mit",
"rule_identifier":"spdx-license-identifier-mit-5da48780aba670b0860c46d899ed42a0f243ff06",
"rule_relevance":100,
"rule_url":null,
"matched_text":"MIT"
}
],
"identifier":"mit-a822f434-d61f-f2b1-c792-8b8cb9e7b9bf"
}
],
"other_license_expression":null,
"other_license_expression_spdx":null,
"other_license_detections":[],
"extracted_license_statement":"['MIT']",
"notice_text":null,
"source_packages":[],
"extra_data":{},
Expand Down

0 comments on commit 7c198a1

Please sign in to comment.