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