Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into qt/fix-scancode-s…
Browse files Browse the repository at this point in the history
…ummary-m
  • Loading branch information
qtomlinson committed Dec 7, 2023
2 parents 2f40283 + 6e88ccf commit be0d785
Show file tree
Hide file tree
Showing 6 changed files with 20,351 additions and 78 deletions.
11 changes: 9 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ function isLicenseFile(filePath, coordinates) {
if (_licenseFileNames.includes(basePath)) return true
if (!coordinates) return false
for (const prefix of getLicenseLocations(coordinates) || []) {
if (_licenseFileNames.includes(filePath.replace(prefix, ''))) return true
const prefixLowered = prefix.toLowerCase()
if (_licenseFileNames.includes(filePath.replace(prefixLowered, ''))) return true
}
return false
}
Expand All @@ -338,7 +339,13 @@ function isDeclaredLicense(identifier) {
}

function getLicenseLocations(coordinates) {
const map = { npm: ['package/'], maven: ['meta-inf/'], pypi: [`${coordinates.name}-${coordinates.revision}/`], go: [goLicenseLocations(coordinates)] }
const map = {
npm: ['package/'],
maven: ['META-INF/'],
pypi: [`${coordinates.name}-${coordinates.revision}/`],
go: [goLicenseLocations(coordinates)]
}
map.sourcearchive = map.maven
return map[coordinates.type]
}

Expand Down
Loading

0 comments on commit be0d785

Please sign in to comment.