chiark / gitweb /
ed86e29ad32473e5ffc48a76689f6576a6d5afc1
[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             if url != '.':
218                 parsed = urllib.parse.urlparse(url)
219                 if not parsed.scheme or not parsed.netloc:
220                     yield _('UpdateCheckData not a valid URL: {url}').format(url=url)
221                 if parsed.scheme != 'https':
222                     yield _('UpdateCheckData must use HTTPS URL: {url}').format(url=url)
223
224
225 def check_ucm_tags(app):
226     lastbuild = get_lastbuild(app.builds)
227     if (lastbuild is not None
228             and lastbuild.commit
229             and app.UpdateCheckMode == 'RepoManifest'
230             and not lastbuild.commit.startswith('unknown')
231             and lastbuild.versionCode == app.CurrentVersionCode
232             and not lastbuild.forcevercode
233             and any(s in lastbuild.commit for s in '.,_-/')):
234         yield _("Last used commit '{commit}' looks like a tag, but Update Check Mode is '{ucm}'")\
235             .format(commit=lastbuild.commit, ucm=app.UpdateCheckMode)
236
237
238 def check_char_limits(app):
239     limits = config['char_limits']
240
241     if len(app.Summary) > limits['summary']:
242         yield _("Summary of length {length} is over the {limit} char limit")\
243             .format(length=len(app.Summary), limit=limits['summary'])
244
245     if len(app.Description) > limits['description']:
246         yield _("Description of length {length} is over the {limit} char limit")\
247             .format(length=len(app.Description), limit=limits['description'])
248
249
250 def check_old_links(app):
251     usual_sites = [
252         'github.com',
253         'gitlab.com',
254         'bitbucket.org',
255     ]
256     old_sites = [
257         'gitorious.org',
258         'code.google.com',
259     ]
260     if any(s in app.Repo for s in usual_sites):
261         for f in ['WebSite', 'SourceCode', 'IssueTracker', 'Changelog']:
262             v = app.get(f)
263             if any(s in v for s in old_sites):
264                 yield _("App is in '{repo}' but has a link to {url}")\
265                     .format(repo=app.Repo, url=v)
266
267
268 def check_useless_fields(app):
269     if app.UpdateCheckName == app.id:
270         yield _("Update Check Name is set to the known app id - it can be removed")
271
272
273 filling_ucms = re.compile(r'^(Tags.*|RepoManifest.*)')
274
275
276 def check_checkupdates_ran(app):
277     if filling_ucms.match(app.UpdateCheckMode):
278         if not app.AutoName and not app.CurrentVersion and app.CurrentVersionCode == '0':
279             yield _("UCM is set but it looks like checkupdates hasn't been run yet")
280
281
282 def check_empty_fields(app):
283     if not app.Categories:
284         yield _("Categories are not set")
285
286
287 all_categories = set([
288     "Connectivity",
289     "Development",
290     "Games",
291     "Graphics",
292     "Internet",
293     "Money",
294     "Multimedia",
295     "Navigation",
296     "Phone & SMS",
297     "Reading",
298     "Science & Education",
299     "Security",
300     "Sports & Health",
301     "System",
302     "Theming",
303     "Time",
304     "Writing",
305 ])
306
307
308 def check_categories(app):
309     for categ in app.Categories:
310         if categ not in all_categories:
311             yield _("Category '%s' is not valid" % categ)
312
313
314 def check_duplicates(app):
315     if app.Name and app.Name == app.AutoName:
316         yield _("Name '%s' is just the auto name - remove it") % app.Name
317
318     links_seen = set()
319     for f in ['Source Code', 'Web Site', 'Issue Tracker', 'Changelog']:
320         v = app.get(f)
321         if not v:
322             continue
323         v = v.lower()
324         if v in links_seen:
325             yield _("Duplicate link in '{field}': {url}").format(field=f, url=v)
326         else:
327             links_seen.add(v)
328
329     name = app.Name or app.AutoName
330     if app.Summary and name:
331         if app.Summary.lower() == name.lower():
332             yield _("Summary '%s' is just the app's name") % app.Summary
333
334     if app.Summary and app.Description and len(app.Description) == 1:
335         if app.Summary.lower() == app.Description[0].lower():
336             yield _("Description '%s' is just the app's summary") % app.Summary
337
338     seenlines = set()
339     for l in app.Description.splitlines():
340         if len(l) < 1:
341             continue
342         if l in seenlines:
343             yield _("Description has a duplicate line")
344         seenlines.add(l)
345
346
347 desc_url = re.compile(r'(^|[^[])\[([^ ]+)( |\]|$)')
348
349
350 def check_mediawiki_links(app):
351     wholedesc = ' '.join(app.Description)
352     for um in desc_url.finditer(wholedesc):
353         url = um.group(1)
354         for m, r in http_checks:
355             if m.match(url):
356                 yield _("URL {url} in Description: {error}").format(url=url, error=r)
357
358
359 def check_bulleted_lists(app):
360     validchars = ['*', '#']
361     lchar = ''
362     lcount = 0
363     for l in app.Description.splitlines():
364         if len(l) < 1:
365             lcount = 0
366             continue
367
368         if l[0] == lchar and l[1] == ' ':
369             lcount += 1
370             if lcount > 2 and lchar not in validchars:
371                 yield _("Description has a list (%s) but it isn't bulleted (*) nor numbered (#)") % lchar
372                 break
373         else:
374             lchar = l[0]
375             lcount = 1
376
377
378 def check_builds(app):
379     supported_flags = set(metadata.build_flags)
380     # needed for YAML and JSON
381     for build in app.builds:
382         if build.disable:
383             if build.disable.startswith('Generated by import.py'):
384                 yield _("Build generated by `fdroid import` - remove disable line once ready")
385             continue
386         for s in ['master', 'origin', 'HEAD', 'default', 'trunk']:
387             if build.commit and build.commit.startswith(s):
388                 yield _("Branch '{branch}' used as commit in build '{versionName}'")\
389                     .format(branch=s, versionName=build.versionName)
390             for srclib in build.srclibs:
391                 if '@' in srclib:
392                     ref = srclib.split('@')[1].split('/')[0]
393                     if ref.startswith(s):
394                         yield _("Branch '{branch}' used as commit in srclib '{srclib}'")\
395                             .format(branch=s, srclib=srclib)
396                 else:
397                     yield _('srclibs missing name and/or @') + ' (srclibs: ' + srclib + ')'
398         for key in build.keys():
399             if key not in supported_flags:
400                 yield _('%s is not an accepted build field') % key
401
402
403 def check_files_dir(app):
404     dir_path = os.path.join('metadata', app.id)
405     if not os.path.isdir(dir_path):
406         return
407     files = set()
408     for name in os.listdir(dir_path):
409         path = os.path.join(dir_path, name)
410         if not (os.path.isfile(path) or name == 'signatures' or locale_pattern.match(name)):
411             yield _("Found non-file at %s") % path
412             continue
413         files.add(name)
414
415     used = {'signatures', }
416     for build in app.builds:
417         for fname in build.patch:
418             if fname not in files:
419                 yield _("Unknown file '{filename}' in build '{versionName}'")\
420                     .format(filename=fname, versionName=build.versionName)
421             else:
422                 used.add(fname)
423
424     for name in files.difference(used):
425         if locale_pattern.match(name):
426             continue
427         yield _("Unused file at %s") % os.path.join(dir_path, name)
428
429
430 def check_format(app):
431     if options.format and not rewritemeta.proper_format(app):
432         yield _("Run rewritemeta to fix formatting")
433
434
435 def check_license_tag(app):
436     '''Ensure all license tags are in https://spdx.org/license-list'''
437     if app.License.rstrip('+') not in SPDX:
438         yield _('Invalid license tag "%s"! Use only tags from https://spdx.org/license-list') \
439             % (app.License)
440
441
442 def check_extlib_dir(apps):
443     dir_path = os.path.join('build', 'extlib')
444     unused_extlib_files = set()
445     for root, dirs, files in os.walk(dir_path):
446         for name in files:
447             unused_extlib_files.add(os.path.join(root, name)[len(dir_path) + 1:])
448
449     used = set()
450     for app in apps:
451         for build in app.builds:
452             for path in build.extlibs:
453                 if path not in unused_extlib_files:
454                     yield _("{appid}: Unknown extlib {path} in build '{versionName}'")\
455                         .format(appid=app.id, path=path, versionName=build.versionName)
456                 else:
457                     used.add(path)
458
459     for path in unused_extlib_files.difference(used):
460         if any(path.endswith(s) for s in [
461                 '.gitignore',
462                 'source.txt', 'origin.txt', 'md5.txt',
463                 'LICENSE', 'LICENSE.txt',
464                 'COPYING', 'COPYING.txt',
465                 'NOTICE', 'NOTICE.txt',
466                 ]):
467             continue
468         yield _("Unused extlib at %s") % os.path.join(dir_path, path)
469
470
471 def check_for_unsupported_metadata_files(basedir=""):
472     """Checks whether any non-metadata files are in metadata/"""
473
474     global config
475
476     return_value = False
477     formats = config['accepted_formats']
478     for f in glob.glob(basedir + 'metadata/*') + glob.glob(basedir + 'metadata/.*'):
479         if os.path.isdir(f):
480             exists = False
481             for t in formats:
482                 exists = exists or os.path.exists(f + '.' + t)
483             if not exists:
484                 print(_('"%s/" has no matching metadata file!') % f)
485                 return_value = True
486         elif not os.path.splitext(f)[1][1:] in formats:
487             print('"' + f.replace(basedir, '')
488                   + '" is not a supported file format: (' + ','.join(formats) + ')')
489             return_value = True
490
491     return return_value
492
493
494 def main():
495
496     global config, options
497
498     # Parse command line...
499     parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
500     common.setup_global_opts(parser)
501     parser.add_argument("-f", "--format", action="store_true", default=False,
502                         help=_("Also warn about formatting issues, like rewritemeta -l"))
503     parser.add_argument("appid", nargs='*', help=_("applicationId in the form APPID"))
504     metadata.add_metadata_arguments(parser)
505     options = parser.parse_args()
506     metadata.warnings_action = options.W
507
508     config = common.read_config(options)
509
510     # Get all apps...
511     allapps = metadata.read_metadata(xref=True)
512     apps = common.read_app_args(options.appid, allapps, False)
513
514     anywarns = check_for_unsupported_metadata_files()
515
516     apps_check_funcs = []
517     if len(options.appid) == 0:
518         # otherwise it finds tons of unused extlibs
519         apps_check_funcs.append(check_extlib_dir)
520     for check_func in apps_check_funcs:
521         for warn in check_func(apps.values()):
522             anywarns = True
523             print(warn)
524
525     for appid, app in apps.items():
526         if app.Disabled:
527             continue
528
529         app_check_funcs = [
530             check_regexes,
531             check_update_check_data_url,
532             check_ucm_tags,
533             check_char_limits,
534             check_old_links,
535             check_checkupdates_ran,
536             check_useless_fields,
537             check_empty_fields,
538             check_categories,
539             check_duplicates,
540             check_mediawiki_links,
541             check_bulleted_lists,
542             check_builds,
543             check_files_dir,
544             check_format,
545             check_license_tag,
546         ]
547
548         for check_func in app_check_funcs:
549             for warn in check_func(app):
550                 anywarns = True
551                 print("%s: %s" % (appid, warn))
552
553     if anywarns:
554         sys.exit(1)
555
556
557 # A compiled, public domain list of official SPDX license tags from:
558 # https://github.com/sindresorhus/spdx-license-list/blob/v3.0.1/spdx-simple.json
559 # The deprecated license tags have been removed from the list, they are at the
560 # bottom, starting after the last license tags that start with Z.
561 # This is at the bottom, since its a long list of data
562 SPDX = [
563     "PublicDomain",  # an F-Droid addition, until we can enforce a better option
564     "Glide",
565     "Abstyles",
566     "AFL-1.1",
567     "AFL-1.2",
568     "AFL-2.0",
569     "AFL-2.1",
570     "AFL-3.0",
571     "AMPAS",
572     "APL-1.0",
573     "Adobe-Glyph",
574     "APAFML",
575     "Adobe-2006",
576     "AGPL-1.0",
577     "Afmparse",
578     "Aladdin",
579     "ADSL",
580     "AMDPLPA",
581     "ANTLR-PD",
582     "Apache-1.0",
583     "Apache-1.1",
584     "Apache-2.0",
585     "AML",
586     "APSL-1.0",
587     "APSL-1.1",
588     "APSL-1.2",
589     "APSL-2.0",
590     "Artistic-1.0",
591     "Artistic-1.0-Perl",
592     "Artistic-1.0-cl8",
593     "Artistic-2.0",
594     "AAL",
595     "Bahyph",
596     "Barr",
597     "Beerware",
598     "BitTorrent-1.0",
599     "BitTorrent-1.1",
600     "BSL-1.0",
601     "Borceux",
602     "BSD-2-Clause",
603     "BSD-2-Clause-FreeBSD",
604     "BSD-2-Clause-NetBSD",
605     "BSD-3-Clause",
606     "BSD-3-Clause-Clear",
607     "BSD-3-Clause-No-Nuclear-License",
608     "BSD-3-Clause-No-Nuclear-License-2014",
609     "BSD-3-Clause-No-Nuclear-Warranty",
610     "BSD-4-Clause",
611     "BSD-Protection",
612     "BSD-Source-Code",
613     "BSD-3-Clause-Attribution",
614     "0BSD",
615     "BSD-4-Clause-UC",
616     "bzip2-1.0.5",
617     "bzip2-1.0.6",
618     "Caldera",
619     "CECILL-1.0",
620     "CECILL-1.1",
621     "CECILL-2.0",
622     "CECILL-2.1",
623     "CECILL-B",
624     "CECILL-C",
625     "ClArtistic",
626     "MIT-CMU",
627     "CNRI-Jython",
628     "CNRI-Python",
629     "CNRI-Python-GPL-Compatible",
630     "CPOL-1.02",
631     "CDDL-1.0",
632     "CDDL-1.1",
633     "CPAL-1.0",
634     "CPL-1.0",
635     "CATOSL-1.1",
636     "Condor-1.1",
637     "CC-BY-1.0",
638     "CC-BY-2.0",
639     "CC-BY-2.5",
640     "CC-BY-3.0",
641     "CC-BY-4.0",
642     "CC-BY-ND-1.0",
643     "CC-BY-ND-2.0",
644     "CC-BY-ND-2.5",
645     "CC-BY-ND-3.0",
646     "CC-BY-ND-4.0",
647     "CC-BY-NC-1.0",
648     "CC-BY-NC-2.0",
649     "CC-BY-NC-2.5",
650     "CC-BY-NC-3.0",
651     "CC-BY-NC-4.0",
652     "CC-BY-NC-ND-1.0",
653     "CC-BY-NC-ND-2.0",
654     "CC-BY-NC-ND-2.5",
655     "CC-BY-NC-ND-3.0",
656     "CC-BY-NC-ND-4.0",
657     "CC-BY-NC-SA-1.0",
658     "CC-BY-NC-SA-2.0",
659     "CC-BY-NC-SA-2.5",
660     "CC-BY-NC-SA-3.0",
661     "CC-BY-NC-SA-4.0",
662     "CC-BY-SA-1.0",
663     "CC-BY-SA-2.0",
664     "CC-BY-SA-2.5",
665     "CC-BY-SA-3.0",
666     "CC-BY-SA-4.0",
667     "CC0-1.0",
668     "Crossword",
669     "CrystalStacker",
670     "CUA-OPL-1.0",
671     "Cube",
672     "curl",
673     "D-FSL-1.0",
674     "diffmark",
675     "WTFPL",
676     "DOC",
677     "Dotseqn",
678     "DSDP",
679     "dvipdfm",
680     "EPL-1.0",
681     "ECL-1.0",
682     "ECL-2.0",
683     "eGenix",
684     "EFL-1.0",
685     "EFL-2.0",
686     "MIT-advertising",
687     "MIT-enna",
688     "Entessa",
689     "ErlPL-1.1",
690     "EUDatagrid",
691     "EUPL-1.0",
692     "EUPL-1.1",
693     "Eurosym",
694     "Fair",
695     "MIT-feh",
696     "Frameworx-1.0",
697     "FreeImage",
698     "FTL",
699     "FSFAP",
700     "FSFUL",
701     "FSFULLR",
702     "Giftware",
703     "GL2PS",
704     "Glulxe",
705     "AGPL-3.0",
706     "GFDL-1.1",
707     "GFDL-1.2",
708     "GFDL-1.3",
709     "GPL-1.0",
710     "GPL-2.0",
711     "GPL-3.0",
712     "LGPL-2.1",
713     "LGPL-3.0",
714     "LGPL-2.0",
715     "gnuplot",
716     "gSOAP-1.3b",
717     "HaskellReport",
718     "HPND",
719     "IBM-pibs",
720     "IPL-1.0",
721     "ICU",
722     "ImageMagick",
723     "iMatix",
724     "Imlib2",
725     "IJG",
726     "Info-ZIP",
727     "Intel-ACPI",
728     "Intel",
729     "Interbase-1.0",
730     "IPA",
731     "ISC",
732     "JasPer-2.0",
733     "JSON",
734     "LPPL-1.0",
735     "LPPL-1.1",
736     "LPPL-1.2",
737     "LPPL-1.3a",
738     "LPPL-1.3c",
739     "Latex2e",
740     "BSD-3-Clause-LBNL",
741     "Leptonica",
742     "LGPLLR",
743     "Libpng",
744     "libtiff",
745     "LAL-1.2",
746     "LAL-1.3",
747     "LiLiQ-P-1.1",
748     "LiLiQ-Rplus-1.1",
749     "LiLiQ-R-1.1",
750     "LPL-1.02",
751     "LPL-1.0",
752     "MakeIndex",
753     "MTLL",
754     "MS-PL",
755     "MS-RL",
756     "MirOS",
757     "MITNFA",
758     "MIT",
759     "Motosoto",
760     "MPL-1.0",
761     "MPL-1.1",
762     "MPL-2.0",
763     "MPL-2.0-no-copyleft-exception",
764     "mpich2",
765     "Multics",
766     "Mup",
767     "NASA-1.3",
768     "Naumen",
769     "NBPL-1.0",
770     "Net-SNMP",
771     "NetCDF",
772     "NGPL",
773     "NOSL",
774     "NPL-1.0",
775     "NPL-1.1",
776     "Newsletr",
777     "NLPL",
778     "Nokia",
779     "NPOSL-3.0",
780     "NLOD-1.0",
781     "Noweb",
782     "NRL",
783     "NTP",
784     "Nunit",
785     "OCLC-2.0",
786     "ODbL-1.0",
787     "PDDL-1.0",
788     "OCCT-PL",
789     "OGTSL",
790     "OLDAP-2.2.2",
791     "OLDAP-1.1",
792     "OLDAP-1.2",
793     "OLDAP-1.3",
794     "OLDAP-1.4",
795     "OLDAP-2.0",
796     "OLDAP-2.0.1",
797     "OLDAP-2.1",
798     "OLDAP-2.2",
799     "OLDAP-2.2.1",
800     "OLDAP-2.3",
801     "OLDAP-2.4",
802     "OLDAP-2.5",
803     "OLDAP-2.6",
804     "OLDAP-2.7",
805     "OLDAP-2.8",
806     "OML",
807     "OPL-1.0",
808     "OSL-1.0",
809     "OSL-1.1",
810     "OSL-2.0",
811     "OSL-2.1",
812     "OSL-3.0",
813     "OpenSSL",
814     "OSET-PL-2.1",
815     "PHP-3.0",
816     "PHP-3.01",
817     "Plexus",
818     "PostgreSQL",
819     "psfrag",
820     "psutils",
821     "Python-2.0",
822     "QPL-1.0",
823     "Qhull",
824     "Rdisc",
825     "RPSL-1.0",
826     "RPL-1.1",
827     "RPL-1.5",
828     "RHeCos-1.1",
829     "RSCPL",
830     "RSA-MD",
831     "Ruby",
832     "SAX-PD",
833     "Saxpath",
834     "SCEA",
835     "SWL",
836     "SMPPL",
837     "Sendmail",
838     "SGI-B-1.0",
839     "SGI-B-1.1",
840     "SGI-B-2.0",
841     "OFL-1.0",
842     "OFL-1.1",
843     "SimPL-2.0",
844     "Sleepycat",
845     "SNIA",
846     "Spencer-86",
847     "Spencer-94",
848     "Spencer-99",
849     "SMLNJ",
850     "SugarCRM-1.1.3",
851     "SISSL",
852     "SISSL-1.2",
853     "SPL-1.0",
854     "Watcom-1.0",
855     "TCL",
856     "TCP-wrappers",
857     "Unlicense",
858     "TMate",
859     "TORQUE-1.1",
860     "TOSL",
861     "Unicode-DFS-2015",
862     "Unicode-DFS-2016",
863     "Unicode-TOU",
864     "UPL-1.0",
865     "NCSA",
866     "Vim",
867     "VOSTROM",
868     "VSL-1.0",
869     "W3C-20150513",
870     "W3C-19980720",
871     "W3C",
872     "Wsuipa",
873     "Xnet",
874     "X11",
875     "Xerox",
876     "XFree86-1.1",
877     "xinetd",
878     "xpp",
879     "XSkat",
880     "YPL-1.0",
881     "YPL-1.1",
882     "Zed",
883     "Zend-2.0",
884     "Zimbra-1.3",
885     "Zimbra-1.4",
886     "Zlib",
887     "zlib-acknowledgement",
888     "ZPL-1.1",
889     "ZPL-2.0",
890     "ZPL-2.1",
891 ]
892
893 if __name__ == "__main__":
894     main()