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