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