sitelink1 | https://fosslight.org/fosslight-guide/scanner/2_source.html |
---|---|
sitelink2 | https://fosslight.org/fosslight-guide/scanner/ |
sitelink3 | |
sitelink4 | |
extra_vars5 | |
extra_vars6 |
FOSSLight Source Scanner 는 SPDX format file 을 출력해 주지 않지만 FOSSLight Scanner 는 Source Scanner 의 분석 결과 파일을 이용하여 SPDX format file 을 출력해 준다.
다만 Source Scanner는 내부적으로 ScanCode와 SCANOSS 오픈소스 라이브러리를 이용하여 분석 결과를 매우 상세하게 출력해 준다.
그런데... SCANOSS 는 동작시 파일 갯수 제한이 걸려 있어서 몇번 테스트 하다보면 ScanCode 만 동작하게 된다.
그래서 ScanCode 의 동작 특성에 대해 다음과 같은 특징을 발견하게 되었다.
javascript library 내에 첫 문단에 라이선스 관련하여 주석으로 다음과 같은 문구를 입력해 놓았다.
// NOTICE: OOOOOOO permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
위 문구에는 라이선스 키워드가 없지만 ScanCode 는 위 문구를 통해서 adobe 의 "adobe-dng-sdk" 라이선스의 내용과 일정 이상 매칭이 된다고 알려주고
해당 문구를 통해 "adobe-dng-sdk" 라이선스가 고지된 것이라고 검출해 낸다. ( "licenseComments": "LicenseRef-adobe-dng-sdk" )
나는 이게 FOSSLight Scanner 가 알 수 없는 라이선스를 만났을때의 예외 동작인줄 알았다.
FOSSLight Source Scanner 는 여러 라이선스들의 문구들을 통해 소스 주석에 매칭되는 내용을 찾지 못하면 해당 라이브러리는 관련한 라이선스가 없다고 판단하고 목록에서 제외 시킨다.
그래서 결국 SPDX 문서에는 해당 파일의 라이선스 내용이 사라지게 되는데...
위와 같은 경우는 엉뚱한 라이선스가 적용되었다고 알려주게 되는 것이다.
그래서 해당 문구의 앞과 뒤에 아주 강력한 내용의 다음과 같은 "apache-2.0" 라이선스 문구를 발췌해다가 삽입했다.
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
뒤쪽에 배치했을때 ScanCode 는 해당 라이브러리는 "apache-2.0" 라이선스만 적용된다고 결과를 내었다.
하지만 앞쪽에 배치하자 해당 라이브러리에 적용한 라이선스가 "apache-2.0,unknown-license-reference" 라고 나온다.
그리고 FOSSLight Scanner 에서는 위 정보를 이용하여 SPDX 내용을 작성할때 다음과 같이 출력한다.
{
"SPDXID": "SPDXRef-File10",
"checksums": [
{
"algorithm": "SHA1",
"checksumValue": "2be6981ecd35405f1537c5b0b447e4c48dd1b47c"
}
],
"copyrightText": "Copyright 2017 OOOOOOO Co., Ltd.",
"fileName": "framework/System.js",
"licenseComments": "LicenseRef-unknown-license-reference",
"licenseInfoInFiles": [
"Apache-2.0"
]
}
licenseComments 란에 unknown-license 라고 나온다.
만일 "Apache-2.0"의 장문의 라이선스 문구를 입력하지 않았었다면
{
"SPDXID": "SPDXRef-File10",
"checksums": [
{
"algorithm": "SHA1",
"checksumValue": "2be6981ecd35405f1537c5b0b447e4c48dd1b47c"
}
],
"copyrightText": "Copyright 2017 OOOOOOO Co., Ltd.",
"fileName": "framework/System.js",
"licenseComments": "LicenseRef-adobe-dng-sdk"
}
"licenseInfoInFiles" 내용은 빠져있고 "licenseComments"에 "adobe-dng-sdk" 라이선스를 넣어 SPDX 문서를 출력했을 것이다.