From 03efb04d70d201d8828b2f6d8286809db700c3cc Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 8 Jun 2021 14:15:15 +0200 Subject: [PATCH 1/8] Support holder as copyright #216 Signed-off-by: Philippe Ombredanne --- src/cluecode/copyrights.py | 10 +++++++--- tests/cluecode/data/copyrights/holders.txt | 7 +++++++ tests/cluecode/data/copyrights/holders.txt.yml | 9 +++++++++ tests/cluecode/data/holders/holder_young_c-c.c.yml | 4 ++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 tests/cluecode/data/copyrights/holders.txt create mode 100644 tests/cluecode/data/copyrights/holders.txt.yml diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index d2798674727..7cf3635e1d6 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -2133,9 +2133,6 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): # (C) 2001-2009, Takuo KITAME, Bart Martens, and Canonical, LTD COPYRIGHT: { } #26381 - #Copyright Holders Kevin Vandersloot Erik Johnsson - COPYRIGHT: { } #26383 - #Copyright (c) 1995, 1996 - Blue Sky Software Corp. COPYRIGHT: { } #2639 @@ -2301,6 +2298,12 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): # Copyright (c) 2008 Intel Corporation / Qualcomm Inc. COPYRIGHT: { } #copydash-co + #Copyright Holders Kevin Vandersloot Erik Johnsson + COPYRIGHT: { } #83000 + + #holder is Tim Hudson (tjh@mincom.oz.au). + COPYRIGHT: { } #83001 + ####################################### # Authors ####################################### @@ -2712,6 +2715,7 @@ def refine_names(s, prefixes): 'reserved', 'held', 'by', + 'is', ]) )) diff --git a/tests/cluecode/data/copyrights/holders.txt b/tests/cluecode/data/copyrights/holders.txt new file mode 100644 index 00000000000..afc49d43fd5 --- /dev/null +++ b/tests/cluecode/data/copyrights/holders.txt @@ -0,0 +1,7 @@ + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@mincom.oz.au). + + + +Copyright Holders Kevin Vandersloot Erik Johnsson diff --git a/tests/cluecode/data/copyrights/holders.txt.yml b/tests/cluecode/data/copyrights/holders.txt.yml new file mode 100644 index 00000000000..e64f5e056b0 --- /dev/null +++ b/tests/cluecode/data/copyrights/holders.txt.yml @@ -0,0 +1,9 @@ +what: + - copyrights + - holders +copyrights: + - holder is Tim Hudson (tjh@mincom.oz.au) + - Copyright Holders Kevin Vandersloot Erik Johnsson +holders: + - Tim Hudson + - Kevin Vandersloot Erik Johnsson diff --git a/tests/cluecode/data/holders/holder_young_c-c.c.yml b/tests/cluecode/data/holders/holder_young_c-c.c.yml index a38319daca7..8c4a0284064 100644 --- a/tests/cluecode/data/holders/holder_young_c-c.c.yml +++ b/tests/cluecode/data/holders/holder_young_c-c.c.yml @@ -3,6 +3,10 @@ what: - holders_summary holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 + From 2500df5843c9dbda27f99bcd499a53265e18d1d5 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 8 Jun 2021 14:35:19 +0200 Subject: [PATCH 2/8] Format code and apply cosmetic refactorings Signed-off-by: Philippe Ombredanne --- src/cluecode/copyrights.py | 400 +++++++++++++++++++++++-------------- 1 file changed, 250 insertions(+), 150 deletions(-) diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index 7cf3635e1d6..b6721be82c2 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -7,11 +7,11 @@ # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # -from collections import deque -from functools import partial import os import re import sys +from collections import deque +from functools import partial from time import time from cluecode import copyrights_hint @@ -48,27 +48,42 @@ def logger_debug(*args): The process consists in: - prepare and cleanup text - - identify regions of text that may contain copyright (using hints) + - identify regions of text that may contain copyright (using hints). + These are called "candidates". - tag the text for parts-of-speech (POS) to identify various copyright - statements parts such as dates, names ("named entities"), etc. This is done - using NLTK POS tagging + statements parts such as dates, companues, names ("named entities"), etc. + This is done using NLTK POS tagging. - feed the tagged text to a parsing grammar describing actual copyright - statements - - yield copyright statements,holder and authors with start and end line + statements (also using NLTK) + - yield copyright statements, holder and authors with start and end line from the parse tree with some post-detection cleanups. """ -def detect_copyrights(location, copyrights=True, holders=True, authors=True, - include_years=True, include_allrights=False, - demarkup=True, - deadline=sys.maxsize): +def detect_copyrights( + location, + copyrights=True, + holders=True, + authors=True, + include_years=True, + include_allrights=False, + demarkup=True, + deadline=sys.maxsize, +): """ Yield tuples of (detection type, detected string, start line, end line) - detected in file at `location`. - Include years in copyrights if include_years is True. - Valid detection types are: copyrights, authors, holders. - These are included in the yielded tuples based on the values of `copyrights=True`, `holders=True`, `authors=True`, + detected in the file at ``location``. + + "detection type" is one of : "copyrights", "authors", "holders". + + These are included in the yielded tuples based on the values of + ``copyrights=True``, ``holders=True``, ``authors=True`` + + - Include years in copyrights if ``include_years`` is True. + - Include trailing "all rights reserved"-style mentions if + ``include_allrights`` is True. + - Strip markup from text if ``demarkup`` is True. + - Run for up to ``deadline`` seconds and return results found so far. """ from textcode.analysis import numbered_text_lines numbered_lines = numbered_text_lines(location, demarkup=demarkup) @@ -88,16 +103,33 @@ def detect_copyrights(location, copyrights=True, holders=True, authors=True, deadline=deadline) -def detect_copyrights_from_lines(numbered_lines, copyrights=True, holders=True, authors=True, - include_years=True, include_allrights=False, - deadline=sys.maxsize): +def detect_copyrights_from_lines( + numbered_lines, + copyrights=True, + holders=True, + authors=True, + include_years=True, + include_allrights=False, + deadline=sys.maxsize, +): """ Yield tuples of (detection type, detected string, start line, end line) - detected in numbered lines - Include years in copyrights if include_years is True. - Valid detection types are: copyrights, authors, holders. - These are included in the yielded tuples based on the values of `copyrights=True`, `holders=True`, `authors=True`, + detected in a ``numbered_lines`` sequence of tuples of (line numer, text) + + "detection type" is one of : "copyrights", "authors", "holders". + + These are included in the yielded tuples based on the values of + ``copyrights=True``, ``holders=True``, ``authors=True`` + + - Include years in copyrights if ``include_years`` is True. + - Include trailing "all rights reserved"-style mentions if + ``include_allrights`` is True. + - Strip markup from text if ``demarkup`` is True. + - Run for up to ``deadline`` seconds and return results found so far. """ + if not numbered_lines: + return + detector = CopyrightDetector() candidate_lines_groups = candidate_lines(numbered_lines) @@ -111,7 +143,8 @@ def detect_copyrights_from_lines(numbered_lines, copyrights=True, holders=True, if TRACE: from pprint import pformat can = pformat(candidates, width=160) - logger_debug(f' detect_copyrights_from_lines: processing candidates group:\n{can}') + logger_debug( + f' detect_copyrights_from_lines: processing candidates group:\n{can}') detections = detector.detect( numbered_lines=candidates, @@ -152,18 +185,32 @@ def __init__(self): self.tagger = nltk.RegexpTagger(patterns) self.chunker = nltk.RegexpParser(grammar, trace=TRACE_DEEP) - def detect(self, numbered_lines, - copyrights=True, holders=True, authors=True, - include_years=True, include_allrights=False): + def detect(self, + numbered_lines, + copyrights=True, + holders=True, + authors=True, + include_years=True, + include_allrights=False, + ): """ - Yield tuples of (detection type, detected value, start_line, end_line) - where the type is one of copyrights, authors, holders. Use an iterable - of `numbered_lines` tuples of (line number, line text). - If `include_years` is False, the copyright statement do not have years - or year range information. + Yield tuples of (detection type, detected string, start line, end line) + detected in a ``numbered_lines`` sequence of tuples of (line numer, text) + + "detection type" is one of : "copyrights", "authors", "holders". + + These are included in the yielded tuples based on the values of + ``copyrights=True``, ``holders=True``, ``authors=True`` + + - Include years in copyrights statements if ``include_years`` is True. + - Include trailing "all rights reserved"-style mentions if + ``include_allrights`` is True. + - Strip markup from text if ``demarkup`` is True. """ from nltk.tree import Tree numbered_lines = list(numbered_lines) + if not numbered_lines: + return start_line = numbered_lines[0][0] end_line = numbered_lines[-1][0] @@ -224,14 +271,19 @@ def detect(self, numbered_lines, tree_node_label = tree_node.label() if 'COPYRIGHT' in tree_node_label: - if TRACE: logger_debug('CopyrightDetector:Copyright tree node: ' + str(tree_node)) + if TRACE: + logger_debug(f'CopyrightDetector.detect: tree node: {tree_node}') if node_text and node_text.strip(): refined = refine_copyright(node_text) # checking for junk is a last resort if refined and refined.lower() not in COPYRIGHTS_JUNK: if copyrights: - if TRACE: logger_debug('CopyrightDetector: detected copyrights:', refined, start_line, end_line) + if TRACE: + logger_debug( + 'CopyrightDetector.detect: detected copyrights:', + refined, start_line, end_line, + ) yield 'copyrights', refined, start_line, end_line if holders: @@ -248,27 +300,40 @@ def detect(self, numbered_lines, if refined_holder: yield 'holders', refined_holder, start_line, end_line - if TRACE: logger_debug('CopyrightDetector: detected holders:', refined_holder, start_line, end_line) + if TRACE: + logger_debug( + 'CopyrightDetector: detected holders:', + refined_holder, start_line, end_line + ) elif authors and tree_node_label == 'AUTHOR': node_text = as_str(tree_node, ignores=non_authors_labels) refined_auth = refine_author(node_text) if refined_auth and refined_auth.lower() not in AUTHORS_JUNK: - if TRACE: logger_debug('CopyrightDetector: detected authors:', refined_auth, start_line, end_line) + if TRACE: logger_debug( + 'CopyrightDetector: detected authors:', + refined_auth, start_line, end_line + ) yield 'authors', refined_auth, start_line, end_line def get_tokens(self, numbered_lines): """ - Return an iterable of tokens from lines of text. + Return an iterable of tokens build from a ``numbered_lines`` sequence of + tuples of (line number, text). """ tokens = [] tokens_append = tokens.append for _line_number, line in numbered_lines: - if TRACE_TOK: logger_debug(' get_tokens: bare line: ' + repr(line)) + if TRACE_TOK: + logger_debug(' get_tokens: bare line: ' + repr(line)) + line = prepare_text_line(line) - if TRACE_TOK: logger_debug(' get_tokens:preped line: ' + repr(line)) + + if TRACE_TOK: + logger_debug(' get_tokens:preped line: ' + repr(line)) + for tok in splitter(line): # strip trailing single quotes and ignore empties tok = tok.strip("' ") @@ -278,6 +343,7 @@ def get_tokens(self, numbered_lines): tok = tok.lstrip('@').strip() if tok and tok not in (':',): tokens_append(tok) + if TRACE_TOK: logger_debug(' get_tokens:tokens: ' + repr(tokens)) logger_debug(' get_tokens: ALL tokens collected') @@ -289,7 +355,6 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): Return a parse tree node as a space-normalized string. Optionally filters node labels provided in the ignores set. """ - # if TRACE_DEEP: logger_debug('CopyrightDetector: as_str: starting node.leaves():', node.leaves()) if ignores: leaves = [(text, label) for text, label in node.leaves() @@ -310,19 +375,13 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): filtered[-1][1] == 'RIGHT' and filtered[-2][1] in ('NN', 'CAPS', 'NNP')): - # if TRACE_DEEP: logger_debug(' droping:', filtered[-2], filtered[-1], (text, label),) - # if TRACE_DEEP: logger_debug(' before droping: filtered:', filtered) filtered = filtered[:-2] - # if TRACE_DEEP: logger_debug(' after droping: filtered:', filtered) else: - # if TRACE_DEEP: logger_debug(' keeping:', (text, label)) filtered.append((text, label)) - # if TRACE_DEEP: logger_debug(' final: filtered:', filtered) - # if TRACE_DEEP: logger_debug() - node_string = u' '.join(t for t, _ in filtered) - return u' '.join(node_string.split()) + node_string = ' '.join(t for t, _ in filtered) + return ' '.join(node_string.split()) ################################################################################ # POS TAGGING AND CHUNKING @@ -463,7 +522,7 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): ############################################################################ # Combo of many (3+) letters and punctuations groups without spaces is likely junk - # "AEO>>,o>>u'!xeoI?o?O1/4thuA/" + # "AEO>>,o>>'!xeoI?o?O1/4thuA/" # (r'((\w+\W+){3,})+', 'JUNK'), # CamELCaseeXXX is typcally JUNK such as code variable names @@ -1816,7 +1875,8 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): ANDCO: { } #940 ANDCO: { +} #950 - # Copyright 2005-2007 Christopher Montgomery, Jean-Marc Valin, Timothy Terriberry, CSIRO, and other contributors + # Copyright 2005-2007 Christopher Montgomery, Jean-Marc Valin, + # Timothy Terriberry, CSIRO, and other contributors ANDCO: { +} #960 COMPANY: { +} #970 @@ -1884,7 +1944,8 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): COMPANY: {+} #1480 - # Copyright (c) 2002 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). + # Copyright (c) 2002 World Wide Web Consortium, (Massachusetts Institute of + # Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). COMPANY: { } #1490 # Oracle and/or its affiliates. @@ -1896,7 +1957,8 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): # UC Berkeley and its contributors NAME: { } #1412 - #copyrighted by Douglas C. Schmidt and his research group at Washington University, University of California, Irvine, and Vanderbilt University, Copyright (c) 1993-2008, + # copyrighted by Douglas C. Schmidt and his research group at Washington University, + # University of California, Irvine, and Vanderbilt University, Copyright (c) 1993-2008, COMPANY: { +} #1413 # The University of Utah and the Regents of the University of California @@ -2402,18 +2464,18 @@ def refine_copyright(c): Refine a detected copyright string. FIXME: the grammar should not allow this to happen. """ - c = u' '.join(c.split()) + c = ' '.join(c.split()) c = strip_some_punct(c) # this catches trailing slashes in URL for consistency - c = c.strip(u'/ ') + c = c.strip('/ ') # c = fix_trailing_space_dot(c) c = strip_all_unbalanced_parens(c) c = remove_same_extra_words(c) - c = u' '.join(c.split()) + c = ' '.join(c.split()) c = remove_dupe_copyright_words(c) - c = strip_prefixes(c, prefixes=set([u'by', u'c'])) + c = strip_prefixes(c, prefixes=set(['by', 'c'])) c = c.strip() - c = c.strip(u'+') + c = c.strip('+') c = strip_balanced_edge_parens(c) c = strip_suffixes(c, suffixes=COPYRIGHTS_SUFFIXES) c = strip_trailing_period(c) @@ -2428,7 +2490,7 @@ def refine_holder(h): """ # handle the acse where "all right reserved" is in the middle and the # company name contains the word all. - if u'reserved' in h.lower(): + if 'reserved' in h.lower(): prefixes = HOLDERS_PREFIXES_WITH_ALL else: prefixes = HOLDERS_PREFIXES @@ -2814,7 +2876,7 @@ def strip_prefixes(s, prefixes=()): # author vs copyright grammar in two while s and s[0].lower() in prefixes: s = s[1:] - s = u' '.join(s) + s = ' '.join(s) return s @@ -2826,7 +2888,7 @@ def strip_suffixes(s, suffixes=()): s = s.split() while s and s[-1].lower() in suffixes: s = s[:-1] - s = u' '.join(s) + s = ' '.join(s) return s @@ -2869,12 +2931,12 @@ def refine_date(c): def strip_leading_numbers(s): """ - Return a string removing leading words made only of numbers. + Return a string removing leading words made only of digits. """ s = s.split() while s and s[0].isdigit(): s = s[1:] - return u' '.join(s) + return ' '.join(s) def strip_some_punct(s): @@ -3017,7 +3079,7 @@ def prep_line(line): for candidate and other checks or None. """ line = prepare_text_line(line.lower(), dedeb=False) - chars_only = remove_non_chars(u'', line) + chars_only = remove_non_chars('', line) return line, chars_only.strip() @@ -3032,28 +3094,30 @@ def is_candidate(prepared_line): return False if is_only_digit_and_punct(prepared_line): - if TRACE: logger_debug('is_candidate: is_only_digit_and_punct:\n%(prepared_line)r' % locals()) + if TRACE: + logger_debug( + f'is_candidate: is_only_digit_and_punct:\n{prepared_line!r}') + return False if copyrights_hint.years(prepared_line): - # if TRACE: logger_debug('is_candidate: year in line:\n%(prepared_line)r' % locals()) return True else: - # if TRACE: logger_debug('is_candidate: NOT year in line:\n%(prepared_line)r' % locals()) pass for marker in copyrights_hint.statement_markers: if marker in prepared_line: - # if TRACE: logger_debug('is_candidate: %(marker)r in line:\n%(prepared_line)r' % locals()) return True -def is_inside_statement(chars_only_line): +def is_inside_statement( + chars_only_line, + markers=('copyright', 'copyrights', 'copyrightby',) + copyrights_hint.all_years, +): """ Return True if a line ends with some strings that indicate we are still inside a statement. """ - markers = ('copyright', 'copyrights', 'copyrightby',) + copyrights_hint.all_years return chars_only_line and chars_only_line.endswith(markers) @@ -3062,13 +3126,16 @@ def is_end_of_statement(chars_only_line): Return True if a line ends with some strings that indicate we are at the end of a statement. """ - return chars_only_line and chars_only_line.endswith(('rightreserved', 'rightsreserved')) + return ( + chars_only_line + and chars_only_line.endswith(('rightreserved', 'rightsreserved')) + ) def candidate_lines(numbered_lines): """ - Yield groups of candidate lines as list where each list element is a tuple - of (line number, line text) given an iterable of numbered_lines as tuples + Yield groups of candidate line lists where each list element is a tuple of + (line number, line text) given an iterable of ``numbered_lines`` as tuples of (line number, line text) . A candidate line is a line of text that may contain copyright statements. @@ -3084,7 +3151,10 @@ def candidate_lines(numbered_lines): # the previous line (chars only) previous_chars = None for numbered_line in numbered_lines: - if TRACE: logger_debug('# candidate_lines: evaluating line:' + repr(numbered_line)) + if TRACE: + logger_debug( + f'# candidate_lines: evaluating line: {numbered_line!r}') + line_number, line = numbered_line # FIXME: we should get the prepared text from here and return @@ -3097,7 +3167,10 @@ def candidate_lines(numbered_lines): if TRACE: cands = list(candidates) - logger_debug(' candidate_lines: is EOS: yielding candidates\n %(cands)r\n\n' % locals()) + logger_debug( + ' candidate_lines: is EOS: yielding candidates\n' + f' {cands}r\n\n' + ) yield list(candidates) candidates_clear() @@ -3119,16 +3192,29 @@ def candidate_lines(numbered_lines): candidates_append(numbered_line) previous_chars = chars_only - if TRACE: logger_debug(' candidate_lines: line is candidate') + if TRACE: + logger_debug(' candidate_lines: line is candidate') elif in_copyright > 0: - if ((not chars_only) - and (not previous_chars.endswith(('copyright', 'copyrights', 'copyrightsby', 'copyrightby',)))): + if ( + (not chars_only) + and ( + not previous_chars.endswith(( + 'copyright', + 'copyrights', + 'copyrightsby', + 'copyrightby', + )) + ) + ): # completely empty or only made of punctuations if TRACE: cands = list(candidates) - logger_debug(' candidate_lines: empty: yielding candidates\n %(cands)r\n\n' % locals()) + logger_debug( + ' candidate_lines: empty: yielding candidates\n' + f' {cands}r\n\n' + ) yield list(candidates) candidates_clear() @@ -3139,12 +3225,17 @@ def candidate_lines(numbered_lines): candidates_append(numbered_line) # and decrement our state in_copyright -= 1 - if TRACE: logger_debug(' candidate_lines: line is in copyright') + if TRACE: + logger_debug(' candidate_lines: line is in copyright') elif candidates: if TRACE: cands = list(candidates) - logger_debug(' candidate_lines: not in COP: yielding candidates\n %(cands)r\n\n' % locals()) + logger_debug( + ' candidate_lines: not in COP: yielding candidates\n' + f' {cands}r\n\n' + ) + yield list(candidates) candidates_clear() in_copyright = 0 @@ -3154,7 +3245,10 @@ def candidate_lines(numbered_lines): if candidates: if TRACE: cands = list(candidates) - logger_debug('candidate_lines: finally yielding candidates\n %(cands)r\n\n' % locals()) + logger_debug( + 'candidate_lines: finally yielding candidates\n' + f' {cands}r\n\n' + ) yield list(candidates) @@ -3165,24 +3259,26 @@ def candidate_lines(numbered_lines): # this catches tags but not does not remove the text inside tags remove_tags = re.compile( - r'<' - r'[(--)\?\!\%\/]?' - r'[a-gi-vx-zA-GI-VX-Z][a-zA-Z#\"\=\s\.\;\:\%\&?!,\+\*\-_\/]*' - r'[a-zA-Z0-9#\"\=\s\.\;\:\%\&?!,\+\*\-_\/]+' - r'\/?>', - re.MULTILINE | re.UNICODE - ).sub + r'<' + r'[(--)\?\!\%\/]?' + r'[a-gi-vx-zA-GI-VX-Z][a-zA-Z#\"\=\s\.\;\:\%\&?!,\+\*\-_\/]*' + r'[a-zA-Z0-9#\"\=\s\.\;\:\%\&?!,\+\*\-_\/]+' + r'\/?>', + re.MULTILINE | re.UNICODE +).sub def strip_markup(text, dedeb=True): """ - Strip markup tags from text. - If `dedeb` is True, also remove "Debian" markup tags. + Strip markup tags from ``text``. + + If ``dedeb`` is True, remove "Debian" markup tags seen in + older copyright files. """ - text = remove_tags(u' ', text) + text = remove_tags(' ', text) # Debian copyright file markup if dedeb: - return text.replace(u'', u'').replace(u'', u'').replace(u'', u'') + return text.replace('', '').replace('', '').replace('', '') else: return text @@ -3206,79 +3302,83 @@ def strip_markup(text, dedeb=True): def prepare_text_line(line, dedeb=True, to_ascii=True): """ - Prepare a unicode `line` of text for copyright detection. - If `dedeb` is True, also remove "Debian" markup tags. + Prepare a text ``line`` for copyright detection. + + If ``dedeb`` is True, remove "Debian" markup tags seen in + older copyright files. + + If ``to_ascii`` convert the text to ASCiI characters. """ # remove some junk in man pages: \(co line = (line - .replace(u'\\\\ co', u' ') - .replace(u'\\ co', u' ') - .replace(u'(co ', u' ') + .replace('\\\\ co', ' ') + .replace('\\ co', ' ') + .replace('(co ', ' ') ) - line = remove_printf_format_codes(u' ', line) + line = remove_printf_format_codes(' ', line) # un common comment line prefixes - line = remove_comment_markers(u' ', line) - line = remove_man_comment_markers(u' ', line) + line = remove_comment_markers(' ', line) + line = remove_man_comment_markers(' ', line) line = (line # C and C++ style markers - .replace(u'^//', u' ') - .replace(u'/*', u' ').replace(u'*/', u' ') + .replace('^//', ' ') + .replace('/*', ' ').replace('*/', ' ') # un common pipe chars in some ascii art - .replace(u'|', u' ') + .replace('|', ' ') # normalize copyright signs and spacing around them - .replace(u'"Copyright', u'" Copyright') - .replace(u'( C)', u' (c) ') - .replace(u'(C)', u' (c) ') - .replace(u'(c)', u' (c) ') + .replace('"Copyright', '" Copyright') + .replace('( C)', ' (c) ') + .replace('(C)', ' (c) ') + .replace('(c)', ' (c) ') # the case of \251 is tested by 'weirdencoding.h' - .replace(u'©', u' (c) ') - .replace(u'\251', u' (c) ') - .replace(u'©', u' (c) ') - .replace(u'©', u' (c) ') - .replace(u'©', u' (c) ') - .replace(u'©', u' (c) ') - .replace(u'©', u' (c) ') - .replace(u'u00A9', u' (c) ') - .replace(u'u00a9', u' (c) ') - .replace(u'\xa9', u' (c) ') - .replace(u'\\XA9', u' (c) ') + .replace('©', ' (c) ') + .replace('\251', ' (c) ') + .replace('©', ' (c) ') + .replace('©', ' (c) ') + .replace('©', ' (c) ') + .replace('©', ' (c) ') + .replace('©', ' (c) ') + .replace('u00A9', ' (c) ') + .replace('u00a9', ' (c) ') + .replace('\xa9', ' (c) ') + .replace('\\XA9', ' (c) ') # \xc2 is a  - .replace(u'\xc2', u'') - .replace(u'\\xc2', u'') + .replace('\xc2', '') + .replace('\\xc2', '') # not really a dash: an emdash - .replace(u'–', u'-') + .replace('–', '-') # TODO: add more HTML entities replacements # see http://www.htmlhelp.com/reference/html40/entities/special.html # convert html entities CR LF to space - .replace(u' ', u' ') - .replace(u' ', u' ') - .replace(u' ', u' ') + .replace(' ', ' ') + .replace(' ', ' ') + .replace(' ', ' ') # spaces - .replace(u' ', u' ') - .replace(u' ', u' ') - .replace(u' ', u' ') + .replace(' ', ' ') + .replace(' ', ' ') + .replace(' ', ' ') # common named HTML entities - .replace(u'"', u'"') - .replace(u'"', u'"') - .replace(u'&', u'&') - .replace(u'&', u'&') - .replace(u'>', u'>') - .replace(u'>', u'>') - .replace(u'<', u'<') - .replace(u'<', u'<') + .replace('"', '"') + .replace('"', '"') + .replace('&', '&') + .replace('&', '&') + .replace('>', '>') + .replace('>', '>') + .replace('<', '<') + .replace('<', '<') # normalize (possibly repeated) quotes to unique single quote ' # backticks ` and " - .replace(u'`', u"'") - .replace(u'"', u"'") + .replace('`', u"'") + .replace('"', u"'") ) # keep only one quote line = fold_consecutive_quotes(u"'", line) @@ -3286,34 +3386,34 @@ def prepare_text_line(line, dedeb=True, to_ascii=True): # treat some escaped literal CR, LF, tabs, \00 as new lines # such as in code literals: a="\\n some text" line = (line - .replace(u'\\t', u' ') - .replace(u'\\n', u' ') - .replace(u'\\r', u' ') - .replace(u'\\0', u' ') + .replace('\\t', ' ') + .replace('\\n', ' ') + .replace('\\r', ' ') + .replace('\\0', ' ') # TODO: why backslashes? - .replace(u'\\', u' ') + .replace('\\', ' ') # replace (' - .replace(u'("', u' ') + .replace('("', ' ') # some trailing garbage ') - .replace(u"')", u' ') - .replace(u"],", u' ') + .replace(u"')", ' ') + .replace(u"],", ' ') ) # note that we do not replace the debian tag by a space: we remove it line = strip_markup(line, dedeb=dedeb) - line = remove_punctuation(u' ', line) + line = remove_punctuation(' ', line) # normalize spaces around commas - line = line.replace(u' , ', u', ') + line = line.replace(' , ', ', ') # remove ASCII "line decorations" # such as in --- or === or !!! or ***** - line = remove_ascii_decorations(u' ', line) + line = remove_ascii_decorations(' ', line) # in apache'>Copyright replace ">" by "> " - line = line.replace(u'>', u'> ').replace(u'<', u' <') + line = line.replace('>', '> ').replace('<', ' <') # normalize to ascii text if to_ascii: @@ -3325,9 +3425,9 @@ def prepare_text_line(line, dedeb=True, to_ascii=True): # strip verbatim back slash and comment signs again at both ends of a line # FIXME: this is done at the start of this function already - line = line.strip(u'\\/*#%;') + line = line.strip('\\/*#%;') # normalize spaces - line = u' '.join(line.split()) + line = ' '.join(line.split()) return line From 0b4abcb112a244e824874461513a1abac4e36f0b Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 8 Jun 2021 22:46:30 +0200 Subject: [PATCH 3/8] Update tests #216 Signed-off-by: Philippe Ombredanne --- tests/cluecode/data/copyrights/author_young_c-c.c.yml | 4 ++++ tests/cluecode/data/copyrights/eric_young_c-c.c.yml | 4 ++++ .../openoffice_org_report_builder_bin.copyright.yml | 6 ++++++ tests/cluecode/data/copyrights/openssl-c.c.yml | 4 ++++ .../about_credits.html.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/app_rand.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/apps.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/apps.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/asn1pars.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/openssl.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/s_client.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/s_server.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-apps/speed.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-asn1/a_sign.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bf/bf_locl.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bio/b_print.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bn/bn.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bn/bn_blind.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bn/bn_exp.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bn/bn_lcl.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-bn/bn_mod.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-des/read2pwd.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-des/rpc_des.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-evp/m_ecdsa.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-pem/pem_all.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-rand/rand_win.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-ui/ui_openssl.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto-x509/x509.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-crypto/cryptlib.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-include-openssl/ssl.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-include-openssl/ssl3.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-include-openssl/tls1.h.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/d1_both.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/d1_clnt.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/s2_lib.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/s3_enc.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/s3_lib.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/ssl_asn1.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/ssl_cert.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/ssltest.c.yml | 4 ++++ tests/cluecode/data/ics/openssl-ssl/t1_reneg.c.yml | 4 ++++ tests/cluecode/data/ics/openssl/NOTICE.yml | 4 ++++ tests/cluecode/data/ics/openssl/e_os.h.yml | 4 ++++ 43 files changed, 174 insertions(+) diff --git a/tests/cluecode/data/copyrights/author_young_c-c.c.yml b/tests/cluecode/data/copyrights/author_young_c-c.c.yml index e8b3f5b9a56..e7d4fec90ef 100644 --- a/tests/cluecode/data/copyrights/author_young_c-c.c.yml +++ b/tests/cluecode/data/copyrights/author_young_c-c.c.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au) + - holder is Tim Hudson (tjh@mincom.oz.au) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/copyrights/eric_young_c-c.c.yml b/tests/cluecode/data/copyrights/eric_young_c-c.c.yml index e8b3f5b9a56..e7d4fec90ef 100644 --- a/tests/cluecode/data/copyrights/eric_young_c-c.c.yml +++ b/tests/cluecode/data/copyrights/eric_young_c-c.c.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au) + - holder is Tim Hudson (tjh@mincom.oz.au) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/copyrights/openoffice_org_report_builder_bin.copyright.yml b/tests/cluecode/data/copyrights/openoffice_org_report_builder_bin.copyright.yml index 471e63c4d8a..12838b5ea8e 100644 --- a/tests/cluecode/data/copyrights/openoffice_org_report_builder_bin.copyright.yml +++ b/tests/cluecode/data/copyrights/openoffice_org_report_builder_bin.copyright.yml @@ -90,6 +90,7 @@ copyrights: - Copyright (c) 1998-2007 The OpenSSL Project - Copyright (c) 1998-2007 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation - Copyright (c) 2000 BeOpen.com - Copyright (c) 1995-2001 Corporation for National Research Initiatives @@ -124,6 +125,7 @@ copyrights: - Copyright (c) 1998-2007 The OpenSSL Project - Copyright (c) 1998-2007 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation - Copyright (c) 2000 BeOpen.com - Copyright (c) 1995-2001 Corporation for National Research Initiatives @@ -240,6 +242,7 @@ holders: - The OpenSSL Project - The OpenSSL Project - Eric Young + - Tim Hudson - Python Software Foundation - BeOpen.com - Corporation for National Research Initiatives @@ -274,6 +277,7 @@ holders: - The OpenSSL Project - The OpenSSL Project - Eric Young + - Tim Hudson - Python Software Foundation - BeOpen.com - Corporation for National Research Initiatives @@ -366,6 +370,8 @@ holders_summary: count: 2 - value: The Khronos Group Inc. count: 2 + - value: Tim Hudson + count: 2 - value: Tommi Komulainen count: 2 - value: University of Bristol diff --git a/tests/cluecode/data/copyrights/openssl-c.c.yml b/tests/cluecode/data/copyrights/openssl-c.c.yml index e8b3f5b9a56..e7d4fec90ef 100644 --- a/tests/cluecode/data/copyrights/openssl-c.c.yml +++ b/tests/cluecode/data/copyrights/openssl-c.c.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au) + - holder is Tim Hudson (tjh@mincom.oz.au) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/chromium-chrome-browser-resources/about_credits.html.yml b/tests/cluecode/data/ics/chromium-chrome-browser-resources/about_credits.html.yml index d730c52536b..d4f63fde4f4 100644 --- a/tests/cluecode/data/ics/chromium-chrome-browser-resources/about_credits.html.yml +++ b/tests/cluecode/data/ics/chromium-chrome-browser-resources/about_credits.html.yml @@ -80,6 +80,7 @@ copyrights: - Copyright (c) 2008 The Khronos Group Inc. - Copyright (c) 1998-2008 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 2009 The Chromium Authors - Copyright 2007 Google Inc. - Copyright (c) 2010 The Chromium Authors @@ -184,6 +185,7 @@ holders: - The Khronos Group Inc. - The OpenSSL Project - Eric Young + - Tim Hudson - The Chromium Authors - Google Inc. - The Chromium Authors @@ -350,6 +352,8 @@ holders_summary: count: 1 - value: Thomas Broyer, Charlie Bozeman and Daniel Veillard count: 1 + - value: Tim Hudson + count: 1 - value: University of Chicago count: 1 - value: Xiph.org Foundation diff --git a/tests/cluecode/data/ics/openssl-apps/app_rand.c.yml b/tests/cluecode/data/ics/openssl-apps/app_rand.c.yml index c8b0331aa9c..fc3d8402214 100644 --- a/tests/cluecode/data/ics/openssl-apps/app_rand.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/app_rand.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2000 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/apps.c.yml b/tests/cluecode/data/ics/openssl-apps/apps.c.yml index 5a35cc33574..8277dd8ef50 100644 --- a/tests/cluecode/data/ics/openssl-apps/apps.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/apps.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2001 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/apps.h.yml b/tests/cluecode/data/ics/openssl-apps/apps.h.yml index 5a35cc33574..8277dd8ef50 100644 --- a/tests/cluecode/data/ics/openssl-apps/apps.h.yml +++ b/tests/cluecode/data/ics/openssl-apps/apps.h.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2001 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/asn1pars.c.yml b/tests/cluecode/data/ics/openssl-apps/asn1pars.c.yml index a067791ee80..b7f805459f1 100644 --- a/tests/cluecode/data/ics/openssl-apps/asn1pars.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/asn1pars.c.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/openssl.c.yml b/tests/cluecode/data/ics/openssl-apps/openssl.c.yml index 84429a2f5f7..f27a55db934 100644 --- a/tests/cluecode/data/ics/openssl-apps/openssl.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/openssl.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2006 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/s_client.c.yml b/tests/cluecode/data/ics/openssl-apps/s_client.c.yml index 2bf18d299a6..8677231fa50 100644 --- a/tests/cluecode/data/ics/openssl-apps/s_client.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/s_client.c.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2006 The OpenSSL Project - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Nokia holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/s_server.c.yml b/tests/cluecode/data/ics/openssl-apps/s_server.c.yml index b2a530865c3..14c91958354 100644 --- a/tests/cluecode/data/ics/openssl-apps/s_server.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/s_server.c.yml @@ -4,11 +4,13 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2006 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. - Nokia @@ -21,3 +23,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-apps/speed.c.yml b/tests/cluecode/data/ics/openssl-apps/speed.c.yml index 3160629ebda..8dc5f14fb41 100644 --- a/tests/cluecode/data/ics/openssl-apps/speed.c.yml +++ b/tests/cluecode/data/ics/openssl-apps/speed.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright 2002 Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - Sun Microsystems, Inc. holders_summary: - value: Eric Young count: 1 - value: Sun Microsystems, Inc. count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-asn1/a_sign.c.yml b/tests/cluecode/data/ics/openssl-crypto-asn1/a_sign.c.yml index 6ef4a6efd5f..188c3fda568 100644 --- a/tests/cluecode/data/ics/openssl-crypto-asn1/a_sign.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-asn1/a_sign.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2003 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bf/bf_locl.h.yml b/tests/cluecode/data/ics/openssl-crypto-bf/bf_locl.h.yml index c82d30134fa..c04caad3d82 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bf/bf_locl.h.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bf/bf_locl.h.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1997 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bio/b_print.c.yml b/tests/cluecode/data/ics/openssl-crypto-bio/b_print.c.yml index f2252445b16..c22ce8f9f22 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bio/b_print.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bio/b_print.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright Patrick Powell 1995 holders: - Eric Young + - Tim Hudson - Patrick Powell holders_summary: - value: Eric Young count: 1 - value: Patrick Powell count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bn/bn.h.yml b/tests/cluecode/data/ics/openssl-crypto-bn/bn.h.yml index ec8cd2aece7..6fbd7aaef13 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bn/bn.h.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bn/bn.h.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1997 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2006 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bn/bn_blind.c.yml b/tests/cluecode/data/ics/openssl-crypto-bn/bn_blind.c.yml index 0491c3cf1c5..97e5168f6db 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bn/bn_blind.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bn/bn_blind.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1998-2006 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bn/bn_exp.c.yml b/tests/cluecode/data/ics/openssl-crypto-bn/bn_exp.c.yml index cde667adef9..f92e170af7f 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bn/bn_exp.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bn/bn_exp.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2005 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bn/bn_lcl.h.yml b/tests/cluecode/data/ics/openssl-crypto-bn/bn_lcl.h.yml index c8b0331aa9c..fc3d8402214 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bn/bn_lcl.h.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bn/bn_lcl.h.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2000 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-bn/bn_mod.c.yml b/tests/cluecode/data/ics/openssl-crypto-bn/bn_mod.c.yml index c6342c83238..57e5e9e65f1 100644 --- a/tests/cluecode/data/ics/openssl-crypto-bn/bn_mod.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-bn/bn_mod.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1998-2000 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-des/read2pwd.c.yml b/tests/cluecode/data/ics/openssl-crypto-des/read2pwd.c.yml index 9b0cc43ab33..5cce1118314 100644 --- a/tests/cluecode/data/ics/openssl-crypto-des/read2pwd.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-des/read2pwd.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 2001-2002 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-des/rpc_des.h.yml b/tests/cluecode/data/ics/openssl-crypto-des/rpc_des.h.yml index 8520fb20a73..6eaea1dc572 100644 --- a/tests/cluecode/data/ics/openssl-crypto-des/rpc_des.h.yml +++ b/tests/cluecode/data/ics/openssl-crypto-des/rpc_des.h.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1986 by Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - Sun Microsystems, Inc. holders_summary: - value: Eric Young count: 1 - value: Sun Microsystems, Inc. count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-evp/m_ecdsa.c.yml b/tests/cluecode/data/ics/openssl-crypto-evp/m_ecdsa.c.yml index a721c5cb09e..dad0c02a47e 100644 --- a/tests/cluecode/data/ics/openssl-crypto-evp/m_ecdsa.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-evp/m_ecdsa.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1998-2002 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-pem/pem_all.c.yml b/tests/cluecode/data/ics/openssl-crypto-pem/pem_all.c.yml index 10ad14698c4..04df6a1fbd5 100644 --- a/tests/cluecode/data/ics/openssl-crypto-pem/pem_all.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-pem/pem_all.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2002 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-rand/rand_win.c.yml b/tests/cluecode/data/ics/openssl-crypto-rand/rand_win.c.yml index 1da71ed89df..c5ba591e286 100644 --- a/tests/cluecode/data/ics/openssl-crypto-rand/rand_win.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-rand/rand_win.c.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2000 The OpenSSL Project - (c) Copyright Microsoft Corp. 1993 holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Microsoft Corp. holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-ui/ui_openssl.c.yml b/tests/cluecode/data/ics/openssl-crypto-ui/ui_openssl.c.yml index a9e1fd90be8..0ca31041ee5 100644 --- a/tests/cluecode/data/ics/openssl-crypto-ui/ui_openssl.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto-ui/ui_openssl.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 2001 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto-x509/x509.h.yml b/tests/cluecode/data/ics/openssl-crypto-x509/x509.h.yml index 3160629ebda..8dc5f14fb41 100644 --- a/tests/cluecode/data/ics/openssl-crypto-x509/x509.h.yml +++ b/tests/cluecode/data/ics/openssl-crypto-x509/x509.h.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright 2002 Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - Sun Microsystems, Inc. holders_summary: - value: Eric Young count: 1 - value: Sun Microsystems, Inc. count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-crypto/cryptlib.c.yml b/tests/cluecode/data/ics/openssl-crypto/cryptlib.c.yml index 1d2093c99d8..89a8120ffd3 100644 --- a/tests/cluecode/data/ics/openssl-crypto/cryptlib.c.yml +++ b/tests/cluecode/data/ics/openssl-crypto/cryptlib.c.yml @@ -5,10 +5,12 @@ what: copyrights: - Copyright (c) 1998-2006 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright 2002 Sun Microsystems, Inc. holders: - The OpenSSL Project - Eric Young + - Tim Hudson - Sun Microsystems, Inc. holders_summary: - value: Eric Young @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-include-openssl/ssl.h.yml b/tests/cluecode/data/ics/openssl-include-openssl/ssl.h.yml index 01e2a3c280f..32e068f4e2b 100644 --- a/tests/cluecode/data/ics/openssl-include-openssl/ssl.h.yml +++ b/tests/cluecode/data/ics/openssl-include-openssl/ssl.h.yml @@ -4,11 +4,13 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2007 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. - Nokia @@ -21,3 +23,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-include-openssl/ssl3.h.yml b/tests/cluecode/data/ics/openssl-include-openssl/ssl3.h.yml index cddc67e80f9..76eac7cf09f 100644 --- a/tests/cluecode/data/ics/openssl-include-openssl/ssl3.h.yml +++ b/tests/cluecode/data/ics/openssl-include-openssl/ssl3.h.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2002 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-include-openssl/tls1.h.yml b/tests/cluecode/data/ics/openssl-include-openssl/tls1.h.yml index b2a530865c3..14c91958354 100644 --- a/tests/cluecode/data/ics/openssl-include-openssl/tls1.h.yml +++ b/tests/cluecode/data/ics/openssl-include-openssl/tls1.h.yml @@ -4,11 +4,13 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2006 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. - Nokia @@ -21,3 +23,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/d1_both.c.yml b/tests/cluecode/data/ics/openssl-ssl/d1_both.c.yml index 044e28b672d..575a93c7a43 100644 --- a/tests/cluecode/data/ics/openssl-ssl/d1_both.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/d1_both.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1998-2005 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/d1_clnt.c.yml b/tests/cluecode/data/ics/openssl-ssl/d1_clnt.c.yml index 8409b85b3a3..2bc8442c3a0 100644 --- a/tests/cluecode/data/ics/openssl-ssl/d1_clnt.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/d1_clnt.c.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1999-2007 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/s2_lib.c.yml b/tests/cluecode/data/ics/openssl-ssl/s2_lib.c.yml index b5f0605feff..ac81d058ee3 100644 --- a/tests/cluecode/data/ics/openssl-ssl/s2_lib.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/s2_lib.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2007 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/s3_enc.c.yml b/tests/cluecode/data/ics/openssl-ssl/s3_enc.c.yml index 613a12636fc..39ba373d405 100644 --- a/tests/cluecode/data/ics/openssl-ssl/s3_enc.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/s3_enc.c.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2007 The OpenSSL Project - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Nokia holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/s3_lib.c.yml b/tests/cluecode/data/ics/openssl-ssl/s3_lib.c.yml index 01e2a3c280f..32e068f4e2b 100644 --- a/tests/cluecode/data/ics/openssl-ssl/s3_lib.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/s3_lib.c.yml @@ -4,11 +4,13 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2007 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. - Nokia @@ -21,3 +23,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/ssl_asn1.c.yml b/tests/cluecode/data/ics/openssl-ssl/ssl_asn1.c.yml index f747af40033..ed9cecad040 100644 --- a/tests/cluecode/data/ics/openssl-ssl/ssl_asn1.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/ssl_asn1.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - Nokia holders_summary: - value: Eric Young count: 1 - value: Nokia count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/ssl_cert.c.yml b/tests/cluecode/data/ics/openssl-ssl/ssl_cert.c.yml index dc45ea0e931..959ae535e06 100644 --- a/tests/cluecode/data/ics/openssl-ssl/ssl_cert.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/ssl_cert.c.yml @@ -4,10 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2007 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. holders_summary: @@ -17,3 +19,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/ssltest.c.yml b/tests/cluecode/data/ics/openssl-ssl/ssltest.c.yml index f1130af69ce..0aa9cf3d694 100644 --- a/tests/cluecode/data/ics/openssl-ssl/ssltest.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/ssltest.c.yml @@ -4,11 +4,13 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2000 The OpenSSL Project - Copyright 2002 Sun Microsystems, Inc. - Copyright 2005 Nokia holders: - Eric Young + - Tim Hudson - The OpenSSL Project - Sun Microsystems, Inc. - Nokia @@ -21,3 +23,5 @@ holders_summary: count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl-ssl/t1_reneg.c.yml b/tests/cluecode/data/ics/openssl-ssl/t1_reneg.c.yml index 5265d0ba4ab..79b257a4656 100644 --- a/tests/cluecode/data/ics/openssl-ssl/t1_reneg.c.yml +++ b/tests/cluecode/data/ics/openssl-ssl/t1_reneg.c.yml @@ -4,12 +4,16 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) - Copyright (c) 1998-2009 The OpenSSL Project holders: - Eric Young + - Tim Hudson - The OpenSSL Project holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl/NOTICE.yml b/tests/cluecode/data/ics/openssl/NOTICE.yml index f32113eae12..1afa0c6d923 100644 --- a/tests/cluecode/data/ics/openssl/NOTICE.yml +++ b/tests/cluecode/data/ics/openssl/NOTICE.yml @@ -5,11 +5,15 @@ what: copyrights: - Copyright (c) 1998-2011 The OpenSSL Project - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - The OpenSSL Project - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 - value: The OpenSSL Project count: 1 + - value: Tim Hudson + count: 1 diff --git a/tests/cluecode/data/ics/openssl/e_os.h.yml b/tests/cluecode/data/ics/openssl/e_os.h.yml index a067791ee80..b7f805459f1 100644 --- a/tests/cluecode/data/ics/openssl/e_os.h.yml +++ b/tests/cluecode/data/ics/openssl/e_os.h.yml @@ -4,8 +4,12 @@ what: - holders_summary copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) holders: - Eric Young + - Tim Hudson holders_summary: - value: Eric Young count: 1 + - value: Tim Hudson + count: 1 From 79294c9a55b0fcebaac60b8a587d8dd7f0ff8f8c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 11 Jun 2021 00:23:54 +0200 Subject: [PATCH 4/8] Fix formatting of doc Signed-off-by: Philippe Ombredanne --- src/cluecode/copyrights.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index b6721be82c2..1a80ac2b6f5 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -74,15 +74,15 @@ def detect_copyrights( Yield tuples of (detection type, detected string, start line, end line) detected in the file at ``location``. - "detection type" is one of : "copyrights", "authors", "holders". + "detection type" is one of: "copyrights", "authors", or "holders". These are included in the yielded tuples based on the values of ``copyrights=True``, ``holders=True``, ``authors=True`` - - Include years in copyrights if ``include_years`` is True. - - Include trailing "all rights reserved"-style mentions if + - Include years in copyrights, if ``include_years`` is True. + - Include trailing "all rights reserved"-style mentions, if ``include_allrights`` is True. - - Strip markup from text if ``demarkup`` is True. + - Strip markup from text, if ``demarkup`` is True. - Run for up to ``deadline`` seconds and return results found so far. """ from textcode.analysis import numbered_text_lines From 29467b63213b1373e5b1683911939e19a435a591 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 15 Jun 2021 15:50:40 +0200 Subject: [PATCH 5/8] Replace nltk with pygmars, a simplified subset Signed-off-by: Philippe Ombredanne --- requirements.txt | 2 +- setup-mini.cfg | 2 +- setup.cfg | 2 +- src/cluecode/copyrights.py | 64 ++++++++++++++++++++------------------ 4 files changed, 36 insertions(+), 34 deletions(-) diff --git a/requirements.txt b/requirements.txt index e992e8449a9..d35a90952ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,6 @@ license-expression==1.2 lxml==4.6.3 MarkupSafe==2.0.1 more-itertools==8.8.0 -nltk==3.4.5 normality==2.2.2 packageurl-python==0.9.4 packaging==20.9 @@ -50,6 +49,7 @@ publicsuffix2==2.20191221 pyahocorasick==1.4.2 pycparser==2.20 Pygments==2.9.0 +pygmars==0.5.0 pymaven-patch==0.3.0 pyparsing==2.4.7 PyYAML==5.4.1 diff --git a/setup-mini.cfg b/setup-mini.cfg index 518738aa4ad..b95cf91dde1 100644 --- a/setup-mini.cfg +++ b/setup-mini.cfg @@ -76,7 +76,6 @@ install_requires = license_expression >= 1.0 lxml >= 4.6.3, < 5.0.0 MarkupSafe >= 1.0 - nltk >= 3.2, !=3.6, < 4.0 packageurl_python >= 0.9.0 packaging > 20 pdfminer.six >= 20200101 @@ -86,6 +85,7 @@ install_requires = plugincode >= 21.1.21 publicsuffix2 pyahocorasick >= 1.4.0, < 1.5 + pygmars pygments pymaven_patch >= 0.2.8 requests >= 2.7.0, < 3.0.0 diff --git a/setup.cfg b/setup.cfg index e11e9284e4f..9192b1abcbf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -76,7 +76,6 @@ install_requires = license_expression >= 1.0 lxml >= 4.6.3, < 5.0.0 MarkupSafe >= 1.0 - nltk >= 3.2, !=3.6, < 4.0 packageurl_python >= 0.9.0 packaging > 20 pdfminer.six >= 20200101 @@ -86,6 +85,7 @@ install_requires = plugincode >= 21.1.21 publicsuffix2 pyahocorasick >= 1.4.0, < 1.5 + pygmars pygments pymaven_patch >= 0.2.8 requests >= 2.7.0, < 3.0.0 diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index 1a80ac2b6f5..22cac1e1e58 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -14,13 +14,16 @@ from functools import partial from time import time -from cluecode import copyrights_hint +import pygmars + from commoncode.text import toascii from commoncode.text import unixlinesep +from cluecode import copyrights_hint + # Tracing flags TRACE = False or os.environ.get('SCANCODE_DEBUG_COPYRIGHT', False) -# set to 1 to enable nltk deep tracing +# set to 1 to enable pygmars deep tracing TRACE_DEEP = 0 if os.environ.get('SCANCODE_DEBUG_COPYRIGHT_DEEP'): TRACE_DEEP = 1 @@ -50,13 +53,13 @@ def logger_debug(*args): - prepare and cleanup text - identify regions of text that may contain copyright (using hints). These are called "candidates". - - tag the text for parts-of-speech (POS) to identify various copyright - statements parts such as dates, companues, names ("named entities"), etc. - This is done using NLTK POS tagging. + - tag the text to recognize (e.g. lex) parts-of-speech (POS) tags to identify various copyright + statements parts such as dates, companies, names ("named entities"), etc. + This is done using pygmars which contains a lexer derived from NLTK POS tagger. - feed the tagged text to a parsing grammar describing actual copyright - statements (also using NLTK) - - yield copyright statements, holder and authors with start and end line - from the parse tree with some post-detection cleanups. + statements (also using pygmars) and obtain a parse tree. + - Walk the parse tree and yield copyright statements, holder and authors with start + and end line from the parse tree with some extra post-detection cleanups. """ @@ -181,9 +184,8 @@ class CopyrightDetector(object): """ def __init__(self): - import nltk - self.tagger = nltk.RegexpTagger(patterns) - self.chunker = nltk.RegexpParser(grammar, trace=TRACE_DEEP) + self.lexer = pygmars.lex.RegexpLexer(patterns) + self.parser = pygmars.parse.RegexpParser(grammar, trace=TRACE_DEEP) def detect(self, numbered_lines, @@ -207,7 +209,7 @@ def detect(self, ``include_allrights`` is True. - Strip markup from text if ``demarkup`` is True. """ - from nltk.tree import Tree + Tree = pygmars.tree.Tree numbered_lines = list(numbered_lines) if not numbered_lines: return @@ -226,11 +228,11 @@ def detect(self, return # first, POS tag each token using token regexes - tagged_text = self.tagger.tag(tokens) - if TRACE: logger_debug('CopyrightDetector:tagged_text: ' + str(tagged_text)) + lexed_text = self.lexer.lex(tokens) + if TRACE: logger_debug('CopyrightDetector:tagged_text: ' + str(lexed_text)) # then build a parse tree based on tagged tokens - tree = self.chunker.parse(tagged_text) + tree = self.parser.parse(lexed_text) if TRACE: logger_debug('CopyrightDetector:parse tree: ' + str(tree)) as_str = partial(CopyrightDetector.as_str, include_allrights=include_allrights) @@ -1603,7 +1605,7 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): ####################################### # All/No/Some Rights Reserved OR All Rights Are Reserved - ALLRIGHTRESERVED: { ? } #allrightsreserved + ALLRIGHTRESERVED: { ? } #allrightsreserved ####################################### @@ -1654,10 +1656,10 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): DASHCAPS: { } # INRIA - CIRAD - INRA - COMPANY: { +} #1280 + COMPANY: { +} #1280 # Project Admins leethomason - COMPANY: { +} #1281 + COMPANY: { +} #1281 # the Regents of the University of California COMPANY: {? ?} #130 @@ -1694,7 +1696,7 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): # NNP NN NNP NNP COMP COMP') COMPANY: { +} #207 - # was: COMPANY: { ? ? ? ? ? ?} #210 + # was COMPANY { ? ? ? ? ? ?} #210 COMPANY: {+ +} #210 COMPANY: { + ?} #220 COMPANY: {+ } #230 @@ -1767,16 +1769,16 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): NAME: { } #483 # Kungliga Tekniska Hogskolan (Royal Institute of Technology, Stockholm, Sweden) - COMPANY: { } #529 + COMPANY: { } #529 # Instituto Nokia de Tecnologia - COMPANY: { } # 5391 + COMPANY: { } # 5391 # Laboratoire MASI - Institut Blaise Pascal - COMPANY: { } #5292 + COMPANY: { } #5292 # Nara Institute of Science and Technology. - COMPANY: { } #5293 + COMPANY: { } #5293 # Instituto Nokia de Tecnologia - INdT COMPANY: { } #52934 @@ -1800,7 +1802,7 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): NAME-YEAR: { + ?} #5612 #Academy of Motion Picture Arts and Sciences - NAME: { } # 561 + NAME: { } # 561 # Adam Weinberger and the GNOME Foundation NAME: { } # 565 @@ -1834,12 +1836,12 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): NAME: { } #710 NAME: {? } #720 NAME: {} #730 - NAME: { + } #740 + NAME: { + } #740 # by BitRouter - NAME: { } #741 + NAME: { } #741 # Philippe http//nexb.com joe@nexb.com - NAME: { } #742 + NAME: { } #742 # Companies COMPANY: {+ ? ?} #770 @@ -1965,10 +1967,10 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): COMPANY: { } #1414 # by the Massachusetts Institute of Technology - COMPANY: { } #1415 + COMPANY: { } #1415 # Computer Systems and Communication Lab, Institute of Information Science, Academia Sinica. - COMPANY: { } #1416 + COMPANY: { } #1416 # Copyright 2007-2010 the original author or authors. # Copyright (c) 2007-2010 the original author or authors. @@ -2093,10 +2095,10 @@ def as_str(cls, node, ignores=frozenset(), include_allrights=False): COPYRIGHT: {+ } #2274 # Copyright (c) 2017 Contributors et.al. - COPYRIGHT: { } #2276 + COPYRIGHT: { } #2276 #Copyright (c) 2020 Contributors as noted in the AUTHORS file - COPYRIGHT: { * ? * } + COPYRIGHT: { * ? * } # copyrighted by Object Computing, Inc., St. Louis Missouri, Copyright (C) 2002, all rights reserved. COPYRIGHT: { + } #2278 From 858574114de4a17a090aaf46f9d7330b2591dc2f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 15 Jun 2021 16:05:42 +0200 Subject: [PATCH 6/8] Add CHANGELOG entry on copyrights improvements Signed-off-by: Philippe Ombredanne --- CHANGELOG.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9b11df8be25..025363943bd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -39,6 +39,11 @@ Copyright detection: - The data structure in the JSON is now using consistently named attributes as opposed to a plain value. + - The copyright detection speed has been significantly improved with the tests + taking roughly 1/2 of the time to run. This is achieved mostly by replacing + NLTK with a the minimal and simplified subset we need in a new library named + pygmars. + Package detection: ~~~~~~~~~~~~~~~~~~ From 92a89a945307c14ec5fad8446c81605182a9b1c8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 15 Jun 2021 18:03:45 +0200 Subject: [PATCH 7/8] Update tests for improved copyright detection #216 Signed-off-by: Philippe Ombredanne --- src/licensedcode/data/rules/openssl-ssleay.SPDX.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_14.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_18.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_3.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_31.yml | 4 +++- src/licensedcode/data/rules/openssl-ssleay_34.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_35.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_36.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_37.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_4.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_40.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_55.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_56.yml | 2 ++ src/licensedcode/data/rules/openssl-ssleay_9.yml | 2 ++ src/licensedcode/data/rules/ssleay-windows_1.yml | 4 ++++ src/licensedcode/data/rules/ssleay-windows_2.yml | 4 ++++ src/licensedcode/data/rules/ssleay-windows_3.yml | 4 ++++ src/licensedcode/data/rules/ssleay-windows_4.yml | 4 ++++ src/licensedcode/data/rules/ssleay_3.yml | 4 ++++ src/licensedcode/data/rules/ssleay_4.yml | 4 ++++ src/licensedcode/data/rules/ssleay_5.yml | 2 ++ ...stable_firmware-qcom-media.copyright-detailed.expected.yml | 1 + .../stable_firmware-qcom-media.copyright.expected.yml | 1 + .../usr/share/doc/libssl1.1/copyright-detailed.expected.yml | 1 + .../usr/share/doc/libssl1.1/copyright.expected.yml | 1 + 25 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/licensedcode/data/rules/openssl-ssleay.SPDX.yml b/src/licensedcode/data/rules/openssl-ssleay.SPDX.yml index 9f693bfe234..3818c2566fa 100644 --- a/src/licensedcode/data/rules/openssl-ssleay.SPDX.yml +++ b/src/licensedcode/data/rules/openssl-ssleay.SPDX.yml @@ -4,8 +4,10 @@ minimum_coverage: 80 notes: license text as published by SPDX ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_14.yml b/src/licensedcode/data/rules/openssl-ssleay_14.yml index 1de16425b79..eb8c5f5d0bd 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_14.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_14.yml @@ -4,9 +4,11 @@ minimum_coverage: 80 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2018 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_18.yml b/src/licensedcode/data/rules/openssl-ssleay_18.yml index 138f24f6850..1a11eaa21f2 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_18.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_18.yml @@ -4,9 +4,11 @@ minimum_coverage: 80 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_3.yml b/src/licensedcode/data/rules/openssl-ssleay_3.yml index df98d43ef9f..b195c72071f 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_3.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_3.yml @@ -4,8 +4,10 @@ minimum_coverage: 80 notes: full openssl/ssleay with extra headers ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_31.yml b/src/licensedcode/data/rules/openssl-ssleay_31.yml index 243806da1bc..0c5c01ca45a 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_31.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_31.yml @@ -1,12 +1,14 @@ license_expression: openssl-ssleay is_license_text: yes -notes: typo in "if the [rouines] from the library" +notes: typo in "if the [rouines] from the library" ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2008 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_34.yml b/src/licensedcode/data/rules/openssl-ssleay_34.yml index de7a59b80ed..268d9e6e5f5 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_34.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_34.yml @@ -3,8 +3,10 @@ is_license_text: yes relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_35.yml b/src/licensedcode/data/rules/openssl-ssleay_35.yml index 84aa3da6a51..cce5127fb91 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_35.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_35.yml @@ -4,9 +4,11 @@ relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2016 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_36.yml b/src/licensedcode/data/rules/openssl-ssleay_36.yml index deda3545e1c..4d9ad269ddb 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_36.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_36.yml @@ -5,9 +5,11 @@ minimum_coverage: 90 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2003 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_37.yml b/src/licensedcode/data/rules/openssl-ssleay_37.yml index d4651b9b829..09c43c0e7df 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_37.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_37.yml @@ -4,9 +4,11 @@ relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2002 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_4.yml b/src/licensedcode/data/rules/openssl-ssleay_4.yml index 07a41ba1417..88344531a3d 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_4.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_4.yml @@ -5,9 +5,11 @@ notes: full openssl/ssleay with extra headers ignorable_copyrights: - Copyright (c) Eric Young (eay@cryptsoft.com) - Copyright (c) The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_40.yml b/src/licensedcode/data/rules/openssl-ssleay_40.yml index 7057c0e8e4b..5169d67b314 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_40.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_40.yml @@ -4,9 +4,11 @@ relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2017 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_55.yml b/src/licensedcode/data/rules/openssl-ssleay_55.yml index be01b045cb8..e3f667cff1c 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_55.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_55.yml @@ -4,9 +4,11 @@ relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2008 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_56.yml b/src/licensedcode/data/rules/openssl-ssleay_56.yml index afe54792644..b3ff4483a79 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_56.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_56.yml @@ -4,9 +4,11 @@ relevance: 100 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998-2019 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/openssl-ssleay_9.yml b/src/licensedcode/data/rules/openssl-ssleay_9.yml index d09a9a0f974..4826ee55050 100644 --- a/src/licensedcode/data/rules/openssl-ssleay_9.yml +++ b/src/licensedcode/data/rules/openssl-ssleay_9.yml @@ -4,9 +4,11 @@ minimum_coverage: 80 ignorable_copyrights: - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) - Copyright (c) 1998 The OpenSSL Project + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_holders: - Eric Young - The OpenSSL Project + - Tim Hudson ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) diff --git a/src/licensedcode/data/rules/ssleay-windows_1.yml b/src/licensedcode/data/rules/ssleay-windows_1.yml index fa7f375b1c4..ec5582e9c4c 100644 --- a/src/licensedcode/data/rules/ssleay-windows_1.yml +++ b/src/licensedcode/data/rules/ssleay-windows_1.yml @@ -1,6 +1,10 @@ license_expression: ssleay-windows is_license_text: yes notes: SSLEAY windows Variant with typos +ignorable_copyrights: + - holder is Tim Hudson (tjh@cryptsoft.com) +ignorable_holders: + - Tim Hudson ignorable_authors: - Tim Hudson (tjh@cryptsoft.com) ignorable_emails: diff --git a/src/licensedcode/data/rules/ssleay-windows_2.yml b/src/licensedcode/data/rules/ssleay-windows_2.yml index cd91f99eca8..9295fa23e53 100644 --- a/src/licensedcode/data/rules/ssleay-windows_2.yml +++ b/src/licensedcode/data/rules/ssleay-windows_2.yml @@ -1,6 +1,10 @@ license_expression: ssleay-windows is_license_text: yes notes: Variant of Original SSLeay License with Windows exception +ignorable_copyrights: + - holder is Tim Hudson (tjh@mincom.oz.au) +ignorable_holders: + - Tim Hudson ignorable_authors: - Eric Young (eay@mincom.oz.au) - Tim Hudson (tjh@mincom.oz.au) diff --git a/src/licensedcode/data/rules/ssleay-windows_3.yml b/src/licensedcode/data/rules/ssleay-windows_3.yml index fa7f375b1c4..ec5582e9c4c 100644 --- a/src/licensedcode/data/rules/ssleay-windows_3.yml +++ b/src/licensedcode/data/rules/ssleay-windows_3.yml @@ -1,6 +1,10 @@ license_expression: ssleay-windows is_license_text: yes notes: SSLEAY windows Variant with typos +ignorable_copyrights: + - holder is Tim Hudson (tjh@cryptsoft.com) +ignorable_holders: + - Tim Hudson ignorable_authors: - Tim Hudson (tjh@cryptsoft.com) ignorable_emails: diff --git a/src/licensedcode/data/rules/ssleay-windows_4.yml b/src/licensedcode/data/rules/ssleay-windows_4.yml index 679ce80a610..1c3d00fdb4f 100644 --- a/src/licensedcode/data/rules/ssleay-windows_4.yml +++ b/src/licensedcode/data/rules/ssleay-windows_4.yml @@ -1,6 +1,10 @@ license_expression: ssleay-windows is_license_text: yes notes: SSLEAY windows Variant with typos +ignorable_copyrights: + - holder is Tim Hudson (tjh@mincom.oz.au) +ignorable_holders: + - Tim Hudson ignorable_authors: - Tim Hudson (tjh@mincom.oz.au) ignorable_emails: diff --git a/src/licensedcode/data/rules/ssleay_3.yml b/src/licensedcode/data/rules/ssleay_3.yml index 67f84ed1547..0f65d06e1d1 100644 --- a/src/licensedcode/data/rules/ssleay_3.yml +++ b/src/licensedcode/data/rules/ssleay_3.yml @@ -1,5 +1,9 @@ license_expression: ssleay is_license_text: yes +ignorable_copyrights: + - holder is Tim Hudson (tjh@cryptsoft.com) +ignorable_holders: + - Tim Hudson ignorable_emails: - eay@cryptsoft.com - tjh@cryptsoft.com diff --git a/src/licensedcode/data/rules/ssleay_4.yml b/src/licensedcode/data/rules/ssleay_4.yml index f8ce26dbd27..5c93c0748a6 100644 --- a/src/licensedcode/data/rules/ssleay_4.yml +++ b/src/licensedcode/data/rules/ssleay_4.yml @@ -1,6 +1,10 @@ license_expression: ssleay is_license_text: yes notes: Variant of SSLEay with typos +ignorable_copyrights: + - holder is Tim Hudson (tjh@mincom.oz.au) +ignorable_holders: + - Tim Hudson ignorable_emails: - eay@mincom.oz.au - tjh@mincom.oz.au diff --git a/src/licensedcode/data/rules/ssleay_5.yml b/src/licensedcode/data/rules/ssleay_5.yml index 0d4ccc2e652..32f64145ac1 100644 --- a/src/licensedcode/data/rules/ssleay_5.yml +++ b/src/licensedcode/data/rules/ssleay_5.yml @@ -2,8 +2,10 @@ license_expression: ssleay is_license_text: yes ignorable_copyrights: - Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au) + - holder is Tim Hudson (tjh@mincom.oz.au) ignorable_holders: - Eric Young + - Tim Hudson ignorable_authors: - Eric Young (eay@mincom.oz.au) ignorable_emails: diff --git a/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright-detailed.expected.yml b/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright-detailed.expected.yml index 994ca3e7131..54b263af7fc 100644 --- a/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright-detailed.expected.yml +++ b/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright-detailed.expected.yml @@ -7,6 +7,7 @@ Copyright (c) 2013-2017 Qualcomm Technologies, Inc. Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + holder is Tim Hudson (tjh@cryptsoft.com) Copyright (c) 1995-2005 Jean-loup Gailly Copyright (c) 1995-2009 Mark Adler Copyright (c) 1995-2003, 2010 Mark Adler diff --git a/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright.expected.yml b/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright.expected.yml index 994ca3e7131..54b263af7fc 100644 --- a/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright.expected.yml +++ b/tests/packagedcode/data/debian/copyright/debian-2019-11-15/non-free/f/firmware-nonfree/stable_firmware-qcom-media.copyright.expected.yml @@ -7,6 +7,7 @@ Copyright (c) 2013-2017 Qualcomm Technologies, Inc. Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + holder is Tim Hudson (tjh@cryptsoft.com) Copyright (c) 1995-2005 Jean-loup Gailly Copyright (c) 1995-2009 Mark Adler Copyright (c) 1995-2003, 2010 Mark Adler diff --git a/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright-detailed.expected.yml b/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright-detailed.expected.yml index 009fbcd0507..585b38eeb7e 100644 --- a/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright-detailed.expected.yml +++ b/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright-detailed.expected.yml @@ -5,3 +5,4 @@ Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Copyright (c) 1998-2004 The OpenSSL Project Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + holder is Tim Hudson (tjh@cryptsoft.com) diff --git a/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright.expected.yml b/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright.expected.yml index 009fbcd0507..585b38eeb7e 100644 --- a/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright.expected.yml +++ b/tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libssl1.1/copyright.expected.yml @@ -5,3 +5,4 @@ Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Copyright (c) 1998-2004 The OpenSSL Project Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + holder is Tim Hudson (tjh@cryptsoft.com) From 06baf2defd1f2c027d1b00d4fece78d5752cfebf Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 16 Jun 2021 00:56:38 +0200 Subject: [PATCH 8/8] Use correct ignorables for OpenSSL licenses #216 Signed-off-by: Philippe Ombredanne --- .../data/licenses/openssl-ssleay.yml | 19 +++++++++++-------- .../data/licenses/ssleay-windows.yml | 9 +++++++-- src/licensedcode/data/licenses/ssleay.yml | 9 +++++++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/licensedcode/data/licenses/openssl-ssleay.yml b/src/licensedcode/data/licenses/openssl-ssleay.yml index 40977ede49b..0e3960420f3 100644 --- a/src/licensedcode/data/licenses/openssl-ssleay.yml +++ b/src/licensedcode/data/licenses/openssl-ssleay.yml @@ -13,17 +13,20 @@ text_urls: - http://www.openssl.org/source/license.html faq_url: http://www.openssl.org/support/faq.html minimum_coverage: 70 -ignorable_copyrights: - - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) - the OpenSSL Project +ignorable_copyrights: + - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) + - holder is Tim Hudson (tjh@cryptsoft.com) +ignorable_emails: + - eay@cryptsoft.com + - openssl-core@openssl.org + - tjh@cryptsoft.com ignorable_holders: - - Eric Young + - Eric Young + - Tim Hudson ignorable_urls: - - http://www.openssl.org/ -ignorable_emails: - - eay@cryptsoft.com - - openssl-core@openssl.org - - tjh@cryptsoft.com + - http://www.openssl.org/ + diff --git a/src/licensedcode/data/licenses/ssleay-windows.yml b/src/licensedcode/data/licenses/ssleay-windows.yml index cde9722b1c7..f2b7956262f 100644 --- a/src/licensedcode/data/licenses/ssleay-windows.yml +++ b/src/licensedcode/data/licenses/ssleay-windows.yml @@ -12,6 +12,11 @@ other_urls: ignorable_authors: - Eric Young (eay@cryptsoft.com) - Tim Hudson (tjh@cryptsoft.com) +ignorable_copyrights: + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_emails: - - eay@cryptsoft.com - - tjh@cryptsoft.com + - eay@cryptsoft.com + - tjh@cryptsoft.com +ignorable_holders: + - Tim Hudson + diff --git a/src/licensedcode/data/licenses/ssleay.yml b/src/licensedcode/data/licenses/ssleay.yml index 33da9b9eeb5..ba1284d55bb 100644 --- a/src/licensedcode/data/licenses/ssleay.yml +++ b/src/licensedcode/data/licenses/ssleay.yml @@ -9,6 +9,11 @@ text_urls: - http://www.openssl.org/source/license.html ignorable_authors: - Eric Young (eay@cryptsoft.com) +ignorable_copyrights: + - holder is Tim Hudson (tjh@cryptsoft.com) ignorable_emails: - - eay@cryptsoft.com - - tjh@cryptsoft.com + - eay@cryptsoft.com + - tjh@cryptsoft.com +ignorable_holders: + - Tim Hudson +