32 'GFDL-1.3' =>
'GFDL-1.3-only',
39 'Reponsible-AI-Source-Code-License-v1.0' =>
'RAIL-S-1.0',
43 'Autoconf-exception' =>
'Autoconf-exception-generic',
45 'GPL-2.0-with-autoconf-exception' =>
'GPL-2.0-only WITH Autoconf-exception-3.0',
46 'GPL-2.0-with-bison-exception' =>
'GPL-2.0-only WITH Bison-exception-2.2',
47 'GPL-2.0-with-classpath-exception' =>
'GPL-2.0-only WITH Classpath-exception-2.0',
48 'GPL-2.0-with-font-exception' =>
'GPL-2.0-only WITH Font-exception-2.0',
49 'GPL-2.0-with-GCC-exception' =>
'GPL-2.0-only WITH GCC-exception-3.1',
50 'GPL-2.0+-with-bison-exception' =>
'GPL-2.0-or-later WITH Bison-exception-2.2',
51 'GPL-2.0-or-later-with-Bison-2.2-exception' =>
'GPL-2.0-or-later WITH Bison-exception-2.2',
52 'GPL-2.0+-with-classpath-exception' =>
'GPL-2.0-or-later WITH Classpath-exception-2.0',
53 'GPL-3.0-with-autoconf-exception' =>
'GPL-3.0-only WITH Autoconf-exception-3.0',
54 'GPL-3.0-with-bison-exception' =>
'GPL-3.0-only WITH Bison-exception-2.2',
55 'GPL-3.0-with-classpath-exception' =>
'GPL-3.0-only WITH Classpath-exception-2.0',
56 'GPL-3.0-with-GCC-exception' =>
'GPL-3.0-only WITH GCC-exception-3.1',
57 'GPL-3.0+-with-bison-exception' =>
'GPL-3.0-or-later WITH Bison-exception-2.2',
58 'GPL-3.0+-with-classpath-exception' =>
'GPL-3.0-or-later WITH Classpath-exception-2.0',
61 'Alliance for Open Media Patent License 1.0' =>
'AOM-Patent-1.0',
62 'unRAR restriction' =>
'unRAR-restriction',
63 'GPL-2.1[sic]' =>
'GPL-2.1-sic',
64 'GPL-2.1+[sic]' =>
'GPL-2.1-or-later-sic',
65 'CopyLeft[1]' =>
'CopyLeft-1',
66 'CopyLeft[2]' =>
'CopyLeft-2',
67 'GPL(rms)' =>
'GPL-rms',
69 'X/Open-style' =>
'X-Open-style',
70 'CECILL(dual)' =>
'CECILL-dual',
71 'ImageMagick(Apache)' =>
'ImageMagick-Apache',
72 'SGI_GLX' =>
'SGI-GLX',
73 'ANT+SharedSource' =>
'ANT-SharedSource',
74 'AgainstDRM' =>
'Against-DRM',
75 'M-Plus-Project' =>
'M-Plus',
76 'GPL-2.0-or-laterKDEupgradeClause' =>
'GPL-2.0-or-later-with-KDE-upgrade-clause',
77 'SGI_GLX-1.0' =>
'SGI-GLX-1.0',
78 'Public-domain(C)' =>
'Public-domain-copyright',
79 'UnclassifiedLicense(PS)' =>
'UnclassifiedLicense-PS',
80 'Empty-file-no-data!' =>
'Empty-file-no-data',
81 'Platform-Computing(RESTRICTED)' =>
'Platform-Computing-RESTRICTED',
84 'openssl-exception-AGPL-3.0-or-later' =>
'AGPL-3.0-or-later-with-openssl-exception',
85 'openssl-exception-GPL-2.0-or-later' =>
'GPL-2.0-or-later-with-openssl-exception',
86 'GPL-3.0-or-later-openssl' =>
'GPL-3.0-or-later-with-openssl-exception',
87 'cygwin-exception-LGPL-3.0-or-later' =>
'LGPL-3.0-or-later-with-Cygwin-exception',
88 'spell-checker-exception-LGPL-2.1-or-later' =>
'LGPL-2.1-or-later-with-spell-checker-exception',
89 'opensc-openssl-openpace-exception-gpl' =>
'GPL-with-opensc-openssl-openpace-exception',
92 'DOCBOOK' =>
'Docbook',
93 'MindTerm' =>
'Mindterm',
94 'Qt.Commercial' =>
'QT.Commercial',
95 'SpikeSource' =>
'Spikesource',
96 'VMware-EULA' =>
'VMWare-EULA',
97 'WxWindows' =>
'wxWindows',
98 'ubuntu-font-1.0' =>
'Ubuntu-font-1.0',
99 'universal-foss-exception-1.0' =>
'Universal-FOSS-exception-1.0',
100 'naist-2003' =>
'NAIST-2003',
111 array(
'clearing_event',
'rf_fk'),
112 array(
'custom_phrase_license_map',
'rf_fk'),
113 array(
'license_file',
'rf_fk'),
114 array(
'license_map',
'rf_fk'),
115 array(
'license_map',
'rf_parent'),
116 array(
'license_set_bulk',
'rf_fk'),
117 array(
'obligation_candidate_map',
'rf_fk'),
118 array(
'obligation_map',
'rf_fk'),
119 array(
'upload_clearing_license',
'rf_fk'),
120 array(
'comp_result',
'first_rf_fk'),
121 array(
'comp_result',
'second_rf_fk'),
122 array(
'license_rules',
'first_rf_fk'),
123 array(
'license_rules',
'second_rf_fk'),
137 $dbManager->prepare($statementName, $sql);
138 $res = $dbManager->execute($statementName, $params);
139 $dbManager->freeResult($res);
156 if (!$dbManager->existsTable(
'report_info')) {
162 $oldName =
trim(json_encode($old),
'"');
163 $newName =
trim(json_encode($new),
'"');
164 $pattern =
'(^|[^A-Za-z0-9-])' . preg_quote($oldName) .
'([^A-Za-z0-9-]|$)';
165 $replacement =
'\1' . str_replace(
'\\',
'\\\\', $newName) .
'\2';
169 SET ri_excluded_obligations =
170 regexp_replace(ri_excluded_obligations::text, $1, $2, 'g')::json
171 WHERE ri_excluded_obligations::text ~ $1",
172 array($pattern, $replacement), __FUNCTION__);
185 $row = $dbManager->getSingleRow(
187 (SELECT rf_pk FROM license_ref WHERE rf_shortname=$1 LIMIT 1) AS old_id,
188 (SELECT rf_pk FROM license_ref WHERE rf_shortname=$2 LIMIT 1) AS new_id",
190 __FUNCTION__ .
'.getIds'
193 $oldId = (!empty($row) && !empty($row[
'old_id'])) ? intval($row[
'old_id']) : 0;
194 $newId = (!empty($row) && !empty($row[
'new_id'])) ? intval($row[
'new_id']) : 0;
196 if ($oldId === 0 || $oldId === $newId) {
201 legacyLicenseWrite($dbManager,
"UPDATE license_ref SET rf_shortname=$1 WHERE rf_pk=$2",
202 array($new, $oldId), __FUNCTION__ .
'.rename');
204 print
"renamed license $old to $new\n";
210 list ($table, $column) = $ref;
211 if (!$dbManager->existsTable($table)) {
215 array($newId, $oldId), __FUNCTION__ .
".move.$table.$column");
219 array($oldId), __FUNCTION__ .
'.deleteLegacy');
221 print
"merged license $old into existing $new\n";
232 if (!$dbManager->existsTable(
'license_ref')) {
241 $dbManager->commit();
Migrate_Legacy_License_Names(DbManager $dbManager, $verbose=false)
updateExcludedObligationNames(DbManager $dbManager, $old, $new)
Rewrite a shortname held in report_info.ri_excluded_obligations.
getLicenseRefReferences()
Columns referencing license_ref.rf_pk, as table => column pairs.
legacyLicenseWrite(DbManager $dbManager, $sql, $params, $statementName)
Run a parameterised write; getSingleRow() would fetch a command result.
getLegacyLicenseNames()
Deprecated shortname => current shortname.
renameOrMergeLicense(DbManager $dbManager, $old, $new, $verbose=false)
Rename a license, or merge it away when the target already exists.
char * trim(char *ptext)
Trimming whitespace.