chiark / gitweb /
lint: require UpdateCheckData to contain only valid HTTPS URLs
[fdroidserver.git] / fdroidserver / lint.py
1 #!/usr/bin/env python3
2 #
3 # lint.py - part of the FDroid server tool
4 # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See th
14 # GNU Affero General Public License for more details.
15 #
16 # You should have received a copy of the GNU Affero General Public Licen
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 from argparse import ArgumentParser
20 import glob
21 import os
22 import re
23 import sys
24 import urllib.parse
25
26 from . import _
27 from . import common
28 from . import metadata
29 from . import rewritemeta
30
31 config = None
32 options = None
33
34
35 def enforce_https(domain):
36     return (re.compile(r'^[^h][^t][^t][^p][^s]://[^/]*' + re.escape(domain) + r'(/.*)?', re.IGNORECASE),
37             domain + " URLs should always use https://")
38
39
40 https_enforcings = [
41     enforce_https('github.com'),
42     enforce_https('gitlab.com'),
43     enforce_https('bitbucket.org'),
44     enforce_https('apache.org'),
45     enforce_https('google.com'),
46     enforce_https('git.code.sf.net'),
47     enforce_https('svn.code.sf.net'),
48     enforce_https('anongit.kde.org'),
49     enforce_https('savannah.nongnu.org'),
50     enforce_https('git.savannah.nongnu.org'),
51     enforce_https('download.savannah.nongnu.org'),
52     enforce_https('savannah.gnu.org'),
53     enforce_https('git.savannah.gnu.org'),
54     enforce_https('download.savannah.gnu.org'),
55     enforce_https('github.io'),
56     enforce_https('gitlab.io'),
57     enforce_https('githubusercontent.com'),
58 ]
59
60
61 def forbid_shortener(domain):
62     return (re.compile(r'https?://[^/]*' + re.escape(domain) + r'/.*'),
63             _("URL shorteners should not be used"))
64
65
66 http_url_shorteners = [
67     forbid_shortener('1url.com'),
68     forbid_shortener('adf.ly'),
69     forbid_shortener('bc.vc'),
70     forbid_shortener('bit.do'),
71     forbid_shortener('bit.ly'),
72     forbid_shortener('bitly.com'),
73     forbid_shortener('budurl.com'),
74     forbid_shortener('buzurl.com'),
75     forbid_shortener('cli.gs'),
76     forbid_shortener('cur.lv'),
77     forbid_shortener('cutt.us'),
78     forbid_shortener('db.tt'),
79     forbid_shortener('filoops.info'),
80     forbid_shortener('goo.gl'),
81     forbid_shortener('is.gd'),
82     forbid_shortener('ity.im'),
83     forbid_shortener('j.mp'),
84     forbid_shortener('l.gg'),
85     forbid_shortener('lnkd.in'),
86     forbid_shortener('moourl.com'),
87     forbid_shortener('ow.ly'),
88     forbid_shortener('para.pt'),
89     forbid_shortener('po.st'),
90     forbid_shortener('q.gs'),
91     forbid_shortener('qr.ae'),
92     forbid_shortener('qr.net'),
93     forbid_shortener('rdlnk.com'),
94     forbid_shortener('scrnch.me'),
95     forbid_shortener('short.nr'),
96     forbid_shortener('sn.im'),
97     forbid_shortener('snipurl.com'),
98     forbid_shortener('su.pr'),
99     forbid_shortener('t.co'),
100     forbid_shortener('tiny.cc'),
101     forbid_shortener('tinyarrows.com'),
102     forbid_shortener('tinyurl.com'),
103     forbid_shortener('tr.im'),
104     forbid_shortener('tweez.me'),
105     forbid_shortener('twitthis.com'),
106     forbid_shortener('twurl.nl'),
107     forbid_shortener('tyn.ee'),
108     forbid_shortener('u.bb'),
109     forbid_shortener('u.to'),
110     forbid_shortener('ur1.ca'),
111     forbid_shortener('urlof.site'),
112     forbid_shortener('v.gd'),
113     forbid_shortener('vzturl.com'),
114     forbid_shortener('x.co'),
115     forbid_shortener('xrl.us'),
116     forbid_shortener('yourls.org'),
117     forbid_shortener('zip.net'),
118     forbid_shortener('✩.ws'),
119     forbid_shortener('➡.ws'),
120 ]
121
122 http_checks = https_enforcings + http_url_shorteners + [
123     (re.compile(r'.*github\.com/[^/]+/[^/]+\.git'),
124      _("Appending .git is not necessary")),
125     (re.compile(r'.*://[^/]*(github|gitlab|bitbucket|rawgit)[^/]*/([^/]+/){1,3}master'),
126      _("Use /HEAD instead of /master to point at a file in the default branch")),
127 ]
128
129 regex_checks = {
130     'WebSite': http_checks,
131     'SourceCode': http_checks,
132     'Repo': https_enforcings,
133     'UpdateCheckMode': https_enforcings,
134     'IssueTracker': http_checks + [
135         (re.compile(r'.*github\.com/[^/]+/[^/]+/*$'),
136          _("/issues is missing")),
137         (re.compile(r'.*gitlab\.com/[^/]+/[^/]+/*$'),
138          _("/issues is missing")),
139     ],
140     'Donate': http_checks + [
141         (re.compile(r'.*flattr\.com'),
142          _("Flattr donation methods belong in the FlattrID flag")),
143         (re.compile(r'.*liberapay\.com'),
144          _("Liberapay donation methods belong in the LiberapayID flag")),
145     ],
146     'Changelog': http_checks,
147     'Author Name': [
148         (re.compile(r'^\s'),
149          _("Unnecessary leading space")),
150         (re.compile(r'.*\s$'),
151          _("Unnecessary trailing space")),
152     ],
153     'Summary': [
154         (re.compile(r'.*\b(free software|open source)\b.*', re.IGNORECASE),
155          _("No need to specify that the app is Free Software")),
156         (re.compile(r'.*((your|for).*android|android.*(app|device|client|port|version))', re.IGNORECASE),
157          _("No need to specify that the app is for Android")),
158         (re.compile(r'.*[a-z0-9][.!?]( |$)'),
159          _("Punctuation should be avoided")),
160         (re.compile(r'^\s'),
161          _("Unnecessary leading space")),
162         (re.compile(r'.*\s$'),
163          _("Unnecessary trailing space")),
164     ],
165     'Description': https_enforcings + http_url_shorteners + [
166         (re.compile(r'\s*[*#][^ .]'),
167          _("Invalid bulleted list")),
168         (re.compile(r'^\s'),
169          _("Unnecessary leading space")),
170         (re.compile(r'.*\s$'),
171          _("Unnecessary trailing space")),
172         (re.compile(r'.*<(applet|base|body|button|embed|form|head|html|iframe|img|input|link|object|picture|script|source|style|svg|video).*', re.IGNORECASE),
173          _("Forbidden HTML tags")),
174         (re.compile(r'''.*\s+src=["']javascript:.*'''),
175          _("Javascript in HTML src attributes")),
176     ],
177 }
178
179 locale_pattern = re.compile(r'^[a-z]{2,3}(-[A-Z][A-Z])?$')
180
181
182 def check_regexes(app):
183     for f, checks in regex_checks.items():
184         for m, r in checks:
185             v = app.get(f)
186             t = metadata.fieldtype(f)
187             if t == metadata.TYPE_MULTILINE:
188                 for l in v.splitlines():
189                     if m.match(l):
190                         yield "%s at line '%s': %s" % (f, l, r)
191             else:
192                 if v is None:
193                     continue
194                 if m.match(v):
195                     yield "%s '%s': %s" % (f, v, r)
196
197
198 def get_lastbuild(builds):
199     lowest_vercode = -1
200     lastbuild = None
201     for build in builds:
202         if not build.disable:
203             vercode = int(build.versionCode)
204             if lowest_vercode == -1 or vercode < lowest_vercode:
205                 lowest_vercode = vercode
206         if not lastbuild or int(build.versionCode) > int(lastbuild.versionCode):
207             lastbuild = build
208     return lastbuild
209
210
211 def check_update_check_data_url(app):
212     """UpdateCheckData must have a valid HTTPS URL to protect checkupdates runs
213     """
214     if app.UpdateCheckData:
215         urlcode, codeex, urlver, verex = app.UpdateCheckData.split('|')
216         for url in (urlcode, urlver):
217             parsed = urllib.parse.urlparse(url)
218             if not parsed.scheme or not parsed.netloc:
219                 yield _('UpdateCheckData not a valid URL: {url}').format(url=url)
220             if parsed.scheme != 'https':
221                 yield _('UpdateCheckData must use HTTPS URL: {url}').format(url=url)
222
223
224 def check_ucm_tags(app):
225     lastbuild = get_lastbuild(app.builds)
226     if (lastbuild is not None
227             and lastbuild.commit
228             and app.UpdateCheckMode == 'RepoManifest'
229             and not lastbuild.commit.startswith('unknown')
230             and lastbuild.versionCode == app.CurrentVersionCode
231             and not lastbuild.forcevercode
232             and any(s in lastbuild.commit for s in '.,_-/')):
233         yield _("Last used commit '{commit}' looks like a tag, but Update Check Mode is '{ucm}'")\
234             .format(commit=lastbuild.commit, ucm=app.UpdateCheckMode)
235
236
237 def check_char_limits(app):
238     limits = config['char_limits']
239
240     if len(app.Summary) > limits['summary']:
241         yield _("Summary of length {length} is over the {limit} char limit")\
242             .format(length=len(app.Summary), limit=limits['summary'])
243
244     if len(app.Description) > limits['description']:
245         yield _("Description of length {length} is over the {limit} char limit")\
246             .format(length=len(app.Description), limit=limits['description'])
247
248
249 def check_old_links(app):
250     usual_sites = [
251         'github.com',
252         'gitlab.com',
253         'bitbucket.org',
254     ]
255     old_sites = [
256         'gitorious.org',
257         'code.google.com',
258     ]
259     if any(s in app.Repo for s in usual_sites):
260         for f in ['WebSite', 'SourceCode', 'IssueTracker', 'Changelog']:
261             v = app.get(f)
262             if any(s in v for s in old_sites):
263                 yield _("App is in '{repo}' but has a link to {url}")\
264                     .format(repo=app.Repo, url=v)
265
266
267 def check_useless_fields(app):
268     if app.UpdateCheckName == app.id:
269         yield _("Update Check Name is set to the known app id - it can be removed")
270
271
272 filling_ucms = re.compile(r'^(Tags.*|RepoManifest.*)')
273
274
275 def check_checkupdates_ran(app):
276     if filling_ucms.match(app.UpdateCheckMode):
277         if not app.AutoName and not app.CurrentVersion and app.CurrentVersionCode == '0':
278             yield _("UCM is set but it looks like checkupdates hasn't been run yet")
279
280
281 def check_empty_fields(app):
282     if not app.Categories:
283         yield _("Categories are not set")
284
285
286 all_categories = set([
287     "Connectivity",
288     "Development",
289     "Games",
290     "Graphics",
291     "Internet",
292     "Money",
293     "Multimedia",
294     "Navigation",
295     "Phone & SMS",
296     "Reading",
297     "Science & Education",
298     "Security",
299     "Sports & Health",
300     "System",
301     "Theming",
302     "Time",
303     "Writing",
304 ])
305
306
307 def check_categories(app):
308     for categ in app.Categories:
309         if categ not in all_categories:
310             yield _("Category '%s' is not valid" % categ)
311
312
313 def check_duplicates(app):
314     if app.Name and app.Name == app.AutoName:
315         yield _("Name '%s' is just the auto name - remove it") % app.Name
316
317     links_seen = set()
318     for f in ['Source Code', 'Web Site', 'Issue Tracker', 'Changelog']:
319         v = app.get(f)
320         if not v:
321             continue
322         v = v.lower()
323         if v in links_seen:
324             yield _("Duplicate link in '{field}': {url}").format(field=f, url=v)
325         else:
326             links_seen.add(v)
327
328     name = app.Name or app.AutoName
329     if app.Summary and name:
330         if app.Summary.lower() == name.lower():
331             yield _("Summary '%s' is just the app's name") % app.Summary
332
333     if app.Summary and app.Description and len(app.Description) == 1:
334         if app.Summary.lower() == app.Description[0].lower():
335             yield _("Description '%s' is just the app's summary") % app.Summary
336
337     seenlines = set()
338     for l in app.Description.splitlines():
339         if len(l) < 1:
340             continue
341         if l in seenlines:
342             yield _("Description has a duplicate line")
343         seenlines.add(l)
344
345
346 desc_url = re.compile(r'(^|[^[])\[([^ ]+)( |\]|$)')
347
348
349 def check_mediawiki_links(app):
350     wholedesc = ' '.join(app.Description)
351     for um in desc_url.finditer(wholedesc):
352         url = um.group(1)
353         for m, r in http_checks:
354             if m.match(url):
355                 yield _("URL {url} in Description: {error}").format(url=url, error=r)
356
357
358 def check_bulleted_lists(app):
359     validchars = ['*', '#']
360     lchar = ''
361     lcount = 0
362     for l in app.Description.splitlines():
363         if len(l) < 1:
364             lcount = 0
365             continue
366
367         if l[0] == lchar and l[1] == ' ':
368             lcount += 1
369             if lcount > 2 and lchar not in validchars:
370                 yield _("Description has a list (%s) but it isn't bulleted (*) nor numbered (#)") % lchar
371                 break
372         else:
373             lchar = l[0]
374             lcount = 1
375
376
377 def check_builds(app):
378     supported_flags = set(metadata.build_flags)
379     # needed for YAML and JSON
380     for build in app.builds:
381         if build.disable:
382             if build.disable.startswith('Generated by import.py'):
383                 yield _("Build generated by `fdroid import` - remove disable line once ready")
384             continue
385         for s in ['master', 'origin', 'HEAD', 'default', 'trunk']:
386             if build.commit and build.commit.startswith(s):
387                 yield _("Branch '{branch}' used as commit in build '{versionName}'")\
388                     .format(branch=s, versionName=build.versionName)
389             for srclib in build.srclibs:
390                 if '@' in srclib:
391                     ref = srclib.split('@')[1].split('/')[0]
392                     if ref.startswith(s):
393                         yield _("Branch '{branch}' used as commit in srclib '{srclib}'")\
394                             .format(branch=s, srclib=srclib)
395                 else:
396                     yield _('srclibs missing name and/or @') + ' (srclibs: ' + srclib + ')'
397         for key in build.keys():
398             if key not in supported_flags:
399                 yield _('%s is not an accepted build field') % key
400
401
402 def check_files_dir(app):
403     dir_path = os.path.join('metadata', app.id)
404     if not os.path.isdir(dir_path):
405         return
406     files = set()
407     for name in os.listdir(dir_path):
408         path = os.path.join(dir_path, name)
409         if not (os.path.isfile(path) or name == 'signatures' or locale_pattern.match(name)):
410             yield _("Found non-file at %s") % path
411             continue
412         files.add(name)
413
414     used = {'signatures', }
415     for build in app.builds:
416         for fname in build.patch:
417             if fname not in files:
418                 yield _("Unknown file '{filename}' in build '{versionName}'")\
419                     .format(filename=fname, versionName=build.versionName)
420             else:
421                 used.add(fname)
422
423     for name in files.difference(used):
424         if locale_pattern.match(name):
425             continue
426         yield _("Unused file at %s") % os.path.join(dir_path, name)
427
428
429 def check_format(app):
430     if options.format and not rewritemeta.proper_format(app):
431         yield _("Run rewritemeta to fix formatting")
432
433
434 def check_license_tag(app):
435     '''Ensure all license tags are in https://spdx.org/license-list'''
436     if app.License.rstrip('+') not in SPDX:
437         yield _('Invalid license tag "%s"! Use only tags from https://spdx.org/license-list') \
438             % (app.License)
439
440
441 def check_extlib_dir(apps):
442     dir_path = os.path.join('build', 'extlib')
443     unused_extlib_files = set()
444     for root, dirs, files in os.walk(dir_path):
445         for name in files:
446             unused_extlib_files.add(os.path.join(root, name)[len(dir_path) + 1:])
447
448     used = set()
449     for app in apps:
450         for build in app.builds:
451             for path in build.extlibs:
452                 if path not in unused_extlib_files:
453                     yield _("{appid}: Unknown extlib {path} in build '{versionName}'")\
454                         .format(appid=app.id, path=path, versionName=build.versionName)
455                 else:
456                     used.add(path)
457
458     for path in unused_extlib_files.difference(used):
459         if any(path.endswith(s) for s in [
460                 '.gitignore',
461                 'source.txt', 'origin.txt', 'md5.txt',
462                 'LICENSE', 'LICENSE.txt',
463                 'COPYING', 'COPYING.txt',
464                 'NOTICE', 'NOTICE.txt',
465                 ]):
466             continue
467         yield _("Unused extlib at %s") % os.path.join(dir_path, path)
468
469
470 def check_for_unsupported_metadata_files(basedir=""):
471     """Checks whether any non-metadata files are in metadata/"""
472
473     global config
474
475     return_value = False
476     formats = config['accepted_formats']
477     for f in glob.glob(basedir + 'metadata/*') + glob.glob(basedir + 'metadata/.*'):
478         if os.path.isdir(f):
479             exists = False
480             for t in formats:
481                 exists = exists or os.path.exists(f + '.' + t)
482             if not exists:
483                 print(_('"%s/" has no matching metadata file!') % f)
484                 return_value = True
485         elif not os.path.splitext(f)[1][1:] in formats:
486             print('"' + f.replace(basedir, '')
487                   + '" is not a supported file format: (' + ','.join(formats) + ')')
488             return_value = True
489
490     return return_value
491
492
493 def main():
494
495     global config, options
496
497     # Parse command line...
498     parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
499     common.setup_global_opts(parser)
500     parser.add_argument("-f", "--format", action="store_true", default=False,
501                         help=_("Also warn about formatting issues, like rewritemeta -l"))
502     parser.add_argument("appid", nargs='*', help=_("applicationId in the form APPID"))
503     metadata.add_metadata_arguments(parser)
504     options = parser.parse_args()
505     metadata.warnings_action = options.W
506
507     config = common.read_config(options)
508
509     # Get all apps...
510     allapps = metadata.read_metadata(xref=True)
511     apps = common.read_app_args(options.appid, allapps, False)
512
513     anywarns = check_for_unsupported_metadata_files()
514
515     apps_check_funcs = []
516     if len(options.appid) == 0:
517         # otherwise it finds tons of unused extlibs
518         apps_check_funcs.append(check_extlib_dir)
519     for check_func in apps_check_funcs:
520         for warn in check_func(apps.values()):
521             anywarns = True
522             print(warn)
523
524     for appid, app in apps.items():
525         if app.Disabled:
526             continue
527
528         app_check_funcs = [
529             check_regexes,
530             check_update_check_data_url,
531             check_ucm_tags,
532             check_char_limits,
533             check_old_links,
534             check_checkupdates_ran,
535             check_useless_fields,
536             check_empty_fields,
537             check_categories,
538             check_duplicates,
539             check_mediawiki_links,
540             check_bulleted_lists,
541             check_builds,
542             check_files_dir,
543             check_format,
544             check_license_tag,
545         ]
546
547         for check_func in app_check_funcs:
548             for warn in check_func(app):
549                 anywarns = True
550                 print("%s: %s" % (appid, warn))
551
552     if anywarns:
553         sys.exit(1)
554
555
556 # A compiled, public domain list of official SPDX license tags from:
557 # https://github.com/sindresorhus/spdx-license-list/blob/v3.0.1/spdx-simple.json
558 # The deprecated license tags have been removed from the list, they are at the
559 # bottom, starting after the last license tags that start with Z.
560 # This is at the bottom, since its a long list of data
561 SPDX = [
562     "PublicDomain",  # an F-Droid addition, until we can enforce a better option
563     "Glide",
564     "Abstyles",
565     "AFL-1.1",
566     "AFL-1.2",
567     "AFL-2.0",
568     "AFL-2.1",
569     "AFL-3.0",
570     "AMPAS",
571     "APL-1.0",
572     "Adobe-Glyph",
573     "APAFML",
574     "Adobe-2006",
575     "AGPL-1.0",
576     "Afmparse",
577     "Aladdin",
578     "ADSL",
579     "AMDPLPA",
580     "ANTLR-PD",
581     "Apache-1.0",
582     "Apache-1.1",
583     "Apache-2.0",
584     "AML",
585     "APSL-1.0",
586     "APSL-1.1",
587     "APSL-1.2",
588     "APSL-2.0",
589     "Artistic-1.0",
590     "Artistic-1.0-Perl",
591     "Artistic-1.0-cl8",
592     "Artistic-2.0",
593     "AAL",
594     "Bahyph",
595     "Barr",
596     "Beerware",
597     "BitTorrent-1.0",
598     "BitTorrent-1.1",
599     "BSL-1.0",
600     "Borceux",
601     "BSD-2-Clause",
602     "BSD-2-Clause-FreeBSD",
603     "BSD-2-Clause-NetBSD",
604     "BSD-3-Clause",
605     "BSD-3-Clause-Clear",
606     "BSD-3-Clause-No-Nuclear-License",
607     "BSD-3-Clause-No-Nuclear-License-2014",
608     "BSD-3-Clause-No-Nuclear-Warranty",
609     "BSD-4-Clause",
610     "BSD-Protection",
611     "BSD-Source-Code",
612     "BSD-3-Clause-Attribution",
613     "0BSD",
614     "BSD-4-Clause-UC",
615     "bzip2-1.0.5",
616     "bzip2-1.0.6",
617     "Caldera",
618     "CECILL-1.0",
619     "CECILL-1.1",
620     "CECILL-2.0",
621     "CECILL-2.1",
622     "CECILL-B",
623     "CECILL-C",
624     "ClArtistic",
625     "MIT-CMU",
626     "CNRI-Jython",
627     "CNRI-Python",
628     "CNRI-Python-GPL-Compatible",
629     "CPOL-1.02",
630     "CDDL-1.0",
631     "CDDL-1.1",
632     "CPAL-1.0",
633     "CPL-1.0",
634     "CATOSL-1.1",
635     "Condor-1.1",
636     "CC-BY-1.0",
637     "CC-BY-2.0",
638     "CC-BY-2.5",
639     "CC-BY-3.0",
640     "CC-BY-4.0",
641     "CC-BY-ND-1.0",
642     "CC-BY-ND-2.0",
643     "CC-BY-ND-2.5",
644     "CC-BY-ND-3.0",
645     "CC-BY-ND-4.0",
646     "CC-BY-NC-1.0",
647     "CC-BY-NC-2.0",
648     "CC-BY-NC-2.5",
649     "CC-BY-NC-3.0",
650     "CC-BY-NC-4.0",
651     "CC-BY-NC-ND-1.0",
652     "CC-BY-NC-ND-2.0",
653     "CC-BY-NC-ND-2.5",
654     "CC-BY-NC-ND-3.0",
655     "CC-BY-NC-ND-4.0",
656     "CC-BY-NC-SA-1.0",
657     "CC-BY-NC-SA-2.0",
658     "CC-BY-NC-SA-2.5",
659     "CC-BY-NC-SA-3.0",
660     "CC-BY-NC-SA-4.0",
661     "CC-BY-SA-1.0",
662     "CC-BY-SA-2.0",
663     "CC-BY-SA-2.5",
664     "CC-BY-SA-3.0",
665     "CC-BY-SA-4.0",
666     "CC0-1.0",
667     "Crossword",
668     "CrystalStacker",
669     "CUA-OPL-1.0",
670     "Cube",
671     "curl",
672     "D-FSL-1.0",
673     "diffmark",
674     "WTFPL",
675     "DOC",
676     "Dotseqn",
677     "DSDP",
678     "dvipdfm",
679     "EPL-1.0",
680     "ECL-1.0",
681     "ECL-2.0",
682     "eGenix",
683     "EFL-1.0",
684     "EFL-2.0",
685     "MIT-advertising",
686     "MIT-enna",
687     "Entessa",
688     "ErlPL-1.1",
689     "EUDatagrid",
690     "EUPL-1.0",
691     "EUPL-1.1",
692     "Eurosym",
693     "Fair",
694     "MIT-feh",
695     "Frameworx-1.0",
696     "FreeImage",
697     "FTL",
698     "FSFAP",
699     "FSFUL",
700     "FSFULLR",
701     "Giftware",
702     "GL2PS",
703     "Glulxe",
704     "AGPL-3.0",
705     "GFDL-1.1",
706     "GFDL-1.2",
707     "GFDL-1.3",
708     "GPL-1.0",
709     "GPL-2.0",
710     "GPL-3.0",
711     "LGPL-2.1",
712     "LGPL-3.0",
713     "LGPL-2.0",
714     "gnuplot",
715     "gSOAP-1.3b",
716     "HaskellReport",
717     "HPND",
718     "IBM-pibs",
719     "IPL-1.0",
720     "ICU",
721     "ImageMagick",
722     "iMatix",
723     "Imlib2",
724     "IJG",
725     "Info-ZIP",
726     "Intel-ACPI",
727     "Intel",
728     "Interbase-1.0",
729     "IPA",
730     "ISC",
731     "JasPer-2.0",
732     "JSON",
733     "LPPL-1.0",
734     "LPPL-1.1",
735     "LPPL-1.2",
736     "LPPL-1.3a",
737     "LPPL-1.3c",
738     "Latex2e",
739     "BSD-3-Clause-LBNL",
740     "Leptonica",
741     "LGPLLR",
742     "Libpng",
743     "libtiff",
744     "LAL-1.2",
745     "LAL-1.3",
746     "LiLiQ-P-1.1",
747     "LiLiQ-Rplus-1.1",
748     "LiLiQ-R-1.1",
749     "LPL-1.02",
750     "LPL-1.0",
751     "MakeIndex",
752     "MTLL",
753     "MS-PL",
754     "MS-RL",
755     "MirOS",
756     "MITNFA",
757     "MIT",
758     "Motosoto",
759     "MPL-1.0",
760     "MPL-1.1",
761     "MPL-2.0",
762     "MPL-2.0-no-copyleft-exception",
763     "mpich2",
764     "Multics",
765     "Mup",
766     "NASA-1.3",
767     "Naumen",
768     "NBPL-1.0",
769     "Net-SNMP",
770     "NetCDF",
771     "NGPL",
772     "NOSL",
773     "NPL-1.0",
774     "NPL-1.1",
775     "Newsletr",
776     "NLPL",
777     "Nokia",
778     "NPOSL-3.0",
779     "NLOD-1.0",
780     "Noweb",
781     "NRL",
782     "NTP",
783     "Nunit",
784     "OCLC-2.0",
785     "ODbL-1.0",
786     "PDDL-1.0",
787     "OCCT-PL",
788     "OGTSL",
789     "OLDAP-2.2.2",
790     "OLDAP-1.1",
791     "OLDAP-1.2",
792     "OLDAP-1.3",
793     "OLDAP-1.4",
794     "OLDAP-2.0",
795     "OLDAP-2.0.1",
796     "OLDAP-2.1",
797     "OLDAP-2.2",
798     "OLDAP-2.2.1",
799     "OLDAP-2.3",
800     "OLDAP-2.4",
801     "OLDAP-2.5",
802     "OLDAP-2.6",
803     "OLDAP-2.7",
804     "OLDAP-2.8",
805     "OML",
806     "OPL-1.0",
807     "OSL-1.0",
808     "OSL-1.1",
809     "OSL-2.0",
810     "OSL-2.1",
811     "OSL-3.0",
812     "OpenSSL",
813     "OSET-PL-2.1",
814     "PHP-3.0",
815     "PHP-3.01",
816     "Plexus",
817     "PostgreSQL",
818     "psfrag",
819     "psutils",
820     "Python-2.0",
821     "QPL-1.0",
822     "Qhull",
823     "Rdisc",
824     "RPSL-1.0",
825     "RPL-1.1",
826     "RPL-1.5",
827     "RHeCos-1.1",
828     "RSCPL",
829     "RSA-MD",
830     "Ruby",
831     "SAX-PD",
832     "Saxpath",
833     "SCEA",
834     "SWL",
835     "SMPPL",
836     "Sendmail",
837     "SGI-B-1.0",
838     "SGI-B-1.1",
839     "SGI-B-2.0",
840     "OFL-1.0",
841     "OFL-1.1",
842     "SimPL-2.0",
843     "Sleepycat",
844     "SNIA",
845     "Spencer-86",
846     "Spencer-94",
847     "Spencer-99",
848     "SMLNJ",
849     "SugarCRM-1.1.3",
850     "SISSL",
851     "SISSL-1.2",
852     "SPL-1.0",
853     "Watcom-1.0",
854     "TCL",
855     "TCP-wrappers",
856     "Unlicense",
857     "TMate",
858     "TORQUE-1.1",
859     "TOSL",
860     "Unicode-DFS-2015",
861     "Unicode-DFS-2016",
862     "Unicode-TOU",
863     "UPL-1.0",
864     "NCSA",
865     "Vim",
866     "VOSTROM",
867     "VSL-1.0",
868     "W3C-20150513",
869     "W3C-19980720",
870     "W3C",
871     "Wsuipa",
872     "Xnet",
873     "X11",
874     "Xerox",
875     "XFree86-1.1",
876     "xinetd",
877     "xpp",
878     "XSkat",
879     "YPL-1.0",
880     "YPL-1.1",
881     "Zed",
882     "Zend-2.0",
883     "Zimbra-1.3",
884     "Zimbra-1.4",
885     "Zlib",
886     "zlib-acknowledgement",
887     "ZPL-1.1",
888     "ZPL-2.0",
889     "ZPL-2.1",
890 ]
891
892 if __name__ == "__main__":
893     main()