[vcpkg ci] Check for deprecated license identifiers (#23039)

This commit is contained in:
autoantwort 2022-04-27 21:58:45 +02:00 committed by GitHub
parent 474f73649c
commit e9d2b4c40e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 10 deletions

View File

@ -39,7 +39,9 @@ jobs:
git config user.name github-actions@github.com
git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*portfile.cmake' | sed 's/[MAR]\t*//' | while read filename; do grep -q -E '(vcpkg_install_cmake|vcpkg_build_cmake|vcpkg_configure_cmake|vcpkg_fixup_cmake_targets)' "$filename" && echo " - \`$filename\`" || true; done > .github-pr.deprecated-cmake
git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*vcpkg.json' | sed 's/[MAR]\t*//' | while read filename; do grep -q -E '"license": ' "$filename" || echo " - \`$filename\`" || true; done > .github-pr.missing-license
git diff --name-status --merge-base HEAD^ HEAD --diff-filter=MAR -- '*vcpkg.json' | sed 's/[MAR]\t*//' > .github-pr.changed-manifest-files
cat .github-pr.changed-manifest-files | while read filename; do grep -q -E '"license": ' "$filename" || echo " - \`$filename\`" || true; done > .github-pr.missing-license
cat .github-pr.changed-manifest-files | while read filename; do match=$(grep -oiP '"license": ".*\K(AGPL-1\.0|AGPL-3\.0|BSD-2-Clause-FreeBSD|BSD-2-Clause-NetBSD|bzip2-1\.0\.5|eCos-2\.0|GFDL-1\.1|GFDL-1\.2|GFDL-1\.3|GPL-1\.0|GPL-1\.0\+|GPL-2\.0|GPL-2\.0\+|GPL-2\.0-with-autoconf-exception|GPL-2\.0-with-bison-exception|GPL-2\.0-with-classpath-exception|GPL-2\.0-with-font-exception|GPL-2\.0-with-GCC-exception|GPL-3\.0|GPL-3\.0\+|GPL-3\.0-with-autoconf-exception|GPL-3\.0-with-GCC-exception|LGPL-2\.0|LGPL-2\.0\+|LGPL-2\.1|LGPL-2\.1\+|LGPL-3\.0|LGPL-3\.0\+|Nunit|StandardML-NJ|wxWindows)(?=[ "])' "$filename" || true); if [ ! -z "$match" ]; then echo " - \`$filename\` (\`$match\`)" ; fi ; done > .github-pr.deprecated-license
./vcpkg format-manifest --all --convert-control
git diff > .github-pr.format-manifest
git add -u
@ -63,6 +65,7 @@ jobs:
const format = (await fs.readFile('.github-pr.format-manifest', 'utf8')).trim()
const cmake = (await fs.readFile('.github-pr.deprecated-cmake', 'utf8')).trim()
const missing_license = (await fs.readFile('.github-pr.missing-license', 'utf8')).trim()
const deprecated_license = (await fs.readFile('.github-pr.deprecated-license', 'utf8')).trim()
let approve = true;
var output = ''
@ -112,13 +115,19 @@ jobs:
output += `The following files are affected:\n${cmake}\n`
output += "</details>\n\n"
}
if (missing_license !== "") {
output += 'You have modified or added at least one vcpkg.json where a "license" field is missing.\n'
if (missing_license !== "" || deprecated_license !== "") {
output += 'You have modified or added at least one vcpkg.json where you should check the `license` field.\n'
output += "<details>\n\n"
if (missing_license !== "") {
output += 'If you feel able to do so, please consider adding a "license" field to the following files:\n'
output += missing_license
output += "\n\nValid values for the license field can be found in the [documentation](https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/manifest-files.md#license)\n"
output += "\n\nValid values for the license field can be found in the [documentation](https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/manifest-files.md#license)\n\n"
}
if (deprecated_license !== "") {
output += 'If you feel able to do so, please consider replacing the deprecated license identifiers in the following files:\n'
output += deprecated_license
output += "\n\nDeprecated and non deprecated license identifiers can be found [here](https://spdx.github.io/spdx-spec/SPDX-license-list/#a3-deprecated-licenses)\n"
}
output += "</details>\n\n"
}

View File

@ -1,7 +1,7 @@
{
"name": "kfr",
"version-semver": "4.2.1",
"port-version": 1,
"port-version": 2,
"description": "Fast, modern C++ DSP framework.",
"homepage": "https://www.kfr.dev/",
"license": "GPL-2.0",

View File

@ -1,6 +1,7 @@
{
"name": "zug",
"version-date": "2021-04-23",
"port-version": 1,
"description": "Transducers for C++",
"homepage": "https://sinusoid.es/zug/",
"dependencies": [

View File

@ -3266,7 +3266,7 @@
},
"kfr": {
"baseline": "4.2.1",
"port-version": 1
"port-version": 2
},
"kinectsdk1": {
"baseline": "1.8",
@ -7726,7 +7726,7 @@
},
"zug": {
"baseline": "2021-04-23",
"port-version": 0
"port-version": 1
},
"zydis": {
"baseline": "3.2.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7465d297a8018bccb142249ed62bf26481608837",
"version-semver": "4.2.1",
"port-version": 2
},
{
"git-tree": "76c0a2397fec739067cac1a9970c113ed47341b1",
"version-semver": "4.2.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ebb162e61d6a161de1d01184b20389079eb3fdc6",
"version-date": "2021-04-23",
"port-version": 1
},
{
"git-tree": "2213b3d809f8a99994484b626896f6cf6e3858c3",
"version-date": "2021-04-23",