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