From 065d0a3f1e189db36699644efcb09d0e50e12faf Mon Sep 17 00:00:00 2001 From: "Yash D. Saraf" Date: Fri, 17 Nov 2017 02:43:57 +0530 Subject: [PATCH 001/122] Support multiple options for pre-scan plugins #787 Signed-off-by: Yash D. Saraf --- src/plugincode/pre_scan.py | 14 +++++++++----- src/scancode/cli.py | 20 ++++++++++---------- src/scancode/plugin_ignore.py | 13 +++++++++---- tests/scancode/test_ignore_files.py | 12 ++++++------ 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index c9ba789bdad..7f44363a5f9 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -40,13 +40,9 @@ class PreScanPlugin(object): """ A pre-scan plugin layout class to be extended by the pre_scan plugins. - Docstring of a plugin class will be used as the plugin option's help text """ - # attributes to be used while creating the option for this plugin. - option_attrs = {} - - def __init__(self, user_input): + def __init__(self, option, user_input): self.user_input = user_input def process_resource(self, resource): @@ -63,6 +59,14 @@ def get_ignores(self): """ return {} + @staticmethod + def get_click_options(): + """ + Return an iterable of `click.Option` objects to be + used for calling the plugin. + """ + return () + pre_scan_plugins = PluginManager('pre_scan') pre_scan_plugins.add_hookspecs(sys.modules[__name__]) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 304bf2f7a16..ff35543f092 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -262,12 +262,11 @@ def __init__(self, name, context_settings=None, callback=None, option = ScanOption(('--' + name,), is_flag=True, help=help_text, group=POST_SCAN) self.params.append(option) for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - attrs = plugin.option_attrs - attrs['default'] = None - attrs['group'] = PRE_SCAN - attrs['help'] = ' '.join(plugin.__doc__.split()) - option = ScanOption(('--' + name,), **attrs) - self.params.append(option) + for option in plugin.get_click_options(): + if not isinstance(option, click.Option): + raise Exception('Invalid plugin "%(name)s": supplied click option is not an instance of "click.Option".' % locals()) + option.group = PRE_SCAN + self.params.append(option) def format_options(self, ctx, formatter): """ @@ -470,10 +469,11 @@ def scancode(ctx, scans_cache_class = get_scans_cache_class() pre_scan_plugins = [] for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - user_input = kwargs[name.replace('-', '_')] - if user_input: - options['--' + name] = user_input - pre_scan_plugins.append(plugin(user_input)) + for option in plugin.get_click_options(): + user_input = kwargs[option.name] + if user_input: + options['--' + name] = user_input + pre_scan_plugins.append(plugin(option.name, user_input)) try: files_count, results, success = scan( diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index fec8de91704..36ee999c7eb 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -25,6 +25,8 @@ from __future__ import absolute_import from __future__ import unicode_literals +from click import Option + from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl @@ -32,12 +34,15 @@ @pre_scan_impl class ProcessIgnore(PreScanPlugin): """ - Ignore files matching . + Ignore files matching the supplied pattern. """ - option_attrs = dict(multiple=True, metavar='') - def __init__(self, user_input): - super(ProcessIgnore, self).__init__(user_input) + def __init__(self, option, user_input): + super(ProcessIgnore, self).__init__(option, user_input) def get_ignores(self): return {pattern: 'User ignore: Supplied by --ignore' for pattern in self.user_input} + + @staticmethod + def get_click_options(): + return [Option(('--ignore',), multiple=True, metavar='', help='Ignore files matching .')] diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py index 0d8ea8e5cf3..a195c1393cc 100644 --- a/tests/scancode/test_ignore_files.py +++ b/tests/scancode/test_ignore_files.py @@ -72,7 +72,7 @@ def test_ignore_glob_file(self): def test_resource_paths_with_single_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore(('sample.doc',)) + test_plugin = ProcessIgnore('ignore', ('sample.doc',)) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -87,7 +87,7 @@ def test_resource_paths_with_single_file(self): def test_resource_paths_with_multiple_files(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore(('ignore.doc',)) + test_plugin = ProcessIgnore('ignore', ('ignore.doc',)) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -101,7 +101,7 @@ def test_resource_paths_with_multiple_files(self): def test_resource_paths_with_glob_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore(('*.doc',)) + test_plugin = ProcessIgnore('ignore', ('*.doc',)) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -114,7 +114,7 @@ def test_resource_paths_with_glob_file(self): def test_resource_paths_with_glob_path(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore(('*/src/test',)) + test_plugin = ProcessIgnore('ignore', ('*/src/test',)) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -129,8 +129,8 @@ def test_resource_paths_with_multiple_plugins(self): test_dir = self.extract_test_tar('ignore/user.tgz') scan_cache_class = get_scans_cache_class(self.get_temp_dir()) test_plugins = [ - ProcessIgnore(('*.doc',)), - ProcessIgnore(('*/src/test/*',)) + ProcessIgnore('ignore', ('*.doc',)), + ProcessIgnore('ignore', ('*/src/test/*',)) ] expected = [ 'user', From 6095fb1d8677fd46cc4bda6f603a9076e4f0f2a4 Mon Sep 17 00:00:00 2001 From: Saravanan G Date: Tue, 14 Nov 2017 10:03:27 +0530 Subject: [PATCH 002/122] Added MakeHuman Exception License Signed-off-by: Saravanan G --- .../data/licenses/make-human-exception.LICENSE | 17 ++++++++++++++++- .../data/rules/make-human-exception.RULE | 11 +++++++++++ .../data/rules/make-human-exception.yml | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/licensedcode/data/rules/make-human-exception.RULE create mode 100644 src/licensedcode/data/rules/make-human-exception.yml diff --git a/src/licensedcode/data/licenses/make-human-exception.LICENSE b/src/licensedcode/data/licenses/make-human-exception.LICENSE index c9c36e47ef6..cdfe57b5d0b 100644 --- a/src/licensedcode/data/licenses/make-human-exception.LICENSE +++ b/src/licensedcode/data/licenses/make-human-exception.LICENSE @@ -1,3 +1,4 @@ +<<<<<<< Upstream, based on upstream/develop MakeHuman output GPL exception @@ -21,4 +22,18 @@ for commercial purposes, all without asking permission. For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: -http://www.makehuman.org/content/license_explanation.html \ No newline at end of file +http://www.makehuman.org/content/license_explanation.html +======= +MakeHuman output GPL exception + +================================== + +As a special and limited exception, the copyright holders of the MakeHuman assets grants the option to use CC0 1.0 Universal as published by the Creative Commons, either version 1.0 of the License, or (at your option) any later version, as a license for the MakeHuman characters exported under the conditions that a) The assets were bundled in an export that was made using the file export functionality inside an OFFICIAL and UNMODIFIED version of MakeHuman and/or b) the asset solely consists of a 2D binary image in PNG, BMP or JPG format. + +The short version of CC0 is as follows: + +The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. + +For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: http://www.makehuman.org/content/license_explanation.html + +>>>>>>> c4575f6 Added MakeHuman Exception License diff --git a/src/licensedcode/data/rules/make-human-exception.RULE b/src/licensedcode/data/rules/make-human-exception.RULE new file mode 100644 index 00000000000..5815e24a957 --- /dev/null +++ b/src/licensedcode/data/rules/make-human-exception.RULE @@ -0,0 +1,11 @@ +MakeHuman output GPL exception + +================================== + +As a special and limited exception, the copyright holders of the MakeHuman assets grants the option to use CC0 1.0 Universal as published by the Creative Commons, either version 1.0 of the License, or (at your option) any later version, as a license for the MakeHuman characters exported under the conditions that a) The assets were bundled in an export that was made using the file export functionality inside an OFFICIAL and UNMODIFIED version of MakeHuman and/or b) the asset solely consists of a 2D binary image in PNG, BMP or JPG format. + +The short version of CC0 is as follows: + +The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. + +For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: http://www.makehuman.org/content/license_explanation.html diff --git a/src/licensedcode/data/rules/make-human-exception.yml b/src/licensedcode/data/rules/make-human-exception.yml new file mode 100644 index 00000000000..9253b459947 --- /dev/null +++ b/src/licensedcode/data/rules/make-human-exception.yml @@ -0,0 +1,2 @@ +licenses: + - make-human-exception From 4f0475cdbebb34558d64015dd5b09618a40455c1 Mon Sep 17 00:00:00 2001 From: Saravanan G Date: Tue, 14 Nov 2017 18:24:17 +0530 Subject: [PATCH 003/122] formatted LICENSE file and removed rules Signed-off-by: Saravanan G --- .../data/licenses/make-human-exception.LICENSE | 17 +---------------- .../data/rules/make-human-exception.RULE | 11 ----------- .../data/rules/make-human-exception.yml | 2 -- 3 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 src/licensedcode/data/rules/make-human-exception.RULE delete mode 100644 src/licensedcode/data/rules/make-human-exception.yml diff --git a/src/licensedcode/data/licenses/make-human-exception.LICENSE b/src/licensedcode/data/licenses/make-human-exception.LICENSE index cdfe57b5d0b..c9c36e47ef6 100644 --- a/src/licensedcode/data/licenses/make-human-exception.LICENSE +++ b/src/licensedcode/data/licenses/make-human-exception.LICENSE @@ -1,4 +1,3 @@ -<<<<<<< Upstream, based on upstream/develop MakeHuman output GPL exception @@ -22,18 +21,4 @@ for commercial purposes, all without asking permission. For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: -http://www.makehuman.org/content/license_explanation.html -======= -MakeHuman output GPL exception - -================================== - -As a special and limited exception, the copyright holders of the MakeHuman assets grants the option to use CC0 1.0 Universal as published by the Creative Commons, either version 1.0 of the License, or (at your option) any later version, as a license for the MakeHuman characters exported under the conditions that a) The assets were bundled in an export that was made using the file export functionality inside an OFFICIAL and UNMODIFIED version of MakeHuman and/or b) the asset solely consists of a 2D binary image in PNG, BMP or JPG format. - -The short version of CC0 is as follows: - -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. - -For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: http://www.makehuman.org/content/license_explanation.html - ->>>>>>> c4575f6 Added MakeHuman Exception License +http://www.makehuman.org/content/license_explanation.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/make-human-exception.RULE b/src/licensedcode/data/rules/make-human-exception.RULE deleted file mode 100644 index 5815e24a957..00000000000 --- a/src/licensedcode/data/rules/make-human-exception.RULE +++ /dev/null @@ -1,11 +0,0 @@ -MakeHuman output GPL exception - -================================== - -As a special and limited exception, the copyright holders of the MakeHuman assets grants the option to use CC0 1.0 Universal as published by the Creative Commons, either version 1.0 of the License, or (at your option) any later version, as a license for the MakeHuman characters exported under the conditions that a) The assets were bundled in an export that was made using the file export functionality inside an OFFICIAL and UNMODIFIED version of MakeHuman and/or b) the asset solely consists of a 2D binary image in PNG, BMP or JPG format. - -The short version of CC0 is as follows: - -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. - -For an elaboration and clarification on our intention and interpretation of these license terms see the License Explanation: http://www.makehuman.org/content/license_explanation.html diff --git a/src/licensedcode/data/rules/make-human-exception.yml b/src/licensedcode/data/rules/make-human-exception.yml deleted file mode 100644 index 9253b459947..00000000000 --- a/src/licensedcode/data/rules/make-human-exception.yml +++ /dev/null @@ -1,2 +0,0 @@ -licenses: - - make-human-exception From 5a304fd1a49e85e96ff1355f1e1b43d2adae9531 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Thu, 23 Nov 2017 22:05:31 +0100 Subject: [PATCH 004/122] Refactor post scan plugins so they can have command line options Signed-off-by: Haiko Schol --- setup.py | 4 +-- src/plugincode/post_scan.py | 31 +++++++++++++---- src/scancode/cli.py | 17 ++++----- src/scancode/plugin_mark_source.py | 52 ++++++++++++++++------------ src/scancode/plugin_only_findings.py | 26 +++++++++----- 5 files changed, 83 insertions(+), 47 deletions(-) diff --git a/setup.py b/setup.py index b3d63e9c7eb..984d21fbc91 100644 --- a/setup.py +++ b/setup.py @@ -222,8 +222,8 @@ def read(*names, **kwargs): # becomes the ScanCode CLI boolean flag used to enable a # given post_scan plugin 'scancode_post_scan': [ - 'only-findings = scancode.plugin_only_findings:process_only_findings', - 'mark-source = scancode.plugin_mark_source:process_mark_source', + 'only-findings = scancode.plugin_only_findings:OnlyFindings', + 'mark-source = scancode.plugin_mark_source:MarkSource', ], # scancode_pre_scan is an entry point to define pre_scan plugins. diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index 4f1aee9ce79..8a0a8345ba3 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -38,14 +38,30 @@ @post_scan_spec -def post_scan_handler(active_scans, results): +class PostScanPlugin(object): """ - Process the scanned files and yield the modified results. - Parameters: - - `active_scans`: a list of scanners names requested in the current run. - - `results`: an iterable of scan results for each file or directory. + A post-scan plugin layout class to be extended by the post_scan plugins. """ - pass + + def __init__(self, option, user_input): + self.option = option + self.user_input = user_input + + def process_results(self, results, active_scans): + """ + Process the scan results. + results - an iterable of resources + active_scans - iterable of scanners that were used to obtain the results (e.g. "copyrights", "licenses") + """ + return results + + @staticmethod + def get_click_options(): + """ + Return an iterable of `click.Option` objects to be + used for calling the plugin. + """ + return () post_scan_plugins = PluginManager('post_scan') @@ -57,6 +73,9 @@ def initialize(): NOTE: this defines the entry points for use in setup.py """ post_scan_plugins.load_setuptools_entrypoints('scancode_post_scan') + for name, plugin in get_post_scan_plugins().items(): + if not issubclass(plugin, PostScanPlugin): + raise Exception('Invalid post-scan plugin "%(name)s": does not extend "plugincode.post_scan.PostScanPlugin".' % locals()) def get_post_scan_plugins(): diff --git a/src/scancode/cli.py b/src/scancode/cli.py index ff35543f092..fb9b242dacf 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -499,14 +499,15 @@ def scancode(ctx, has_requested_post_scan_plugins = False - for option, post_scan_handler in plugincode.post_scan.get_post_scan_plugins().items(): - is_requested = kwargs[option.replace('-', '_')] - if is_requested: - options['--' + option] = True - if not quiet: - echo_stderr('Running post-scan plugin: %(option)s...' % locals(), fg='green') - results = post_scan_handler(active_scans, results) - has_requested_post_scan_plugins = True + for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): + for option in plugin.get_click_options(): + user_input = kwargs[option.name] + if user_input: + options['--' + name] = user_input + if not quiet: + echo_stderr('Running post-scan plugin: %(option)s...' % locals(), fg='green') + results = plugin(option.name, user_input).process_results(results, active_scans) + has_requested_post_scan_plugins = True if has_requested_post_scan_plugins: # FIXME: computing len needs a list and therefore needs loading it all ahead of time diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 6fefc52012b..299f20b3629 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -28,43 +28,51 @@ from os import path +from click import Option + +from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl @post_scan_impl -def process_mark_source(active_scans, results): +class MarkSource(PostScanPlugin): """ Set the "is_source" flag to true for directories that contain over 90% of source files as direct children. Has no effect unless the --info scan is requested. """ - # FIXME: this is forcing all the scan results to be loaded in memory - # and defeats lazy loading from cache - results = list(results) + def process_results(self, results, _): + # FIXME: this is forcing all the scan results to be loaded in memory + # and defeats lazy loading from cache + results = list(results) + + # FIXME: we should test for active scans instead, but "info" may not + # be present for now. check if the first item has a file info. + has_file_info = 'type' in results[0] - # FIXME: we should test for active scans instead, but "info" may not - # be present for now. check if the first item has a file info. - has_file_info = 'type' in results[0] + if not has_file_info: + # just yield results untouched + for scanned_file in results: + yield scanned_file + return - if not has_file_info: - # just yield results untouched + # FIXME: this is an nested loop, looping twice on results + # TODO: this may not recusrively roll up the is_source flag, as we + # may not iterate bottom up. for scanned_file in results: + if scanned_file['type'] == 'directory' and scanned_file['files_count'] > 0: + source_files_count = 0 + for scanned_file2 in results: + if path.dirname(scanned_file2['path']) == scanned_file['path']: + if scanned_file2['is_source']: + source_files_count += 1 + mark_source(source_files_count, scanned_file) yield scanned_file - return - # FIXME: this is an nested loop, looping twice on results - # TODO: this may not recusrively roll up the is_source flag, as we - # may not iterate bottom up. - for scanned_file in results: - if scanned_file['type'] == 'directory' and scanned_file['files_count'] > 0: - source_files_count = 0 - for scanned_file2 in results: - if path.dirname(scanned_file2['path']) == scanned_file['path']: - if scanned_file2['is_source']: - source_files_count += 1 - mark_source(source_files_count, scanned_file) - yield scanned_file + @staticmethod + def get_click_options(): + return [Option(('--mark-source',), is_flag=True)] def mark_source(source_files_count, scanned_file): diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index db155543e1d..40a42d1318f 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -25,25 +25,33 @@ from __future__ import absolute_import from __future__ import unicode_literals +from click import Option + +from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl @post_scan_impl -def process_only_findings(active_scans, results): +class OnlyFindings(PostScanPlugin): """ Only return files or directories with findings for the requested scans. Files and directories without findings are omitted (not considering basic file information as findings). """ - # FIXME: this is forcing all the scan results to be loaded in memory - # and defeats lazy loading from cache. Only a different caching - # (e.g. DB) could work here. - # FIXME: We should instead use a generator or use a filter function - # that pass to the scan results loader iterator - for scanned_file in results: - if has_findings(active_scans, scanned_file): - yield scanned_file + def process_results(self, results, active_scans): + # FIXME: this is forcing all the scan results to be loaded in memory + # and defeats lazy loading from cache. Only a different caching + # (e.g. DB) could work here. + # FIXME: We should instead use a generator or use a filter function + # that pass to the scan results loader iterator + for scanned_file in results: + if has_findings(active_scans, scanned_file): + yield scanned_file + + @staticmethod + def get_click_options(): + return [Option(('--only-findings',), is_flag=True)] def has_findings(active_scans, scanned_file): From f41bca6f25607b4760eed947a5f13835549dee6c Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Fri, 24 Nov 2017 10:23:46 +0100 Subject: [PATCH 005/122] Improve documentation of PostScanPlugin.process_results() Signed-off-by: Haiko Schol --- src/plugincode/post_scan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index 8a0a8345ba3..f7e4294416b 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -49,7 +49,8 @@ def __init__(self, option, user_input): def process_results(self, results, active_scans): """ - Process the scan results. + Return an iterable of results (eventually transformed or filtered) based on the results iterable. + results - an iterable of resources active_scans - iterable of scanners that were used to obtain the results (e.g. "copyrights", "licenses") """ From 403b1b2effffa5573c71b74b1861904327ea0845 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Fri, 24 Nov 2017 10:59:00 +0100 Subject: [PATCH 006/122] Rename get_click_options() to get_options() Signed-off-by: Haiko Schol --- src/plugincode/post_scan.py | 2 +- src/plugincode/pre_scan.py | 2 +- src/scancode/cli.py | 6 +++--- src/scancode/plugin_ignore.py | 2 +- src/scancode/plugin_mark_source.py | 2 +- src/scancode/plugin_only_findings.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index f7e4294416b..9af8641a77e 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -57,7 +57,7 @@ def process_results(self, results, active_scans): return results @staticmethod - def get_click_options(): + def get_options(): """ Return an iterable of `click.Option` objects to be used for calling the plugin. diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index 7f44363a5f9..845db14ff2a 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -60,7 +60,7 @@ def get_ignores(self): return {} @staticmethod - def get_click_options(): + def get_options(): """ Return an iterable of `click.Option` objects to be used for calling the plugin. diff --git a/src/scancode/cli.py b/src/scancode/cli.py index fb9b242dacf..f868aaaac6d 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -262,7 +262,7 @@ def __init__(self, name, context_settings=None, callback=None, option = ScanOption(('--' + name,), is_flag=True, help=help_text, group=POST_SCAN) self.params.append(option) for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - for option in plugin.get_click_options(): + for option in plugin.get_options(): if not isinstance(option, click.Option): raise Exception('Invalid plugin "%(name)s": supplied click option is not an instance of "click.Option".' % locals()) option.group = PRE_SCAN @@ -469,7 +469,7 @@ def scancode(ctx, scans_cache_class = get_scans_cache_class() pre_scan_plugins = [] for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - for option in plugin.get_click_options(): + for option in plugin.get_options(): user_input = kwargs[option.name] if user_input: options['--' + name] = user_input @@ -500,7 +500,7 @@ def scancode(ctx, has_requested_post_scan_plugins = False for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): - for option in plugin.get_click_options(): + for option in plugin.get_options(): user_input = kwargs[option.name] if user_input: options['--' + name] = user_input diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 36ee999c7eb..22b4b4e5af4 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -44,5 +44,5 @@ def get_ignores(self): return {pattern: 'User ignore: Supplied by --ignore' for pattern in self.user_input} @staticmethod - def get_click_options(): + def get_options(): return [Option(('--ignore',), multiple=True, metavar='', help='Ignore files matching .')] diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 299f20b3629..9e4c1c88d50 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -71,7 +71,7 @@ def process_results(self, results, _): yield scanned_file @staticmethod - def get_click_options(): + def get_options(): return [Option(('--mark-source',), is_flag=True)] diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 40a42d1318f..47bfb5459c0 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -50,7 +50,7 @@ def process_results(self, results, active_scans): yield scanned_file @staticmethod - def get_click_options(): + def get_options(): return [Option(('--only-findings',), is_flag=True)] From 5f4c626be80dbb9aedd536bad7a00aa5106683d2 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Fri, 24 Nov 2017 20:09:43 +0100 Subject: [PATCH 007/122] Allow post-scan plugins to take options other than boolean flags Signed-off-by: Haiko Schol --- setup.py | 6 +++--- src/scancode/cli.py | 33 ++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 984d21fbc91..00f23102337 100644 --- a/setup.py +++ b/setup.py @@ -218,9 +218,9 @@ def read(*names, **kwargs): # scancode_post_scan is an entry point for post_scan_plugins. # See plugincode.post_scan module for details and doc. - # note: the "name" of the entrypoint (e.g only-findings) - # becomes the ScanCode CLI boolean flag used to enable a - # given post_scan plugin + # note: for simple plugins, the "name" of the entrypoint + # (e.g only-findings) becomes the ScanCode CLI boolean flag + # used to enable the plugin 'scancode_post_scan': [ 'only-findings = scancode.plugin_only_findings:OnlyFindings', 'mark-source = scancode.plugin_mark_source:MarkSource', diff --git a/src/scancode/cli.py b/src/scancode/cli.py index f868aaaac6d..f19a0c25c44 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -256,17 +256,24 @@ def __init__(self, name, context_settings=None, callback=None, super(ScanCommand, self).__init__(name, context_settings, callback, params, help, epilog, short_help, options_metavar, add_help_option) - for name, callback in plugincode.post_scan.get_post_scan_plugins().items(): - # normalize white spaces in help. - help_text = ' '.join(callback.__doc__.split()) - option = ScanOption(('--' + name,), is_flag=True, help=help_text, group=POST_SCAN) - self.params.append(option) - for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - for option in plugin.get_options(): - if not isinstance(option, click.Option): - raise Exception('Invalid plugin "%(name)s": supplied click option is not an instance of "click.Option".' % locals()) - option.group = PRE_SCAN - self.params.append(option) + plugins_by_group = { + PRE_SCAN: plugincode.pre_scan.get_pre_scan_plugins(), + POST_SCAN: plugincode.post_scan.get_post_scan_plugins(), + } + + for group, plugins in plugins_by_group.items(): + for name, plugin in plugins.items(): + # Normalize white spaces in docstring and use it as help text for options + # that don't specify a help text. + help_text = ' '.join(plugin.__doc__.split()) + + for option in plugin.get_options(): + if not isinstance(option, click.Option): + raise Exception('Invalid plugin "%(name)s": supplied click option is not an instance of "click.Option".' % locals()) + + option.help = option.help or help_text + option.group = group + self.params.append(option) def format_options(self, ctx, formatter): """ @@ -503,9 +510,9 @@ def scancode(ctx, for option in plugin.get_options(): user_input = kwargs[option.name] if user_input: - options['--' + name] = user_input + options['--' + option.name.replace('_', '-')] = user_input if not quiet: - echo_stderr('Running post-scan plugin: %(option)s...' % locals(), fg='green') + echo_stderr('Running post-scan plugin: %(name)s...' % locals(), fg='green') results = plugin(option.name, user_input).process_results(results, active_scans) has_requested_post_scan_plugins = True From 612cf689b8273613afa5331b9114f1633ca4cad1 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sun, 10 Dec 2017 10:12:07 +0100 Subject: [PATCH 008/122] Use a common BasePlugin class for all plugins #787 Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 46 +++++++++++++++++++++++++++- src/plugincode/post_scan.py | 27 +++------------- src/plugincode/pre_scan.py | 39 ++++++----------------- src/scancode/api.py | 7 ++--- src/scancode/cli.py | 35 ++++++++++++--------- src/scancode/plugin_ignore.py | 11 ++++--- src/scancode/plugin_only_findings.py | 2 +- 7 files changed, 90 insertions(+), 77 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 7ebe6b01cb0..91d02bac53e 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -24,3 +24,47 @@ from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals + + +class BasePlugin(object): + """ + A base class for all scancode plugins. + """ + # a short string describing this plugin. Subclass must override + name = None + + def __init__(self, selected_options): + """ + Initialize a new plugin with a mapping of user selected options. + """ + self.selected_options = selected_options + + def process_one(self, resource): + """ + Yield zero, one or more Resource objects from a single `resource` + Resource object. + """ + yield resource + + def process_resources(self, resources): + """ + Return an iterable of Resource objects, possibly transformed, filtered + or enhanced by this plugin from a `resources` iterable of Resource + objects. + """ + for resource in resources: + for res in self.process_one(resource): + if res: + yield res + + @classmethod + def get_plugin_options(): + """ + Return a list of `ScanOption` objects for this plugin. + Subclass must override. + """ + return [] + + diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index 9af8641a77e..ffe367b5135 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -32,38 +32,19 @@ from pluggy import HookspecMarker from pluggy import PluginManager +from plugincode import BasePlugin + post_scan_spec = HookspecMarker('post_scan') post_scan_impl = HookimplMarker('post_scan') @post_scan_spec -class PostScanPlugin(object): +class PostScanPlugin(BasePlugin): """ - A post-scan plugin layout class to be extended by the post_scan plugins. + A post-scan plugin base class. """ - def __init__(self, option, user_input): - self.option = option - self.user_input = user_input - - def process_results(self, results, active_scans): - """ - Return an iterable of results (eventually transformed or filtered) based on the results iterable. - - results - an iterable of resources - active_scans - iterable of scanners that were used to obtain the results (e.g. "copyrights", "licenses") - """ - return results - - @staticmethod - def get_options(): - """ - Return an iterable of `click.Option` objects to be - used for calling the plugin. - """ - return () - post_scan_plugins = PluginManager('post_scan') post_scan_plugins.add_hookspecs(sys.modules[__name__]) diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index 845db14ff2a..d28b61673ec 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -32,41 +32,19 @@ from pluggy import HookspecMarker from pluggy import PluginManager +from plugincode import BasePlugin + pre_scan_spec = HookspecMarker('pre_scan') pre_scan_impl = HookimplMarker('pre_scan') + @pre_scan_spec -class PreScanPlugin(object): +class PreScanPlugin(BasePlugin): """ - A pre-scan plugin layout class to be extended by the pre_scan plugins. + A pre-scan plugin base class. """ - def __init__(self, option, user_input): - self.user_input = user_input - - def process_resource(self, resource): - """ - Process a resource prior to scan. - :param resource: instance of Resource to process - :return: resource or None to ignore the resource - """ - return resource - - def get_ignores(self): - """ - Return a dict of ignores to be used when processing resources - """ - return {} - - @staticmethod - def get_options(): - """ - Return an iterable of `click.Option` objects to be - used for calling the plugin. - """ - return () - pre_scan_plugins = PluginManager('pre_scan') pre_scan_plugins.add_hookspecs(sys.modules[__name__]) @@ -79,10 +57,11 @@ def initialize(): if not issubclass(plugin, PreScanPlugin): raise Exception('Invalid pre-scan plugin "%(name)s": does not extend "plugincode.pre_scan.PreScanPlugin".' % locals()) + def get_pre_scan_plugins(): """ - Return an ordered mapping of CLI option name --> plugin callable - for all the pre_scan plugins. The mapping is ordered by sorted key. - This is the main API for other code to access pre_scan plugins. + Return an ordered mapping of plugin "name" --> plugin object + for all the pre-scan plugins. The mapping is sorted by name. + This is the main API for other code to access pre-scan plugins. """ return OrderedDict(sorted(pre_scan_plugins.list_name_plugin())) diff --git a/src/scancode/api.py b/src/scancode/api.py index 86d0eac8ad9..9f78b62288b 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -42,8 +42,8 @@ class Resource(object): """ - Store scanned details for a single resource (file or a directory) - such as infos and path + A resource represent a file or directory with its essential "file + information" and the scanned data details. """ def __init__(self, scan_cache_class, abs_path, base_is_dir, len_base_path): @@ -52,8 +52,7 @@ def __init__(self, scan_cache_class, abs_path, base_is_dir, len_base_path): self.abs_path = abs_path self.base_is_dir = base_is_dir posix_path = as_posixpath(abs_path) - # fix paths: keep the path as relative to the original - # base_path. This is always Unicode + # keep the path as relative to the original base_path, always Unicode self.rel_path = get_relative_path(posix_path, len_base_path, base_is_dir) self.infos = OrderedDict() self.infos['path'] = self.rel_path diff --git a/src/scancode/cli.py b/src/scancode/cli.py index f19a0c25c44..ca42200b60a 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -253,26 +253,28 @@ class ScanCommand(BaseCommand): def __init__(self, name, context_settings=None, callback=None, params=None, help=None, epilog=None, short_help=None, options_metavar='[OPTIONS]', add_help_option=True): + super(ScanCommand, self).__init__(name, context_settings, callback, params, help, epilog, short_help, options_metavar, add_help_option) - plugins_by_group = { - PRE_SCAN: plugincode.pre_scan.get_pre_scan_plugins(), - POST_SCAN: plugincode.post_scan.get_post_scan_plugins(), - } + plugins_by_group = [ + (PRE_SCAN, plugincode.pre_scan.get_pre_scan_plugins()), + (POST_SCAN, plugincode.post_scan.get_post_scan_plugins()), + ] - for group, plugins in plugins_by_group.items(): - for name, plugin in plugins.items(): + for group, plugins in plugins_by_group: + for name, plugin in sorted(plugins.items()): # Normalize white spaces in docstring and use it as help text for options # that don't specify a help text. help_text = ' '.join(plugin.__doc__.split()) for option in plugin.get_options(): - if not isinstance(option, click.Option): - raise Exception('Invalid plugin "%(name)s": supplied click option is not an instance of "click.Option".' % locals()) + if not isinstance(option, ScanOption): + raise Exception('Invalid plugin option "%(name)s": option is not an instance of "ScanOption".' % locals()) option.help = option.help or help_text option.group = group + # this makes the plugin options "available" to the command self.params.append(option) def format_options(self, ctx, formatter): @@ -304,6 +306,7 @@ def format_options(self, ctx, formatter): with formatter.section(group): formatter.write_dl(option) + class ScanOption(click.Option): """ Allow an extra param `group` to be set which can be used @@ -315,10 +318,12 @@ def __init__(self, param_decls=None, show_default=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, type=None, help=None, group=None, **attrs): + super(ScanOption, self).__init__(param_decls, show_default, prompt, confirmation_prompt, hide_input, is_flag, flag_value, multiple, count, allow_from_autoenv, type, help, **attrs) + self.group = group @@ -400,13 +405,14 @@ def validate_exclusive(ctx, exclusive_options): def scancode(ctx, input, output_file, - copyright, license, package, - email, url, info, - license_score, license_text, license_url_template, + copyright, package, email, url, info, + license, license_score, license_text, license_url_template, strip_root, full_root, - format, verbose, quiet, processes, + format, + + verbose, quiet, processes, diag, timeout, *args, **kwargs): - """scan the file or directory for origin clues and license and save results to the . + """scan the file or directory for license, origin and packages and save results to . The scan results are printed to stdout if is not provided. Error and progress is printed to stderr. @@ -447,7 +453,8 @@ def scancode(ctx, options['--license'] = True options['--package'] = True - # A hack to force info being exposed for SPDX output in order to reuse calculated file SHA1s. + # A hack to force info being exposed for SPDX output in order to reuse + # calculated file SHA1s. if format in ('spdx-tv', 'spdx-rdf'): possible_scans['infos'] = True diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 22b4b4e5af4..d2b33fdfc45 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -36,13 +36,16 @@ class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ - - def __init__(self, option, user_input): - super(ProcessIgnore, self).__init__(option, user_input) + name = 'ignores' def get_ignores(self): return {pattern: 'User ignore: Supplied by --ignore' for pattern in self.user_input} @staticmethod def get_options(): - return [Option(('--ignore',), multiple=True, metavar='', help='Ignore files matching .')] + return [ + Option(('--ignore',), + multiple=True, + metavar='', + help='Ignore files matching .') + ] diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 47bfb5459c0..5ba0b22276d 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -49,7 +49,7 @@ def process_results(self, results, active_scans): if has_findings(active_scans, scanned_file): yield scanned_file - @staticmethod + @classmethod def get_options(): return [Option(('--only-findings',), is_flag=True)] From b765432d035ef7827d94de22b135d4146f7a1668 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 13:22:15 +0100 Subject: [PATCH 009/122] Inline fileutils imports #787 Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index ca42200b60a..265904c7000 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -46,11 +46,18 @@ click.disable_unicode_literals_warning = True from click.termui import style -from commoncode import filetype -from commoncode import fileutils +from commoncode.filetype import is_dir +from commoncode.fileutils import as_posixpath +from commoncode.fileutils import create_dir +from commoncode.fileutils import file_name +from commoncode.fileutils import parent_directory +from commoncode.fileutils import PATH_TYPE from commoncode.fileutils import path_to_bytes from commoncode.fileutils import path_to_unicode +from commoncode.fileutils import resource_iter + from commoncode import ignore + from commoncode.system import on_linux from commoncode.text import toascii @@ -246,6 +253,7 @@ def reindex_licenses(ctx, param, value): number of files processed. Use --verbose to display file-by-file progress. ''' + class ScanCommand(BaseCommand): short_usage_help = ''' Try 'scancode --help' for help on options and arguments.''' @@ -357,7 +365,7 @@ def validate_exclusive(ctx, exclusive_options): @click.pass_context # ensure that the input path is bytes on Linux, unicode elsewhere -@click.argument('input', metavar='', type=click.Path(exists=True, readable=True, path_type=fileutils.PATH_TYPE)) +@click.argument('input', metavar='', type=click.Path(exists=True, readable=True, path_type=PATH_TYPE)) @click.argument('output_file', default='-', metavar='', type=click.File(mode='wb', lazy=False)) # Note that click's 'default' option is set to 'false' here despite these being documented to be enabled by default in @@ -727,17 +735,17 @@ def _get_root_dir(input_path, strip_root=False, full_root=False): return scanned_path = os.path.abspath(os.path.normpath(os.path.expanduser(input_path))) - scanned_path = fileutils.as_posixpath(scanned_path) - if filetype.is_dir(scanned_path): + scanned_path = as_posixpath(scanned_path) + if is_dir(scanned_path): root_dir = scanned_path else: - root_dir = fileutils.parent_directory(scanned_path) - root_dir = fileutils.as_posixpath(root_dir) + root_dir = parent_directory(scanned_path) + root_dir = as_posixpath(root_dir) if full_root: return root_dir else: - return fileutils.file_name(root_dir) + return file_name(root_dir) def _resource_logger(logfile_fd, resources): @@ -827,7 +835,7 @@ def resource_paths(base_path, diag, scans_cache_class, pre_scan_plugins=None): base_path = path_to_unicode(base_path) base_path = os.path.abspath(os.path.normpath(os.path.expanduser(base_path))) - base_is_dir = filetype.is_dir(base_path) + base_is_dir = is_dir(base_path) len_base_path = len(base_path) ignores = {} if pre_scan_plugins: @@ -836,7 +844,7 @@ def resource_paths(base_path, diag, scans_cache_class, pre_scan_plugins=None): ignores.update(ignore.ignores_VCS) ignorer = build_ignorer(ignores, unignores={}) - resources = fileutils.resource_iter(base_path, ignored=ignorer) + resources = resource_iter(base_path, ignored=ignorer) for abs_path in resources: resource = Resource(scans_cache_class, abs_path, base_is_dir, len_base_path) @@ -927,7 +935,7 @@ def save_results(scanners, files_count, results, format, options, input, output_ # we are writing to a real filesystem file: create directories! parent_dir = os.path.dirname(output_file.name) if parent_dir: - fileutils.create_dir(abspath(expanduser(parent_dir))) + create_dir(abspath(expanduser(parent_dir))) # Write scan results to file or screen as a formatted output ... # ... using a user-provided custom format template From 7f9b74c16d9893567448e556ec878108aa2c51ae Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 13:22:54 +0100 Subject: [PATCH 010/122] Use proper import in prep for Python 3 #787 Signed-off-by: Philippe Ombredanne --- src/commoncode/fileutils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index a0c236212e1..4caac8fab8f 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -37,6 +37,7 @@ try: from os import fsencode + from os import fsdecode except ImportError: from backports.os import fsencode from backports.os import fsdecode From cff89add2a6bce29e2f28bd95a238cd32dea5bf9 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 14:55:00 +0100 Subject: [PATCH 011/122] Update help text test to match latest code #787 Signed-off-by: Philippe Ombredanne --- tests/scancode/data/help/help.txt | 4 ++-- tests/scancode/test_scan_help_groups.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index 9ffd2a0e6ad..e6327c116d1 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -1,7 +1,7 @@ Usage: scancode [OPTIONS] - scan the file or directory for origin clues and license and save - results to the . + scan the file or directory for license, origin and packages and save + results to . The scan results are printed to stdout if is not provided. Error and progress is printed to stderr. diff --git a/tests/scancode/test_scan_help_groups.py b/tests/scancode/test_scan_help_groups.py index 6485b9652b9..a3fbc20746f 100644 --- a/tests/scancode/test_scan_help_groups.py +++ b/tests/scancode/test_scan_help_groups.py @@ -75,4 +75,8 @@ def scan(opt): def test_scan_cli_help(self): expected_file = self.get_test_loc('help/help.txt') result = run_scan_click(['--help']) + regen = False + if regen: + with open(expected_file, 'wb') as ef: + ef.write(result.output) assert open(expected_file).read() == result.output From 75908e75694116d4c12bdf683cb537826ab73167 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 14:56:23 +0100 Subject: [PATCH 012/122] Use class method for get_plugin_options #787 Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 2 +- src/scancode/__init__.py | 26 ++++++++++++++++++++++++++ src/scancode/cli.py | 27 ++++----------------------- src/scancode/plugin_ignore.py | 9 ++++----- src/scancode/plugin_mark_source.py | 9 ++++----- src/scancode/plugin_only_findings.py | 7 +++---- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 91d02bac53e..d65d438798d 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -60,7 +60,7 @@ def process_resources(self, resources): yield res @classmethod - def get_plugin_options(): + def get_plugin_options(cls): """ Return a list of `ScanOption` objects for this plugin. Subclass must override. diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index 46affd53e35..5235507ad89 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -32,6 +32,8 @@ from os.path import join from os.path import exists +import click + from commoncode import fileutils @@ -51,3 +53,27 @@ except DistributionNotFound: # package is not installed ?? __version__ = '2.2.1' + + + +class ScanOption(click.Option): + """ + Allow an extra param `group` to be set which can be used + to determine to which group the option belongs. + """ + + def __init__(self, param_decls=None, show_default=False, + prompt=False, confirmation_prompt=False, + hide_input=False, is_flag=None, flag_value=None, + multiple=False, count=False, allow_from_autoenv=True, + type=None, help=None, group=None, **attrs): + + super(ScanOption, self).__init__(param_decls, show_default, + prompt, confirmation_prompt, + hide_input, is_flag, flag_value, + multiple, count, allow_from_autoenv, type, help, **attrs) + + self.group = group + + + diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 265904c7000..1788f9d9a2f 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -66,6 +66,7 @@ import plugincode.pre_scan from scancode import __version__ as version +from scancode import ScanOption from scancode.api import DEJACODE_LICENSE_URL from scancode.api import _empty_file_infos @@ -276,7 +277,7 @@ def __init__(self, name, context_settings=None, callback=None, # that don't specify a help text. help_text = ' '.join(plugin.__doc__.split()) - for option in plugin.get_options(): + for option in plugin.get_plugin_options(): if not isinstance(option, ScanOption): raise Exception('Invalid plugin option "%(name)s": option is not an instance of "ScanOption".' % locals()) @@ -315,26 +316,6 @@ def format_options(self, ctx, formatter): formatter.write_dl(option) -class ScanOption(click.Option): - """ - Allow an extra param `group` to be set which can be used - to determine to which group the option belongs. - """ - - def __init__(self, param_decls=None, show_default=False, - prompt=False, confirmation_prompt=False, - hide_input=False, is_flag=None, flag_value=None, - multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, group=None, **attrs): - - super(ScanOption, self).__init__(param_decls, show_default, - prompt, confirmation_prompt, - hide_input, is_flag, flag_value, - multiple, count, allow_from_autoenv, type, help, **attrs) - - self.group = group - - def validate_formats(ctx, param, value): """ Validate formats and template files. Raise a BadParameter on errors. @@ -491,7 +472,7 @@ def scancode(ctx, scans_cache_class = get_scans_cache_class() pre_scan_plugins = [] for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - for option in plugin.get_options(): + for option in plugin.get_plugin_options(): user_input = kwargs[option.name] if user_input: options['--' + name] = user_input @@ -522,7 +503,7 @@ def scancode(ctx, has_requested_post_scan_plugins = False for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): - for option in plugin.get_options(): + for option in plugin.get_plugin_options(): user_input = kwargs[option.name] if user_input: options['--' + option.name.replace('_', '-')] = user_input diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index d2b33fdfc45..7e284c76e57 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -25,10 +25,9 @@ from __future__ import absolute_import from __future__ import unicode_literals -from click import Option - from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl +from scancode.cli import ScanOption @pre_scan_impl @@ -41,10 +40,10 @@ class ProcessIgnore(PreScanPlugin): def get_ignores(self): return {pattern: 'User ignore: Supplied by --ignore' for pattern in self.user_input} - @staticmethod - def get_options(): + @classmethod + def get_plugin_options(cls): return [ - Option(('--ignore',), + ScanOption(('--ignore',), multiple=True, metavar='', help='Ignore files matching .') diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 9e4c1c88d50..0677d4545c4 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -28,10 +28,9 @@ from os import path -from click import Option - from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl +from scancode.cli import ScanOption @post_scan_impl @@ -70,9 +69,9 @@ def process_results(self, results, _): mark_source(source_files_count, scanned_file) yield scanned_file - @staticmethod - def get_options(): - return [Option(('--mark-source',), is_flag=True)] + @classmethod + def get_plugin_options(cls): + return [ScanOption(('--mark-source',), is_flag=True)] def mark_source(source_files_count, scanned_file): diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 5ba0b22276d..f282a80436a 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -25,10 +25,9 @@ from __future__ import absolute_import from __future__ import unicode_literals -from click import Option - from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl +from scancode.cli import ScanOption @post_scan_impl @@ -50,8 +49,8 @@ def process_results(self, results, active_scans): yield scanned_file @classmethod - def get_options(): - return [Option(('--only-findings',), is_flag=True)] + def get_plugin_options(cls): + return [ScanOption(('--only-findings',), is_flag=True)] def has_findings(active_scans, scanned_file): From 586d392018e72b02f93ce5e5b809a2f72e698c3c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 14:56:49 +0100 Subject: [PATCH 013/122] Use scans_cache_class not scan_cache_class #787 Signed-off-by: Philippe Ombredanne --- src/scancode/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scancode/api.py b/src/scancode/api.py index 9f78b62288b..c877f1e53fa 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -46,8 +46,8 @@ class Resource(object): information" and the scanned data details. """ - def __init__(self, scan_cache_class, abs_path, base_is_dir, len_base_path): - self.scan_cache_class = scan_cache_class() + def __init__(self, scans_cache_class, abs_path, base_is_dir, len_base_path): + self.scans_cache_class = scans_cache_class() self.is_cached = False self.abs_path = abs_path self.base_is_dir = base_is_dir @@ -62,13 +62,13 @@ def put_info(self, infos): Cache file info and set `is_cached` to True if already cached or false otherwise. """ self.infos.update(infos) - self.is_cached = self.scan_cache_class.put_info(self.rel_path, self.infos) + self.is_cached = self.scans_cache_class.put_info(self.rel_path, self.infos) def get_info(self): """ Retrieve info from cache. """ - return self.scan_cache_class.get_info(self.rel_path) + return self.scans_cache_class.get_info(self.rel_path) def extract_archives(location, recurse=True): From 66ec6dc4c9856a97e61930645db50335380a1f98 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 14:57:14 +0100 Subject: [PATCH 014/122] Extract function to get_cache_dir #787 Signed-off-by: Philippe Ombredanne --- src/scancode/cache.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/scancode/cache.py b/src/scancode/cache.py index 1621dc42798..e8f9cd7c90c 100644 --- a/src/scancode/cache.py +++ b/src/scancode/cache.py @@ -87,16 +87,24 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) -def get_scans_cache_class(cache_dir=scans_cache_dir): +def get_cache_dir(base_cache_dir=scans_cache_dir): """ - Return a new persistent cache class configured with a unique storage directory. + Return a new, created and unique cache storage directory. """ # create a unique temp directory in cache_dir - fileutils.create_dir(cache_dir) + fileutils.create_dir(base_cache_dir) prefix = timeutils.time2tstamp() + u'-' - cache_dir = fileutils.get_temp_dir(cache_dir, prefix=prefix) + cache_dir = fileutils.get_temp_dir(base_cache_dir, prefix=prefix) if on_linux: cache_dir = path_to_bytes(cache_dir) + return cache_dir + + +def get_scans_cache_class(base_cache_dir=scans_cache_dir): + """ + Return a new persistent cache class configured with a unique storage directory. + """ + cache_dir = get_cache_dir(base_cache_dir=base_cache_dir) sc = ScanFileCache(cache_dir) sc.setup() return partial(ScanFileCache, cache_dir) From 81780ea6274fc8eb9b3a1fd282c2031f3795af5d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 2 Jan 2018 16:39:24 +0100 Subject: [PATCH 015/122] Ensure all tests pass #787 * more ScanOption to scancode.__init__.py * add active_scans to BasePlugin initializer * ensure plugins work consistently * try to not make ignores a special case Signed-off-by: Philippe Ombredanne --- src/scancode/__init__.py | 6 +- src/scancode/cli.py | 94 +++++++++++++++------------- src/scancode/plugin_ignore.py | 5 +- src/scancode/plugin_mark_source.py | 2 +- src/scancode/plugin_only_findings.py | 5 +- tests/scancode/test_ignore_files.py | 12 ++-- 6 files changed, 66 insertions(+), 58 deletions(-) diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index 5235507ad89..8e0e0999a77 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -55,7 +55,6 @@ __version__ = '2.2.1' - class ScanOption(click.Option): """ Allow an extra param `group` to be set which can be used @@ -72,8 +71,5 @@ def __init__(self, param_decls=None, show_default=False, prompt, confirmation_prompt, hide_input, is_flag, flag_value, multiple, count, allow_from_autoenv, type, help, **attrs) - - self.group = group - - + self.group = group diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 1788f9d9a2f..d2c7c3efa58 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -272,14 +272,14 @@ def __init__(self, name, context_settings=None, callback=None, ] for group, plugins in plugins_by_group: - for name, plugin in sorted(plugins.items()): - # Normalize white spaces in docstring and use it as help text for options - # that don't specify a help text. + for pname, plugin in sorted(plugins.items()): + # Normalize white spaces in docstring and use it as help text + # for options that don't specify a help text. help_text = ' '.join(plugin.__doc__.split()) for option in plugin.get_plugin_options(): if not isinstance(option, ScanOption): - raise Exception('Invalid plugin option "%(name)s": option is not an instance of "ScanOption".' % locals()) + raise Exception('Invalid plugin option "%(pname)s": option is not an instance of "ScanOption".' % locals()) option.help = option.help or help_text option.group = group @@ -395,10 +395,10 @@ def validate_exclusive(ctx, exclusive_options): def scancode(ctx, input, output_file, copyright, package, email, url, info, - license, license_score, license_text, license_url_template, + license, license_score, license_text, license_url_template, strip_root, full_root, - format, - + format, + verbose, quiet, processes, diag, timeout, *args, **kwargs): """scan the file or directory for license, origin and packages and save results to . @@ -468,50 +468,56 @@ def scancode(ctx, # FIXME: this is does not make sense to use tuple and positional values scanners = OrderedDict(zip(possible_scans.keys(), zip(possible_scans.values(), scan_functions))) + # Find all scans that are both enabled and have a valid function + # reference. This deliberately filters out the "info" scan + # (which always has a "None" function reference) as there is no + # dedicated "infos" key in the results that "plugin_only_findings.has_findings()" + # could check. + # FIXME: we should not use positional tings tuples for v[0], v[1] that are mysterious values for now + active_scans = [k for k, v in scanners.items() if v[0] and v[1]] scans_cache_class = get_scans_cache_class() pre_scan_plugins = [] for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): + pre_scan_plugins.append(plugin(kwargs, active_scans)) + # FIXME: this just does not make sense at all: collecting which option + # is enabled and how should be made in a cleaner way for option in plugin.get_plugin_options(): user_input = kwargs[option.name] if user_input: + # FIXME: we should not dabble with CLI args options['--' + name] = user_input - pre_scan_plugins.append(plugin(option.name, user_input)) + try: - files_count, results, success = scan( - input_path=input, - scanners=scanners, - verbose=verbose, - quiet=quiet, - processes=processes, - timeout=timeout, - diag=diag, + files_count, results, success = scan_all( + input_path=input, scanners=scanners, + verbose=verbose, quiet=quiet, + processes=processes, timeout=timeout, diag=diag, scans_cache_class=scans_cache_class, - strip_root=strip_root, - full_root=full_root, + strip_root=strip_root, full_root=full_root, pre_scan_plugins=pre_scan_plugins) - # Find all scans that are both enabled and have a valid function - # reference. This deliberately filters out the "info" scan - # (which always has a "None" function reference) as there is no - # dedicated "infos" key in the results that "plugin_only_findings.has_findings()" - # could check. - # FIXME: we should not use positional tings tuples for v[0], v[1] that are mysterious values for now - active_scans = [k for k, v in scanners.items() if v[0] and v[1]] - + # FIXME: THIS IS USELESS!! has_requested_post_scan_plugins = False - for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): + for pname, plugin in plugincode.post_scan.get_post_scan_plugins().items(): + # FIXME: this just does not make sense at all: collecting which option + # is enabled and how should be made in a cleaner way for option in plugin.get_plugin_options(): user_input = kwargs[option.name] + # FIXME: this is wrong!!!!!: what is the option value is False or None? if user_input: + # FIXME: we should not dabble with CLI args options['--' + option.name.replace('_', '-')] = user_input if not quiet: - echo_stderr('Running post-scan plugin: %(name)s...' % locals(), fg='green') - results = plugin(option.name, user_input).process_results(results, active_scans) + echo_stderr('Running post-scan plugin: %(pname)s...' % locals(), fg='green') has_requested_post_scan_plugins = True + # FIXME: this is wrong!!!!!1 + plugin_runner = plugin(kwargs, active_scans) + results = plugin_runner.process_resources(results) + if has_requested_post_scan_plugins: # FIXME: computing len needs a list and therefore needs loading it all ahead of time results = list(results) @@ -532,14 +538,10 @@ def scancode(ctx, ctx.exit(rc) -def scan(input_path, - scanners, - verbose=False, quiet=False, - processes=1, timeout=DEFAULT_TIMEOUT, - diag=False, - scans_cache_class=None, - strip_root=False, - full_root=False, +def scan_all(input_path, scanners, + verbose=False, quiet=False, processes=1, timeout=DEFAULT_TIMEOUT, + diag=False, scans_cache_class=None, + strip_root=False, full_root=False, pre_scan_plugins=None): """ Return a tuple of (files_count, scan_results, success) where @@ -825,15 +827,23 @@ def resource_paths(base_path, diag, scans_cache_class, pre_scan_plugins=None): ignores.update(ignore.ignores_VCS) ignorer = build_ignorer(ignores, unignores={}) - resources = resource_iter(base_path, ignored=ignorer) + locations = resource_iter(base_path, ignored=ignorer) + + resources = build_resources(locations, scans_cache_class, base_is_dir, len_base_path, diag) + if pre_scan_plugins: + for plugin in pre_scan_plugins: + resources = plugin.process_resources(resources) + return resources + - for abs_path in resources: +def build_resources(locations, scans_cache_class, base_is_dir, len_base_path, diag): + """ + Yield Resource objects from an iterable of absolute paths. + """ + for abs_path in locations: resource = Resource(scans_cache_class, abs_path, base_is_dir, len_base_path) # always fetch infos and cache. resource.put_info(scan_infos(abs_path, diag=diag)) - if pre_scan_plugins: - for plugin in pre_scan_plugins: - resource = plugin.process_resource(resource) if resource: yield resource diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 7e284c76e57..6193635f8fa 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -35,10 +35,11 @@ class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ - name = 'ignores' + name = 'ignore' def get_ignores(self): - return {pattern: 'User ignore: Supplied by --ignore' for pattern in self.user_input} + user_ignores = self.selected_options.get('ignore') or [] + return {pattern: 'User ignore: Supplied by --ignore' for pattern in user_ignores} @classmethod def get_plugin_options(cls): diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 0677d4545c4..54f1ffd4ba2 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -41,7 +41,7 @@ class MarkSource(PostScanPlugin): Has no effect unless the --info scan is requested. """ - def process_results(self, results, _): + def process_resources(self, results): # FIXME: this is forcing all the scan results to be loaded in memory # and defeats lazy loading from cache results = list(results) diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index f282a80436a..e1662472594 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -38,14 +38,15 @@ class OnlyFindings(PostScanPlugin): considering basic file information as findings). """ - def process_results(self, results, active_scans): + def process_resources(self, results): # FIXME: this is forcing all the scan results to be loaded in memory # and defeats lazy loading from cache. Only a different caching # (e.g. DB) could work here. # FIXME: We should instead use a generator or use a filter function # that pass to the scan results loader iterator + active_scan_names= self.active_scan_names for scanned_file in results: - if has_findings(active_scans, scanned_file): + if has_findings(active_scan_names, scanned_file): yield scanned_file @classmethod diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py index a195c1393cc..88d2f3c9cb8 100644 --- a/tests/scancode/test_ignore_files.py +++ b/tests/scancode/test_ignore_files.py @@ -72,7 +72,7 @@ def test_ignore_glob_file(self): def test_resource_paths_with_single_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore('ignore', ('sample.doc',)) + test_plugin = ProcessIgnore({'ignore': ('sample.doc',)}) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -87,7 +87,7 @@ def test_resource_paths_with_single_file(self): def test_resource_paths_with_multiple_files(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore('ignore', ('ignore.doc',)) + test_plugin = ProcessIgnore({'ignore': ('ignore.doc',)}) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -101,7 +101,7 @@ def test_resource_paths_with_multiple_files(self): def test_resource_paths_with_glob_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore('ignore', ('*.doc',)) + test_plugin = ProcessIgnore({'ignore': ('*.doc',)}) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -114,7 +114,7 @@ def test_resource_paths_with_glob_file(self): def test_resource_paths_with_glob_path(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore('ignore', ('*/src/test',)) + test_plugin = ProcessIgnore({'ignore': ('*/src/test',)}) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -129,8 +129,8 @@ def test_resource_paths_with_multiple_plugins(self): test_dir = self.extract_test_tar('ignore/user.tgz') scan_cache_class = get_scans_cache_class(self.get_temp_dir()) test_plugins = [ - ProcessIgnore('ignore', ('*.doc',)), - ProcessIgnore('ignore', ('*/src/test/*',)) + ProcessIgnore({'ignore': ('*.doc',)}), + ProcessIgnore({'ignore': ('*/src/test/*',)}) ] expected = [ 'user', From d9f8ec1f19fb41fe43862edbfb00931ebc12989a Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 3 Jan 2018 17:30:08 +0100 Subject: [PATCH 016/122] Remove junk print statements Signed-off-by: Philippe Ombredanne --- src/commoncode/paths.py | 2 -- src/extractcode/sevenzip.py | 1 - src/packagedcode/pypi.py | 2 +- src/packagedcode/rpm.py | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/commoncode/paths.py b/src/commoncode/paths.py index 903eba1e224..71ff649aa11 100644 --- a/src/commoncode/paths.py +++ b/src/commoncode/paths.py @@ -78,8 +78,6 @@ def safe_path(path, posix=False): segments = [s.strip() for s in path.split(path_sep) if s.strip()] segments = [portable_filename(s) for s in segments] - # print('safe_path: orig:', orig_path, 'segments:', segments) - if not segments: return '_' diff --git a/src/extractcode/sevenzip.py b/src/extractcode/sevenzip.py index c626fba2699..ff800eaa7ca 100644 --- a/src/extractcode/sevenzip.py +++ b/src/extractcode/sevenzip.py @@ -222,7 +222,6 @@ def list_entries(location, arch_type='*'): if rc != 0: # FIXME: this test is useless _error = get_7z_errors(stdout) or UNKNOWN_ERROR - # print(_error) # the listing was produced as UTF on windows to avoid damaging binary # paths in console outputs diff --git a/src/packagedcode/pypi.py b/src/packagedcode/pypi.py index c99368fcb16..ae724c4d550 100644 --- a/src/packagedcode/pypi.py +++ b/src/packagedcode/pypi.py @@ -129,8 +129,8 @@ def parse_metadata(location): for fname in ('METADATA', 'DESCRIPTION.rst')): return # FIXME: wrap in a with statement + # FIXME: use ordereddict infos = json.loads(open(location, 'rb').read()) - print(infos) homepage_url = None authors = [] if infos['extensions']: diff --git a/src/packagedcode/rpm.py b/src/packagedcode/rpm.py index b715bb16952..5d25131842f 100644 --- a/src/packagedcode/rpm.py +++ b/src/packagedcode/rpm.py @@ -118,7 +118,6 @@ def info(location, include_desc=False): the long RPM description value if include_desc is True. """ tgs = tags(location, include_desc) - print(tgs) return tgs and RPMInfo(**tgs) or None From 4f143b7268b34cb6997002f79efba43c71526fbe Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 3 Jan 2018 18:05:58 +0100 Subject: [PATCH 017/122] Streamline core CLI and plugins processing * use structured namedtuple to track Scanners and CommandOptions * rework how default scan and selected options are handled using these tuples to streamline the corresponding code and the way selected options are reported in the scan results (at least for JSON) * add is_enabled method to Plugin * ensure the help of options is used for each option, and not a global help for all the options of a given plugin * add new plural option for each scan (such as --licenses) that maps exactly to the key used in the scan results. Use plural variables throughout to simplify the code * use kwargs for the main cli.scancode function for all all options and no longer use named arguments: args can come from any plugins and are not known until runtime. Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 35 +- src/scancode/__init__.py | 2 +- src/scancode/cli.py | 391 +++++----- src/scancode/plugin_ignore.py | 26 +- src/scancode/plugin_mark_source.py | 34 +- src/scancode/plugin_only_findings.py | 21 +- tests/formattedcode/data/csv/srp.csv | 6 +- .../formattedcode/data/csv/tree/expected.csv | 6 +- .../data/json/simple-expected.json | 10 +- .../data/json/simple-expected.jsonlines | 71 +- .../data/json/simple-expected.jsonpp | 9 +- .../data/json/tree/expected.json | 12 +- .../data/spdx/license_known/expected.rdf | 48 +- .../spdx/license_known/expected_with_text.rdf | 38 +- .../data/spdx/license_ref/expected.rdf | 58 +- .../spdx/license_ref/expected_with_text.rdf | 40 +- .../data/spdx/or_later/expected.rdf | 24 +- .../data/spdx/simple/expected.rdf | 26 +- .../formattedcode/data/spdx/tree/expected.rdf | 110 +-- .../data/spdx/unicode/expected.rdf | 48 +- tests/formattedcode/test_format_jsonlines.py | 8 +- .../data/index/test__add_rules.json | 310 ++++---- .../index/test__add_rules_with_templates.json | 308 ++++---- .../data/index/test_init_with_rules.json | 310 ++++---- .../data/models/licenses.expected.json | 206 +++--- .../data/models/rules.expected.json | 20 +- .../data/altpath/copyright.expected.json | 8 +- .../data/composer/composer.expected.json | 4 +- .../data/failing/patchelf.expected.json | 6 +- tests/scancode/data/help/help.txt | 32 +- tests/scancode/data/info/all.expected.json | 10 +- .../data/info/all.rooted.expected.json | 10 +- tests/scancode/data/info/basic.expected.json | 6 +- .../data/info/basic.rooted.expected.json | 4 +- .../data/info/email_url_info.expected.json | 10 +- .../scancode/data/license_text/test.expected | 6 +- .../data/mark_source/with_info.expected.json | 679 +++++++++--------- .../mark_source/without_info.expected.json | 8 +- .../data/non_utf8/expected-linux.json | 6 +- .../scancode/data/only_findings/expected.json | 215 +++--- ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 4 +- .../unicodepath.expected-linux.json | 16 +- .../data/weird_file_name/expected-linux.json | 8 +- tests/scancode/test_ignore_files.py | 26 +- 44 files changed, 1646 insertions(+), 1589 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index d65d438798d..2ef741012d1 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -35,16 +35,34 @@ class BasePlugin(object): # a short string describing this plugin. Subclass must override name = None - def __init__(self, selected_options): + def __init__(self, selected_options, active_scan_names=None): """ - Initialize a new plugin with a mapping of user selected options. + Initialize a new plugin with a mapping of user `selected_options` (e.g. + keyword arguments) and a list of `active_scan_names`. """ - self.selected_options = selected_options + self.selected_options = selected_options or {} + self.active_scan_names = active_scan_names or [] + + @classmethod + def get_plugin_options(cls): + """ + Return a list of `ScanOption` objects for this plugin. + Subclasses must override and implement. + """ + raise NotImplementedError + + def is_enabled(self): + """ + Return True is this plugin is enabled by user-selected options. + Subclasses must override and implement. + """ + raise NotImplementedError def process_one(self, resource): """ Yield zero, one or more Resource objects from a single `resource` Resource object. + Subclasses should override. """ yield resource @@ -53,18 +71,9 @@ def process_resources(self, resources): Return an iterable of Resource objects, possibly transformed, filtered or enhanced by this plugin from a `resources` iterable of Resource objects. + Subclasses should override. """ for resource in resources: for res in self.process_one(resource): if res: yield res - - @classmethod - def get_plugin_options(cls): - """ - Return a list of `ScanOption` objects for this plugin. - Subclass must override. - """ - return [] - - diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index 8e0e0999a77..c75ca34b5d1 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -65,7 +65,7 @@ def __init__(self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, group=None, **attrs): + type=None, help=None, group=None, expose_value=True, **attrs): super(ScanOption, self).__init__(param_decls, show_default, prompt, confirmation_prompt, diff --git a/src/scancode/cli.py b/src/scancode/cli.py index d2c7c3efa58..f968808db61 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -31,6 +31,7 @@ from scancode.pool import get_pool import codecs +from collections import namedtuple from collections import OrderedDict from functools import partial from itertools import imap @@ -113,6 +114,10 @@ plugincode.post_scan.initialize() +CommandOption = namedtuple('CommandOption', 'group, name, option, value, default') +Scanner = namedtuple('Scanner', 'name function is_enabled') + + info_text = ''' ScanCode scans code and other files for origin and license. Visit https://github.com/nexB/scancode-toolkit/ for support and download. @@ -256,41 +261,42 @@ def reindex_licenses(ctx, param, value): class ScanCommand(BaseCommand): + """ + A command class that is aware of ScanCode plugins and provides help where + each option is grouped by group. + """ short_usage_help = ''' Try 'scancode --help' for help on options and arguments.''' def __init__(self, name, context_settings=None, callback=None, params=None, help=None, epilog=None, short_help=None, - options_metavar='[OPTIONS]', add_help_option=True): + options_metavar='[OPTIONS]', add_help_option=True, + plugins_by_group=()): super(ScanCommand, self).__init__(name, context_settings, callback, params, help, epilog, short_help, options_metavar, add_help_option) - plugins_by_group = [ - (PRE_SCAN, plugincode.pre_scan.get_pre_scan_plugins()), - (POST_SCAN, plugincode.post_scan.get_post_scan_plugins()), - ] - for group, plugins in plugins_by_group: for pname, plugin in sorted(plugins.items()): - # Normalize white spaces in docstring and use it as help text - # for options that don't specify a help text. - help_text = ' '.join(plugin.__doc__.split()) - for option in plugin.get_plugin_options(): if not isinstance(option, ScanOption): - raise Exception('Invalid plugin option "%(pname)s": option is not an instance of "ScanOption".' % locals()) + raise Exception( + 'Invalid plugin option "%(pname)s": option is not ' + 'an instance of "ScanOption".' % locals()) - option.help = option.help or help_text + # normalize the help text, which may otherwise be messy + option.help = option.help and ' '.join(option.help.split()) option.group = group - # this makes the plugin options "available" to the command + # this makes the plugin options "known" from the command self.params.append(option) def format_options(self, ctx, formatter): """ - Overridden from click.Command to write all options into the formatter in groups - they belong to. If a group is not specified, add the option to MISC group. + Overridden from click.Command to write all options into the formatter in + groups they belong to. If a group is not specified, add the option to + MISC group. """ + # this mapping defines the CLI help presentation order groups = OrderedDict([ (SCANS, []), (OUTPUT, []), @@ -307,6 +313,7 @@ def format_options(self, ctx, formatter): if getattr(param, 'group', None): groups[param.group].append(help_record) else: + # use the misc group if no group is defined groups['misc'].append(help_record) with formatter.section('Options'): @@ -325,7 +332,9 @@ def validate_formats(ctx, param, value): return value_lower # render using a user-provided custom format template if not os.path.isfile(value): - raise click.BadParameter('Unknwow or invalid template file path: "%(value)s" does not exist or is not readable.' % locals()) + raise click.BadParameter( + 'Unknwow or invalid template file path: "%(value)s" ' + 'does not exist or is not readable.' % locals()) return value @@ -342,7 +351,14 @@ def validate_exclusive(ctx, exclusive_options): raise click.UsageError(msg) -@click.command(name='scancode', epilog=epilog_text, cls=ScanCommand) +# collect plugins for each group and add plugins options to the command +# params +_plugins_by_group = [ + (PRE_SCAN, plugincode.pre_scan.get_pre_scan_plugins()), + (POST_SCAN, plugincode.post_scan.get_post_scan_plugins()), +] + +@click.command(name='scancode', epilog=epilog_text, cls=ScanCommand, plugins_by_group=_plugins_by_group) @click.pass_context # ensure that the input path is bytes on Linux, unicode elsewhere @@ -351,13 +367,13 @@ def validate_exclusive(ctx, exclusive_options): # Note that click's 'default' option is set to 'false' here despite these being documented to be enabled by default in # order to more elegantly enable all of these (see code below) if *none* of the command line options are specified. -@click.option('-c', '--copyright', is_flag=True, default=False, help='Scan for copyrights. [default]', group=SCANS, cls=ScanOption) -@click.option('-l', '--license', is_flag=True, default=False, help='Scan for licenses. [default]', group=SCANS, cls=ScanOption) -@click.option('-p', '--package', is_flag=True, default=False, help='Scan for packages. [default]', group=SCANS, cls=ScanOption) +@click.option('-c', '--copyright', '--copyrights', is_flag=True, default=False, help='Scan for copyrights. [default]', group=SCANS, cls=ScanOption) +@click.option('-l', '--license', '--licenses', is_flag=True, default=False, help='Scan for licenses. [default]', group=SCANS, cls=ScanOption) +@click.option('-p', '--package', '--packages', is_flag=True, default=False, help='Scan for packages. [default]', group=SCANS, cls=ScanOption) -@click.option('-e', '--email', is_flag=True, default=False, help='Scan for emails.', group=SCANS, cls=ScanOption) -@click.option('-u', '--url', is_flag=True, default=False, help='Scan for urls.', group=SCANS, cls=ScanOption) -@click.option('-i', '--info', is_flag=True, default=False, help='Include information such as size, type, etc.', group=SCANS, cls=ScanOption) +@click.option('-e', '--email', '--emails', is_flag=True, default=False, help='Scan for emails.', group=SCANS, cls=ScanOption) +@click.option('-u', '--url', '--urls', is_flag=True, default=False, help='Scan for urls.', group=SCANS, cls=ScanOption) +@click.option('-i', '--info', '--infos', is_flag=True, default=False, help='Include information such as size, type, etc.', group=SCANS, cls=ScanOption) @click.option('--license-score', is_flag=False, default=0, type=int, show_default=True, help='Do not return license matches with scores lower than this score. A number between 0 and 100.', group=SCANS, cls=ScanOption) @@ -392,136 +408,124 @@ def validate_exclusive(ctx, exclusive_options): @click.option('--timeout', is_flag=False, default=DEFAULT_TIMEOUT, type=float, show_default=True, help='Stop scanning a file if scanning takes longer than a timeout in seconds.', group=CORE, cls=ScanOption) @click.option('--reindex-licenses', is_flag=True, default=False, is_eager=True, callback=reindex_licenses, help='Force a check and possible reindexing of the cached license index.', group=MISC, cls=ScanOption) -def scancode(ctx, - input, output_file, - copyright, package, email, url, info, - license, license_score, license_text, license_url_template, - strip_root, full_root, - format, - - verbose, quiet, processes, - diag, timeout, *args, **kwargs): +def scancode(ctx, input, output_file, *args, **kwargs): """scan the file or directory for license, origin and packages and save results to . The scan results are printed to stdout if is not provided. Error and progress is printed to stderr. """ - validate_exclusive(ctx, ['strip_root', 'full_root']) - possible_scans = OrderedDict([ - ('infos', info), - ('licenses', license), - ('copyrights', copyright), - ('packages', package), - ('emails', email), - ('urls', url) - ]) - - options = OrderedDict([ - ('--copyright', copyright), - ('--license', license), - ('--package', package), - ('--email', email), - ('--url', url), - ('--info', info), - ('--license-score', license_score), - ('--license-text', license_text), - ('--strip-root', strip_root), - ('--full-root', full_root), - ('--format', format), - ('--diag', diag), - ]) - - # Use default scan options when no options are provided on the command line. - if not any(possible_scans.values()): - possible_scans['copyrights'] = True - possible_scans['licenses'] = True - possible_scans['packages'] = True - options['--copyright'] = True - options['--license'] = True - options['--package'] = True - - # A hack to force info being exposed for SPDX output in order to reuse - # calculated file SHA1s. - if format in ('spdx-tv', 'spdx-rdf'): - possible_scans['infos'] = True - - # FIXME: pombredanne: what is this? I cannot understand what this does - for key in options: - if key == "--license-score": - continue - if options[key] == False: - del options[key] - - get_licenses_with_score = partial(get_licenses, min_score=license_score, include_text=license_text, diag=diag, license_url_template=license_url_template) - - # List of scan functions in the same order as "possible_scans". - scan_functions = [ - None, # For "infos" there is no separate scan function, they are always gathered, though not always exposed. - get_licenses_with_score, - get_copyrights, - get_package_infos, - get_emails, - get_urls + # ## TODO: FIX when plugins are used everywhere + copyrights = kwargs.get('copyrights') + licenses = kwargs.get('licenses') + packages = kwargs.get('packages') + emails = kwargs.get('emails') + urls = kwargs.get('urls') + infos = kwargs.get('infos') + + strip_root = kwargs.get('strip_root') + full_root = kwargs.get('full_root') + format = kwargs.get('format') + + verbose = kwargs.get('verbose') + quiet = kwargs.get('quiet') + processes = kwargs.get('processes') + diag = kwargs.get('diag') + timeout = kwargs.get('timeout') + # ## TODO: END FIX when plugins are used everywhere + + # Use default scan options when no scan option is provided + # FIXME: this should be removed? + use_default_scans = not any([infos, licenses, copyrights, packages, emails, urls]) + + # FIXME: A hack to force info being exposed for SPDX output in order to + # reuse calculated file SHA1s. + is_spdx = format in ('spdx-tv', 'spdx-rdf') + + get_licenses_with_score = partial(get_licenses, + diag=diag, + min_score=kwargs.get('license_score'), + include_text=kwargs.get('license_text'), + license_url_template=kwargs.get('license_url_template')) + + scanners = [ + # FIXME: For "infos" there is no separate scan function, they are always + # gathered, though not always exposed. + Scanner('infos', None, infos or is_spdx), + Scanner('licenses', get_licenses_with_score, licenses or use_default_scans), + Scanner('copyrights', get_copyrights, copyrights or use_default_scans), + Scanner('packages', get_package_infos, packages or use_default_scans), + Scanner('emails', get_emails, emails), + Scanner('urls', get_urls, urls) ] - # FIXME: this is does not make sense to use tuple and positional values - scanners = OrderedDict(zip(possible_scans.keys(), zip(possible_scans.values(), scan_functions))) + ignored_options = 'verbose', 'quiet', 'processes', 'timeout' + all_options = list(get_command_options(ctx, ignores=ignored_options, skip_no_group=True)) + + # FIXME: this is terribly hackish :| + # FIXUP OPTIONS FOR DEFAULT SCANS + options = [] + enabled_scans = {sc.name: sc.is_enabled for sc in scanners} + for opt in all_options: + if enabled_scans.get(opt.name): + options.append(opt._replace(value=True)) + continue + + # do not report option set to defaults or with an empty list value + if isinstance(opt.value, (list, tuple)): + if opt.value: + options.append(opt) + continue + if opt.value != opt.default: + options.append(opt) + # Find all scans that are both enabled and have a valid function # reference. This deliberately filters out the "info" scan # (which always has a "None" function reference) as there is no # dedicated "infos" key in the results that "plugin_only_findings.has_findings()" # could check. - # FIXME: we should not use positional tings tuples for v[0], v[1] that are mysterious values for now - active_scans = [k for k, v in scanners.items() if v[0] and v[1]] + active_scans = [scan.name for scan in scanners if scan.is_enabled] - scans_cache_class = get_scans_cache_class() + + # FIXME: Prescan should happen HERE not as part of the per-file scan pre_scan_plugins = [] for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - pre_scan_plugins.append(plugin(kwargs, active_scans)) - # FIXME: this just does not make sense at all: collecting which option - # is enabled and how should be made in a cleaner way - for option in plugin.get_plugin_options(): - user_input = kwargs[option.name] - if user_input: - # FIXME: we should not dabble with CLI args - options['--' + name] = user_input + if plugin.is_enabled: + pre_scan_plugins.append(plugin(all_options, active_scans)) + # TODO: new loop + # 1. collect minimally the whole files tree in memory as a Resource tree + # 2. apply the pre scan plugins to this tree + # 3. run the scan proper, save scan details on disk + # 4. apply the post scan plugins to this tree, lazy load as needed the scan + # details from disk. save back updated details on disk + scans_cache_class = get_scans_cache_class() try: files_count, results, success = scan_all( - input_path=input, scanners=scanners, + input_path=input, + scanners=scanners, verbose=verbose, quiet=quiet, processes=processes, timeout=timeout, diag=diag, scans_cache_class=scans_cache_class, strip_root=strip_root, full_root=full_root, + # FIXME: this should not be part of the of scan_all!!!! pre_scan_plugins=pre_scan_plugins) - # FIXME: THIS IS USELESS!! - has_requested_post_scan_plugins = False - + # FIXME!!! for pname, plugin in plugincode.post_scan.get_post_scan_plugins().items(): - # FIXME: this just does not make sense at all: collecting which option - # is enabled and how should be made in a cleaner way - for option in plugin.get_plugin_options(): - user_input = kwargs[option.name] - # FIXME: this is wrong!!!!!: what is the option value is False or None? - if user_input: - # FIXME: we should not dabble with CLI args - options['--' + option.name.replace('_', '-')] = user_input - if not quiet: - echo_stderr('Running post-scan plugin: %(pname)s...' % locals(), fg='green') - has_requested_post_scan_plugins = True - - # FIXME: this is wrong!!!!!1 - plugin_runner = plugin(kwargs, active_scans) - results = plugin_runner.process_resources(results) - - if has_requested_post_scan_plugins: - # FIXME: computing len needs a list and therefore needs loading it all ahead of time - results = list(results) - files_count = len(results) + plug = plugin(all_options, active_scans) + if plug.is_enabled(): + if not quiet: + echo_stderr('Running post-scan plugin: %(pname)s...' % locals(), fg='green') + # FIXME: we should always catch errors from plugins properly + results = plug.process_resources(results) + + # FIXME: computing len needs a list and therefore needs loading it all ahead of time + # this should NOT be needed with a better cache architecture!!! + results = list(results) + files_count = len(results) if not quiet: echo_stderr('Saving results.', fg='green') @@ -558,8 +562,7 @@ def scan_all(input_path, scanners, # Display scan start details ############################ - # FIXME: it does not make sense to use tuple and positional values - scans = [k for k, v in scanners.items() if v[0]] + scans = [scan.name for scan in scanners if scan.is_enabled] _scans = ', '.join(scans) if not quiet: echo_stderr('Scanning files for: %(_scans)s with %(processes)d process(es)...' % locals()) @@ -567,11 +570,12 @@ def scan_all(input_path, scanners, scan_summary['scans'] = scans[:] scan_start = time() indexing_time = 0 - # FIXME: It does not make sense to use tuple and positional values - with_licenses, _ = scanners.get('licenses', (False, '')) + + # FIXME: THIS SHOULD NOT TAKE PLACE HERE!!!!!! + with_licenses = any(sc for sc in scanners if sc.name == 'licenses' and sc.is_enabled) if with_licenses: # build index outside of the main loop for speed - # this also ensures that forked processes will get the index on POSIX naturally + # REALLY????? this also ensures that forked processes will get the index on POSIX naturally if not quiet: echo_stderr('Building license detection index...', fg='green', nl=False) from licensedcode.cache import get_index @@ -584,10 +588,13 @@ def scan_all(input_path, scanners, pool = None - resources = resource_paths(input_path, diag, scans_cache_class, pre_scan_plugins=pre_scan_plugins) + # FIXME: THIS IS NOT where PRE SCANS should take place!!! + resources = resource_paths( + input_path, diag, scans_cache_class, pre_scan_plugins=pre_scan_plugins) + paths_with_error = [] files_count = 0 - + #FIXME: we should NOT USE a logfile!!! logfile_path = scans_cache_class().cache_files_log if on_linux: file_logger = partial(open, logfile_path, 'wb') @@ -706,6 +713,13 @@ def scan_event(item): # finally return an iterator on cached results cached_scan = scans_cache_class() root_dir = _get_root_dir(input_path, strip_root, full_root) + ############################################# + ############################################# + ############################################# + # FIXME: we must return Resources here!!!! + ############################################# + ############################################# + ############################################# return files_count, cached_scan.iterate(scans, root_dir), success @@ -751,35 +765,34 @@ def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT success = True scans_cache = scans_cache_class() - # note: "flag and function" expressions return the function if flag is True - # note: the order of the scans matters to show things in logical order - scanner_functions = map(lambda t : t[0] and t[1], scanners.values()) - scanners = OrderedDict(zip(scanners.keys(), scanner_functions)) - if processes: interrupter = interruptible else: # fake, non inteerrupting used for debugging when processes=0 interrupter = fake_interruptible - if any(scanner_functions): - # Skip other scans if already cached - # FIXME: ENSURE we only do this for files not directories - if not resource.is_cached: - # run the scan as an interruptiple task - scans_runner = partial(scan_one, resource.abs_path, scanners, diag) - success, scan_result = interrupter(scans_runner, timeout=timeout) - if not success: - # Use scan errors as the scan result for that file on failure this is - # a top-level error not attachedd to a specific scanner, hence the - # "scan" key is used for these errors - scan_result = {'scan_errors': [scan_result]} - - scans_cache.put_scan(resource.rel_path, resource.get_info(), scan_result) - - # do not report success if some other errors happened - if scan_result.get('scan_errors'): - success = False + scanners = [scanner for scanner in scanners + if scanner.is_enabled and scanner.function] + if not scanners: + return success, resource.rel_path + + # Skip other scans if already cached + # FIXME: ENSURE we only do this for files not directories + if not resource.is_cached: + # run the scan as an interruptiple task + scans_runner = partial(scan_one, resource.abs_path, scanners, diag) + success, scan_result = interrupter(scans_runner, timeout=timeout) + if not success: + # Use scan errors as the scan result for that file on failure this is + # a top-level error not attachedd to a specific scanner, hence the + # "scan" key is used for these errors + scan_result = {'scan_errors': [scan_result]} + + scans_cache.put_scan(resource.rel_path, resource.get_info(), scan_result) + + # do not report success if some other errors happened + if scan_result.get('scan_errors'): + success = False return success, resource.rel_path @@ -843,9 +856,9 @@ def build_resources(locations, scans_cache_class, base_is_dir, len_base_path, di for abs_path in locations: resource = Resource(scans_cache_class, abs_path, base_is_dir, len_base_path) # always fetch infos and cache. - resource.put_info(scan_infos(abs_path, diag=diag)) - if resource: - yield resource + infos = scan_infos(abs_path, diag=diag) + resource.put_info(infos) + yield resource def scan_infos(input_file, diag=False): @@ -855,6 +868,8 @@ def scan_infos(input_file, diag=False): possibly empty. If `diag` is True, additional diagnostic messages are included. """ + # FIXME: WE SHOULD PROCESS THIS IS MEMORY AND AS PART OF THE SCAN PROPER... and BOTTOM UP!!!! + # THE PROCESSING TIME OF SIZE AGGREGATION ON DIRECTORY IS WAY WAY TOO HIGH!!! errors = [] try: infos = get_file_infos(input_file) @@ -872,8 +887,7 @@ def scan_infos(input_file, diag=False): def scan_one(location, scanners, diag=False): """ Scan one file or directory at `location` and return a scan result - mapping, calling every scanner callable in the `scanners` mapping of - (scan name -> scan function). + mapping, calling every scanner callable in the `scanners` list of Scanners. The scan result mapping contain a 'scan_errors' key with a list of error messages. If `diag` is True, 'scan_errors' error messages also @@ -887,23 +901,21 @@ def scan_one(location, scanners, diag=False): scan_result = OrderedDict() scan_errors = [] - for scan_name, scanner in scanners.items(): - if not scanner: - continue + for scanner in scanners: try: - scan_details = scanner(location) + scan_details = scanner.function(location) # consume generators if isinstance(scan_details, GeneratorType): scan_details = list(scan_details) - scan_result[scan_name] = scan_details + scan_result[scanner.name] = scan_details except TimeoutError: raise except Exception as e: # never fail but instead add an error message and keep an empty scan: - scan_result[scan_name] = [] - messages = ['ERROR: ' + scan_name + ': ' + e.message] + scan_result[scanner.name] = [] + messages = ['ERROR: ' + scanner.name + ': ' + e.message] if diag: - messages.append('ERROR: ' + scan_name + ': ' + traceback.format_exc()) + messages.append('ERROR: ' + scanner.name + ': ' + traceback.format_exc()) scan_errors.extend(messages) # put errors last, after scans proper @@ -948,7 +960,48 @@ def save_results(scanners, files_count, results, format, options, input, output_ writer = format_plugins[format] # FIXME: carrying an echo function does not make sense # FIXME: do not use input as a variable name + # FIXME: do NOT pass options around, but a header instead + opts = OrderedDict([(o.option, o.value) for o in options]) writer(files_count=files_count, version=version, notice=notice, scanned_files=results, - options=options, + options=opts, input=input, output_file=output_file, _echo=echo_stderr) + + +def get_command_options(ctx, ignores=(), skip_default=False, skip_no_group=False): + """ + Yield CommandOption tuples for each Click option in the `ctx` Click context. + Ignore: + - eager flags, + - Parameter with a "name" listed in the `ignores` sequence + - Parameters whose value is the default if `skip_default` is True + - Parameters without a group if `skip_no_group` is True + """ + param_values = ctx.params + for param in ctx.command.params: + + if param.is_eager: + continue + + group = getattr(param, 'group', None) + if skip_no_group and not group: + continue + + name = param.name + if ignores and name in ignores: + continue + + # opts is a list, the last one is the long form by convention + option = param.opts[-1] + + value = param_values.get(name) + # for opened file args that may have a name + if value and hasattr(value, 'name'): + value = getattr(value, 'name', None) + + default = param.default + + if skip_default and value == default: + continue + + yield CommandOption(group, name, option, value, default) diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 6193635f8fa..4f93a98a213 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -35,17 +35,27 @@ class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ - name = 'ignore' - - def get_ignores(self): - user_ignores = self.selected_options.get('ignore') or [] - return {pattern: 'User ignore: Supplied by --ignore' for pattern in user_ignores} @classmethod def get_plugin_options(cls): return [ - ScanOption(('--ignore',), - multiple=True, - metavar='', + ScanOption(('--ignore',), + multiple=True, + metavar='', help='Ignore files matching .') ] + + # FIXME:!!!! + def get_ignores(self): + user_ignores = [] + for se in self.selected_options: + if se.name == 'ignore': + user_ignores=se.value + + return {pattern: 'User ignore: Supplied by --ignore' for pattern in user_ignores} + + def is_enabled(self): + return any(se.value for se in self.selected_options + if se.name == 'ignore') + + PreScanPlugin.is_enabled(self) \ No newline at end of file diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 54f1ffd4ba2..9fddafe6ae3 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -41,23 +41,31 @@ class MarkSource(PostScanPlugin): Has no effect unless the --info scan is requested. """ + @classmethod + def get_plugin_options(cls): + return [ + ScanOption(('--mark-source',), is_flag=True, + help=''' + Set the "is_source" flag to true for directories that contain + over 90% of source files as direct children. + Has no effect unless the --info scan is requested. + ''') + ] + + def is_enabled(self): + # FIXME: we need infos for this to work, we should use a better way to + # express dependencies on one or more scan + return all(se.value for se in self.selected_options + if se.name in ('mark_source', 'infos')) + def process_resources(self, results): + # FIXME: we need to process Resources NOT results mappings!!! # FIXME: this is forcing all the scan results to be loaded in memory # and defeats lazy loading from cache results = list(results) - # FIXME: we should test for active scans instead, but "info" may not - # be present for now. check if the first item has a file info. - has_file_info = 'type' in results[0] - - if not has_file_info: - # just yield results untouched - for scanned_file in results: - yield scanned_file - return - # FIXME: this is an nested loop, looping twice on results - # TODO: this may not recusrively roll up the is_source flag, as we + # TODO: this may not recursively roll up the is_source flag, as we # may not iterate bottom up. for scanned_file in results: if scanned_file['type'] == 'directory' and scanned_file['files_count'] > 0: @@ -69,10 +77,6 @@ def process_resources(self, results): mark_source(source_files_count, scanned_file) yield scanned_file - @classmethod - def get_plugin_options(cls): - return [ScanOption(('--mark-source',), is_flag=True)] - def mark_source(source_files_count, scanned_file): """ diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index e1662472594..870696bc335 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -38,21 +38,32 @@ class OnlyFindings(PostScanPlugin): considering basic file information as findings). """ + @classmethod + def get_plugin_options(cls): + return [ + ScanOption(('--only-findings',), is_flag=True, + help=''' + Only return files or directories with findings for the requested + scans. Files and directories without findings are omitted (not + considering basic file information as findings). + ''') + ] + + def is_enabled(self): + return any(se.value == True for se in self.selected_options + if se.name == 'only_findings') + def process_resources(self, results): # FIXME: this is forcing all the scan results to be loaded in memory # and defeats lazy loading from cache. Only a different caching # (e.g. DB) could work here. # FIXME: We should instead use a generator or use a filter function # that pass to the scan results loader iterator - active_scan_names= self.active_scan_names + active_scan_names = self.active_scan_names for scanned_file in results: if has_findings(active_scan_names, scanned_file): yield scanned_file - @classmethod - def get_plugin_options(cls): - return [ScanOption(('--only-findings',), is_flag=True)] - def has_findings(active_scans, scanned_file): """ diff --git a/tests/formattedcode/data/csv/srp.csv b/tests/formattedcode/data/csv/srp.csv index 6f6556de5da..25a06299727 100644 --- a/tests/formattedcode/data/csv/srp.csv +++ b/tests/formattedcode/data/csv/srp.csv @@ -1,8 +1,8 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder +/srp/srp_vfy.c,,,,, +/srp/srp_vfy.c,,Copyright 2011-2016 The OpenSSL Project,2,2, +/srp/srp_vfy.c,,,2,2,The OpenSSL Project /srp/build.info,,,,, /srp/srp_lib.c,,,,, /srp/srp_lib.c,,Copyright 2011-2016 The OpenSSL Project,2,2, /srp/srp_lib.c,,,2,2,The OpenSSL Project -/srp/srp_vfy.c,,,,, -/srp/srp_vfy.c,,Copyright 2011-2016 The OpenSSL Project,2,2, -/srp/srp_vfy.c,,,2,2,The OpenSSL Project diff --git a/tests/formattedcode/data/csv/tree/expected.csv b/tests/formattedcode/data/csv/tree/expected.csv index 304dee89a97..f785fa5f70e 100644 --- a/tests/formattedcode/data/csv/tree/expected.csv +++ b/tests/formattedcode/data/csv/tree/expected.csv @@ -12,12 +12,12 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder /scan/subdir/copy1.c,,,,, /scan/subdir/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy1.c,,,1,1,"ACME, Inc." +/scan/subdir/copy4.c,,,,, +/scan/subdir/copy4.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/subdir/copy4.c,,,1,1,"ACME, Inc." /scan/subdir/copy2.c,,,,, /scan/subdir/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy2.c,,,1,1,"ACME, Inc." /scan/subdir/copy3.c,,,,, /scan/subdir/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy3.c,,,1,1,"ACME, Inc." -/scan/subdir/copy4.c,,,,, -/scan/subdir/copy4.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy4.c,,,1,1,"ACME, Inc." diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index 22ed5e36e73..90169700f96 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -1,12 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--info": true, - "--license-score": 0, - "--format": "json" + "--copyrights": true, + "--licenses": true, + "--packages": true, + "--infos": true }, "files_count": 1, "files": [ diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 519ffd60496..8665f431ebc 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -1,40 +1,37 @@ [ - { - "header": { - "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "scancode_version": "2.1.0.post69.536f354.dirty.20171004191716", - "scancode_options": { - "--info": true, - "--license-score": 0, - "--format": "jsonlines" - }, - "files_count": 1 - } - }, - { - "files": [ - { - "path": "simple/copyright_acme_c-c.c", - "type": "file", - "name": "copyright_acme_c-c.c", - "base_name": "copyright_acme_c-c", - "extension": ".c", - "date": "2017-10-03", - "size": 55, - "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", - "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": null, - "mime_type": "text/plain", - "file_type": "UTF-8 Unicode text, with no line terminators", - "programming_language": "C", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - } - ] + { + "header": { + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "--infos": true, + "--format": "jsonlines" + }, + "files_count": 1 } + }, + { + "files": [ + { + "path": "simple/copyright_acme_c-c.c", + "type": "file", + "name": "copyright_acme_c-c.c", + "base_name": "copyright_acme_c-c", + "extension": ".c", + "size": 55, + "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", + "md5": "bdf7c572beb4094c2059508fa73c05a4", + "files_count": null, + "mime_type": "text/plain", + "file_type": "UTF-8 Unicode text, with no line terminators", + "programming_language": "C", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + } + ] + } ] \ No newline at end of file diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 940c30598b3..cb66fa72c88 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -1,11 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--info": true, - "--license-score": 0, + "--copyrights": true, + "--licenses": true, + "--packages": true, + "--infos": true, "--format": "json-pp" }, "files_count": 1, diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 966717566af..2fcc3244780 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -1,13 +1,11 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--licenses": true, + "--packages": true, + "--infos": true, + "--strip-root": true }, "files_count": 8, "files": [ diff --git a/tests/formattedcode/data/spdx/license_known/expected.rdf b/tests/formattedcode/data/spdx/license_known/expected.rdf index 49602d49c82..03d7afda23c 100644 --- a/tests/formattedcode/data/spdx/license_known/expected.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected.rdf @@ -5,76 +5,76 @@ "ns1:SpdxDocument": { "ns1:describesPackage": { "ns1:Package": { - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:hasFile": [ null, null ], - "ns1:licenseConcluded": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:name": "scan", "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:name": "scan" + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, + "ns1:specVersion": "SPDX-2.1", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { - "ns1:fileName": "./scan/apache-2.0.LICENSE", + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE" } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + } } } ], diff --git a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf index 22cdd8c71e5..ce83519f92e 100644 --- a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf @@ -3,15 +3,21 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "scan", - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:downloadLocation": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": [ + null, + null + ], "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -26,25 +32,19 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": [ - null, - null - ] + "ns1:name": "scan" } }, - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", "ns1:algorithm": "SHA1" } }, @@ -54,27 +54,27 @@ "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./scan/apache-2.0.LICENSE" + "ns1:fileName": "./scan/cc0-1.0.LICENSE" } }, { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + } } } ], diff --git a/tests/formattedcode/data/spdx/license_ref/expected.rdf b/tests/formattedcode/data/spdx/license_ref/expected.rdf index f12c0f93321..3be5b00f4b4 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected.rdf @@ -11,43 +11,23 @@ "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } }, - "ns1:describesPackage": { - "ns1:Package": { - "ns1:hasFile": null, - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:name": "scan", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseInfoFromFiles": [ + "ns1:referencesFile": { + "ns1:File": { + "ns1:licenseInfoInFile": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, + { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } - }, - { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." - } - }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, - "ns1:referencesFile": { - "ns1:File": { "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", @@ -57,7 +37,25 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": [ + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE" + } + }, + "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:describesPackage": { + "ns1:Package": { + "ns1:name": "scan", + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": null, + "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, @@ -72,8 +70,10 @@ } } ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE" + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf index 3745b692426..4590e71c31a 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf @@ -14,18 +14,19 @@ "ns1:describesPackage": { "ns1:Package": { "ns1:hasFile": null, - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:downloadLocation": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:name": "scan", "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { "ns1:ExtractedLicensingInfo": { @@ -35,11 +36,10 @@ } } ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan" + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." } }, "ns1:specVersion": "SPDX-2.1", @@ -48,23 +48,12 @@ }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./scan/NOTICE", - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" - } - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:licenseInfoInFile": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { "ns1:ExtractedLicensingInfo": { @@ -73,7 +62,18 @@ "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } } - ] + ], + "ns1:checksum": { + "ns1:Checksum": { + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", + "ns1:algorithm": "SHA1" + } + }, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/or_later/expected.rdf b/tests/formattedcode/data/spdx/or_later/expected.rdf index 9b319226c3a..c723b8e20bb 100644 --- a/tests/formattedcode/data/spdx/or_later/expected.rdf +++ b/tests/formattedcode/data/spdx/or_later/expected.rdf @@ -3,9 +3,6 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:describesPackage": { "ns1:Package": { "ns1:downloadLocation": { @@ -14,21 +11,23 @@ "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "or_later", - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" - }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:hasFile": null, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" + }, + "ns1:name": "or_later" } }, "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./test.java", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca", @@ -38,10 +37,11 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" - } + }, + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:fileName": "./test.java" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/simple/expected.rdf b/tests/formattedcode/data/spdx/simple/expected.rdf index 35bf0c8305c..d3b0af43363 100644 --- a/tests/formattedcode/data/spdx/simple/expected.rdf +++ b/tests/formattedcode/data/spdx/simple/expected.rdf @@ -3,34 +3,33 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "simple", - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseConcluded": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": { + "ns1:name": "simple", + "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:licenseInfoFromFiles": { + "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:hasFile": null } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./simple/test.txt", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8", @@ -45,7 +44,8 @@ }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:fileName": "./simple/test.txt" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index 65e40a151aa..ad2c421eb1e 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -3,30 +3,62 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:describesPackage": { + "ns1:Package": { + "ns1:name": "scan", + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": [ + null, + null, + null, + null, + null, + null, + null + ] + } + }, + "ns1:specVersion": "SPDX-2.1", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:referencesFile": [ { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy1.c" + "ns1:fileName": "./scan/subdir/copy3.c" } }, { "ns1:File": { + "ns1:fileName": "./scan/copy1.c", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, @@ -36,15 +68,12 @@ "ns1:algorithm": "SHA1" } }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy2.c" + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." } }, { "ns1:File": { + "ns1:fileName": "./scan/copy2.c", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", @@ -54,65 +83,64 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/subdir/copy1.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." } }, { "ns1:File": { - "ns1:fileName": "./scan/copy3.c", + "ns1:fileName": "./scan/subdir/copy1.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." } }, { "ns1:File": { + "ns1:fileName": "./scan/subdir/copy2.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/subdir/copy4.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", + "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", "ns1:algorithm": "SHA1" } }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/subdir/copy4.c", + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy3.c" + } } }, { @@ -122,7 +150,7 @@ }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", "ns1:algorithm": "SHA1" } }, @@ -130,38 +158,10 @@ "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy2.c" + "ns1:fileName": "./scan/copy3.c" } } ], - "ns1:specVersion": "SPDX-2.1", - "ns1:describesPackage": { - "ns1:Package": { - "ns1:hasFile": [ - null, - null, - null, - null, - null, - null, - null - ], - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:name": "scan", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - } - } - }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } diff --git a/tests/formattedcode/data/spdx/unicode/expected.rdf b/tests/formattedcode/data/spdx/unicode/expected.rdf index 6a5babd4fbf..fb927092f95 100644 --- a/tests/formattedcode/data/spdx/unicode/expected.rdf +++ b/tests/formattedcode/data/spdx/unicode/expected.rdf @@ -11,53 +11,53 @@ "ns1:licenseId": "LicenseRef-agere-bsd" } }, - "ns1:referencesFile": { - "ns1:File": { - "ns1:licenseInfoInFile": { + "ns1:describesPackage": { + "ns1:Package": { + "ns1:name": "unicode", + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": null, + "ns1:licenseInfoFromFiles": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", "ns1:licenseId": "LicenseRef-agere-bsd" } }, - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", - "ns1:algorithm": "SHA1" - } - }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", - "ns1:fileName": "./et131x.h" + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc." } }, "ns1:specVersion": "SPDX-2.1", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:describesPackage": { - "ns1:Package": { - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:referencesFile": { + "ns1:File": { + "ns1:fileName": "./et131x.h", + "ns1:checksum": { + "ns1:Checksum": { + "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", + "ns1:algorithm": "SHA1" + } }, - "ns1:licenseDeclared": { + "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, - "ns1:licenseInfoFromFiles": { + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", + "ns1:licenseInfoInFile": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", "ns1:licenseId": "LicenseRef-agere-bsd" } - }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:name": "unicode" + } } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/test_format_jsonlines.py b/tests/formattedcode/test_format_jsonlines.py index 18483dc67a6..abb191634b9 100644 --- a/tests/formattedcode/test_format_jsonlines.py +++ b/tests/formattedcode/test_format_jsonlines.py @@ -48,10 +48,9 @@ def remove_variable_data(scan_result): for line in scan_result: header = line.get('header') if header: - del header['scancode_version'] + header.pop('scancode_version', None) for scanned_file in line.get('files', []): - if 'date' in scanned_file: - del scanned_file['date'] + scanned_file.pop('date', None) def check_jsonlines_scan(expected_file, result_file, regen=False): @@ -66,8 +65,7 @@ def check_jsonlines_scan(expected_file, result_file, regen=False): if regen: with open(expected_file, 'wb') as reg: - json.dump(result, reg) - + json.dump(result, reg, indent=2, separators=(',', ': ')) expected = _load_json_result(expected_file) remove_variable_data(expected) diff --git a/tests/licensedcode/data/index/test__add_rules.json b/tests/licensedcode/data/index/test__add_rules.json index 70699ae6c09..014dd598949 100644 --- a/tests/licensedcode/data/index/test__add_rules.json +++ b/tests/licensedcode/data/index/test__add_rules.json @@ -1,403 +1,403 @@ { "bsd-no-mod_1": { "warranty": [ - 47, + 47, 120 - ], + ], "interruption": [ 194 - ], + ], "requirement": [ 81 - ], + ], "exemplary": [ 171 - ], + ], "negligence": [ 211 - ], + ], "caused": [ 196 - ], + ], "fitness": [ 151 - ], + ], "herein": [ 21 - ], + ], "conditioned": [ 74 - ], + ], "minimum": [ 61 - ], + ], "including": [ - 76, - 139, - 175, + 76, + 139, + 175, 210 - ], + ], "names": [ - 89, + 89, 98 - ], + ], "substantially": [ 78 - ], + ], "further": [ 83 - ], + ], "event": [ 160 - ], + ], "substitute": [ 182 - ], + ], "use": [ - 2, - 188, + 2, + 188, 221 - ], + ], "strict": [ 206 - ], + ], "unmodified": [ - 23, + 23, 27 - ], + ], "shall": [ 161 - ], + ], "merchantibility": [ 149 - ], + ], "forms": [ 7 - ], + ], "tort": [ 209 - ], + ], "contained": [ 20 - ], + ], "materials": [ 19 - ], + ], "damages": [ - 174, + 174, 233 - ], + ], "above": [ - 36, + 36, 92 - ], + ], "endorse": [ 106 - ], + ], "consequential": [ 173 - ], + ], "neither": [ 87 - ], + ], "warranties": [ - 138, + 138, 146 - ], + ], "particular": [ 154 - ], + ], "notice": [ 38 - ], + ], "used": [ - 26, + 26, 104 - ], + ], "form": [ 57 - ], + ], "permission": [ 118 - ], + ], "express": [ 135 - ], + ], "however": [ 195 - ], + ], "possibility": [ 230 - ], + ], "otherwise": [ 213 - ], + ], "liability": [ - 202, + 202, 207 - ], + ], "met": [ 16 - ], + ], "goods": [ 183 - ], + ], "purpose": [ 155 - ], + ], "noninfringement": [ 148 - ], + ], "advised": [ 227 - ], + ], "promote": [ 108 - ], + ], "nor": [ 96 - ], + ], "must": [ - 33, - 58, + 33, + 58, 72 - ], + ], "loss": [ 186 - ], + ], "redistributions": [ - 29, + 29, 54 - ], + ], "disclaimed": [ 157 - ], + ], "contract": [ 205 - ], + ], "reproduce": [ 59 - ], + ], "procurement": [ 180 - ], + ], "implied": [ - 137, + 137, 145 - ], + ], "liable": [ 168 - ], + ], "retain": [ 34 - ], + ], "redistribution": [ - 0, - 71, + 0, + 71, 85 - ], + ], "arising": [ 214 - ], + ], "modification": [ 52 - ], + ], "profits": [ 191 - ], + ], "disclaimer": [ - 48, - 50, - 63, - 67, + 48, + 50, + 63, + 67, 80 ] - }, + }, "bsd-new_0": { "interruption": [ 173 - ], + ], "exemplary": [ 150 - ], + ], "negligence": [ 190 - ], + ], "caused": [ 175 - ], + ], "fitness": [ 126 - ], + ], "direct": [ 146 - ], + ], "including": [ - 115, - 154, + 115, + 154, 189 - ], + ], "names": [ 76 - ], + ], "owner": [ 139 - ], + ], "indirect": [ 147 - ], + ], "event": [ 135 - ], + ], "substitute": [ 161 - ], + ], "use": [ - 2, - 167, + 2, + 167, 200 - ], + ], "strict": [ 185 - ], + ], "shall": [ 136 - ], + ], "damage": [ 212 - ], + ], "forms": [ 7 - ], + ], "tort": [ 188 - ], + ], "materials": [ 63 - ], + ], "damages": [ 153 - ], + ], "above": [ - 28, + 28, 46 - ], + ], "endorse": [ 84 - ], + ], "consequential": [ 152 - ], + ], "neither": [ 68 - ], + ], "warranties": [ - 114, + 114, 122 - ], + ], "particular": [ 129 - ], + ], "notice": [ - 30, + 30, 48 - ], + ], "used": [ 82 - ], + ], "form": [ 42 - ], + ], "permission": [ 96 - ], + ], "express": [ 111 - ], + ], "however": [ 174 - ], + ], "possibility": [ 209 - ], + ], "otherwise": [ 192 - ], + ], "liability": [ - 181, + 181, 186 - ], + ], "met": [ 20 - ], + ], "goods": [ 162 - ], + ], "purpose": [ 130 - ], + ], "advised": [ 206 - ], + ], "promote": [ 86 - ], + ], "nor": [ 74 - ], + ], "must": [ - 25, + 25, 43 - ], + ], "loss": [ 165 - ], + ], "redistributions": [ - 21, + 21, 39 - ], + ], "disclaimed": [ 132 - ], + ], "incidental": [ 148 - ], + ], "contract": [ 184 - ], + ], "reproduce": [ 44 - ], + ], "procurement": [ 159 - ], + ], "implied": [ - 113, + 113, 121 - ], + ], "liable": [ 143 - ], + ], "retain": [ 26 - ], + ], "merchantability": [ 124 - ], + ], "redistribution": [ 0 - ], + ], "arising": [ 193 - ], + ], "modification": [ 11 - ], + ], "profits": [ 170 - ], + ], "disclaimer": [ - 38, + 38, 56 ] } diff --git a/tests/licensedcode/data/index/test__add_rules_with_templates.json b/tests/licensedcode/data/index/test__add_rules_with_templates.json index 80df55df84a..6a1b178da6b 100644 --- a/tests/licensedcode/data/index/test__add_rules_with_templates.json +++ b/tests/licensedcode/data/index/test__add_rules_with_templates.json @@ -1,402 +1,402 @@ { "bsd-no-mod_1": { "warranty": [ - 45, + 45, 118 - ], + ], "interruption": [ 192 - ], + ], "requirement": [ 79 - ], + ], "exemplary": [ 169 - ], + ], "negligence": [ 209 - ], + ], "caused": [ 194 - ], + ], "fitness": [ 149 - ], + ], "herein": [ 19 - ], + ], "conditioned": [ 72 - ], + ], "minimum": [ 59 - ], + ], "including": [ - 74, - 137, - 173, + 74, + 137, + 173, 208 - ], + ], "names": [ - 87, + 87, 96 - ], + ], "substantially": [ 76 - ], + ], "further": [ 81 - ], + ], "event": [ 158 - ], + ], "substitute": [ 180 - ], + ], "use": [ - 186, + 186, 219 - ], + ], "strict": [ 204 - ], + ], "unmodified": [ - 21, + 21, 25 - ], + ], "shall": [ 159 - ], + ], "merchantibility": [ 147 - ], + ], "forms": [ 5 - ], + ], "tort": [ 207 - ], + ], "contained": [ 18 - ], + ], "materials": [ 17 - ], + ], "damages": [ - 172, + 172, 231 - ], + ], "above": [ - 34, + 34, 90 - ], + ], "endorse": [ 104 - ], + ], "consequential": [ 171 - ], + ], "neither": [ 85 - ], + ], "warranties": [ - 136, + 136, 144 - ], + ], "particular": [ 152 - ], + ], "notice": [ 36 - ], + ], "used": [ - 24, + 24, 102 - ], + ], "form": [ 55 - ], + ], "permission": [ 116 - ], + ], "express": [ 133 - ], + ], "however": [ 193 - ], + ], "possibility": [ 228 - ], + ], "otherwise": [ 211 - ], + ], "liability": [ - 200, + 200, 205 - ], + ], "met": [ 14 - ], + ], "goods": [ 181 - ], + ], "purpose": [ 153 - ], + ], "noninfringement": [ 146 - ], + ], "advised": [ 225 - ], + ], "promote": [ 106 - ], + ], "nor": [ 94 - ], + ], "must": [ - 31, - 56, + 31, + 56, 70 - ], + ], "loss": [ 184 - ], + ], "redistributions": [ - 27, + 27, 52 - ], + ], "disclaimed": [ 155 - ], + ], "contract": [ 203 - ], + ], "reproduce": [ 57 - ], + ], "procurement": [ 178 - ], + ], "implied": [ - 135, + 135, 143 - ], + ], "liable": [ 166 - ], + ], "retain": [ 32 - ], + ], "redistribution": [ - 0, - 69, + 0, + 69, 83 - ], + ], "arising": [ 212 - ], + ], "modification": [ 50 - ], + ], "profits": [ 189 - ], + ], "disclaimer": [ - 46, - 48, - 61, - 65, + 46, + 48, + 61, + 65, 78 ] - }, + }, "bsd-new_0": { "interruption": [ 171 - ], + ], "exemplary": [ 148 - ], + ], "negligence": [ 188 - ], + ], "caused": [ 173 - ], + ], "fitness": [ 124 - ], + ], "direct": [ 144 - ], + ], "including": [ - 113, - 152, + 113, + 152, 187 - ], + ], "names": [ 74 - ], + ], "owner": [ 137 - ], + ], "indirect": [ 145 - ], + ], "event": [ 133 - ], + ], "substitute": [ 159 - ], + ], "use": [ - 2, - 165, + 2, + 165, 198 - ], + ], "strict": [ 183 - ], + ], "shall": [ 134 - ], + ], "damage": [ 210 - ], + ], "forms": [ 7 - ], + ], "tort": [ 186 - ], + ], "materials": [ 63 - ], + ], "damages": [ 151 - ], + ], "above": [ - 28, + 28, 46 - ], + ], "endorse": [ 82 - ], + ], "consequential": [ 150 - ], + ], "neither": [ 68 - ], + ], "warranties": [ - 112, + 112, 120 - ], + ], "particular": [ 127 - ], + ], "notice": [ - 30, + 30, 48 - ], + ], "used": [ 80 - ], + ], "form": [ 42 - ], + ], "permission": [ 94 - ], + ], "express": [ 109 - ], + ], "however": [ 172 - ], + ], "possibility": [ 207 - ], + ], "otherwise": [ 190 - ], + ], "liability": [ - 179, + 179, 184 - ], + ], "met": [ 20 - ], + ], "goods": [ 160 - ], + ], "purpose": [ 128 - ], + ], "advised": [ 204 - ], + ], "promote": [ 84 - ], + ], "nor": [ 72 - ], + ], "must": [ - 25, + 25, 43 - ], + ], "loss": [ 163 - ], + ], "redistributions": [ - 21, + 21, 39 - ], + ], "disclaimed": [ 130 - ], + ], "incidental": [ 146 - ], + ], "contract": [ 182 - ], + ], "reproduce": [ 44 - ], + ], "procurement": [ 157 - ], + ], "implied": [ - 111, + 111, 119 - ], + ], "liable": [ 141 - ], + ], "retain": [ 26 - ], + ], "merchantability": [ 122 - ], + ], "redistribution": [ 0 - ], + ], "arising": [ 191 - ], + ], "modification": [ 11 - ], + ], "profits": [ 168 - ], + ], "disclaimer": [ - 38, + 38, 56 ] } diff --git a/tests/licensedcode/data/index/test_init_with_rules.json b/tests/licensedcode/data/index/test_init_with_rules.json index 70699ae6c09..014dd598949 100644 --- a/tests/licensedcode/data/index/test_init_with_rules.json +++ b/tests/licensedcode/data/index/test_init_with_rules.json @@ -1,403 +1,403 @@ { "bsd-no-mod_1": { "warranty": [ - 47, + 47, 120 - ], + ], "interruption": [ 194 - ], + ], "requirement": [ 81 - ], + ], "exemplary": [ 171 - ], + ], "negligence": [ 211 - ], + ], "caused": [ 196 - ], + ], "fitness": [ 151 - ], + ], "herein": [ 21 - ], + ], "conditioned": [ 74 - ], + ], "minimum": [ 61 - ], + ], "including": [ - 76, - 139, - 175, + 76, + 139, + 175, 210 - ], + ], "names": [ - 89, + 89, 98 - ], + ], "substantially": [ 78 - ], + ], "further": [ 83 - ], + ], "event": [ 160 - ], + ], "substitute": [ 182 - ], + ], "use": [ - 2, - 188, + 2, + 188, 221 - ], + ], "strict": [ 206 - ], + ], "unmodified": [ - 23, + 23, 27 - ], + ], "shall": [ 161 - ], + ], "merchantibility": [ 149 - ], + ], "forms": [ 7 - ], + ], "tort": [ 209 - ], + ], "contained": [ 20 - ], + ], "materials": [ 19 - ], + ], "damages": [ - 174, + 174, 233 - ], + ], "above": [ - 36, + 36, 92 - ], + ], "endorse": [ 106 - ], + ], "consequential": [ 173 - ], + ], "neither": [ 87 - ], + ], "warranties": [ - 138, + 138, 146 - ], + ], "particular": [ 154 - ], + ], "notice": [ 38 - ], + ], "used": [ - 26, + 26, 104 - ], + ], "form": [ 57 - ], + ], "permission": [ 118 - ], + ], "express": [ 135 - ], + ], "however": [ 195 - ], + ], "possibility": [ 230 - ], + ], "otherwise": [ 213 - ], + ], "liability": [ - 202, + 202, 207 - ], + ], "met": [ 16 - ], + ], "goods": [ 183 - ], + ], "purpose": [ 155 - ], + ], "noninfringement": [ 148 - ], + ], "advised": [ 227 - ], + ], "promote": [ 108 - ], + ], "nor": [ 96 - ], + ], "must": [ - 33, - 58, + 33, + 58, 72 - ], + ], "loss": [ 186 - ], + ], "redistributions": [ - 29, + 29, 54 - ], + ], "disclaimed": [ 157 - ], + ], "contract": [ 205 - ], + ], "reproduce": [ 59 - ], + ], "procurement": [ 180 - ], + ], "implied": [ - 137, + 137, 145 - ], + ], "liable": [ 168 - ], + ], "retain": [ 34 - ], + ], "redistribution": [ - 0, - 71, + 0, + 71, 85 - ], + ], "arising": [ 214 - ], + ], "modification": [ 52 - ], + ], "profits": [ 191 - ], + ], "disclaimer": [ - 48, - 50, - 63, - 67, + 48, + 50, + 63, + 67, 80 ] - }, + }, "bsd-new_0": { "interruption": [ 173 - ], + ], "exemplary": [ 150 - ], + ], "negligence": [ 190 - ], + ], "caused": [ 175 - ], + ], "fitness": [ 126 - ], + ], "direct": [ 146 - ], + ], "including": [ - 115, - 154, + 115, + 154, 189 - ], + ], "names": [ 76 - ], + ], "owner": [ 139 - ], + ], "indirect": [ 147 - ], + ], "event": [ 135 - ], + ], "substitute": [ 161 - ], + ], "use": [ - 2, - 167, + 2, + 167, 200 - ], + ], "strict": [ 185 - ], + ], "shall": [ 136 - ], + ], "damage": [ 212 - ], + ], "forms": [ 7 - ], + ], "tort": [ 188 - ], + ], "materials": [ 63 - ], + ], "damages": [ 153 - ], + ], "above": [ - 28, + 28, 46 - ], + ], "endorse": [ 84 - ], + ], "consequential": [ 152 - ], + ], "neither": [ 68 - ], + ], "warranties": [ - 114, + 114, 122 - ], + ], "particular": [ 129 - ], + ], "notice": [ - 30, + 30, 48 - ], + ], "used": [ 82 - ], + ], "form": [ 42 - ], + ], "permission": [ 96 - ], + ], "express": [ 111 - ], + ], "however": [ 174 - ], + ], "possibility": [ 209 - ], + ], "otherwise": [ 192 - ], + ], "liability": [ - 181, + 181, 186 - ], + ], "met": [ 20 - ], + ], "goods": [ 162 - ], + ], "purpose": [ 130 - ], + ], "advised": [ 206 - ], + ], "promote": [ 86 - ], + ], "nor": [ 74 - ], + ], "must": [ - 25, + 25, 43 - ], + ], "loss": [ 165 - ], + ], "redistributions": [ - 21, + 21, 39 - ], + ], "disclaimed": [ 132 - ], + ], "incidental": [ 148 - ], + ], "contract": [ 184 - ], + ], "reproduce": [ 44 - ], + ], "procurement": [ 159 - ], + ], "implied": [ - 113, + 113, 121 - ], + ], "liable": [ 143 - ], + ], "retain": [ 26 - ], + ], "merchantability": [ 124 - ], + ], "redistribution": [ 0 - ], + ], "arising": [ 193 - ], + ], "modification": [ 11 - ], + ], "profits": [ 170 - ], + ], "disclaimer": [ - 38, + 38, 56 ] } diff --git a/tests/licensedcode/data/models/licenses.expected.json b/tests/licensedcode/data/models/licenses.expected.json index dff77edc128..ff308c45cd4 100644 --- a/tests/licensedcode/data/models/licenses.expected.json +++ b/tests/licensedcode/data/models/licenses.expected.json @@ -1,141 +1,141 @@ [ { - "key": "w3c-docs-19990405", - "short_name": "W3C-DOCS-19990405", - "name": "W3C Document Notice and License (1999-04-05)", - "category": "Permissive Restricted", - "owner": "W3C - World Wide Web Consortium", + "key": "w3c-docs-19990405", + "short_name": "W3C-DOCS-19990405", + "name": "W3C Document Notice and License (1999-04-05)", + "category": "Permissive Restricted", + "owner": "W3C - World Wide Web Consortium", "homepage_url": "http://www.w3.org/Consortium/Legal/copyright-documents-19990405" - }, + }, { - "key": "gpl-2.0-library", - "short_name": "GPL 2.0 with Library exception", - "name": "GNU General Public License 2.0 with Library exception", - "category": "Copyleft Limited", - "owner": "Grammatica", - "is_exception": true, + "key": "gpl-2.0-library", + "short_name": "GPL 2.0 with Library exception", + "name": "GNU General Public License 2.0 with Library exception", + "category": "Copyleft Limited", + "owner": "Grammatica", + "is_exception": true, "other_urls": [ "http://grammatica.percederberg.net/index.html" ] - }, + }, { - "key": "bsd-ack-carrot2", - "short_name": "BSD Acknowledgment (Carrot2) License", - "name": "BSD Acknowledgment (Carrot2) License", - "category": "Permissive", - "owner": "Carrot2", - "homepage_url": "http://www.carrot2.org/carrot2.LICENSE", + "key": "bsd-ack-carrot2", + "short_name": "BSD Acknowledgment (Carrot2) License", + "name": "BSD Acknowledgment (Carrot2) License", + "category": "Permissive", + "owner": "Carrot2", + "homepage_url": "http://www.carrot2.org/carrot2.LICENSE", "minimum_coverage": 80 - }, + }, { - "key": "gpl-3.0-plus", - "short_name": "GPL 3.0 or later", - "name": "GNU General Public License 3.0 or later", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/gpl-3.0-standalone.html", - "notes": "notes from SPDX:\nThis license was released: 29 June 2007 This license is OSI certified.", - "is_or_later": true, - "base_license": "gpl-3.0", + "key": "gpl-3.0-plus", + "short_name": "GPL 3.0 or later", + "name": "GNU General Public License 3.0 or later", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/gpl-3.0-standalone.html", + "notes": "notes from SPDX:\nThis license was released: 29 June 2007 This license is OSI certified.", + "is_or_later": true, + "base_license": "gpl-3.0", "spdx_license_key": "GPL-3.0+" - }, + }, { - "key": "apache-2.0", - "short_name": "Apache 2.0", - "name": "Apache License 2.0", - "category": "Permissive", - "owner": "Apache Software Foundation", - "homepage_url": "http://www.apache.org/licenses/", - "spdx_license_key": "Apache-2.0", + "key": "apache-2.0", + "short_name": "Apache 2.0", + "name": "Apache License 2.0", + "category": "Permissive", + "owner": "Apache Software Foundation", + "homepage_url": "http://www.apache.org/licenses/", + "spdx_license_key": "Apache-2.0", "text_urls": [ "http://www.apache.org/licenses/LICENSE-2.0" - ], - "osi_url": "http://opensource.org/licenses/apache2.0.php", + ], + "osi_url": "http://opensource.org/licenses/apache2.0.php", "faq_url": "http://www.apache.org/foundation/licence-FAQ.html" - }, + }, { - "key": "gpl-1.0-plus", - "short_name": "GPL 1.0 or later", - "name": "GNU General Public License 1.0 or later", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html", - "notes": "notes from SPDX:\nThis license was released: February 1989.", - "next_version": "gpl-2.0-plus", - "is_or_later": true, - "base_license": "gpl-1.0", + "key": "gpl-1.0-plus", + "short_name": "GPL 1.0 or later", + "name": "GNU General Public License 1.0 or later", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html", + "notes": "notes from SPDX:\nThis license was released: February 1989.", + "next_version": "gpl-2.0-plus", + "is_or_later": true, + "base_license": "gpl-1.0", "spdx_license_key": "GPL-1.0+" - }, + }, { - "key": "gpl-2.0-plus", - "short_name": "GPL 2.0 or later", - "name": "GNU General Public License 2.0 or later", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", - "notes": "notes from SPDX:\nThis license was released: June 1991 This license is OSI certified.", - "next_version": "gpl-3.0-plus", - "is_or_later": true, - "base_license": "gpl-2.0", + "key": "gpl-2.0-plus", + "short_name": "GPL 2.0 or later", + "name": "GNU General Public License 2.0 or later", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", + "notes": "notes from SPDX:\nThis license was released: June 1991 This license is OSI certified.", + "next_version": "gpl-3.0-plus", + "is_or_later": true, + "base_license": "gpl-2.0", "spdx_license_key": "GPL-2.0+" - }, + }, { - "key": "gpl-1.0", - "short_name": "GPL 1.0", - "name": "GNU General Public License 1.0", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/gpl-1.0.html", - "notes": "notes from SPDX:\nThis license was released: February 1989.", - "next_version": "gpl-2.0", - "spdx_license_key": "GPL-1.0", + "key": "gpl-1.0", + "short_name": "GPL 1.0", + "name": "GNU General Public License 1.0", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/gpl-1.0.html", + "notes": "notes from SPDX:\nThis license was released: February 1989.", + "next_version": "gpl-2.0", + "spdx_license_key": "GPL-1.0", "text_urls": [ "http://www.gnu.org/licenses/gpl-1.0.txt" - ], - "faq_url": "http://www.gnu.org/licenses/gpl-faq.html", + ], + "faq_url": "http://www.gnu.org/licenses/gpl-faq.html", "other_urls": [ "http://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html" ] - }, + }, { - "key": "gpl-3.0", - "short_name": "GPL 3.0", - "name": "GNU General Public License 3.0", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/gpl-3.0.html", - "notes": "notes from SPDX:\nThis license was released: 29 June 2007 This license is OSI certified.", - "spdx_license_key": "GPL-3.0", + "key": "gpl-3.0", + "short_name": "GPL 3.0", + "name": "GNU General Public License 3.0", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/gpl-3.0.html", + "notes": "notes from SPDX:\nThis license was released: 29 June 2007 This license is OSI certified.", + "spdx_license_key": "GPL-3.0", "text_urls": [ - "http://www.gnu.org/licenses/gpl-3.0.txt", + "http://www.gnu.org/licenses/gpl-3.0.txt", "http://www.gnu.org/licenses/gpl-3.0-standalone.html" - ], - "osi_url": "http://opensource.org/licenses/gpl-3.0.html", - "faq_url": "http://www.gnu.org/licenses/gpl-faq.html", + ], + "osi_url": "http://opensource.org/licenses/gpl-3.0.html", + "faq_url": "http://www.gnu.org/licenses/gpl-faq.html", "other_urls": [ "http://www.gnu.org/licenses/quick-guide-gplv3.html" ] - }, + }, { - "key": "gpl-2.0", - "short_name": "GPL 2.0", - "name": "GNU General Public License 2.0", - "category": "Copyleft", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/gpl-2.0.html", - "notes": "This is the last version of the GPL text as published by the FSF. This license was released: June 1991 This license is OSI certified.\n", - "next_version": "gpl-3.0", - "spdx_license_key": "GPL-2.0", + "key": "gpl-2.0", + "short_name": "GPL 2.0", + "name": "GNU General Public License 2.0", + "category": "Copyleft", + "owner": "Free Software Foundation (FSF)", + "homepage_url": "http://www.gnu.org/licenses/gpl-2.0.html", + "notes": "This is the last version of the GPL text as published by the FSF. This license was released: June 1991 This license is OSI certified.\n", + "next_version": "gpl-3.0", + "spdx_license_key": "GPL-2.0", "text_urls": [ - "http://www.gnu.org/licenses/gpl-2.0.txt", + "http://www.gnu.org/licenses/gpl-2.0.txt", "http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt" - ], - "osi_url": "http://opensource.org/licenses/gpl-license.php", - "faq_url": "http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html", + ], + "osi_url": "http://opensource.org/licenses/gpl-license.php", + "faq_url": "http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html", "other_urls": [ - "http://creativecommons.org/licenses/GPL/2.0/", - "http://creativecommons.org/choose/cc-gpl", - "http://creativecommons.org/images/public/cc-GPL-a.png", + "http://creativecommons.org/licenses/GPL/2.0/", + "http://creativecommons.org/choose/cc-gpl", + "http://creativecommons.org/images/public/cc-GPL-a.png", "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" ] } diff --git a/tests/licensedcode/data/models/rules.expected.json b/tests/licensedcode/data/models/rules.expected.json index a8e63110c3d..4f8e327f0cc 100644 --- a/tests/licensedcode/data/models/rules.expected.json +++ b/tests/licensedcode/data/models/rules.expected.json @@ -3,51 +3,51 @@ "licenses": [ "apache-2.0" ] - }, + }, { "licenses": [ "gpl-1.0" ] - }, + }, { "licenses": [ "gpl-1.0-plus" ] - }, + }, { "licenses": [ "gpl-2.0" ] - }, + }, { "licenses": [ "gpl-2.0-library" ] - }, + }, { "licenses": [ "gpl-2.0-plus" ] - }, + }, { "licenses": [ "gpl-3.0" ] - }, + }, { "licenses": [ "gpl-3.0-plus" ] - }, + }, { "licenses": [ "w3c-docs-19990405" ] - }, + }, { "licenses": [ "bsd-ack-carrot2" - ], + ], "minimum_coverage": 80 } ] \ No newline at end of file diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index 38c437da23a..d34ecded2b2 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -1,11 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--infos": true, + "--strip-root": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index 13cdc7241b0..2929b1b95bd 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -1,9 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--package": true, - "--license-score": 0, - "--format": "json" + "--packages": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index 9d803185f32..8ca24a2fd9c 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -1,10 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--strip-root": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index e6327c116d1..7f6c71b97c1 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -9,22 +9,22 @@ Usage: scancode [OPTIONS] Options: scans: - -c, --copyright Scan for copyrights. [default] - -l, --license Scan for licenses. [default] - -p, --package Scan for packages. [default] - -e, --email Scan for emails. - -u, --url Scan for urls. - -i, --info Include information such as size, type, etc. - --license-score INTEGER Do not return license matches with scores lower - than this score. A number between 0 and 100. - [default: 0] - --license-text Include the detected licenses matched text. Has - no effect unless --license is requested. - --license-url-template TEXT Set the template URL used for the license - reference URLs. In a template URL, curly braces - ({}) are replaced by the license key. [default: h - ttps://enterprise.dejacode.com/urn/urn:dje:licens - e:{}] + -c, --copyright, --copyrights Scan for copyrights. [default] + -l, --license, --licenses Scan for licenses. [default] + -p, --package, --packages Scan for packages. [default] + -e, --email, --emails Scan for emails. + -u, --url, --urls Scan for urls. + -i, --info, --infos Include information such as size, type, etc. + --license-score INTEGER Do not return license matches with scores lower + than this score. A number between 0 and 100. + [default: 0] + --license-text Include the detected licenses matched text. Has + no effect unless --license is requested. + --license-url-template TEXT Set the template URL used for the license + reference URLs. In a template URL, curly braces + ({}) are replaced by the license key. + [default: https://enterprise.dejacode.com/urn/u + rn:dje:license:{}] output: --strip-root Strip the root directory segment of all paths. The diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 37abfe5779f..370c4ce6295 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -1,12 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--licenses": true, + "--infos": true, + "--strip-root": true }, "files_count": 11, "files": [ diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index 54aae79eab5..1f0ba7c8be5 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -1,12 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--email": true, - "--url": true, - "--license-score": 0, - "--format": "json" + "--copyrights": true, + "--licenses": true, + "--emails": true, + "--urls": true }, "files_count": 11, "files": [ diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index 3b419812f9d..4c3526d19f1 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -1,10 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--infos": true, + "--strip-root": true }, "files_count": 11, "files": [ diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index 677472d2bb0..fb3b4f58b95 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -1,9 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--info": true, - "--license-score": 0, - "--format": "json" + "--infos": true }, "files_count": 11, "files": [ diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index 0a200dae894..a0508cb1f61 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -1,12 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--email": true, - "--url": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--emails": true, + "--urls": true, + "--infos": true, + "--strip-root": true }, "files_count": 11, "files": [ diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index 73635377faa..1e4d7aa7621 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -1,11 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--license": true, - "--license-score": 0, + "--licenses": true, "--license-text": true, - "--strip-root": true, - "--format": "json" + "--strip-root": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/mark_source/with_info.expected.json b/tests/scancode/data/mark_source/with_info.expected.json index 20479ac7cb1..5de62945398 100644 --- a/tests/scancode/data/mark_source/with_info.expected.json +++ b/tests/scancode/data/mark_source/with_info.expected.json @@ -1,343 +1,340 @@ { - "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "scancode_version": "2.0.1.post147.63a9004c0.dirty.20170806064809", - "scancode_options": { - "--info": true, - "--license-score": 0, - "--format": "json", - "--mark-source": true + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "--infos": true, + "--mark-source": true + }, + "files_count": 15, + "files": [ + { + "path": "JGroups.tgz/JGroups", + "type": "directory", + "name": "JGroups", + "base_name": "JGroups", + "extension": "", + "date": null, + "size": 206642, + "sha1": null, + "md5": null, + "files_count": 12, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, - "files_count": 15, - "files": [ - { - "path": "JGroups.tgz/JGroups", - "type": "directory", - "name": "JGroups", - "base_name": "JGroups", - "extension": "", - "date": null, - "size": 206642, - "sha1": null, - "md5": null, - "files_count": 12, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src", - "type": "directory", - "name": "src", - "base_name": "src", - "extension": "", - "date": null, - "size": 152090, - "sha1": null, - "md5": null, - "files_count": 7, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses", - "type": "directory", - "name": "licenses", - "base_name": "licenses", - "extension": "", - "date": null, - "size": 54552, - "sha1": null, - "md5": null, - "files_count": 5, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/S3_PING.java", - "type": "file", - "name": "S3_PING.java", - "base_name": "S3_PING", - "extension": ".java", - "date": "2017-08-05", - "size": 122528, - "sha1": "08dba9986f69719970ead3592dc565465164df0d", - "md5": "83d8324f37d0e3f120bc89865cf0bd39", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RouterStubManager.java", - "type": "file", - "name": "RouterStubManager.java", - "base_name": "RouterStubManager", - "extension": ".java", - "date": "2017-08-05", - "size": 8162, - "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", - "md5": "20bee9631b7c82a45c250e095352aec7", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RouterStub.java", - "type": "file", - "name": "RouterStub.java", - "base_name": "RouterStub", - "extension": ".java", - "date": "2017-08-05", - "size": 9913, - "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", - "md5": "eecfe23494acbcd8088c93bc1e83c7f2", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RATE_LIMITER.java", - "type": "file", - "name": "RATE_LIMITER.java", - "base_name": "RATE_LIMITER", - "extension": ".java", - "date": "2017-08-05", - "size": 3692, - "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", - "md5": "4626bdbc48871b55513e1a12991c61a8", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/ImmutableReference.java", - "type": "file", - "name": "ImmutableReference.java", - "base_name": "ImmutableReference", - "extension": ".java", - "date": "2017-08-05", - "size": 1838, - "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", - "md5": "48ca3c72fb9a65c771a321222f118b88", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/GuardedBy.java", - "type": "file", - "name": "GuardedBy.java", - "base_name": "GuardedBy", - "extension": ".java", - "date": "2017-08-05", - "size": 813, - "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", - "md5": "c5064400f759d3e81771005051d17dc1", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/FixedMembershipToken.java", - "type": "file", - "name": "FixedMembershipToken.java", - "base_name": "FixedMembershipToken", - "extension": ".java", - "date": "2017-08-05", - "size": 5144, - "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", - "md5": "aca9640ec8beee21b098bcf8ecc91442", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/lgpl.txt", - "type": "file", - "name": "lgpl.txt", - "base_name": "lgpl", - "extension": ".txt", - "date": "2017-08-05", - "size": 26934, - "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", - "md5": "f14599a2f089f6ff8c97e2baa4e3d575", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/cpl-1.0.txt", - "type": "file", - "name": "cpl-1.0.txt", - "base_name": "cpl-1.0", - "extension": ".txt", - "date": "2017-08-05", - "size": 11987, - "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", - "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/bouncycastle.txt", - "type": "file", - "name": "bouncycastle.txt", - "base_name": "bouncycastle", - "extension": ".txt", - "date": "2017-08-05", - "size": 1186, - "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", - "md5": "9fffd8de865a5705969f62b128381f85", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/apache-2.0.txt", - "type": "file", - "name": "apache-2.0.txt", - "base_name": "apache-2.0", - "extension": ".txt", - "date": "2017-08-05", - "size": 11560, - "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", - "md5": "d273d63619c9aeaf15cdaf76422c4f87", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/apache-1.1.txt", - "type": "file", - "name": "apache-1.1.txt", - "base_name": "apache-1.1", - "extension": ".txt", - "date": "2017-08-05", - "size": 2885, - "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", - "md5": "276982197c941f4cbf3d218546e17ae2", - "files_count": null, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - } - ] -} + { + "path": "JGroups.tgz/JGroups/licenses", + "type": "directory", + "name": "licenses", + "base_name": "licenses", + "extension": "", + "date": null, + "size": 54552, + "sha1": null, + "md5": null, + "files_count": 5, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/licenses/apache-1.1.txt", + "type": "file", + "name": "apache-1.1.txt", + "base_name": "apache-1.1", + "extension": ".txt", + "date": "2017-08-05", + "size": 2885, + "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", + "md5": "276982197c941f4cbf3d218546e17ae2", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/licenses/apache-2.0.txt", + "type": "file", + "name": "apache-2.0.txt", + "base_name": "apache-2.0", + "extension": ".txt", + "date": "2017-08-05", + "size": 11560, + "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", + "md5": "d273d63619c9aeaf15cdaf76422c4f87", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/licenses/bouncycastle.txt", + "type": "file", + "name": "bouncycastle.txt", + "base_name": "bouncycastle", + "extension": ".txt", + "date": "2017-08-05", + "size": 1186, + "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", + "md5": "9fffd8de865a5705969f62b128381f85", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/licenses/cpl-1.0.txt", + "type": "file", + "name": "cpl-1.0.txt", + "base_name": "cpl-1.0", + "extension": ".txt", + "date": "2017-08-05", + "size": 11987, + "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", + "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/licenses/lgpl.txt", + "type": "file", + "name": "lgpl.txt", + "base_name": "lgpl", + "extension": ".txt", + "date": "2017-08-05", + "size": 26934, + "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", + "md5": "f14599a2f089f6ff8c97e2baa4e3d575", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src", + "type": "directory", + "name": "src", + "base_name": "src", + "extension": "", + "date": null, + "size": 152090, + "sha1": null, + "md5": null, + "files_count": 7, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/FixedMembershipToken.java", + "type": "file", + "name": "FixedMembershipToken.java", + "base_name": "FixedMembershipToken", + "extension": ".java", + "date": "2017-08-05", + "size": 5144, + "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", + "md5": "aca9640ec8beee21b098bcf8ecc91442", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/GuardedBy.java", + "type": "file", + "name": "GuardedBy.java", + "base_name": "GuardedBy", + "extension": ".java", + "date": "2017-08-05", + "size": 813, + "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", + "md5": "c5064400f759d3e81771005051d17dc1", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/ImmutableReference.java", + "type": "file", + "name": "ImmutableReference.java", + "base_name": "ImmutableReference", + "extension": ".java", + "date": "2017-08-05", + "size": 1838, + "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", + "md5": "48ca3c72fb9a65c771a321222f118b88", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/RATE_LIMITER.java", + "type": "file", + "name": "RATE_LIMITER.java", + "base_name": "RATE_LIMITER", + "extension": ".java", + "date": "2017-08-05", + "size": 3692, + "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", + "md5": "4626bdbc48871b55513e1a12991c61a8", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/RouterStub.java", + "type": "file", + "name": "RouterStub.java", + "base_name": "RouterStub", + "extension": ".java", + "date": "2017-08-05", + "size": 9913, + "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", + "md5": "eecfe23494acbcd8088c93bc1e83c7f2", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/RouterStubManager.java", + "type": "file", + "name": "RouterStubManager.java", + "base_name": "RouterStubManager", + "extension": ".java", + "date": "2017-08-05", + "size": 8162, + "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", + "md5": "20bee9631b7c82a45c250e095352aec7", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + }, + { + "path": "JGroups.tgz/JGroups/src/S3_PING.java", + "type": "file", + "name": "S3_PING.java", + "base_name": "S3_PING", + "extension": ".java", + "date": "2017-08-05", + "size": 122528, + "sha1": "08dba9986f69719970ead3592dc565465164df0d", + "md5": "83d8324f37d0e3f120bc89865cf0bd39", + "files_count": null, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/mark_source/without_info.expected.json b/tests/scancode/data/mark_source/without_info.expected.json index 718179f0c2e..5d639c1d296 100644 --- a/tests/scancode/data/mark_source/without_info.expected.json +++ b/tests/scancode/data/mark_source/without_info.expected.json @@ -1,11 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--license-score": 0, - "--format": "json", + "--copyrights": true, + "--licenses": true, + "--packages": true, "--mark-source": true }, "files_count": 15, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index b6ab979a358..59dce226ed2 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -1,10 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--infos": true, + "--strip-root": true }, "files_count": 19, "files": [ diff --git a/tests/scancode/data/only_findings/expected.json b/tests/scancode/data/only_findings/expected.json index 864a30631c0..d9377448de4 100644 --- a/tests/scancode/data/only_findings/expected.json +++ b/tests/scancode/data/only_findings/expected.json @@ -1,16 +1,115 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "scancode_version": "2.0.1.post147.5eab12f53", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--license-score": 0, - "--format": "json", + "--copyrights": true, + "--licenses": true, + "--packages": true, "--only-findings": true }, "files_count": 3, "files": [ + { + "path": "basic.tgz/basic/dir/e.tar", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [ + { + "type": "plain tarball", + "name": null, + "version": null, + "primary_language": null, + "packaging": "archive", + "summary": null, + "description": null, + "payload_type": null, + "size": null, + "release_date": null, + "authors": [], + "maintainers": [], + "contributors": [], + "owners": [], + "packagers": [], + "distributors": [], + "vendors": [], + "keywords": [], + "keywords_doc_url": null, + "metafile_locations": [], + "metafile_urls": [], + "homepage_url": null, + "notes": null, + "download_urls": [], + "download_sha1": null, + "download_sha256": null, + "download_md5": null, + "bug_tracking_url": null, + "support_contacts": [], + "code_view_url": null, + "vcs_tool": null, + "vcs_repository": null, + "vcs_revision": null, + "copyright_top_level": null, + "copyrights": [], + "asserted_licenses": [], + "legal_file_locations": [], + "license_expression": null, + "license_texts": [], + "notice_texts": [], + "dependencies": {}, + "related_packages": [] + } + ] + }, + { + "path": "basic.tgz/basic/dir2/subdir/bcopy.s", + "scan_errors": [], + "licenses": [ + { + "key": "bsd-original-uc", + "score": 100.0, + "short_name": "BSD-Original-UC", + "category": "Permissive", + "owner": "Regents of the University of California", + "homepage_url": "ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change", + "text_url": "http://www.xfree86.org/3.3.6/COPYRIGHT2.html", + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:bsd-original-uc", + "spdx_license_key": "BSD-4-Clause-UC", + "spdx_url": "https://spdx.org/licenses/BSD-4-Clause-UC", + "start_line": 25, + "end_line": 51, + "matched_rule": { + "identifier": "bsd-original-uc_4.RULE", + "license_choice": false, + "licenses": [ + "bsd-original-uc" + ] + } + } + ], + "copyrights": [ + { + "statements": [ + "Copyright (c) 1993 The Regents of the University of California." + ], + "holders": [ + "The Regents of the University of California." + ], + "authors": [], + "start_line": 22, + "end_line": 23 + }, + { + "statements": [], + "holders": [], + "authors": [ + "the University of California, Berkeley and its contributors." + ], + "start_line": 34, + "end_line": 37 + } + ], + "packages": [] + }, { "path": "basic.tgz/basic/main.c", "scan_errors": [], @@ -74,108 +173,6 @@ } ], "packages": [] - }, - { - "path": "basic.tgz/basic/dir2/subdir/bcopy.s", - "scan_errors": [], - "licenses": [ - { - "key": "bsd-original-uc", - "score": 100.0, - "short_name": "BSD-Original-UC", - "category": "Permissive", - "owner": "Regents of the University of California", - "homepage_url": "ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change", - "text_url": "http://www.xfree86.org/3.3.6/COPYRIGHT2.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:bsd-original-uc", - "spdx_license_key": "BSD-4-Clause-UC", - "spdx_url": "https://spdx.org/licenses/BSD-4-Clause-UC", - "start_line": 25, - "end_line": 51, - "matched_rule": { - "identifier": "bsd-original-uc_4.RULE", - "license_choice": false, - "licenses": [ - "bsd-original-uc" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright (c) 1993 The Regents of the University of California." - ], - "holders": [ - "The Regents of the University of California." - ], - "authors": [], - "start_line": 22, - "end_line": 23 - }, - { - "statements": [], - "holders": [], - "authors": [ - "the University of California, Berkeley and its contributors." - ], - "start_line": 34, - "end_line": 37 - } - ], - "packages": [] - }, - { - "path": "basic.tgz/basic/dir/e.tar", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [ - { - "type": "plain tarball", - "name": null, - "version": null, - "primary_language": null, - "packaging": "archive", - "summary": null, - "description": null, - "payload_type": null, - "size": null, - "release_date": null, - "authors": [], - "maintainers": [], - "contributors": [], - "owners": [], - "packagers": [], - "distributors": [], - "vendors": [], - "keywords": [], - "keywords_doc_url": null, - "metafile_locations": [], - "metafile_urls": [], - "homepage_url": null, - "notes": null, - "download_urls": [], - "download_sha1": null, - "download_sha256": null, - "download_md5": null, - "bug_tracking_url": null, - "support_contacts": [], - "code_view_url": null, - "vcs_tool": null, - "vcs_repository": null, - "vcs_revision": null, - "copyright_top_level": null, - "copyrights": [], - "asserted_licenses": [], - "legal_file_locations": [], - "license_expression": null, - "license_texts": [], - "notice_texts": [], - "dependencies": {}, - "related_packages": [] - } - ] } ] -} +} \ No newline at end of file diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index 1af4296df8d..6cb51660901 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -1,9 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--package": true, - "--license-score": 0, - "--format": "json" + "--packages": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index c61d80baee1..155e4c9f0a9 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -1,15 +1,13 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--license": true, - "--package": true, - "--email": true, - "--url": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--licenses": true, + "--packages": true, + "--emails": true, + "--urls": true, + "--infos": true, + "--strip-root": true }, "files_count": 4, "files": [ diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index 25225a75c16..60876d55708 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -1,11 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyright": true, - "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--copyrights": true, + "--infos": true, + "--strip-root": true }, "files_count": 5, "files": [ diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py index 88d2f3c9cb8..c92d53c102a 100644 --- a/tests/scancode/test_ignore_files.py +++ b/tests/scancode/test_ignore_files.py @@ -30,6 +30,7 @@ from commoncode.testcase import FileBasedTesting from commoncode.ignore import is_ignored from scancode.cache import get_scans_cache_class +from scancode.cli import CommandOption from scancode.cli import resource_paths from scancode.plugin_ignore import ProcessIgnore @@ -71,8 +72,11 @@ def test_ignore_glob_file(self): assert is_ignored(*test) def test_resource_paths_with_single_file(self): + test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore({'ignore': ('sample.doc',)}) + test_plugin = ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('sample.doc',), default=None)] + ) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -87,7 +91,9 @@ def test_resource_paths_with_single_file(self): def test_resource_paths_with_multiple_files(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore({'ignore': ('ignore.doc',)}) + test_plugin = ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('ignore.doc',), default=None)] + ) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -101,7 +107,9 @@ def test_resource_paths_with_multiple_files(self): def test_resource_paths_with_glob_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore({'ignore': ('*.doc',)}) + test_plugin = ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('*.doc',), default=None)] + ) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -114,7 +122,9 @@ def test_resource_paths_with_glob_file(self): def test_resource_paths_with_glob_path(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore({'ignore': ('*/src/test',)}) + test_plugin = ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('*/src/test',), default=None)] + ) scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -129,8 +139,12 @@ def test_resource_paths_with_multiple_plugins(self): test_dir = self.extract_test_tar('ignore/user.tgz') scan_cache_class = get_scans_cache_class(self.get_temp_dir()) test_plugins = [ - ProcessIgnore({'ignore': ('*.doc',)}), - ProcessIgnore({'ignore': ('*/src/test/*',)}) + ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('*.doc',), default=None)] + ), + ProcessIgnore( + [CommandOption(group=None, name='ignore', option='--ignore', value=('*/src/test/*',), default=None)] + ), ] expected = [ 'user', From 7ef1cbaf02c874099067db8dda9016e63437b450 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 5 Jan 2018 08:50:13 +0100 Subject: [PATCH 018/122] Use resource_iter everywhere #787 * fileutils.py: remove file_iter and dir_iter as they were not really used/useful Signed-off-by: Philippe Ombredanne --- src/commoncode/fileutils.py | 41 +-------- src/extractcode/archive.py | 2 +- src/licensedcode/cache.py | 4 +- src/licensedcode/models.py | 6 +- tests/commoncode/test_fileutils.py | 136 ++++++++++++++--------------- tests/extractcode/test_archive.py | 6 +- tests/packagedcode/test_maven.py | 4 +- tests/scancode/test_cli.py | 2 +- tests/scancode/test_extract_cli.py | 10 +-- tests/textcode/test_analysis.py | 6 +- 10 files changed, 90 insertions(+), 127 deletions(-) diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index 4caac8fab8f..e9dedaf9da9 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -433,56 +433,23 @@ def walk(location, ignored=ignore_nothing): yield tripple -def file_iter(location, ignored=ignore_nothing): +def resource_iter(location, ignored=ignore_nothing, with_dirs=True): """ - Return an iterable of files at `location` recursively. + Return an iterable of paths at `location` recursively. :param location: a file or a directory. :param ignored: a callable accepting a location argument and returning True if the location should be ignored. - :return: an iterable of file locations. - """ - if on_linux: - location = path_to_bytes(location) - - return resource_iter(location, ignored, with_dirs=False) - - -def dir_iter(location, ignored=ignore_nothing): - """ - Return an iterable of directories at `location` recursively. - - :param location: a directory. - :param ignored: a callable accepting a location argument and returning True - if the location should be ignored. - :return: an iterable of directory locations. - """ - if on_linux: - location = path_to_bytes(location) - return resource_iter(location, ignored, with_files=False) - - -def resource_iter(location, ignored=ignore_nothing, with_files=True, with_dirs=True): - """ - Return an iterable of resources at `location` recursively. - - :param location: a file or a directory. - :param ignored: a callable accepting a location argument and returning True - if the location should be ignored. - :param with_dirs: If True, include the directories. - :param with_files: If True, include the files. :return: an iterable of file and directory locations. """ - assert with_dirs or with_files, "fileutils.resource_iter: One or both of 'with_dirs' and 'with_files' is required" if on_linux: location = path_to_bytes(location) for top, dirs, files in walk(location, ignored): - if with_files: - for f in files: - yield os.path.join(top, f) if with_dirs: for d in dirs: yield os.path.join(top, d) + for f in files: + yield os.path.join(top, f) # # COPY # diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index 673bcd1199b..436d5441675 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -323,7 +323,7 @@ def extract_twice(location, target_dir, extractor1, extractor2): # extract this intermediate payload to the final target_dir try: - inner_archives = list(fileutils.file_iter(temp_target)) + inner_archives = list(fileutils.resource_iter(temp_target, with_dirs=False)) if not inner_archives: warnings.append(location + ': No files found in archive.') else: diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index 6f155e97ec4..dd486de32ad 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -34,7 +34,7 @@ import yg.lockfile # @UnresolvedImport -from commoncode.fileutils import file_iter +from commoncode.fileutils import resource_iter from commoncode import ignore from licensedcode import root_dir @@ -71,7 +71,7 @@ def tree_checksum(tree_base_dir=src_dir, _ignored=_ignored_from_hash): NOTE: this is not 100% fool proof but good enough in practice. """ hashable = (pth + str(getmtime(pth)) + str(getsize(pth)) - for pth in file_iter(tree_base_dir, ignored=_ignored)) + for pth in resource_iter(tree_base_dir, ignored=_ignored, with_dirs=False)) return md5(''.join(sorted(hashable))).hexdigest() diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index 6057761d43e..81ee0cc42e7 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -39,7 +39,7 @@ from commoncode.fileutils import file_base_name from commoncode.fileutils import file_name -from commoncode.fileutils import file_iter +from commoncode.fileutils import resource_iter from commoncode import saneyaml from textcode.analysis import text_lines @@ -431,7 +431,7 @@ def load_licenses(licenses_data_dir=licenses_data_dir , with_deprecated=False): Return a mapping of key -> license objects, loaded from license files. """ licenses = {} - for data_file in file_iter(licenses_data_dir): + for data_file in resource_iter(licenses_data_dir, with_dirs=False): if not data_file.endswith('.yml'): continue key = file_base_name(data_file) @@ -511,7 +511,7 @@ def load_rules(rules_data_dir=rules_data_dir, load_notes=False): processed_files = set() lower_case_files = set() case_problems = set() - for data_file in file_iter(rules_data_dir): + for data_file in resource_iter(rules_data_dir, with_dirs=False): if data_file.endswith('.yml'): base_name = file_base_name(data_file) rule_file = join(rules_data_dir, base_name + '.RULE') diff --git a/tests/commoncode/test_fileutils.py b/tests/commoncode/test_fileutils.py index ea94a5b75fa..cd6b4ed1c87 100644 --- a/tests/commoncode/test_fileutils.py +++ b/tests/commoncode/test_fileutils.py @@ -306,6 +306,19 @@ def test_resource_name(self): assert 'f.a' == fileutils.resource_name('a/b/d/f/f.a') assert 'f.a' == fileutils.resource_name('f.a') + @skipIf(on_windows, 'Windows FS encoding is ... different') + def test_path_to_unicode_and_path_to_bytes_are_idempotent(self): + a = b'foo\xb1bar' + b = u'foo\udcb1bar' + assert a == path_to_bytes(path_to_unicode(a)) + assert a == path_to_bytes(path_to_unicode(b)) + assert b == path_to_unicode(path_to_bytes(a)) + assert b == path_to_unicode(path_to_bytes(b)) + + +class TestFileUtilsWalk(FileBasedTesting): + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + def test_os_walk_with_unicode_path(self): test_dir = self.extract_test_zip('fileutils/walk/unicode.zip') test_dir = join(test_dir, 'unicode') @@ -359,10 +372,34 @@ def test_fileutils_walk_can_walk_an_empty_dir(self): ] assert expected == result - def test_file_iter(self): + def test_walk_can_walk_non_utf8_path_from_unicode_path(self): + test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') + test_dir = join(test_dir, 'non_unicode') + + if not on_linux: + test_dir = unicode(test_dir) + result = list(fileutils.walk(test_dir))[0] + _dirpath, _dirnames, filenames = result + assert 18 == len(filenames) + + def test_os_walk_can_walk_non_utf8_path_from_unicode_path(self): + test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') + test_dir = join(test_dir, 'non_unicode') + + if not on_linux: + test_dir = unicode(test_dir) + result = list(os.walk(test_dir))[0] + _dirpath, _dirnames, filenames = result + assert 18 == len(filenames) + + +class TestFileUtilsIter(FileBasedTesting): + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_resource_iter(self): test_dir = self.get_test_loc('fileutils/walk') base = self.get_test_loc('fileutils') - result = [as_posixpath(f.replace(base, '')) for f in fileutils.file_iter(test_dir)] + result = [as_posixpath(f.replace(base, '')) for f in fileutils.resource_iter(test_dir, with_dirs=False)] expected = [ '/walk/f', '/walk/unicode.zip', @@ -372,23 +409,35 @@ def test_file_iter(self): ] assert sorted(expected) == sorted(result) - def test_file_iter_can_iterate_a_single_file(self): + def test_resource_iter_can_iterate_a_single_file(self): test_file = self.get_test_loc('fileutils/walk/f') - result = [as_posixpath(f) for f in fileutils.file_iter(test_file)] + result = [as_posixpath(f) for f in fileutils.resource_iter(test_file, with_dirs=False)] expected = [as_posixpath(test_file)] assert expected == result - def test_file_iter_can_walk_an_empty_dir(self): + def test_resource_iter_can_iterate_a_single_file_with_dirs(self): + test_file = self.get_test_loc('fileutils/walk/f') + result = [as_posixpath(f) for f in fileutils.resource_iter(test_file, with_dirs=True)] + expected = [as_posixpath(test_file)] + assert expected == result + + def test_resource_iter_can_walk_an_empty_dir(self): test_dir = self.get_temp_dir() - result = list(fileutils.file_iter(test_dir)) + result = list(fileutils.resource_iter(test_dir, with_dirs=False)) expected = [] assert expected == result - def test_resource_iter_with_files_no_dir(self): + def test_resource_iter_can_walk_an_empty_dir_with_dirs(self): + test_dir = self.get_temp_dir() + result = list(fileutils.resource_iter(test_dir, with_dirs=False)) + expected = [] + assert expected == result + + def test_resource_iter_without_dir(self): test_dir = self.get_test_loc('fileutils/walk') base = self.get_test_loc('fileutils') result = sorted([as_posixpath(f.replace(base, '')) - for f in fileutils.resource_iter(test_dir, with_files=True, with_dirs=False)]) + for f in fileutils.resource_iter(test_dir, with_dirs=False)]) expected = [ '/walk/f', '/walk/unicode.zip', @@ -398,11 +447,11 @@ def test_resource_iter_with_files_no_dir(self): ] assert sorted(expected) == sorted(result) - def test_resource_iter_with_files_and_dir(self): + def test_resource_iter_with_dirs(self): test_dir = self.get_test_loc('fileutils/walk') base = self.get_test_loc('fileutils') result = sorted([as_posixpath(f.replace(base, '')) - for f in fileutils.resource_iter(test_dir, with_files=True, with_dirs=True)]) + for f in fileutils.resource_iter(test_dir, with_dirs=True)]) expected = [ '/walk/d1', '/walk/d1/d2', @@ -415,23 +464,11 @@ def test_resource_iter_with_files_and_dir(self): ] assert sorted(expected) == sorted(result) - def test_resource_iter_with_dir_only(self): - test_dir = self.get_test_loc('fileutils/walk') - base = self.get_test_loc('fileutils') - result = sorted([as_posixpath(f.replace(base, '')) - for f in fileutils.resource_iter(test_dir, with_files=False, with_dirs=True)]) - expected = [ - '/walk/d1', - '/walk/d1/d2', - '/walk/d1/d2/d3', - ] - assert sorted(expected) == sorted(result) - def test_resource_iter_return_byte_on_byte_input(self): test_dir = self.get_test_loc('fileutils/walk') base = self.get_test_loc('fileutils') result = sorted([as_posixpath(f.replace(base, '')) - for f in fileutils.resource_iter(test_dir, with_files=True, with_dirs=True)]) + for f in fileutils.resource_iter(test_dir, with_dirs=True)]) expected = [ '/walk/d1', '/walk/d1/d2', @@ -452,7 +489,7 @@ def test_resource_iter_return_unicode_on_unicode_input(self): test_dir = self.get_test_loc('fileutils/walk') base = unicode(self.get_test_loc('fileutils')) result = sorted([as_posixpath(f.replace(base, '')) - for f in fileutils.resource_iter(test_dir, with_files=True, with_dirs=True)]) + for f in fileutils.resource_iter(test_dir, with_dirs=True)]) expected = [ u'/walk/d1', u'/walk/d1/d2', @@ -466,19 +503,7 @@ def test_resource_iter_return_unicode_on_unicode_input(self): assert sorted(expected) == sorted(result) assert all(isinstance(p, unicode) for p in result) - def test_resource_iter_can_iterate_a_single_file(self): - test_file = self.get_test_loc('fileutils/walk/f') - result = [as_posixpath(f) for f in fileutils.resource_iter(test_file)] - expected = [as_posixpath(test_file)] - assert expected == result - - def test_resource_iter_can_walk_an_empty_dir(self): - test_dir = self.get_temp_dir() - result = list(fileutils.resource_iter(test_dir)) - expected = [] - assert expected == result - - def test_fileutils_resource_iter_can_walk_unicode_path_with_zip(self): + def test_resource_iter_can_walk_unicode_path_with_zip(self): test_dir = self.extract_test_zip('fileutils/walk/unicode.zip') test_dir = join(test_dir, 'unicode') @@ -509,53 +534,24 @@ def test_fileutils_resource_iter_can_walk_unicode_path_with_zip(self): ] assert expected == result - def test_resource_iter_can_walk_non_utf8_path_from_unicode_path(self): + def test_resource_iter_can_walk_non_utf8_path_from_unicode_path_with_dirs(self): test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') test_dir = join(test_dir, 'non_unicode') if not on_linux: test_dir = unicode(test_dir) - result = list(fileutils.resource_iter(test_dir)) + result = list(fileutils.resource_iter(test_dir, with_dirs=True)) assert 18 == len(result) - def test_walk_can_walk_non_utf8_path_from_unicode_path(self): - test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') - test_dir = join(test_dir, 'non_unicode') - - if not on_linux: - test_dir = unicode(test_dir) - result = list(fileutils.walk(test_dir))[0] - _dirpath, _dirnames, filenames = result - assert 18 == len(filenames) - - def test_file_iter_can_walk_non_utf8_path_from_unicode_path(self): + def test_resource_iter_can_walk_non_utf8_path_from_unicode_path(self): test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') test_dir = join(test_dir, 'non_unicode') if not on_linux: test_dir = unicode(test_dir) - result = list(fileutils.file_iter(test_dir)) + result = list(fileutils.resource_iter(test_dir, with_dirs=False)) assert 18 == len(result) - def test_os_walk_can_walk_non_utf8_path_from_unicode_path(self): - test_dir = self.extract_test_tar_raw('fileutils/walk_non_utf8/non_unicode.tgz') - test_dir = join(test_dir, 'non_unicode') - - if not on_linux: - test_dir = unicode(test_dir) - result = list(os.walk(test_dir))[0] - _dirpath, _dirnames, filenames = result - assert 18 == len(filenames) - - @skipIf(on_windows, 'Windows FS encoding is ... different') - def test_path_to_unicode_and_path_to_bytes_are_idempotent(self): - a = b'foo\xb1bar' - b = u'foo\udcb1bar' - assert a == path_to_bytes(path_to_unicode(a)) - assert a == path_to_bytes(path_to_unicode(b)) - assert b == path_to_unicode(path_to_bytes(a)) - assert b == path_to_unicode(path_to_bytes(b)) - class TestBaseName(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index b1ab4839776..0736463c05f 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -255,7 +255,7 @@ def check_extract(self, test_function, test_file, expected, expected_warnings=No if check_all: len_test_dir = len(test_dir) - extracted = {path[len_test_dir:]: filetype.get_size(path) for path in fileutils.file_iter(test_dir)} + extracted = {path[len_test_dir:]: filetype.get_size(path) for path in fileutils.resource_iter(test_dir, with_dirs=False)} expected = {os.path.join(test_dir, exp_path): exp_size for exp_path, exp_size in expected.items()} assert sorted(expected.items()) == sorted(extracted.items()) else: @@ -865,7 +865,7 @@ def test_extract_zip_with_backslash_in_path_3(self): test_dir = self.get_temp_dir() archive.extract_zip(test_file, test_dir) print() - map(print, fileutils.file_iter(test_dir)) + map(print, fileutils.resource_iter(test_dir, with_dirs=False)) result = os.path.join(test_dir, 'src/Boo.Lang.Compiler/TypeSystem/InternalCallableType.cs') assert os.path.exists(result) @@ -2114,7 +2114,7 @@ def check_extract(self, test_function, test_file, expected_suffix, expected_warn return len_test_dir = len(test_dir) - extracted = sorted(path[len_test_dir:] for path in fileutils.file_iter(test_dir)) + extracted = sorted(path[len_test_dir:] for path in fileutils.resource_iter(test_dir, with_dirs=False)) extracted = [unicode(p) for p in extracted] extracted = [to_posix(p) for p in extracted] diff --git a/tests/packagedcode/test_maven.py b/tests/packagedcode/test_maven.py index 1ef082236a3..8152f271d1e 100644 --- a/tests/packagedcode/test_maven.py +++ b/tests/packagedcode/test_maven.py @@ -57,7 +57,7 @@ def test_is_pom_non_pom(self): def test_is_pom_maven2(self): test_dir = self.get_test_loc('maven2') - for test_file in fileutils.file_iter(test_dir): + for test_file in fileutils.resource_iter(test_dir, with_dirs=False): if test_file.endswith('.json'): continue @@ -70,7 +70,7 @@ def test_is_pom_not_misc2(self): def test_is_pom_m2(self): test_dir = self.get_test_loc('m2') - for test_file in fileutils.file_iter(test_dir): + for test_file in fileutils.resource_iter(test_dir, with_dirs=False): if test_file.endswith('.json'): continue diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 8a83f60f7e1..ddc20bea381 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -430,7 +430,7 @@ def test_scan_works_with_multiple_processes_and_timeouts(): # add some random bytes to the test files to ensure that the license results will # not be cached import time, random - for tf in fileutils.file_iter(test_dir): + for tf in fileutils.resource_iter(test_dir, with_dirs=False): with open(tf, 'ab') as tfh: tfh.write('(c)' + str(time.time()) + repr([random.randint(0, 10 ** 6) for _ in range(10000)]) + '(c)') diff --git a/tests/scancode/test_extract_cli.py b/tests/scancode/test_extract_cli.py index 18134e6932e..4c3e07ee01f 100644 --- a/tests/scancode/test_extract_cli.py +++ b/tests/scancode/test_extract_cli.py @@ -33,7 +33,7 @@ from click.testing import CliRunner from commoncode.fileutils import as_posixpath -from commoncode.fileutils import file_iter +from commoncode.fileutils import resource_iter from commoncode.testcase import FileDrivenTesting from commoncode.system import on_windows from scancode import extract_cli @@ -125,7 +125,7 @@ def test_extractcode_command_works_with_relative_paths(monkeypatch): assert not 'WARNING' in result.output assert not 'ERROR' in result.output expected = ['/c/a/a.txt', '/c/b/a.txt', '/c/c/a.txt'] - file_result = [as_posixpath(f.replace(test_tgt_dir, '')) for f in fileutils.file_iter(test_tgt_dir)] + file_result = [as_posixpath(f.replace(test_tgt_dir, '')) for f in fileutils.resource_iter(test_tgt_dir, with_dirs=False)] assert sorted(expected) == sorted(file_result) finally: fileutils.delete(test_src_dir) @@ -199,7 +199,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names_verbose(monk uni_arch = b'unicodepath.tgz' if on_linux else 'unicodepath.tgz' uni_path = b'/unicodepath/' if on_linux else '/unicodepath/' - file_result = [f for f in map(as_posixpath, file_iter(test_dir)) if not f.endswith(uni_arch)] + file_result = [f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith(uni_arch)] file_result = [EMPTY_STRING.join(f.partition(uni_path)[1:]) for f in file_result] file_result = [f for f in file_result if f] expected = [ @@ -222,7 +222,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names(monkeypatch) uni_arch = b'unicodepath.tgz' if on_linux else 'unicodepath.tgz' uni_path = b'/unicodepath/' if on_linux else '/unicodepath/' - file_result = [f for f in map(as_posixpath, file_iter(test_dir)) if not f.endswith(uni_arch)] + file_result = [f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith(uni_arch)] file_result = [EMPTY_STRING.join(f.partition(uni_path)[1:]) for f in file_result] file_result = [f for f in file_result if f] expected = [ @@ -239,7 +239,7 @@ def test_extractcode_command_can_extract_shallow(monkeypatch): runner = CliRunner() result = runner.invoke(extract_cli.extractcode, ['--shallow', test_dir]) assert result.exit_code == 0 - file_result = [f for f in map(as_posixpath, file_iter(test_dir)) if not f.endswith('unicodepath.tgz')] + file_result = [f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith('unicodepath.tgz')] file_result = [''.join(f.partition('/top.zip-extract/')[1:]) for f in file_result] file_result = [f for f in file_result if f] # this checks that the zip in top.zip are not extracted diff --git a/tests/textcode/test_analysis.py b/tests/textcode/test_analysis.py index 85591c27379..d1f3d036c3d 100644 --- a/tests/textcode/test_analysis.py +++ b/tests/textcode/test_analysis.py @@ -33,7 +33,7 @@ from textcode.analysis import unicode_text_lines from textcode.analysis import text_lines -from commoncode.fileutils import file_iter +from commoncode.fileutils import resource_iter class TestAnalysis(FileBasedTesting): @@ -68,13 +68,13 @@ def test_archives_do_not_yield_text_lines(self): def test_some_media_do_yield_text_lines(self): test_dir = self.get_test_loc('media_with_text') - for test_file in file_iter(test_dir): + for test_file in resource_iter(test_dir, with_dirs=False): result = list(text_lines(test_file)) assert result, 'Should return text lines:' + test_file assert any('nexb' in l for l in result) def test_some_media_do_not_yield_text_lines(self): test_dir = self.get_test_loc('media_without_text') - for test_file in file_iter(test_dir): + for test_file in resource_iter(test_dir, with_dirs=False): result = list(text_lines(test_file)) assert [] == result, 'Should not return text lines:' + test_file From a6446c94bea1f327da227328ae318b07ec0d34fc Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 5 Jan 2018 09:00:27 +0100 Subject: [PATCH 019/122] Do not use on-disk file log. Improve pre-scan plugins #787 * refactor pre-scan plugins to use the same approach as all other plugins and not make ignoring a special case * cli.py and cache.py: remove the on-disk file log and use an in-memory list instead Signed-off-by: Philippe Ombredanne --- src/scancode/cache.py | 253 ++++++++++++++-------------- src/scancode/cli.py | 220 +++++++++--------------- src/scancode/plugin_ignore.py | 49 ++++-- tests/scancode/test_ignore_files.py | 59 ++++--- 4 files changed, 286 insertions(+), 295 deletions(-) diff --git a/src/scancode/cache.py b/src/scancode/cache.py index e8f9cd7c90c..6f44e1efc29 100644 --- a/src/scancode/cache.py +++ b/src/scancode/cache.py @@ -35,12 +35,15 @@ import posixpath import sys -from commoncode import fileutils +# from commoncode import fileutils from commoncode.fileutils import as_posixpath +from commoncode.fileutils import create_dir +from commoncode.fileutils import delete +from commoncode.fileutils import get_temp_dir from commoncode.fileutils import path_to_bytes from commoncode.fileutils import path_to_unicode from commoncode.system import on_linux -from commoncode import timeutils +from commoncode.timeutils import time2tstamp from scancode import scans_cache_dir @@ -48,25 +51,30 @@ """ Cache scan results for a file or directory disk using a file-based cache. -The approach is to cache the scan of a file using these files: - - one "global" file contains a log of all the paths scanned. - - for each file being scanned, we store a file that contains the corresponding file - info data as JSON. This file is named after the hash of the path of a scanned file. - - for each unique file being scanned (e.g. based on its content SHA1), we store a - another JSON file that contains the corresponding scan data. This file is named - after the hash of the scanned file content. +The approach is to cache the scan of a file using these data structure and files: + + - a resource_paths list contains all the paths scanned. + + - for each file being scanned, we store a file that contains the corresponding + file info data as JSON. This file is named after the hash of the path of a + scanned file. + + - for each unique file being scanned (e.g. based on its content SHA1), we store + a another JSON file that contains the corresponding scan data. This file is + named after the hash of the scanned file content. Once a scan is completed, we iterate the cache to output the final scan results: -First iterate the global log file to get the paths, from there collect the cached -file info for that file and from the path and file info collect the cached scanned -result. This iterator is then streamed to the final JSON output. +First iterate the resource_paths, from there collect the cached file info for +that file and from the path and file info collect the cached scanned result. +This iterator is then streamed to the final JSON output. Finally once a scan is completed the cache is destroyed to free up disk space. -Internally the cache is organized as a tree of directories named after the first few -characters or a path hash or file hash. This is to avoid having having too many files -per directory that can make some filesystems choke as well as having directories that -are too deep or having file paths that are too long which problematic on some OS. +Internally the cache is organized as a tree of directories named after the first +few characters or a path hash or file hash. This is to avoid having having too +many files per directory that can make some filesystems choke as well as having +directories that are too deep or having file paths that are too long which +problematic on some OS. """ # Tracing flags @@ -84,17 +92,18 @@ def logger_debug(*args): logger.setLevel(logging.DEBUG) def logger_debug(*args): - return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) + return logger.debug(' '.join(isinstance(a, unicode) + and a or repr(a) for a in args)) def get_cache_dir(base_cache_dir=scans_cache_dir): """ Return a new, created and unique cache storage directory. """ + create_dir(base_cache_dir) # create a unique temp directory in cache_dir - fileutils.create_dir(base_cache_dir) - prefix = timeutils.time2tstamp() + u'-' - cache_dir = fileutils.get_temp_dir(base_cache_dir, prefix=prefix) + prefix = time2tstamp() + u'-' + cache_dir = get_temp_dir(base_cache_dir, prefix=prefix) if on_linux: cache_dir = path_to_bytes(cache_dir) return cache_dir @@ -102,7 +111,8 @@ def get_cache_dir(base_cache_dir=scans_cache_dir): def get_scans_cache_class(base_cache_dir=scans_cache_dir): """ - Return a new persistent cache class configured with a unique storage directory. + Return a new persistent cache class configured with a unique storage + directory. """ cache_dir = get_cache_dir(base_cache_dir=base_cache_dir) sc = ScanFileCache(cache_dir) @@ -134,7 +144,8 @@ def info_keys(path, seed=None): def scan_keys(path, file_info): """ Return a scan cache keys tripple for a path and file_info. If the file_info - sha1 is empty (e.g. such as a directory), return a key based on the path instead. + sha1 is empty (e.g. such as a directory), return a key based on the path + instead. """ # we "get" because in some off cases getting file info may have failed # or there may be none for a directory @@ -151,12 +162,13 @@ def keys_from_hash(hexdigest): """ Return a cache keys triple for a hash hexdigest string. - NOTE: since we use the first character and next two characters as directories, we - create at most 16 dir at the first level and 16 dir at the second level for each - first level directory for a maximum total of 16*16 = 256 directories. For a - million files we would have about 4000 files per directory on average with this - scheme which should keep most file systems happy and avoid some performance - issues when there are too many files in a single directory. + NOTE: since we use the first character and next two characters as + directories, we create at most 16 dir at the first level and 16 dir at the + second level for each first level directory for a maximum total of 16*16 = + 256 directories. For a million files we would have about 4000 files per + directory on average with this scheme which should keep most file systems + happy and avoid some performance issues when there are too many files in a + single directory. For example: >>> expected = ('f', 'b', '87db2bb28e9501ac7fdc4812782118f4c94a0f') @@ -169,8 +181,9 @@ def keys_from_hash(hexdigest): def paths_from_keys(base_path, keys): """ - Return a tuple of (parent dir path, filename) for a cache entry built from a cache - keys triple and a base_directory. Ensure that the parent directory exist. + Return a tuple of (parent dir path, filename) for a cache entry built from a + cache keys triple and a base_directory. Ensure that the parent directory + exist. """ if on_linux: keys = [path_to_bytes(k) for k in keys] @@ -181,53 +194,39 @@ def paths_from_keys(base_path, keys): dir1, dir2, file_name = keys parent = os.path.join(base_path, dir1, dir2) - fileutils.create_dir(parent) + create_dir(parent) return parent, file_name class ScanFileCache(object): """ - A file-based cache for scan results saving results in files and using no locking. - This is NOT thread-safe and NOT multi-process safe but works OK in our context: - we cache the scan for a given file once and read it only a few times. + A file-based cache for scan results saving results in files and using no + locking. This is NOT thread-safe and NOT multi-process safe but works OK in + our context: we cache the scan for a given file once and read it only a few + times. """ def __init__(self, cache_dir): # subdirs for info and scans_dir caches if on_linux: infos_dir = b'infos_dir/' scans_dir = b'scans_dir/' - files_log = b'files_log' self.cache_base_dir = path_to_bytes(cache_dir) else: infos_dir = u'infos_dir/' scans_dir = u'scans_dir/' - files_log = u'files_log' self.cache_base_dir = cache_dir self.cache_infos_dir = as_posixpath(os.path.join(self.cache_base_dir, infos_dir)) self.cache_scans_dir = as_posixpath(os.path.join(self.cache_base_dir, scans_dir)) - self.cache_files_log = as_posixpath(os.path.join(self.cache_base_dir, files_log)) def setup(self): """ Setup the cache: must be called at least once globally after cache initialization. """ - fileutils.create_dir(self.cache_infos_dir) - fileutils.create_dir(self.cache_scans_dir) - - @classmethod - def log_file_path(cls, logfile_fd, path): - """ - Log file path in the cache logfile_fd **opened** file descriptor. - """ - # we dump one path per line written as bytes or unicode - if on_linux: - path = path_to_bytes(path) + b'\n' - else: - path = path_to_unicode(path) + '\n' - logfile_fd.write(path) + create_dir(self.cache_infos_dir) + create_dir(self.cache_scans_dir) def get_cached_info_path(self, path): """ @@ -239,8 +238,8 @@ def get_cached_info_path(self, path): def put_info(self, path, file_info): """ - Put file_info for path in the cache and return True if the file referenced - in file_info has already been scanned or False otherwise. + Put file_info for path in the cache and return True if the file + referenced in file_info has already been scanned or False otherwise. """ info_path = self.get_cached_info_path(path) with codecs.open(info_path, 'wb', encoding='utf-8') as cached_infos: @@ -248,7 +247,9 @@ def put_info(self, path, file_info): scan_path = self.get_cached_scan_path(path, file_info) is_scan_cached = os.path.exists(scan_path) if TRACE: - logger_debug('put_infos:', 'path:', path, 'is_scan_cached:', is_scan_cached, 'file_info:', file_info, '\n') + logger_debug( + 'put_infos:', 'path:', path, 'is_scan_cached:', is_scan_cached, + 'file_info:', file_info, '\n') return is_scan_cached def get_info(self, path): @@ -263,7 +264,8 @@ def get_info(self, path): def get_cached_scan_path(self, path, file_info): """ - Return the path where to store a scan in the cache given a path and file_info. + Return the path where to store a scan in the cache given a path and + file_info. """ keys = scan_keys(path, file_info) paths = paths_from_keys(self.cache_scans_dir, keys) @@ -278,7 +280,9 @@ def put_scan(self, path, file_info, scan_result): with codecs.open(scan_path, 'wb', encoding='utf-8') as cached_scan: json.dump(scan_result, cached_scan, check_circular=False) if TRACE: - logger_debug('put_scan:', 'scan_path:', scan_path, 'file_info:', file_info, 'scan_result:', scan_result, '\n') + logger_debug( + 'put_scan:', 'scan_path:', scan_path, 'file_info:', file_info, + 'scan_result:', scan_result, '\n') def get_scan(self, path, file_info): """ @@ -290,93 +294,88 @@ def get_scan(self, path, file_info): with codecs.open(scan_path, 'r', encoding='utf-8') as cached_scan: return json.load(cached_scan, object_pairs_hook=OrderedDict) - def iterate(self, scan_names, root_dir=None, paths_subset=tuple()): + def iterate(self, resource_paths, scan_names, root_dir=None, paths_subset=tuple()): """ - Yield scan data for all cached scans e.g. the whole cache given - a list of scan names. - If a `paths_subset` sequence of paths is provided, then only - these paths are iterated. + Yield scan data for all cached scans e.g. the whole cache given a list + of `resource_paths` and `scan_names`. - The logfile MUST have been closed before calling this method. + If a `paths_subset` sequence of paths is provided, then only these paths + are iterated. """ if on_linux: paths_subset = set(path_to_bytes(p) for p in paths_subset) else: paths_subset = set(path_to_unicode(p) for p in paths_subset) - if on_linux: - log_opener = partial(open, self.cache_files_log, 'rb') - else: - log_opener = partial(codecs.open, self.cache_files_log, 'rb', encoding='utf-8') - EOL = b'\n' if on_linux else '\n' + for resource_path in resource_paths: + if paths_subset and resource_path not in paths_subset: + continue + file_info = self.get_info(resource_path) - with log_opener() as cached_files: - # iterate paths, one by line - for file_log in cached_files: - # must be unicode - path = file_log.rstrip(EOL) - if paths_subset and path not in paths_subset: - continue - file_info = self.get_info(path) + if on_linux: + unicode_path = path_to_unicode(resource_path) + else: + unicode_path = resource_path + if root_dir: + # must be unicode if on_linux: - unicode_path = path_to_unicode(path) - else: - unicode_path = path - - if root_dir: - # must be unicode - if on_linux: - root_dir = path_to_unicode(root_dir) - rooted_path = posixpath.join(root_dir, unicode_path) - else: - rooted_path = unicode_path - rooted_path = fileutils.as_posixpath(rooted_path) - logger_debug('iterate:', 'rooted_path:', rooted_path) - - # rare but possible corner case - if file_info is None: - no_info = ('ERROR: file info unavailable in cache: ' - 'This is either a bug or processing was aborted with CTRL-C.') - scan_result = OrderedDict(path=rooted_path) - scan_result['scan_errors'] = [no_info] - if TRACE: - logger_debug('iterate:', 'scan_result:', scan_result, 'for path:', rooted_path, '\n') - yield scan_result - continue - - _unicode_path_from_file_info = file_info.pop('path') + root_dir = path_to_unicode(root_dir) + rooted_path = posixpath.join(root_dir, unicode_path) + else: + rooted_path = unicode_path + rooted_path = as_posixpath(rooted_path) + logger_debug('iterate:', 'rooted_path:', rooted_path) + + # rare but possible corner case + if file_info is None: + no_info = ('ERROR: file info unavailable in cache: ' + 'This is either a bug or processing was aborted ' + 'with CTRL-C.') scan_result = OrderedDict(path=rooted_path) - - if 'infos' in scan_names: - # info are always collected but only returned if requested - # we flatten these as direct attributes of a file object - scan_result.update(file_info.items()) - - if not scan_result.get('scan_errors'): - scan_result['scan_errors'] = [] - - # check if we have more than just infos - if ['infos'] != scan_names: - errors = scan_result['scan_errors'] - scan_details = self.get_scan(path, file_info) - if scan_details is None: - no_scan_details = ( - 'ERROR: scan details unavailable in cache: ' - 'This is either a bug or processing was aborted with CTRL-C.') - errors.append(no_scan_details) - else: - # append errors to other top level errors if any - scan_errors = scan_details.pop('scan_errors', []) - errors.extend(scan_errors) - scan_result.update(scan_details) - + scan_result['scan_errors'] = [no_info] if TRACE: - logger_debug('iterate:', 'scan_result:', scan_result, 'for path:', rooted_path, '\n') + logger_debug( + 'iterate:', 'scan_result:', scan_result, + 'for resource_path:', rooted_path, '\n') yield scan_result + continue + + _unicode_path_from_file_info = file_info.pop('path') + scan_result = OrderedDict(path=rooted_path) + + if 'infos' in scan_names: + # info are always collected but only returned if requested + # we flatten these as direct attributes of a file object + scan_result.update(file_info.items()) + + if not scan_result.get('scan_errors'): + scan_result['scan_errors'] = [] + + # check if we have more than just infos + if ['infos'] != scan_names: + errors = scan_result['scan_errors'] + scan_details = self.get_scan(resource_path, file_info) + if scan_details is None: + no_scan_details = ( + 'ERROR: scan details unavailable in cache: ' + 'This is either a bug or processing was aborted with ' + 'CTRL-C.') + errors.append(no_scan_details) + else: + # append errors to other top level errors if any + scan_errors = scan_details.pop('scan_errors', []) + errors.extend(scan_errors) + scan_result.update(scan_details) + + if TRACE: + logger_debug( + 'iterate:', 'scan_result:', scan_result, + 'for resource_path:', rooted_path, '\n') + yield scan_result def clear(self, *args): """ Purge the cache by deleting the corresponding cached data files. """ - fileutils.delete(self.cache_base_dir) + delete(self.cache_base_dir) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index f968808db61..6cc34767373 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -30,7 +30,6 @@ # Import early because this import has monkey-patching side effects from scancode.pool import get_pool -import codecs from collections import namedtuple from collections import OrderedDict from functools import partial @@ -56,9 +55,7 @@ from commoncode.fileutils import path_to_bytes from commoncode.fileutils import path_to_unicode from commoncode.fileutils import resource_iter - from commoncode import ignore - from commoncode.system import on_linux from commoncode.text import toascii @@ -68,7 +65,6 @@ from scancode import __version__ as version from scancode import ScanOption - from scancode.api import DEJACODE_LICENSE_URL from scancode.api import _empty_file_infos from scancode.api import get_copyrights @@ -78,15 +74,11 @@ from scancode.api import get_package_infos from scancode.api import get_urls from scancode.api import Resource - from scancode.cache import get_scans_cache_class -from scancode.cache import ScanFileCache - from scancode.interrupt import DEFAULT_TIMEOUT from scancode.interrupt import fake_interruptible from scancode.interrupt import interruptible from scancode.interrupt import TimeoutError - from scancode.utils import BaseCommand from scancode.utils import compute_fn_max_len from scancode.utils import fixed_width_file_name @@ -588,83 +580,77 @@ def scan_all(input_path, scanners, pool = None - # FIXME: THIS IS NOT where PRE SCANS should take place!!! - resources = resource_paths( - input_path, diag, scans_cache_class, pre_scan_plugins=pre_scan_plugins) + resources = get_resources(input_path, diag, scans_cache_class) + + # FIXME: we should try/catch here + for plugin in pre_scan_plugins: + resources = plugin.process_resources(resources) + + resources = list(resources) paths_with_error = [] files_count = 0 - #FIXME: we should NOT USE a logfile!!! - logfile_path = scans_cache_class().cache_files_log - if on_linux: - file_logger = partial(open, logfile_path, 'wb') - else: - file_logger = partial(codecs.open, logfile_path, 'w', encoding='utf-8') - - with file_logger() as logfile_fd: - logged_resources = _resource_logger(logfile_fd, resources) + scanit = partial(_scanit, scanners=scanners, scans_cache_class=scans_cache_class, + diag=diag, timeout=timeout, processes=processes) - scanit = partial(_scanit, scanners=scanners, scans_cache_class=scans_cache_class, - diag=diag, timeout=timeout, processes=processes) + max_file_name_len = compute_fn_max_len() + # do not display a file name in progress bar if there is less than 5 chars available. + display_fn = bool(max_file_name_len > 10) + try: + if processes: + # maxtasksperchild helps with recycling processes in case of leaks + pool = get_pool(processes=processes, maxtasksperchild=1000) + # Using chunksize is documented as much more efficient in the Python doc. + # Yet "1" still provides a better and more progressive feedback. + # With imap_unordered, results are returned as soon as ready and out of order. + scanned_files = pool.imap_unordered(scanit, resources, chunksize=1) + pool.close() + else: + # no multiprocessing with processes=0 + scanned_files = imap(scanit, resources) + if not quiet: + echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') - max_file_name_len = compute_fn_max_len() - # do not display a file name in progress bar if there is less than 5 chars available. - display_fn = bool(max_file_name_len > 10) - try: - if processes: - # maxtasksperchild helps with recycling processes in case of leaks - pool = get_pool(processes=processes, maxtasksperchild=1000) - # Using chunksize is documented as much more efficient in the Python doc. - # Yet "1" still provides a better and more progressive feedback. - # With imap_unordered, results are returned as soon as ready and out of order. - scanned_files = pool.imap_unordered(scanit, logged_resources, chunksize=1) - pool.close() + if not quiet: + echo_stderr('Scanning files...', fg='green') + + def scan_event(item): + """Progress event displayed each time a file is scanned""" + if quiet or not item or not display_fn: + return '' + _scan_success, _scanned_path = item + _scanned_path = unicode(toascii(_scanned_path)) + if verbose: + _progress_line = _scanned_path else: - # no multiprocessing with processes=0 - scanned_files = imap(scanit, logged_resources) - if not quiet: - echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') - - if not quiet: - echo_stderr('Scanning files...', fg='green') - - def scan_event(item): - """Progress event displayed each time a file is scanned""" - if quiet or not item or not display_fn: - return '' - _scan_success, _scanned_path = item - _scanned_path = unicode(toascii(_scanned_path)) - if verbose: - _progress_line = _scanned_path - else: - _progress_line = fixed_width_file_name(_scanned_path, max_file_name_len) - return style('Scanned: ') + style(_progress_line, fg=_scan_success and 'green' or 'red') - - scanning_errors = [] - files_count = 0 - with progressmanager( - scanned_files, item_show_func=scan_event, show_pos=True, - verbose=verbose, quiet=quiet, file=sys.stderr) as scanned: - while True: - try: - result = scanned.next() - scan_success, scanned_rel_path = result - if not scan_success: - paths_with_error.append(scanned_rel_path) - files_count += 1 - except StopIteration: - break - except KeyboardInterrupt: - print('\nAborted with Ctrl+C!') - if pool: - pool.terminate() - break - finally: - if pool: - # ensure the pool is really dead to work around a Python 2.7.3 bug: - # http://bugs.python.org/issue15101 - pool.terminate() + _progress_line = fixed_width_file_name(_scanned_path, max_file_name_len) + return style('Scanned: ') + style(_progress_line, fg=_scan_success and 'green' or 'red') + + scanning_errors = [] + files_count = 0 + with progressmanager( + scanned_files, item_show_func=scan_event, show_pos=True, + verbose=verbose, quiet=quiet, file=sys.stderr) as scanned: + while True: + try: + result = scanned.next() + scan_success, scanned_rel_path = result + if not scan_success: + paths_with_error.append(scanned_rel_path) + files_count += 1 + except StopIteration: + break + except KeyboardInterrupt: + print('\nAborted with Ctrl+C!') + if pool: + pool.terminate() + break + finally: + if pool: + # ensure the pool is really dead to work around a Python 2.7.3 bug: + # http://bugs.python.org/issue15101 + pool.terminate() # TODO: add stats to results somehow @@ -690,7 +676,8 @@ def scan_event(item): # iterate cached results to collect all scan errors cached_scan = scans_cache_class() root_dir = _get_root_dir(input_path, strip_root, full_root) - scan_results = cached_scan.iterate(scans, root_dir, paths_subset=paths_with_error) + resource_paths = (r.rel_path for r in resources) + scan_results = cached_scan.iterate(resource_paths, scans, root_dir, paths_subset=paths_with_error) for scan_result in scan_results: errored_path = scan_result.get('path', '') echo_stderr('Path: ' + errored_path, fg='red') @@ -720,7 +707,8 @@ def scan_event(item): ############################################# ############################################# ############################################# - return files_count, cached_scan.iterate(scans, root_dir), success + resource_paths = (r.rel_path for r in resources) + return files_count, cached_scan.iterate(resource_paths, scans, root_dir), success def _get_root_dir(input_path, strip_root=False, full_root=False): @@ -745,17 +733,6 @@ def _get_root_dir(input_path, strip_root=False, full_root=False): return file_name(root_dir) -def _resource_logger(logfile_fd, resources): - """ - Log file path to the logfile_fd opened file descriptor for each resource and - yield back the resources. - """ - file_logger = ScanFileCache.log_file_path - for resource in resources: - file_logger(logfile_fd, resource.rel_path) - yield resource - - def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT, processes=1): """ Run scans and cache results on disk. Return a tuple of (success, scanned relative @@ -797,65 +774,32 @@ def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT return success, resource.rel_path -def build_ignorer(ignores, unignores): +def get_resources(base_path, diag, scans_cache_class): """ - Return a callable suitable for path ignores with OS-specific encoding - preset. + Yield `Resource` objects for all the files found at base_path (either a + directory or file) given an absolute base_path. """ - ignores = ignores or {} - unignores = unignores or {} if on_linux: - ignores = {path_to_bytes(k): v for k, v in ignores.items()} - unignores = {path_to_bytes(k): v for k, v in unignores.items()} + base_path = base_path and path_to_bytes(base_path) else: - ignores = {path_to_unicode(k): v for k, v in ignores.items()} - unignores = {path_to_unicode(k): v for k, v in unignores.items()} - return partial(ignore.is_ignored, ignores=ignores, unignores=unignores) - - -def resource_paths(base_path, diag, scans_cache_class, pre_scan_plugins=None): - """ - Yield `Resource` objects for all the files found at base_path - (either a directory or file) given an absolute base_path. Only yield - Files, not directories. - absolute path is a native OS path. - base_path-relative path is a POSIX path. - - The relative path is guaranted to be unicode and may be URL-encoded and may not - be suitable to address an actual file. - """ - if base_path: - if on_linux: - base_path = path_to_bytes(base_path) - else: - base_path = path_to_unicode(base_path) + base_path = base_path and path_to_unicode(base_path) base_path = os.path.abspath(os.path.normpath(os.path.expanduser(base_path))) base_is_dir = is_dir(base_path) len_base_path = len(base_path) - ignores = {} - if pre_scan_plugins: - for plugin in pre_scan_plugins: - ignores.update(plugin.get_ignores()) - ignores.update(ignore.ignores_VCS) - - ignorer = build_ignorer(ignores, unignores={}) - locations = resource_iter(base_path, ignored=ignorer) - - resources = build_resources(locations, scans_cache_class, base_is_dir, len_base_path, diag) - if pre_scan_plugins: - for plugin in pre_scan_plugins: - resources = plugin.process_resources(resources) - return resources + ignores = ignore.ignores_VCS + if on_linux: + ignores = {path_to_bytes(k): v for k, v in ignores.items()} + else: + ignores = {path_to_unicode(k): v for k, v in ignores.items()} + ignorer = partial(ignore.is_ignored, ignores=ignores, unignores={}, skip_special=True) -def build_resources(locations, scans_cache_class, base_is_dir, len_base_path, diag): - """ - Yield Resource objects from an iterable of absolute paths. - """ + locations = resource_iter(base_path, ignored=ignorer, with_dirs=True) for abs_path in locations: resource = Resource(scans_cache_class, abs_path, base_is_dir, len_base_path) - # always fetch infos and cache. + # FIXME: they should be kept in memory instead + # always fetch infos and cache them. infos = scan_infos(abs_path, diag=diag) resource.put_info(infos) yield resource diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 4f93a98a213..cf0286438d4 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -25,17 +25,42 @@ from __future__ import absolute_import from __future__ import unicode_literals +from commoncode import fileset +from commoncode.fileutils import parent_directory +from commoncode.system import on_linux from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl from scancode.cli import ScanOption +def is_ignored(location, ignores): + """ + Return a tuple of (pattern , message) if a file at location is ignored or + False otherwise. `ignores` is a mappings of patterns to a reason. + """ + return fileset.match(location, includes=ignores, excludes={}) + + @pre_scan_impl class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ + def __init__(self, selected_options, active_scan_names=None): + PreScanPlugin.__init__( + self, selected_options, active_scan_names=active_scan_names) + + ignores = [] + for se in selected_options: + if se.name == 'ignore': + ignores = se.value or [] + + self.ignores = { + pattern: 'User ignore: Supplied by --ignore' for pattern in ignores + } + + @classmethod def get_plugin_options(cls): return [ @@ -45,17 +70,19 @@ def get_plugin_options(cls): help='Ignore files matching .') ] - # FIXME:!!!! - def get_ignores(self): - user_ignores = [] - for se in self.selected_options: - if se.name == 'ignore': - user_ignores=se.value - - return {pattern: 'User ignore: Supplied by --ignore' for pattern in user_ignores} + def process_resources(self, resources): + # FIXME: this is hacksih at best + ignored_paths = set() + seps = b'/\\' if on_linux else '/\\' + for resource in resources: + abs_path = resource.abs_path.strip(seps) + if is_ignored(abs_path, ignores=self.ignores): + ignored_paths.add(abs_path) + else: + parent = parent_directory(abs_path).strip(seps) + if parent not in ignored_paths: + yield resource def is_enabled(self): return any(se.value for se in self.selected_options - if se.name == 'ignore') - - PreScanPlugin.is_enabled(self) \ No newline at end of file + if se.name == 'ignore') diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py index c92d53c102a..020d7ff9974 100644 --- a/tests/scancode/test_ignore_files.py +++ b/tests/scancode/test_ignore_files.py @@ -31,7 +31,7 @@ from commoncode.ignore import is_ignored from scancode.cache import get_scans_cache_class from scancode.cli import CommandOption -from scancode.cli import resource_paths +from scancode.cli import get_resources from scancode.plugin_ignore import ProcessIgnore @@ -74,9 +74,9 @@ def test_ignore_glob_file(self): def test_resource_paths_with_single_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore( + test_plugins = [ProcessIgnore( [CommandOption(group=None, name='ignore', option='--ignore', value=('sample.doc',), default=None)] - ) + )] scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -86,14 +86,19 @@ def test_resource_paths_with_single_file(self): 'user/src/test', 'user/src/test/sample.txt' ] - test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, [test_plugin])] - assert expected == sorted(test) + + resources = get_resources(test_dir, False, scan_cache_class) + for plugin in test_plugins: + resources = plugin.process_resources(resources) + + resources = [resource.rel_path for resource in resources] + assert expected == sorted(resources) def test_resource_paths_with_multiple_files(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore( + test_plugins = [ProcessIgnore( [CommandOption(group=None, name='ignore', option='--ignore', value=('ignore.doc',), default=None)] - ) + )] scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -102,14 +107,18 @@ def test_resource_paths_with_multiple_files(self): 'user/src/test/sample.doc', 'user/src/test/sample.txt' ] - test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, [test_plugin])] - assert expected == sorted(test) + resources = get_resources(test_dir, False, scan_cache_class) + for plugin in test_plugins: + resources = plugin.process_resources(resources) + + resources = [resource.rel_path for resource in resources] + assert expected == sorted(resources) def test_resource_paths_with_glob_file(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore( + test_plugins = [ProcessIgnore( [CommandOption(group=None, name='ignore', option='--ignore', value=('*.doc',), default=None)] - ) + )] scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -117,14 +126,18 @@ def test_resource_paths_with_glob_file(self): 'user/src/test', 'user/src/test/sample.txt' ] - test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, [test_plugin])] - assert expected == sorted(test) + resources = get_resources(test_dir, False, scan_cache_class) + for plugin in test_plugins: + resources = plugin.process_resources(resources) + + resources = [resource.rel_path for resource in resources] + assert expected == sorted(resources) def test_resource_paths_with_glob_path(self): test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugin = ProcessIgnore( + test_plugins = [ProcessIgnore( [CommandOption(group=None, name='ignore', option='--ignore', value=('*/src/test',), default=None)] - ) + )] scan_cache_class = get_scans_cache_class(self.get_temp_dir()) expected = [ 'user', @@ -132,8 +145,12 @@ def test_resource_paths_with_glob_path(self): 'user/src', 'user/src/ignore.doc' ] - test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, [test_plugin])] - assert expected == sorted(test) + resources = get_resources(test_dir, False, scan_cache_class) + for plugin in test_plugins: + resources = plugin.process_resources(resources) + + resources = [resource.rel_path for resource in resources] + assert expected == sorted(resources) def test_resource_paths_with_multiple_plugins(self): test_dir = self.extract_test_tar('ignore/user.tgz') @@ -151,5 +168,9 @@ def test_resource_paths_with_multiple_plugins(self): 'user/src', 'user/src/test' ] - test = [resource.rel_path for resource in resource_paths(test_dir, False, scan_cache_class, test_plugins)] - assert expected == sorted(test) + resources = get_resources(test_dir, False, scan_cache_class) + for plugin in test_plugins: + resources = plugin.process_resources(resources) + + resources = [resource.rel_path for resource in resources] + assert expected == sorted(resources) From 0c3625b0343e6edc223ffe48deffe74e66a5c252 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 5 Jan 2018 09:09:19 +0100 Subject: [PATCH 020/122] Add new extract_zip_raw test function Signed-off-by: Philippe Ombredanne --- src/commoncode/testcase.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/commoncode/testcase.py b/src/commoncode/testcase.py index 780fd74a29d..096f39727bd 100644 --- a/src/commoncode/testcase.py +++ b/src/commoncode/testcase.py @@ -247,7 +247,6 @@ def remove_vcs(self, test_dir): map(os.remove, [os.path.join(root, file_loc) for file_loc in files if file_loc.endswith(tilde)]) - def __extract(self, test_path, extract_func=None, verbatim=False): """ Given an archive file identified by test_path relative @@ -272,6 +271,9 @@ def __extract(self, test_path, extract_func=None, verbatim=False): def extract_test_zip(self, test_path, *args, **kwargs): return self.__extract(test_path, extract_zip) + def extract_test_zip_raw(self, test_path, *args, **kwargs): + return self.__extract(test_path, extract_zip_raw) + def extract_test_tar(self, test_path, verbatim=False): return self.__extract(test_path, extract_tar, verbatim) @@ -353,6 +355,22 @@ def extract_zip(location, target_dir, *args, **kwargs): f.write(content) +def extract_zip_raw(location, target_dir, *args, **kwargs): + """ + Extract a zip archive file at location in the target_dir directory. + Use the builtin extractall function + """ + if not os.path.isfile(location) and zipfile.is_zipfile(location): + raise Exception('Incorrect zip file %(location)r' % locals()) + + if on_linux: + location = path_to_bytes(location) + target_dir = path_to_bytes(target_dir) + + with zipfile.ZipFile(location) as zipf: + zipf.extractall(path=target_dir) + + def tar_can_extract(tarinfo, verbatim): """ Return True if a tar member can be extracted to handle OS specifics. From 9884c9f293df54cddf765f5cf69a652f2de72e3f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 5 Jan 2018 11:09:20 +0100 Subject: [PATCH 021/122] Bump attrs and add typing library #787 Signed-off-by: Philippe Ombredanne --- .../prod/attrs-16.3.0-py2.py3-none-any.whl | Bin 21266 -> 0 bytes .../prod/attrs-17.4.0-py2.py3-none-any.whl | Bin 0 -> 31658 bytes thirdparty/prod/attrs.ABOUT | 8 +- thirdparty/prod/typing-3.6.2-py2-none-any.whl | Bin 0 -> 20226 bytes thirdparty/prod/typing.ABOUT | 9 + thirdparty/prod/typing.LICENSE | 254 ++++++++++++++++++ 6 files changed, 267 insertions(+), 4 deletions(-) delete mode 100644 thirdparty/prod/attrs-16.3.0-py2.py3-none-any.whl create mode 100644 thirdparty/prod/attrs-17.4.0-py2.py3-none-any.whl create mode 100644 thirdparty/prod/typing-3.6.2-py2-none-any.whl create mode 100644 thirdparty/prod/typing.ABOUT create mode 100644 thirdparty/prod/typing.LICENSE diff --git a/thirdparty/prod/attrs-16.3.0-py2.py3-none-any.whl b/thirdparty/prod/attrs-16.3.0-py2.py3-none-any.whl deleted file mode 100644 index 6124236be40a718dc5d02fa4c6304234177c87b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21266 zcmaI8W3XsJvn6NQJz%VNd*{{#37NS+#&BSOCcOT$d4*=()eLL0{rbI_UG_8h*vLW`S=+n>Uz2K5> zA8%-@3}%-TC8HPb(@zsIregb0K7uX`LXk;a?2`&v#X)TUbn$cYdL^n-G>kEfkZT9G z>BJ5L6U4|QJ;-66pUC&k7T9PAd%i%niW!_K8oyXQar}kR3yuujrQ!)GdNhOPL0`Vj zu2GC;AaG3uuaq~DYY zeZiJA1*dS~&;I&6VT^2%oq_}3(KyknpCY$andY{8ie&o|66zxq9WG-p%&sVrdSnYz zuzRy(L4TL4lt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b*-QL@uM-?`hot|n84Ab7JhO}`w z4szI_8>kdZzZzZX@rIj-17<M!V1fG%6 zkhCFSvq9Y24N0YLX}lvWQ#5rSr`r)uxWZ5?{i=ZCod$EMerpxe!7H4~F%dD$HE%h1 z;xxyc_c=MZ=dn2VQmE6b)AP46CuXiVGS;_C1Au|t1eWjVCu(c!`XWjK%E{iMuH;{v z$G0Cevemf*W|2#5!~9sEq~Mz?0AW7Zumo@BmfNL^q-3n*f8V(~yeR(n$qWARb$s>i zclu9DX+K#KlDy!(L(B4${{P*y-{C*)Lmk0thqu@N!oSv{euw`wpmYS=9L_5Jg#VpW z`knpLR>l!qLH{rNYdPb0^iO@WBeYQX7y6&}+3)ZnZN1b<9Wvo-BBJM_Sd}s_`2hX z$Cb@dA_x4hiT@Ee#}kjco1;YAzbF3Bks{T b)Lptrd3e?QDC+@8*bmRfg~M4a5|aM|UNkzP diff --git a/thirdparty/prod/attrs-17.4.0-py2.py3-none-any.whl b/thirdparty/prod/attrs-17.4.0-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..54a2652c9dbfd6f54bbcf45b6aef38e71b0a0f58 GIT binary patch literal 31658 zcmY(qLy#~`l(gHnZQHi{ZQHhO+qP}nwr$(C{eN>86L(e>ah4TNWS+{%l9vJoK>+{& zfB^6j$dyt>Pv8dv0ssgH0RTYwZ))J|>`1StXJKpMtfxn3@8O~(6Su^G(DS7hJy?RO z&>1Bl-cQ5_a*d}Br+nxif5IipT!}5#x)kR(w;r3+h}t{deU@Q1=f17p1U{QJ0I%u* z*M1lCLclhAK0uvo56Ox*UvMFLPV1VB#B~A5yb2Nm5wk!C{XFQ2;<;VRL@VPaze;^2 zDNkPUnJ?%Y#FYSE(15n9&Ti@`Xt2<4b)|^oGX1oQc#6Rk@KXLFG6xYM5L*0ftJ) zn!~cn|Gk1qPo7 zV`<_g^GN7hpMI!$_r+ed^59-wsBUuYii#Q&jVRZWCk%K8#iS7&{`R12m|tX_*u(E; z3C?d)HKH)C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LJPrc40R&Xd7|ZBf0toxyty9iL6g92u2?j}mQ<&^_vHjxR?b?FLPfbjMkNTrUNqNqT~*h4C!rZPH*?tn z04y8!a7bKl%^Z$!&}H!1oX?7(+1FVhodo(LBuOwJLuS`Atima%YAN4(JJZ?^A(KcA ztJB60%w}AtHnxu9ph-le%bmBTv3t!Qk@(PI>|XP&B7Sb7A?)u3@S};mKiDS0kV;%A zKNg_Wg`s)QcFi+Sqk(fl3y8|BZ?LP9j@xWu-6C4gBJ$F~vK>q}(rGy`Mk>+zroMMY z$()V8F6qb92IXEgC9+BrTLh-rofRVVQq;Va#AxF!oMbLuHGi?>VvaAUvz%xv8-KL% zD={LqH#1P21l`Uo#wU1DzUA3pIsf>4Rum8j1^A!)=YCG0f4vI){#gCqP4~am|Erto zzqJ4W1%C9OiG_cw|F5^|@8aK^5B??Q{balU5&zkW@OSa=-TD3!Ye4)*{GVQZziWT* zJ@l8h<@34OfB*2Gorr#y{%!*MOKKtbr}S@@u;2B+`=I{P7YqHV|C=l7cm40inZNW+ zB7f@tveEo5{@ttbm)Q5~pW?qcH~w4yzn(1qOOGV|Z~gy3=f6E?{CmvbbEtpC^wRpr znE#bg{XO3ANv*%)aeZ?BKmObQv5kLAas3|g_guqY5g+ycG2-7c55GtJJ?ZdQL_ULm zjQFn<#P5-Q&l3CMed$8Y6q<;kia{9;3`uAy7P7)OCkFO(qzEwWY!@RD4 GeENUQ%0Vvx literal 0 HcmV?d00001 diff --git a/thirdparty/prod/attrs.ABOUT b/thirdparty/prod/attrs.ABOUT index dca5af0e243..b2cdd3b73a3 100644 --- a/thirdparty/prod/attrs.ABOUT +++ b/thirdparty/prod/attrs.ABOUT @@ -1,8 +1,8 @@ -about_resource: attrs-16.3.0-py2.py3-none-any.whl -version: 16.3.0 +about_resource: attrs-17.4.0-py2.py3-none-any.whl +version: 17.4.0 name: attrs home_url: http://attrs.org -download_url: https://pypi.python.org/packages/bb/6c/730710c765ab6d4493f460196ab003671d27b38568412a780fc67532b47c/attrs-16.3.0-py2.py3-none-any.whl#md5=0d188abbbde8c83253cb11e8df890d30 +download_url: https://pypi.python.org/packages/b5/60/4e178c1e790fd60f1229a9b3cb2f8bc2f4cc6ff2c8838054c142c70b5adc/attrs-17.4.0-py2.py3-none-any.whl#md5=5835a573b3f0316e1602dac3fd9c1daf license_text_file: attrs.LICENSE dje_license: mit -copyright: Copyright (c) 2015 Hynek Schlawack \ No newline at end of file +copyright: Copyright (c) Hynek Schlawack \ No newline at end of file diff --git a/thirdparty/prod/typing-3.6.2-py2-none-any.whl b/thirdparty/prod/typing-3.6.2-py2-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..fa13a535f7483de67548699eabe99d76587276a1 GIT binary patch literal 20226 zcmV(zK<2+tO9KQH000080G%KROBD`)$?-z~0LB&p00{s90Cah9X>MmOaCzN*{d3zk z((v#8EBH8*k<`j;le>H79{1ciCzrOFUfWFL=6d7tsI&yxtR+$S!K^}&HFIX##o5cr~MH&r%mmZrHbXJhw!Rh27KHTSmev|KFAw8_h&wvXoP zV%n7D!ab-=lGRDw%oh3O1b!q>lGFEPK7-1|d|gA`#EX>mUo^VgREA-h}{_j{4m z^}DRHzrQqvsq(4)`P~ZplP&D;v-Qf?Jp;Px?+VNh1yq9{g68Rqmvu5Eeu>CFvM36# zyfw{Wj8&p?DZEGn6u&V|#zpJ(ppBsGz&? z)>Duoz<$$fGrg%{-lsQdmI51=O$ozjx$t}Q-c)t2dJEi(6RC#5j~~4(m%wRv@#8NR zW!A(GUl)zX2L@tVnZ_svVgZoafm*{zIRgI;`|Ez>)5gD;XX{0yAN@VA6`kDIFRJoa zQ>X{uW=k`ZnSv;NTcSLJiFXg|h`4A*meCgMzbnj9IiDvu`>)jW1u9$U)68RWWts^B zoIvr$(ePVytEXmBav2()&WDqknU(?Hl`vF5YB%y{z}xQoKi|BXy!`6b%dcO5`z1WQ zK#6t+a(Gpn^{hOC>9{Os>xHS4L1lPK4e}DcfS_JwAUMl8$?etpa*@$-x1^OI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TLI(>G(-du!K&_Ldk~WN?9&*#@U@=cSH7;ui zWVx`$hbr}j1$4i{?U;#rJ#O)MwTun+Y54l20HM-VLZ7uZCIhm;bnGFeLUpr3XS|!3 z`C0n+6q6)@wm!`ckDhlYi{`}_ur8bVrdYge9PGz`*+0}A8|als4`Mtk8~FzMt~%Uw zsSKIq?wY!gRZ^a*EDUdXY#GH`{m`>79y%>G6)%zAtcTQ4?###jhaNSv$}uX zfZ5?yl`W7kon$*~hWMHoDD?D{+>((Go`TP5Im*htP z4)isu?p7OH1wnWZ8Y35Y9F)w<|lr1d9IgB zbIF99cJRwqeF@vHptDBCUJ;Y{yeMNcxpogMASm116I`Q#`E;0gY&tex)x@2W%bb!! z`0Q<+;@3!IxlH-(9w9pl6P)$p*^a8GrlO;#>eT~z{!Z~c*`%M~kxmRl3^7Y7Adj4l zC_+QOj6QW;%i8Ozy5o2fs!^$wlF8N=Cpp_)6-B7d~|nkF2y@48815sNZ2|E^^+uk$OpR zM|jQK#(D3}&cc2AmK%m+FuqA0+skv?-~2zjr5k2zHKZsS{(&_!p9P*@)_uPHI)WKA z9LLWF0980%(9UIT9{{h0-{Kj>HFDHYTa$KNdb`GC5~5=JRT<+ELD8g+@$0{*#^d~& zuc(&Gaj9om(2MVlQJ47KNB+{Q2@QXM$8Ng-wV7D40aeoN2xU9qS*q}00rP+oa}_iR5LmD7a~5uYbHTilHBmi|04AOE=gBX#!Q-TqhY z^H(PTAoDSs>fhb|HBFwXgibS0R|Y?s+G=Mqf2k8r6HjM?pTrW4Gl{?Ch10~-3E?O4 z@ND9r>ESf#^d$b16bm}jw!f$J)3DQl_7ip;awhDru+xQ*k^gv{f^aer;&c@H Date: Sat, 6 Jan 2018 23:02:51 +0100 Subject: [PATCH 022/122] Make info a regular scan and other CLI loop reorg #787 * move and other file info code such as get_file_infos and Resource to new resource.py module. Make infos a proper, regular scan * Do use content checksum for scan cache, instead use plain path checksum. This enabled making info a proper scan, since content checksums are no longer needed for cache handling. * remove info cache and use only one cache file per file for its details * Reorganize scan steps to make them co-located and explicit: inventory pre-scan, scan and post-scan are not a set of clean loops * move most of the CLI output in the main scancode function * Add name class attribute to plugins to support UI reporting Signed-off-by: Philippe Ombredanne --- src/scancode/api.py | 119 +---------- src/scancode/cache.py | 266 ++++++++---------------- src/scancode/cli.py | 292 ++++++++++++--------------- src/scancode/plugin_ignore.py | 2 +- src/scancode/plugin_mark_source.py | 2 + src/scancode/plugin_only_findings.py | 2 + src/scancode/resource.py | 252 +++++++++++++++++++++++ tests/scancode/test_scan_cache.py | 8 +- 8 files changed, 468 insertions(+), 475 deletions(-) create mode 100644 src/scancode/resource.py diff --git a/src/scancode/api.py b/src/scancode/api.py index c877f1e53fa..d8dbc830b5e 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -28,11 +28,9 @@ from collections import OrderedDict -from commoncode.fileutils import as_posixpath -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode -from commoncode.system import on_linux -from scancode.utils import get_relative_path +# exposed as API +from scancode.resource import Resource # @UnusedImport +from scancode.resource import get_file_infos # @UnusedImport """ @@ -40,36 +38,6 @@ Note: this API is unstable and still evolving. """ -class Resource(object): - """ - A resource represent a file or directory with its essential "file - information" and the scanned data details. - """ - - def __init__(self, scans_cache_class, abs_path, base_is_dir, len_base_path): - self.scans_cache_class = scans_cache_class() - self.is_cached = False - self.abs_path = abs_path - self.base_is_dir = base_is_dir - posix_path = as_posixpath(abs_path) - # keep the path as relative to the original base_path, always Unicode - self.rel_path = get_relative_path(posix_path, len_base_path, base_is_dir) - self.infos = OrderedDict() - self.infos['path'] = self.rel_path - - def put_info(self, infos): - """ - Cache file info and set `is_cached` to True if already cached or false otherwise. - """ - self.infos.update(infos) - self.is_cached = self.scans_cache_class.put_info(self.rel_path, self.infos) - - def get_info(self): - """ - Retrieve info from cache. - """ - return self.scans_cache_class.get_info(self.rel_path) - def extract_archives(location, recurse=True): """ @@ -196,87 +164,6 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, license_ yield result -def get_file_infos(location): - """ - Return a mapping of file information collected from the file or - directory at `location`. - """ - from commoncode import fileutils - from commoncode import filetype - from commoncode.hash import multi_checksums - from typecode import contenttype - - if on_linux: - location = path_to_bytes(location) - else: - location = path_to_unicode(location) - - infos = OrderedDict() - is_file = filetype.is_file(location) - is_dir = filetype.is_dir(location) - - T = contenttype.get_type(location) - - infos['type'] = filetype.get_type(location, short=False) - name = fileutils.file_name(location) - if is_file: - base_name, extension = fileutils.splitext(location) - else: - base_name = name - extension = '' - - if on_linux: - infos['name'] = path_to_unicode(name) - infos['base_name'] = path_to_unicode(base_name) - infos['extension'] = path_to_unicode(extension) - else: - infos['name'] = name - infos['base_name'] = base_name - infos['extension'] = extension - - infos['date'] = is_file and filetype.get_last_modified_date(location) or None - infos['size'] = T.size - infos.update(multi_checksums(location, ('sha1', 'md5',))) - infos['files_count'] = is_dir and filetype.get_file_count(location) or None - infos['mime_type'] = is_file and T.mimetype_file or None - infos['file_type'] = is_file and T.filetype_file or None - infos['programming_language'] = is_file and T.programming_language or None - infos['is_binary'] = bool(is_file and T.is_binary) - infos['is_text'] = bool(is_file and T.is_text) - infos['is_archive'] = bool(is_file and T.is_archive) - infos['is_media'] = bool(is_file and T.is_media) - infos['is_source'] = bool(is_file and T.is_source) - infos['is_script'] = bool(is_file and T.is_script) - - return infos - - -# FIXME: this smells bad -def _empty_file_infos(): - """ - Return an empty mapping of file info, used in case of failure. - """ - infos = OrderedDict() - infos['type'] = None - infos['name'] = None - infos['extension'] = None - infos['date'] = None - infos['size'] = None - infos['sha1'] = None - infos['md5'] = None - infos['files_count'] = None - infos['mime_type'] = None - infos['file_type'] = None - infos['programming_language'] = None - infos['is_binary'] = False - infos['is_text'] = False - infos['is_archive'] = False - infos['is_media'] = False - infos['is_source'] = False - infos['is_script'] = False - return infos - - def get_package_infos(location): """ Return a list of mappings of package information collected from the diff --git a/src/scancode/cache.py b/src/scancode/cache.py index 6f44e1efc29..3cc1ebd0ffc 100644 --- a/src/scancode/cache.py +++ b/src/scancode/cache.py @@ -52,29 +52,21 @@ Cache scan results for a file or directory disk using a file-based cache. The approach is to cache the scan of a file using these data structure and files: - - - a resource_paths list contains all the paths scanned. - - - for each file being scanned, we store a file that contains the corresponding - file info data as JSON. This file is named after the hash of the path of a - scanned file. - - - for each unique file being scanned (e.g. based on its content SHA1), we store - a another JSON file that contains the corresponding scan data. This file is - named after the hash of the scanned file content. + - a resources list contains all the Resource objects scanned. + - for each file being scanned, we store a JSON file that contains the + corresponding scan data. This file is named after the hash of its path. Once a scan is completed, we iterate the cache to output the final scan results: -First iterate the resource_paths, from there collect the cached file info for -that file and from the path and file info collect the cached scanned result. +First iterate the resources and from the path collect the cached scanned result. This iterator is then streamed to the final JSON output. Finally once a scan is completed the cache is destroyed to free up disk space. Internally the cache is organized as a tree of directories named after the first -few characters or a path hash or file hash. This is to avoid having having too -many files per directory that can make some filesystems choke as well as having -directories that are too deep or having file paths that are too long which -problematic on some OS. +few characters or a path hash. This is to avoid having having too many files per +directory that can make some filesystems choke as well as having directories +that are too deep or having file paths that are too long which problematic on +some OS. """ # Tracing flags @@ -120,47 +112,16 @@ def get_scans_cache_class(base_cache_dir=scans_cache_dir): return partial(ScanFileCache, cache_dir) -def info_keys(path, seed=None): +def scan_keys(path): """ - Return a file info cache "keys" tripple for a path composed of three + Return a cache "keys" tripple for a path composed of three paths segments derived from a checksum. For example: >>> expected = 'fb87db2bb28e9501ac7fdc4812782118f4c94a0f' >>> assert expected == sha1('/w421/scancode-toolkit2').hexdigest() - >>> expected = ('f', 'b', '87db2bb28e9501ac7fdc4812782118f4c94a0f') - >>> assert expected == info_keys('/w421/scancode-toolkit2') - """ - # ensure that we always pass bytes to the hash function - if isinstance(path, unicode): - path = path_to_bytes(path) - if seed: - if isinstance(seed, unicode): - seed = path_to_bytes(seed) - path = seed + path - return keys_from_hash(sha1(path).hexdigest()) - - -def scan_keys(path, file_info): - """ - Return a scan cache keys tripple for a path and file_info. If the file_info - sha1 is empty (e.g. such as a directory), return a key based on the path - instead. - """ - # we "get" because in some off cases getting file info may have failed - # or there may be none for a directory - sha1_digest = file_info.get('sha1') - if sha1_digest: - return keys_from_hash(sha1_digest) - else: - # we may eventually store directories, in which case we use the - # path as a key with some extra seed - return info_keys(path, seed=b'empty hash') - - -def keys_from_hash(hexdigest): - """ - Return a cache keys triple for a hash hexdigest string. + >>> expected = ('0', 'c', 'a4f74d39ecbf551b1acfc63dc37bf2c8b9482c') + >>> assert expected == scan_keys('/w421/scancode-toolkit2') NOTE: since we use the first character and next two characters as directories, we create at most 16 dir at the first level and 16 dir at the @@ -169,33 +130,15 @@ def keys_from_hash(hexdigest): directory on average with this scheme which should keep most file systems happy and avoid some performance issues when there are too many files in a single directory. - - For example: - >>> expected = ('f', 'b', '87db2bb28e9501ac7fdc4812782118f4c94a0f') - >>> assert expected == keys_from_hash('fb87db2bb28e9501ac7fdc4812782118f4c94a0f') """ + # ensure that we always pass bytes to the hash function + path = path_to_bytes(path) + hexdigest = sha1(path + b'empty hash').hexdigest() if on_linux: hexdigest = bytes(hexdigest) - return hexdigest[0], hexdigest[1], hexdigest[2:] - - -def paths_from_keys(base_path, keys): - """ - Return a tuple of (parent dir path, filename) for a cache entry built from a - cache keys triple and a base_directory. Ensure that the parent directory - exist. - """ - if on_linux: - keys = [path_to_bytes(k) for k in keys] - base_path = path_to_bytes(base_path) else: - keys = [path_to_unicode(k) for k in keys] - base_path = path_to_unicode(base_path) - - dir1, dir2, file_name = keys - parent = os.path.join(base_path, dir1, dir2) - create_dir(parent) - return parent, file_name + hexdigest = unicode(hexdigest) + return hexdigest[0], hexdigest[1], hexdigest[2:] class ScanFileCache(object): @@ -206,98 +149,61 @@ class ScanFileCache(object): times. """ def __init__(self, cache_dir): - # subdirs for info and scans_dir caches if on_linux: - infos_dir = b'infos_dir/' - scans_dir = b'scans_dir/' self.cache_base_dir = path_to_bytes(cache_dir) - else: - infos_dir = u'infos_dir/' - scans_dir = u'scans_dir/' self.cache_base_dir = cache_dir - - self.cache_infos_dir = as_posixpath(os.path.join(self.cache_base_dir, infos_dir)) - self.cache_scans_dir = as_posixpath(os.path.join(self.cache_base_dir, scans_dir)) + self.cache_scans_dir = as_posixpath(self.cache_base_dir) def setup(self): """ Setup the cache: must be called at least once globally after cache initialization. """ - create_dir(self.cache_infos_dir) create_dir(self.cache_scans_dir) - def get_cached_info_path(self, path): + def get_cached_scan_path(self, path): """ - Return the path where to store a file info in the cache given a path. + Return the path where to store a scan in the cache given a path. """ - keys = info_keys(path) - paths = paths_from_keys(self.cache_infos_dir, keys) - return posixpath.join(*paths) + dir1, dir2, file_name = scan_keys(path) - def put_info(self, path, file_info): - """ - Put file_info for path in the cache and return True if the file - referenced in file_info has already been scanned or False otherwise. - """ - info_path = self.get_cached_info_path(path) - with codecs.open(info_path, 'wb', encoding='utf-8') as cached_infos: - json.dump(file_info, cached_infos, check_circular=False) - scan_path = self.get_cached_scan_path(path, file_info) - is_scan_cached = os.path.exists(scan_path) - if TRACE: - logger_debug( - 'put_infos:', 'path:', path, 'is_scan_cached:', is_scan_cached, - 'file_info:', file_info, '\n') - return is_scan_cached + if on_linux: + base_path = path_to_bytes(self.cache_scans_dir) + else: + base_path = path_to_unicode(self.cache_scans_dir) - def get_info(self, path): - """ - Return file info from the cache for a path. - Return None on failure to find the info in the cache. - """ - info_path = self.get_cached_info_path(path) - if os.path.exists(info_path): - with codecs.open(info_path, 'r', encoding='utf-8') as ci: - return json.load(ci, object_pairs_hook=OrderedDict) + parent = os.path.join(base_path, dir1, dir2) + create_dir(parent) - def get_cached_scan_path(self, path, file_info): - """ - Return the path where to store a scan in the cache given a path and - file_info. - """ - keys = scan_keys(path, file_info) - paths = paths_from_keys(self.cache_scans_dir, keys) - return posixpath.join(*paths) + return posixpath.join(parent, file_name) - def put_scan(self, path, file_info, scan_result): + def put_scan(self, path, scan_result): """ Put scan_result in the cache if not already cached. """ - scan_path = self.get_cached_scan_path(path, file_info) + scan_path = self.get_cached_scan_path(path) if not os.path.exists(scan_path): with codecs.open(scan_path, 'wb', encoding='utf-8') as cached_scan: json.dump(scan_result, cached_scan, check_circular=False) if TRACE: logger_debug( - 'put_scan:', 'scan_path:', scan_path, 'file_info:', file_info, - 'scan_result:', scan_result, '\n') + 'put_scan:', 'scan_path:', scan_path, 'scan_result:', scan_result, '\n') - def get_scan(self, path, file_info): + def get_scan(self, path): """ - Return scan results from the cache for a path and file_info. + Return scan results from the cache for a path. Return None on failure to find the scan results in the cache. """ - scan_path = self.get_cached_scan_path(path, file_info) + scan_path = self.get_cached_scan_path(path) if os.path.exists(scan_path): with codecs.open(scan_path, 'r', encoding='utf-8') as cached_scan: return json.load(cached_scan, object_pairs_hook=OrderedDict) - def iterate(self, resource_paths, scan_names, root_dir=None, paths_subset=tuple()): + def iterate(self, resources, scan_names, root_dir=None, paths_subset=tuple()): """ Yield scan data for all cached scans e.g. the whole cache given a list - of `resource_paths` and `scan_names`. + of `resources` Resource objects and `scan_names`. If a `paths_subset` sequence of paths is provided, then only these paths are iterated. @@ -307,66 +213,35 @@ def iterate(self, resource_paths, scan_names, root_dir=None, paths_subset=tuple( else: paths_subset = set(path_to_unicode(p) for p in paths_subset) - for resource_path in resource_paths: + for resource in resources: + resource_path = resource.rel_path if paths_subset and resource_path not in paths_subset: continue - file_info = self.get_info(resource_path) - - if on_linux: - unicode_path = path_to_unicode(resource_path) - else: - unicode_path = resource_path - - if root_dir: - # must be unicode - if on_linux: - root_dir = path_to_unicode(root_dir) - rooted_path = posixpath.join(root_dir, unicode_path) - else: - rooted_path = unicode_path - rooted_path = as_posixpath(rooted_path) - logger_debug('iterate:', 'rooted_path:', rooted_path) - - # rare but possible corner case - if file_info is None: - no_info = ('ERROR: file info unavailable in cache: ' - 'This is either a bug or processing was aborted ' - 'with CTRL-C.') - scan_result = OrderedDict(path=rooted_path) - scan_result['scan_errors'] = [no_info] - if TRACE: - logger_debug( - 'iterate:', 'scan_result:', scan_result, - 'for resource_path:', rooted_path, '\n') - yield scan_result - continue - _unicode_path_from_file_info = file_info.pop('path') - scan_result = OrderedDict(path=rooted_path) + scan_result = OrderedDict() + + # always set the path to what was expected based on strip/full/root args + rooted_path = get_scan_path(resource, root_dir) + scan_result['path'] = rooted_path + + scan_details = self.get_scan(resource_path) - if 'infos' in scan_names: + if scan_details is None: + no_scan_details = ( + 'ERROR: scan details unavailable in cache: ' + 'This is either a bug or processing was aborted with ' + 'CTRL-C.') + scan_result['scan_errors'] = [no_scan_details] + continue + + infos = scan_details.pop('infos', None) + if 'infos' in scan_names and infos: # info are always collected but only returned if requested # we flatten these as direct attributes of a file object - scan_result.update(file_info.items()) - - if not scan_result.get('scan_errors'): - scan_result['scan_errors'] = [] - - # check if we have more than just infos - if ['infos'] != scan_names: - errors = scan_result['scan_errors'] - scan_details = self.get_scan(resource_path, file_info) - if scan_details is None: - no_scan_details = ( - 'ERROR: scan details unavailable in cache: ' - 'This is either a bug or processing was aborted with ' - 'CTRL-C.') - errors.append(no_scan_details) - else: - # append errors to other top level errors if any - scan_errors = scan_details.pop('scan_errors', []) - errors.extend(scan_errors) - scan_result.update(scan_details) + # FIXME: this should be done in the scan looo NOT HERE!!! + scan_result.update(infos) + + scan_result.update(scan_details) if TRACE: logger_debug( @@ -379,3 +254,26 @@ def clear(self, *args): Purge the cache by deleting the corresponding cached data files. """ delete(self.cache_base_dir) + + +def get_scan_path(resource, root_dir): + """ + Return a path to use in the scan results + """ + # FIXME: Resource should handle this paths thingies + resource_path = resource.rel_path + if on_linux: + unicode_path = path_to_unicode(resource_path) + else: + unicode_path = resource_path + + if root_dir: + # must be unicode + if on_linux: + root_dir = path_to_unicode(root_dir) + rooted_path = posixpath.join(root_dir, unicode_path) + else: + rooted_path = unicode_path + rooted_path = as_posixpath(rooted_path) + logger_debug('get_scan_path:', 'rooted_path:', rooted_path) + return rooted_path diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 6cc34767373..ba553a508ed 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -66,7 +66,6 @@ from scancode import __version__ as version from scancode import ScanOption from scancode.api import DEJACODE_LICENSE_URL -from scancode.api import _empty_file_infos from scancode.api import get_copyrights from scancode.api import get_emails from scancode.api import get_file_infos @@ -400,7 +399,9 @@ def validate_exclusive(ctx, exclusive_options): @click.option('--timeout', is_flag=False, default=DEFAULT_TIMEOUT, type=float, show_default=True, help='Stop scanning a file if scanning takes longer than a timeout in seconds.', group=CORE, cls=ScanOption) @click.option('--reindex-licenses', is_flag=True, default=False, is_eager=True, callback=reindex_licenses, help='Force a check and possible reindexing of the cached license index.', group=MISC, cls=ScanOption) -def scancode(ctx, input, output_file, *args, **kwargs): +def scancode(ctx, input, output_file, infos, + verbose, quiet, processes, diag, timeout, + *args, **kwargs): """scan the file or directory for license, origin and packages and save results to . The scan results are printed to stdout if is not provided. @@ -414,17 +415,10 @@ def scancode(ctx, input, output_file, *args, **kwargs): packages = kwargs.get('packages') emails = kwargs.get('emails') urls = kwargs.get('urls') - infos = kwargs.get('infos') strip_root = kwargs.get('strip_root') full_root = kwargs.get('full_root') format = kwargs.get('format') - - verbose = kwargs.get('verbose') - quiet = kwargs.get('quiet') - processes = kwargs.get('processes') - diag = kwargs.get('diag') - timeout = kwargs.get('timeout') # ## TODO: END FIX when plugins are used everywhere # Use default scan options when no scan option is provided @@ -444,7 +438,7 @@ def scancode(ctx, input, output_file, *args, **kwargs): scanners = [ # FIXME: For "infos" there is no separate scan function, they are always # gathered, though not always exposed. - Scanner('infos', None, infos or is_spdx), + Scanner('infos', get_file_infos, infos or is_spdx), Scanner('licenses', get_licenses_with_score, licenses or use_default_scans), Scanner('copyrights', get_copyrights, copyrights or use_default_scans), Scanner('packages', get_package_infos, packages or use_default_scans), @@ -472,19 +466,14 @@ def scancode(ctx, input, output_file, *args, **kwargs): if opt.value != opt.default: options.append(opt) - # Find all scans that are both enabled and have a valid function - # reference. This deliberately filters out the "info" scan - # (which always has a "None" function reference) as there is no - # dedicated "infos" key in the results that "plugin_only_findings.has_findings()" - # could check. active_scans = [scan.name for scan in scanners if scan.is_enabled] + _scans = ', '.join(active_scans) + if not quiet: + echo_stderr('Scanning files for: %(_scans)s with %(processes)d process(es)...' % locals()) - # FIXME: Prescan should happen HERE not as part of the per-file scan - pre_scan_plugins = [] - for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - if plugin.is_enabled: - pre_scan_plugins.append(plugin(all_options, active_scans)) + if not quiet and not processes: + echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') # TODO: new loop # 1. collect minimally the whole files tree in memory as a Resource tree @@ -492,36 +481,120 @@ def scancode(ctx, input, output_file, *args, **kwargs): # 3. run the scan proper, save scan details on disk # 4. apply the post scan plugins to this tree, lazy load as needed the scan # details from disk. save back updated details on disk - scans_cache_class = get_scans_cache_class() + + if not quiet: + echo_stderr('Collecting file inventory...' % locals(), fg='green') + resources = get_resources(base_path=input, diag=diag, scans_cache_class=scans_cache_class) + resources = list(resources) + + processing_start = time() try: - files_count, results, success = scan_all( + # WARMUP + indexing_time = 0 + with_licenses = any(sc for sc in scanners if sc.name == 'licenses' and sc.is_enabled) + if with_licenses: + # build index outside of the main loop for speed + # FIXME: REALLY????? this also ensures that forked processes will get the index on POSIX naturally + if not quiet: + echo_stderr('Building license detection index...', fg='green', nl=False) + from licensedcode.cache import get_index + get_index(False) + indexing_time = time() - processing_start + if not quiet: + echo_stderr('Done.', fg='green', nl=True) + + # PRE + pre_scan_start = time() + + for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): + plugin = plugin(all_options, active_scans) + if plugin.is_enabled(): + if not quiet: + name = name or plugin.__class__.__name__ + echo_stderr('Running pre-scan plugin: %(name)s...' % locals(), fg='green') + resources = plugin.process_resources(resources) + + pre_scan_time = time() - pre_scan_start + + resources = list(resources) + + # SCAN + scan_start = time() + + if not quiet: + echo_stderr('Scanning files...', fg='green') + + files_count, results, success, paths_with_error = scan_all( input_path=input, scanners=scanners, + resources=resources, verbose=verbose, quiet=quiet, processes=processes, timeout=timeout, diag=diag, scans_cache_class=scans_cache_class, - strip_root=strip_root, full_root=full_root, - # FIXME: this should not be part of the of scan_all!!!! - pre_scan_plugins=pre_scan_plugins) - - # FIXME!!! - for pname, plugin in plugincode.post_scan.get_post_scan_plugins().items(): - plug = plugin(all_options, active_scans) - if plug.is_enabled(): + strip_root=strip_root, full_root=full_root) + + scan_time = time() - scan_start + files_scanned_per_second = round(float(files_count) / scan_time , 2) + + # POST + post_scan_start = time() + + for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): + plugin = plugin(all_options, active_scans) + if plugin.is_enabled(): if not quiet: - echo_stderr('Running post-scan plugin: %(pname)s...' % locals(), fg='green') + name = name or plugin.__class__.__name__ + echo_stderr('Running post-scan plugin: %(name)s...' % locals(), fg='green') # FIXME: we should always catch errors from plugins properly - results = plug.process_resources(results) + results = plugin.process_resources(results) + + post_scan_time = time() - post_scan_start - # FIXME: computing len needs a list and therefore needs loading it all ahead of time - # this should NOT be needed with a better cache architecture!!! + # FIXME: computing len needs a list and therefore needs loading it all + # ahead of time this should NOT be needed with a better cache + # architecture!!! results = list(results) files_count = len(results) - if not quiet: - echo_stderr('Saving results.', fg='green') + total_time = time() - processing_start + + # SCAN SUMMARY + if not quiet: + echo_stderr('Scanning done.', fg=paths_with_error and 'red' or 'green') + + # Display errors + if paths_with_error: + if diag: + echo_stderr('Some files failed to scan properly:', fg='red') + # iterate cached results to collect all scan errors + cached_scan = scans_cache_class() + root_dir = _get_root_dir(input, strip_root, full_root) + scan_results = cached_scan.iterate(resources, active_scans, root_dir, paths_subset=paths_with_error) + for scan_result in scan_results: + errored_path = scan_result.get('path', '') + echo_stderr('Path: ' + errored_path, fg='red') + for error in scan_result.get('scan_errors', []): + for emsg in error.splitlines(False): + echo_stderr(' ' + emsg) + echo_stderr('') + else: + echo_stderr('Some files failed to scan properly. Use the --diag option for additional details:', fg='red') + for errored_path in paths_with_error: + echo_stderr(' ' + errored_path, fg='red') + + echo_stderr('Scan statistics: %(files_count)d files scanned in %(total_time)ds.' % locals()) + echo_stderr('Scan options: %(_scans)s with %(processes)d process(es).' % locals()) + echo_stderr('Scanning speed: %(files_scanned_per_second)s files per sec.' % locals()) + echo_stderr('Scanning in: %(scan_time)ds. ' % locals(), nl=False) + echo_stderr('Indexing in: %(indexing_time)ds. ' % locals(), nl=False) + echo_stderr('Pre-scan in: %(pre_scan_time)ds. ' % locals(), nl=False) + echo_stderr('Post-scan in: %(post_scan_time)ds.' % locals(), reset=True) + + # REPORT + if not quiet: + echo_stderr('Saving results...', fg='green') # FIXME: we should have simpler args: a scan "header" and scan results save_results(scanners, files_count, results, format, options, input, output_file) @@ -534,13 +607,12 @@ def scancode(ctx, input, output_file, *args, **kwargs): ctx.exit(rc) -def scan_all(input_path, scanners, - verbose=False, quiet=False, processes=1, timeout=DEFAULT_TIMEOUT, - diag=False, scans_cache_class=None, - strip_root=False, full_root=False, - pre_scan_plugins=None): +def scan_all(input_path, scanners, resources, + verbose=False, quiet=False, processes=1, timeout=DEFAULT_TIMEOUT, + diag=False, scans_cache_class=None, + strip_root=False, full_root=False): """ - Return a tuple of (files_count, scan_results, success) where + Return a tupple of (files_count, scan_results, success, summary mapping) where scan_results is an iterable and success is a boolean. Run each requested scan proper: each individual file scan is cached @@ -548,46 +620,9 @@ def scan_all(input_path, scanners, the cache and streamed at the end. """ assert scans_cache_class - scan_summary = OrderedDict() - scan_summary['scanned_path'] = input_path - scan_summary['processes'] = processes - - # Display scan start details - ############################ scans = [scan.name for scan in scanners if scan.is_enabled] - _scans = ', '.join(scans) - if not quiet: - echo_stderr('Scanning files for: %(_scans)s with %(processes)d process(es)...' % locals()) - - scan_summary['scans'] = scans[:] - scan_start = time() - indexing_time = 0 - - # FIXME: THIS SHOULD NOT TAKE PLACE HERE!!!!!! - with_licenses = any(sc for sc in scanners if sc.name == 'licenses' and sc.is_enabled) - if with_licenses: - # build index outside of the main loop for speed - # REALLY????? this also ensures that forked processes will get the index on POSIX naturally - if not quiet: - echo_stderr('Building license detection index...', fg='green', nl=False) - from licensedcode.cache import get_index - get_index(False) - indexing_time = time() - scan_start - if not quiet: - echo_stderr('Done.', fg='green', nl=True) - - scan_summary['indexing_time'] = indexing_time - pool = None - resources = get_resources(input_path, diag, scans_cache_class) - - # FIXME: we should try/catch here - for plugin in pre_scan_plugins: - resources = plugin.process_resources(resources) - - resources = list(resources) - paths_with_error = [] files_count = 0 @@ -609,11 +644,6 @@ def scan_all(input_path, scanners, else: # no multiprocessing with processes=0 scanned_files = imap(scanit, resources) - if not quiet: - echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') - - if not quiet: - echo_stderr('Scanning files...', fg='green') def scan_event(item): """Progress event displayed each time a file is scanned""" @@ -627,7 +657,6 @@ def scan_event(item): _progress_line = fixed_width_file_name(_scanned_path, max_file_name_len) return style('Scanned: ') + style(_progress_line, fg=_scan_success and 'green' or 'red') - scanning_errors = [] files_count = 0 with progressmanager( scanned_files, item_show_func=scan_event, show_pos=True, @@ -642,7 +671,7 @@ def scan_event(item): except StopIteration: break except KeyboardInterrupt: - print('\nAborted with Ctrl+C!') + echo_stderr('\nAborted with Ctrl+C!', fg='red') if pool: pool.terminate() break @@ -652,63 +681,14 @@ def scan_event(item): # http://bugs.python.org/issue15101 pool.terminate() - # TODO: add stats to results somehow - - # Compute stats - ########################## - scan_summary['files_count'] = files_count - scan_summary['files_with_errors'] = paths_with_error - total_time = time() - scan_start - scanning_time = total_time - indexing_time - scan_summary['total_time'] = total_time - scan_summary['scanning_time'] = scanning_time - - files_scanned_per_second = round(float(files_count) / scanning_time , 2) - scan_summary['files_scanned_per_second'] = files_scanned_per_second - - if not quiet: - # Display stats - ########################## - echo_stderr('Scanning done.', fg=paths_with_error and 'red' or 'green') - if paths_with_error: - if diag: - echo_stderr('Some files failed to scan properly:', fg='red') - # iterate cached results to collect all scan errors - cached_scan = scans_cache_class() - root_dir = _get_root_dir(input_path, strip_root, full_root) - resource_paths = (r.rel_path for r in resources) - scan_results = cached_scan.iterate(resource_paths, scans, root_dir, paths_subset=paths_with_error) - for scan_result in scan_results: - errored_path = scan_result.get('path', '') - echo_stderr('Path: ' + errored_path, fg='red') - for error in scan_result.get('scan_errors', []): - for emsg in error.splitlines(False): - echo_stderr(' ' + emsg) - echo_stderr('') - else: - echo_stderr('Some files failed to scan properly. Use the --diag option for additional details:', fg='red') - for errored_path in paths_with_error: - echo_stderr(' ' + errored_path, fg='red') - - echo_stderr('Scan statistics: %(files_count)d files scanned in %(total_time)ds.' % locals()) - echo_stderr('Scan options: %(_scans)s with %(processes)d process(es).' % locals()) - echo_stderr('Scanning speed: %(files_scanned_per_second)s files per sec.' % locals()) - echo_stderr('Scanning time: %(scanning_time)ds.' % locals()) - echo_stderr('Indexing time: %(indexing_time)ds.' % locals(), reset=True) - success = not paths_with_error # finally return an iterator on cached results cached_scan = scans_cache_class() root_dir = _get_root_dir(input_path, strip_root, full_root) ############################################# - ############################################# - ############################################# # FIXME: we must return Resources here!!!! ############################################# - ############################################# - ############################################# - resource_paths = (r.rel_path for r in resources) - return files_count, cached_scan.iterate(resource_paths, scans, root_dir), success + return files_count, cached_scan.iterate(resources, scans, root_dir), success, paths_with_error def _get_root_dir(input_path, strip_root=False, full_root=False): @@ -748,12 +728,11 @@ def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT # fake, non inteerrupting used for debugging when processes=0 interrupter = fake_interruptible - scanners = [scanner for scanner in scanners - if scanner.is_enabled and scanner.function] + scanners = [scanner for scanner in scanners if scanner.is_enabled] if not scanners: return success, resource.rel_path - # Skip other scans if already cached + # DUH???? Skip other scans if already cached # FIXME: ENSURE we only do this for files not directories if not resource.is_cached: # run the scan as an interruptiple task @@ -765,7 +744,7 @@ def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT # "scan" key is used for these errors scan_result = {'scan_errors': [scan_result]} - scans_cache.put_scan(resource.rel_path, resource.get_info(), scan_result) + scans_cache.put_scan(resource.rel_path, scan_result) # do not report success if some other errors happened if scan_result.get('scan_errors'): @@ -797,37 +776,14 @@ def get_resources(base_path, diag, scans_cache_class): locations = resource_iter(base_path, ignored=ignorer, with_dirs=True) for abs_path in locations: - resource = Resource(scans_cache_class, abs_path, base_is_dir, len_base_path) - # FIXME: they should be kept in memory instead - # always fetch infos and cache them. - infos = scan_infos(abs_path, diag=diag) - resource.put_info(infos) + resource = Resource( + scans_cache_class=scans_cache_class, + abs_path=abs_path, + base_is_dir=base_is_dir, + len_base_path=len_base_path) yield resource -def scan_infos(input_file, diag=False): - """ - Scan one file or directory and return file_infos data. This always - contains an extra 'errors' key with a list of error messages, - possibly empty. If `diag` is True, additional diagnostic messages - are included. - """ - # FIXME: WE SHOULD PROCESS THIS IS MEMORY AND AS PART OF THE SCAN PROPER... and BOTTOM UP!!!! - # THE PROCESSING TIME OF SIZE AGGREGATION ON DIRECTORY IS WAY WAY TOO HIGH!!! - errors = [] - try: - infos = get_file_infos(input_file) - except Exception as e: - # never fail but instead add an error message. - infos = _empty_file_infos() - errors = ['ERROR: infos: ' + e.message] - if diag: - errors.append('ERROR: infos: ' + traceback.format_exc()) - # put errors last - infos['scan_errors'] = errors - return infos - - def scan_one(location, scanners, diag=False): """ Scan one file or directory at `location` and return a scan result diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index cf0286438d4..67531791c8c 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -46,7 +46,7 @@ class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ - + name = 'ignore' def __init__(self, selected_options, active_scan_names=None): PreScanPlugin.__init__( self, selected_options, active_scan_names=active_scan_names) diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 9fddafe6ae3..ac5c615f35d 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -41,6 +41,8 @@ class MarkSource(PostScanPlugin): Has no effect unless the --info scan is requested. """ + name = 'mark-source' + @classmethod def get_plugin_options(cls): return [ diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 870696bc335..dbc2d11e888 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -38,6 +38,8 @@ class OnlyFindings(PostScanPlugin): considering basic file information as findings). """ + name = 'only-findings' + @classmethod def get_plugin_options(cls): return [ diff --git a/src/scancode/resource.py b/src/scancode/resource.py new file mode 100644 index 00000000000..fdb2b0648e9 --- /dev/null +++ b/src/scancode/resource.py @@ -0,0 +1,252 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + +from collections import OrderedDict +import os +import traceback + +import attr + +from commoncode.filetype import is_dir +from commoncode.filetype import is_file +from commoncode.fileutils import as_posixpath +from commoncode.fileutils import path_to_bytes +from commoncode.fileutils import path_to_unicode +from commoncode.system import on_linux + +from scancode.cache import get_cache_dir +from scancode.utils import get_relative_path + +# Python 2 and 3 support +try: + # Python 2 + unicode + str_orig = str + bytes = str + str = unicode +except NameError: + # Python 3 + unicode = str + + +""" +An abstraction for files and directories used throughout ScanCode. ScanCode +deals with a lot of these as they are the basic unit of processing. They are +eventually cached or stored and this module hides all the details of iterating +files, path handling, caching or storing the file and directoy medatata. +""" + + +@attr.attributes(slots=True) +class Resource(object): + """ + A resource represent a file or directory with essential "file + information" and the scanned data details. + """ + # LEGACY: TODO: remove + scans_cache_class = attr.attrib(default=None) + is_cached = attr.attrib(default=False, type=bool) + abs_path = attr.attrib(default=None) + base_is_dir = attr.attrib(default=True, type=bool) + len_base_path = attr.attrib(default=0, type=int) + rel_path = attr.attrib(default=None) + # END LEGACY + + name = attr.attrib(default=None) + parent = attr.attrib(default=None) + children = attr.attrib(default=attr.Factory(list)) + + has_infos = attr.attrib(default=False) + infos = attr.attrib(default=attr.Factory(OrderedDict)) + scans = attr.attrib(default=attr.Factory(OrderedDict)) + + def __attrs_post_init__(self): + self.scans_cache_class = self.scans_cache_class() + posix_path = as_posixpath(self.abs_path) + # keep the path as relative to the original base_path, always Unicode + self.rel_path = get_relative_path(posix_path, self.len_base_path, self.base_is_dir) + self.infos['path'] = self.rel_path + + def get_infos(self): + if not self.has_infos: + self.infos.update(scan_infos(self.abs_path)) + self.has_infos = True + return self.infos + + def walk(self, topdown=True): + """ + Walk this Resource in a manner similar to os.walk + """ + if topdown: + yield self, self.children + for child in self.children: + for sc in child.walk(topdown): + yield sc + if not topdown: + yield self, self.children + + +def scan_infos(location): + """ + Scan one file or directory and return file_infos data. This always + contains an extra 'errors' key with a list of error messages, + possibly empty. If `diag` is True, additional diagnostic messages + are included. + """ + # FIXME: WE SHOULD PROCESS THIS IS MEMORY AND AS PART OF THE SCAN PROPER... and BOTTOM UP!!!! + # THE PROCESSING TIME OF SIZE AGGREGATION ON DIRECTORY IS WAY WAY TOO HIGH!!! + errors = [] + try: + infos = get_file_infos(location) + except Exception as e: + # never fail but instead add an error message. + infos = _empty_file_infos() + errors = ['ERROR: infos: ' + e.message] + errors.append('ERROR: infos: ' + traceback.format_exc()) + # put errors last + infos['scan_errors'] = errors + return infos + + +def get_file_infos(location): + """ + Return a mapping of file information collected from the file or + directory at `location`. + """ + from commoncode import fileutils + from commoncode import filetype + from commoncode.hash import multi_checksums + from typecode import contenttype + + if on_linux: + location = path_to_bytes(location) + else: + location = path_to_unicode(location) + + infos = OrderedDict() + is_file = filetype.is_file(location) + is_dir = filetype.is_dir(location) + + T = contenttype.get_type(location) + + infos['type'] = filetype.get_type(location, short=False) + name = fileutils.file_name(location) + if is_file: + base_name, extension = fileutils.splitext(location) + else: + base_name = name + extension = '' + + if on_linux: + infos['name'] = path_to_unicode(name) + infos['base_name'] = path_to_unicode(base_name) + infos['extension'] = path_to_unicode(extension) + else: + infos['name'] = name + infos['base_name'] = base_name + infos['extension'] = extension + + infos['date'] = is_file and filetype.get_last_modified_date(location) or None + infos['size'] = T.size + infos.update(multi_checksums(location, ('sha1', 'md5',))) + infos['files_count'] = is_dir and filetype.get_file_count(location) or None + infos['mime_type'] = is_file and T.mimetype_file or None + infos['file_type'] = is_file and T.filetype_file or None + infos['programming_language'] = is_file and T.programming_language or None + infos['is_binary'] = bool(is_file and T.is_binary) + infos['is_text'] = bool(is_file and T.is_text) + infos['is_archive'] = bool(is_file and T.is_archive) + infos['is_media'] = bool(is_file and T.is_media) + infos['is_source'] = bool(is_file and T.is_source) + infos['is_script'] = bool(is_file and T.is_script) + + return infos + + +# FIXME: this smells bad +def _empty_file_infos(): + """ + Return an empty mapping of file info, used in case of failure. + """ + infos = OrderedDict() + infos['type'] = None + infos['name'] = None + infos['extension'] = None + infos['date'] = None + infos['size'] = None + infos['sha1'] = None + infos['md5'] = None + infos['files_count'] = None + infos['mime_type'] = None + infos['file_type'] = None + infos['programming_language'] = None + infos['is_binary'] = False + infos['is_text'] = False + infos['is_archive'] = False + infos['is_media'] = False + infos['is_source'] = False + infos['is_script'] = False + return infos + + +class Codebase(object): + """ + Represent a codebase being scanned. A Codebase is a tree of Resources. + """ + def __init__(self, root_location): + """ + Initialize a new codebase rooted as the `root_location` existing + file or directory. + NOTE: no check is made on the location and it must be an existing location. + """ + + self.location = root_location + # FIXME: encoding??? + self.location_native = path_to_bytes(root_location) + self.is_file = is_file(self.location_native) + self.is_dir = is_dir(self.location_native) + self.cache_dir = get_cache_dir() + self.root = None + + def collect(self): + """ + Return a root Resource for this codebase by walking its root_location. + """ + location = self.location + if on_linux: + location = self.location_native + + def on_error(error): + raise error + + root_dir = Resource() + for top, dirs, files in os.walk( + location, topdown=True, onerror=on_error, followlinks=False): + for dr in dirs: + pass diff --git a/tests/scancode/test_scan_cache.py b/tests/scancode/test_scan_cache.py index f934d550914..13ec47bd2a1 100644 --- a/tests/scancode/test_scan_cache.py +++ b/tests/scancode/test_scan_cache.py @@ -41,11 +41,7 @@ def test_can_cache(self): test_file = self.get_test_loc('cache/package/package.json') from scancode import api package = api.get_package_infos(test_file) - file_info = dict(sha1='def') - test_dir = self.get_temp_dir() cache = ScanFileCache(test_dir) - cache.put_info(path='abc', file_info=file_info) - cache.put_scan(path='abc', file_info=file_info, scan_result=package) - assert file_info == cache.get_info(path='abc') - assert package == cache.get_scan(path='abc', file_info=file_info) + cache.put_scan(path='abc', scan_result=package) + assert package == cache.get_scan(path='abc') From 40835fd4d07f69f019f4f79273d4b29d07967cec Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sat, 6 Jan 2018 23:05:48 +0100 Subject: [PATCH 023/122] Remove diag arg from get_resources() #787 Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 4 ++-- tests/scancode/test_ignore_files.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index ba553a508ed..e528dc19e19 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -485,7 +485,7 @@ def scancode(ctx, input, output_file, infos, if not quiet: echo_stderr('Collecting file inventory...' % locals(), fg='green') - resources = get_resources(base_path=input, diag=diag, scans_cache_class=scans_cache_class) + resources = get_resources(base_path=input, scans_cache_class=scans_cache_class) resources = list(resources) processing_start = time() @@ -753,7 +753,7 @@ def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT return success, resource.rel_path -def get_resources(base_path, diag, scans_cache_class): +def get_resources(base_path, scans_cache_class): """ Yield `Resource` objects for all the files found at base_path (either a directory or file) given an absolute base_path. diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py index 020d7ff9974..6e7a36ccf03 100644 --- a/tests/scancode/test_ignore_files.py +++ b/tests/scancode/test_ignore_files.py @@ -87,7 +87,7 @@ def test_resource_paths_with_single_file(self): 'user/src/test/sample.txt' ] - resources = get_resources(test_dir, False, scan_cache_class) + resources = get_resources(test_dir, scan_cache_class) for plugin in test_plugins: resources = plugin.process_resources(resources) @@ -107,7 +107,7 @@ def test_resource_paths_with_multiple_files(self): 'user/src/test/sample.doc', 'user/src/test/sample.txt' ] - resources = get_resources(test_dir, False, scan_cache_class) + resources = get_resources(test_dir, scan_cache_class) for plugin in test_plugins: resources = plugin.process_resources(resources) @@ -126,7 +126,7 @@ def test_resource_paths_with_glob_file(self): 'user/src/test', 'user/src/test/sample.txt' ] - resources = get_resources(test_dir, False, scan_cache_class) + resources = get_resources(test_dir, scan_cache_class) for plugin in test_plugins: resources = plugin.process_resources(resources) @@ -145,7 +145,7 @@ def test_resource_paths_with_glob_path(self): 'user/src', 'user/src/ignore.doc' ] - resources = get_resources(test_dir, False, scan_cache_class) + resources = get_resources(test_dir, scan_cache_class) for plugin in test_plugins: resources = plugin.process_resources(resources) @@ -168,7 +168,7 @@ def test_resource_paths_with_multiple_plugins(self): 'user/src', 'user/src/test' ] - resources = get_resources(test_dir, False, scan_cache_class) + resources = get_resources(test_dir, scan_cache_class) for plugin in test_plugins: resources = plugin.process_resources(resources) From 3be45778ba8ef8da6c0a4ad7ad0848c810e6470f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 10 Jan 2018 19:06:10 +0100 Subject: [PATCH 024/122] Add function to skip first or last iterable item #787 Signed-off-by: Philippe Ombredanne --- src/commoncode/functional.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/commoncode/functional.py b/src/commoncode/functional.py index 1175f98fd6c..abe0226a80e 100644 --- a/src/commoncode/functional.py +++ b/src/commoncode/functional.py @@ -215,3 +215,34 @@ def memoized(*args, **kwargs): return memos[args] return functools.update_wrapper(memoized, fun) + + +def iter_skip(iterable, skip_first=False, skip_last=False): + """ + Given an iterable, return an iterable skipping the first item if skip_first + is True or the last item if skip_last is True. + For example: + >>> a = iter(range(10)) + >>> list(iter_skip(a, skip_first=True, skip_last=False)) + [1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> a = iter(range(10)) + >>> list(iter_skip(a, skip_first=False, skip_last=True)) + [0, 1, 2, 3, 4, 5, 6, 7, 8] + >>> a = iter(range(10)) + >>> list(iter_skip(a, skip_first=True, skip_last=True)) + [1, 2, 3, 4, 5, 6, 7, 8] + >>> a = iter(range(10)) + >>> list(iter_skip(a, skip_first=False, skip_last=False)) + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> a = iter(range(10)) + >>> list(iter_skip(a)) + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + current = next(iterable) + if skip_first: + current = next(iterable) + for item in iterable: + yield current + current = item + if not skip_last: + yield current From b5e627cda7d1f87c6255431be9e9488a99d94851 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 11 Jan 2018 10:53:11 +0100 Subject: [PATCH 025/122] Change interruptible returned values #787 * now return (error string or None, value or None) * this is cleaner than (success, value) where the value could be either the callble result or the error string Signed-off-by: Philippe Ombredanne --- src/scancode/interrupt.py | 66 +++++++++++++------------------- tests/scancode/test_interrupt.py | 14 ++++--- 2 files changed, 35 insertions(+), 45 deletions(-) diff --git a/src/scancode/interrupt.py b/src/scancode/interrupt.py index c67b0c2d30e..286ae438ccf 100644 --- a/src/scancode/interrupt.py +++ b/src/scancode/interrupt.py @@ -17,36 +17,40 @@ from commoncode.system import on_windows -DEFAULT_TIMEOUT = 120 # seconds - """ -This modules povides an interruptible() function to run a callable and -stop it after a timeout with a windows and POSIX implementation. +This modules povides an interruptible() function to run a callable and stop it +after a timeout with a windows and POSIX implementation. -Call `func` function with `args` and `kwargs` arguments and return a -tuple of (success, return value). `func` is invoked through an OS- -specific wrapper and will be interrupted if it does not return within -`timeout` seconds. +interruptible() calls the `func` function with `args` and `kwargs` arguments and +return a tuple of (error, value). `func` is invoked through an OS- specific +wrapper and will be interrupted if it does not return within `timeout` seconds. `func` returned results must be pickable. `timeout` in seconds defaults to DEFAULT_TIMEOUT. - `args` and `kwargs` are passed to `func` as *args and **kwargs. -In the returned tuple of (success, value), success is True or False. If -success is True, the call was successful and the second item in the -tuple is the returned value of `func`. +In the returned tuple of (`error`, `value`), `error` is an error string or None. +The error message is verbose with a full traceback. +`value` is the returned value of `func` or None. -If success is False, the call did not complete within `timeout` -seconds and was interrupted. In this case, the second item in the -tuple is an error message string. +If `error` is not None, the call did not complete within `timeout` +seconds and was interrupted. In this case, the returned `value` is None. """ + class TimeoutError(Exception): pass +DEFAULT_TIMEOUT = 120 # seconds + +TIMEOUT_MSG = 'ERROR: Processing interrupted: timeout after %(timeout)d seconds.' +ERROR_MSG = 'ERROR: Unknown error:\n' +NO_ERROR = None +NO_VALUE = None + + if not on_windows: """ Some code based in part and inspired from the RobotFramework and @@ -81,14 +85,14 @@ def handler(signum, frame): try: signal.signal(signal.SIGALRM, handler) signal.setitimer(signal.ITIMER_REAL, timeout) - return True, func(*(args or ()), **(kwargs or {})) + return NO_ERROR, func(*(args or ()), **(kwargs or {})) + except TimeoutError: - return False, ('ERROR: Processing interrupted: timeout after ' - '%(timeout)d seconds.' % locals()) + return TIMEOUT_MSG % locals(), NO_VALUE except Exception: import traceback - return False, ('ERROR: Unknown error:\n' + traceback.format_exc()) + return ERROR_MSG + traceback.format_exc(), NO_VALUE finally: signal.setitimer(signal.ITIMER_REAL, 0) @@ -115,7 +119,7 @@ def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): Windows, threads-based interruptible runner. It can work also on POSIX, but is not reliable and works only if everything is pickable. """ - # We run `func` in a thread and run a loop until timeout + # We run `func` in a thread and block on a queue until timeout results = Queue.Queue() def runner(): @@ -124,14 +128,12 @@ def runner(): tid = thread.start_new_thread(runner, ()) try: - res = results.get(timeout=timeout) - return True, res + return NO_ERROR, results.get(timeout=timeout) except (Queue.Empty, multiprocessing.TimeoutError): - return False, ('ERROR: Processing interrupted: timeout after ' - '%(timeout)d seconds.' % locals()) + return TIMEOUT_MSG % locals(), NO_VALUE except Exception: import traceback - return False, ('ERROR: Unknown error:\n' + traceback.format_exc()) + return ERROR_MSG + traceback.format_exc(), NO_VALUE finally: try: async_raise(tid, Exception) @@ -160,17 +162,3 @@ def async_raise(tid, exctype=Exception): # and you should call it again with exc=NULL to revert the effect ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0) raise SystemError('PyThreadState_SetAsyncExc failed.') - - -def fake_interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): - """ - Fake, non-interruptible, using no threads and no signals - implementation used for debugging. This ignores the timeout and just - the function as-is. - """ - - try: - return True, func(*(args or ()), **(kwargs or {})) - except Exception: - import traceback - return False, ('ERROR: Unknown error:\n' + traceback.format_exc()) diff --git a/tests/scancode/test_interrupt.py b/tests/scancode/test_interrupt.py index de76a172495..738195ab51b 100644 --- a/tests/scancode/test_interrupt.py +++ b/tests/scancode/test_interrupt.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,8 +23,8 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals import os @@ -51,8 +51,9 @@ def some_long_function(exec_time): sleep(exec_time) return 'OK' - result = interrupt.interruptible(some_long_function, args=(0.01,), timeout=10) - assert (True, 'OK') == result + results = interrupt.interruptible(some_long_function, args=(0.01,), timeout=10) + expected = None, 'OK' + assert expected == results after = threading.active_count() assert before == after @@ -65,8 +66,9 @@ def some_long_function(exec_time): sleep(i) return 'OK' - result = interrupt.interruptible(some_long_function, args=(20,), timeout=0.00001) - assert (False, 'ERROR: Processing interrupted: timeout after 0 seconds.') == result + results = interrupt.interruptible(some_long_function, args=(20,), timeout=0.00001) + expected = 'ERROR: Processing interrupted: timeout after 0 seconds.', None + assert expected == results after = threading.active_count() assert before == after From e9cd4e5f72a810cdcf6fc5c311ad7d42662af5f4 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 11 Jan 2018 11:34:18 +0100 Subject: [PATCH 026/122] Ensure api function return a list #787 * and not a generator, so they can serialize OK without wrapping Signed-off-by: Philippe Ombredanne --- src/scancode/api.py | 123 +++++++++++++++++++++++++++---------- tests/scancode/test_api.py | 28 +++++---- 2 files changed, 106 insertions(+), 45 deletions(-) diff --git a/src/scancode/api.py b/src/scancode/api.py index d8dbc830b5e..75c02efb29e 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -27,14 +27,24 @@ from __future__ import unicode_literals from collections import OrderedDict +from os.path import getsize -# exposed as API -from scancode.resource import Resource # @UnusedImport -from scancode.resource import get_file_infos # @UnusedImport +from commoncode.hash import multi_checksums +from commoncode.filetype import get_last_modified_date +from commoncode.filetype import get_type as get_simple_type +from commoncode.filetype import is_file as filetype_is_file +from commoncode.fileutils import file_name +from commoncode.fileutils import splitext +from commoncode.system import on_linux +from typecode.contenttype import get_type """ Main scanning functions. + +Each scanner is a function that accepts a location and returns an iterable of +results. + Note: this API is unstable and still evolving. """ @@ -53,68 +63,72 @@ def extract_archives(location, recurse=True): def get_copyrights(location): """ - Yield mappings of copyright data detected in the file at `location`. + Return a list of mappings for copyright detected in the file at `location`. """ from cluecode.copyrights import detect_copyrights - + results = [] for copyrights, authors, _years, holders, start_line, end_line in detect_copyrights(location): result = OrderedDict() + results.append(result) # FIXME: we should call this copyright instead, and yield one item per statement result['statements'] = copyrights result['holders'] = holders result['authors'] = authors result['start_line'] = start_line result['end_line'] = end_line - yield result + return results def get_emails(location): """ - Yield mappings of emails detected in the file at `location`. + Return a list of mappings for emails detected in the file at `location`. """ from cluecode.finder import find_emails + results = [] for email, line_num in find_emails(location): if not email: continue - misc = OrderedDict() - misc['email'] = email - misc['start_line'] = line_num - misc['end_line'] = line_num - yield misc + result = OrderedDict() + results.append(result) + result['email'] = email + result['start_line'] = line_num + result['end_line'] = line_num + return results def get_urls(location): """ - Yield mappings of urls detected in the file at `location`. + Return a list of mappings for urls detected in the file at `location`. """ from cluecode.finder import find_urls + results = [] for urls, line_num in find_urls(location): if not urls: continue - misc = OrderedDict() - misc['url'] = urls - misc['start_line'] = line_num - misc['end_line'] = line_num - yield misc + result = OrderedDict() + results.append(result) + result['url'] = urls + result['start_line'] = line_num + result['end_line'] = line_num + return results DEJACODE_LICENSE_URL = 'https://enterprise.dejacode.com/urn/urn:dje:license:{}' SPDX_LICENSE_URL = 'https://spdx.org/licenses/{}' -def get_licenses(location, min_score=0, include_text=False, diag=False, license_url_template=DEJACODE_LICENSE_URL): +def get_licenses(location, min_score=0, include_text=False, diag=False, + license_url_template=DEJACODE_LICENSE_URL): """ - Yield mappings of license data detected in the file at `location`. + Return a list of mappings for licenses detected in the file at `location`. - `minimum_score` is a minimum score threshold from 0 to 100. The - default is 0 means that all license matches will be returned. With - any other value matches that have a score below minimum score with - not be returned. + `minimum_score` is a minimum score threshold from 0 to 100. The default is 0 + means that all license matches are returned. Otherwise, matches with a score + below `minimum_score` are returned. - if `include_text` is True, the matched text is included in the - returned data. + if `include_text` is True, matched text is included in the returned data. - If `diag` is True, additional match details are returned with the + If `diag` is True, additional license match details are returned with the matched_rule key of the returned mapping. """ from licensedcode.cache import get_index @@ -123,12 +137,15 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, license_ idx = get_index() licenses = get_licenses_db() + results = [] for match in idx.match(location=location, min_score=min_score): if include_text: matched_text = match.matched_text(whole_lines=False) + for license_key in match.rule.licenses: lic = licenses.get(license_key) result = OrderedDict() + results.append(result) result['key'] = lic.key result['score'] = match.score() result['short_name'] = lic.short_name @@ -161,16 +178,56 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, license_ # FIXME: for sanity this should always be included????? if include_text: result['matched_text'] = matched_text - yield result + + return results def get_package_infos(location): """ - Return a list of mappings of package information collected from the - `location` or an empty list. + Return a list of mappings for package information detected in the file at + `location`. """ from packagedcode.recognize import recognize_package package = recognize_package(location) - if not package: - return [] - return [package.to_dict()] + results = [] + if package: + results.append(package.to_dict()) + return results + + +def get_file_info(location): + """ + Return a list of mappings for file information collected for the file or + directory at `location`. + """ + result = OrderedDict() + results = [result] + + collector = get_type(location) + result['type'] = get_simple_type(location, short=False) + is_file = filetype_is_file(location) + + if is_file: + base_name, extension = splitext(location) + else: + # directories have no extension + base_name = file_name(location) + extension = b'' if on_linux else '' + result['base_name'] = base_name + result['extension'] = extension + + if is_file: + result['date'] = get_last_modified_date(location) or None + result['size'] = getsize(location) or 0 + result.update(multi_checksums(location, ('sha1', 'md5',))) + result['mime_type'] = collector.mimetype_file or None + result['file_type'] = collector.filetype_file or None + result['programming_language'] = collector.programming_language or None + result['is_binary'] = bool(collector.is_binary) + result['is_text'] = bool(collector.is_text) + result['is_archive'] = bool(collector.is_archive) + result['is_media'] = bool(collector.is_media) + result['is_source'] = bool(collector.is_source) + result['is_script'] = bool(collector.is_script) + + return results diff --git a/tests/scancode/test_api.py b/tests/scancode/test_api.py index 1e743154bbf..796378bad84 100644 --- a/tests/scancode/test_api.py +++ b/tests/scancode/test_api.py @@ -51,35 +51,39 @@ def test_get_package_infos_can_pickle(self): _pickled = pickle.dumps(package) _cpickled = cPickle.dumps(package) - def test_get_file_infos_flag_are_not_null(self): + def test_get_file_info_flag_are_not_null(self): # note the test file is EMPTY on purpose to generate all False is_* flags test_dir = self.get_test_loc('api/info') - info = api.get_file_infos(test_dir) - is_key_values = [v for k, v in info.items() if k.startswith('is_')] - assert all(v is not None for v in is_key_values) + infos = api.get_file_info(test_dir) + assert len(infos) == 1 + for info in infos: + is_key_values = [v for k, v in info.items() if k.startswith('is_')] + assert all(v is not None for v in is_key_values) def test_get_package_infos_works_for_maven_dot_pom(self): test_file = self.get_test_loc('api/package/p6spy-1.3.pom') packages = api.get_package_infos(test_file) assert len(packages) == 1 - package = packages[0] - assert package['version'] == '1.3' + for package in packages: + assert package['version'] == '1.3' def test_get_package_infos_works_for_maven_pom_dot_xml(self): test_file = self.get_test_loc('api/package/pom.xml') packages = api.get_package_infos(test_file) assert len(packages) == 1 - package = packages[0] - assert package['version'] == '1.3' + for package in packages: + assert package['version'] == '1.3' - def test_get_file_infos_include_base_name(self): + def test_get_file_info_include_base_name(self): test_dir = self.get_test_loc('api/info/test.txt') - info = api.get_file_infos(test_dir) - assert 'test' == info['base_name'] + infos = api.get_file_info(test_dir) + assert len(infos) == 1 + for info in infos: + assert 'test' == info['base_name'] def test_get_copyrights_include_copyrights_and_authors(self): test_file = self.get_test_loc('api/copyright/iproute.c') - cops = list(api.get_copyrights(test_file)) + cops = api.get_copyrights(test_file) expected = [ OrderedDict([ (u'statements', [u'Copyright (c) 2010 Patrick McHardy']), From 59bef89f1ac55ed5fae42e213a0b4813fbaba446 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 11 Jan 2018 19:07:46 +0100 Subject: [PATCH 027/122] Use latest attrs and typing #787 Signed-off-by: Philippe Ombredanne --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 00f23102337..cfb4b883a09 100644 --- a/setup.py +++ b/setup.py @@ -161,7 +161,6 @@ def read(*names, **kwargs): 'pygments >= 2.0.1, <3.0.0', # packagedcode - 'attrs >=16.0, < 17.0', 'pymaven-patch >= 0.2.4', 'requests >= 2.7.0, < 3.0.0', 'schematics_patched', @@ -170,6 +169,8 @@ def read(*names, **kwargs): 'click >= 6.0.0, < 7.0.0', 'colorama >= 0.3.9', 'pluggy >= 0.4.0, < 1.0', + 'attrs >=17.0, < 18.0', + 'typing >=3.6, < 3.7', # scancode outputs 'jinja2 >= 2.7.0, < 3.0.0', From 683ca2611fca6a8e500127050fd82739c3f570e0 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 09:01:39 +0100 Subject: [PATCH 028/122] Add file base_name to info scans #787 Signed-off-by: Philippe Ombredanne --- etc/scripts/testdata/livescan/expected.csv | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/etc/scripts/testdata/livescan/expected.csv b/etc/scripts/testdata/livescan/expected.csv index 1e1003996a2..6a8b9ae74f4 100644 --- a/etc/scripts/testdata/livescan/expected.csv +++ b/etc/scripts/testdata/livescan/expected.csv @@ -1,14 +1,5 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1599,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Resource,type,name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,.rb,2017-10-03,2017-10-03,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, @@ -16,5 +7,14 @@ Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,mime_type, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,file,license,,2017-10-03,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /license,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,.json,2017-10-03,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, From 0279764a6750f9a4014370ed7667da5933394538 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 09:09:22 +0100 Subject: [PATCH 029/122] Replace path_to_bytes/unicode by fsen/decode #787 * This was a useless wrapper * Also improve imports locality and other minor refactorings Signed-off-by: Philippe Ombredanne --- src/commoncode/command.py | 76 +++++++++++++++--------------- src/commoncode/fileutils.py | 66 +++++++++----------------- src/commoncode/ignore.py | 2 +- src/commoncode/testcase.py | 46 +++++++++--------- src/commoncode/timeutils.py | 5 +- src/extractcode/__init__.py | 45 ++++++++++-------- src/extractcode/archive.py | 13 +++-- src/packagedcode/recognize.py | 6 +-- tests/commoncode/test_fileutils.py | 17 ++++--- tests/commoncode/test_ignore.py | 40 +++++----------- 10 files changed, 143 insertions(+), 173 deletions(-) diff --git a/src/commoncode/command.py b/src/commoncode/command.py index ba1b6fd8e53..de922b6fb0c 100644 --- a/src/commoncode/command.py +++ b/src/commoncode/command.py @@ -27,14 +27,21 @@ from __future__ import unicode_literals import ctypes -import os +import os as _os_module +from os.path import abspath +from os.path import exists +from os.path import dirname +from os.path import join + import logging import signal import subprocess -from commoncode import fileutils -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode +from commoncode.fileutils import chmod +from commoncode.fileutils import fsencode +from commoncode.fileutils import fsdecode +from commoncode.fileutils import get_temp_dir +from commoncode.fileutils import RX from commoncode import text from commoncode import system from commoncode.system import current_os_arch @@ -48,15 +55,10 @@ try: # Python 2 unicode - str = unicode + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str - -try: - from os import fsencode -except ImportError: - from backports.os import fsencode + unicode = str # @ReservedAssignment """ @@ -81,7 +83,7 @@ # logger.setLevel(logging.DEBUG) # current directory is the root dir of this library -curr_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +curr_dir = dirname(dirname(abspath(__file__))) def execute(cmd, args, root_dir=None, cwd=None, env=None, to_files=False): @@ -108,9 +110,9 @@ def execute(cmd, args, root_dir=None, cwd=None, env=None, to_files=False): cwd = cwd or curr_dir # temp files for stderr and stdout - tmp_dir = fileutils.get_temp_dir(base_dir='cmd') - sop = os.path.join(tmp_dir, 'stdout') - sep = os.path.join(tmp_dir, 'stderr') + tmp_dir = get_temp_dir(base_dir='cmd') + sop = join(tmp_dir, 'stdout') + sep = join(tmp_dir, 'stderr') # shell==True is DANGEROUS but we are not running arbitrary commands # though we can execute command that just happen to be in the path @@ -144,7 +146,7 @@ def os_arch_dir(root_dir, _os_arch=current_os_arch): Return a sub-directory of `root_dir` tailored for the current OS and current processor architecture. """ - return os.path.join(root_dir, _os_arch) + return join(root_dir, _os_arch) def os_noarch_dir(root_dir, _os_noarch=current_os_noarch): @@ -152,7 +154,7 @@ def os_noarch_dir(root_dir, _os_noarch=current_os_noarch): Return a sub-directory of `root_dir` tailored for the current OS and NOT specific to a processor architecture. """ - return os.path.join(root_dir, _os_noarch) + return join(root_dir, _os_noarch) def noarch_dir(root_dir, _noarch=noarch): @@ -160,7 +162,7 @@ def noarch_dir(root_dir, _noarch=noarch): Return a sub-directory of `root_dir` that is NOT specific to an OS or processor architecture. """ - return os.path.join(root_dir, _noarch) + return join(root_dir, _noarch) def get_base_dirs(root_dir, @@ -185,14 +187,14 @@ def get_base_dirs(root_dir, binary of any given binary. This function resolves to an actual OS/arch location in this context. """ - if not root_dir or not os.path.exists(root_dir): + if not root_dir or not exists(root_dir): return [] dirs = [] def find_loc(fun, arg): loc = fun(root_dir, arg) - if os.path.exists(loc): + if exists(loc): dirs.append(loc) if _os_arch: @@ -217,17 +219,17 @@ def get_bin_lib_dirs(base_dir): if not base_dir: return None, None - bin_dir = os.path.join(base_dir, 'bin') + bin_dir = join(base_dir, 'bin') - if os.path.exists(bin_dir): - fileutils.chmod(bin_dir, fileutils.RX, recurse=True) + if exists(bin_dir): + chmod(bin_dir, RX, recurse=True) else: bin_dir = None - lib_dir = os.path.join(base_dir, 'lib') + lib_dir = join(base_dir, 'lib') - if os.path.exists(lib_dir): - fileutils.chmod(bin_dir, fileutils.RX, recurse=True) + if exists(lib_dir): + chmod(bin_dir, RX, recurse=True) else: # default to bin for lib if it exists lib_dir = bin_dir or None @@ -291,9 +293,9 @@ def get_locations(cmd, root_dir, for base_dir in get_base_dirs(root_dir, _os_arch, _os_noarch, _noarch): bin_dir, lib_dir = get_bin_lib_dirs(base_dir) - cmd_loc = os.path.join(bin_dir, cmd) - if os.path.exists(cmd_loc): - fileutils.chmod(cmd_loc, fileutils.RX, recurse=False) + cmd_loc = join(bin_dir, cmd) + if exists(cmd_loc): + chmod(cmd_loc, RX, recurse=False) return cmd_loc, bin_dir, lib_dir else: # we just care for getting the dirs and grab the first one @@ -341,12 +343,12 @@ def load_lib(libname, root_dir): """ os_dir = get_base_dirs(root_dir)[0] _bin_dir, lib_dir = get_bin_lib_dirs(os_dir) - so = os.path.join(lib_dir, libname + system.lib_ext) + so = join(lib_dir, libname + system.lib_ext) # add lib path to the front of the PATH env var update_path_environment(lib_dir) - if os.path.exists(so): + if exists(so): if not isinstance(so, bytes): # ensure that the path is not Unicode... so = fsencode(so) @@ -356,7 +358,7 @@ def load_lib(libname, root_dir): raise ImportError('Failed to load %(libname)s from %(so)r' % locals()) -def update_path_environment(new_path, _os_module=os): +def update_path_environment(new_path, _os_module=_os_module): """ Update the PATH environment variable by adding `new_path` to the front of PATH if `new_path` is not alreday in the PATH. @@ -379,12 +381,12 @@ def update_path_environment(new_path, _os_module=os): # ensure we use unicode or bytes depending on OSes if on_linux: - new_path = path_to_bytes(new_path) - path_env = path_to_bytes(path_env) + new_path = fsencode(new_path) + path_env = fsencode(path_env) sep = _os_module.pathsep else: - new_path = path_to_unicode(new_path) - path_env = path_to_unicode(path_env) + new_path = fsdecode(new_path) + path_env = fsdecode(path_env) sep = unicode(_os_module.pathsep) path_segments = path_env.split(sep) @@ -399,6 +401,6 @@ def update_path_environment(new_path, _os_module=os): if not on_linux: # recode to bytes using FS encoding - new_path_env = path_to_bytes(new_path_env) + new_path_env = fsencode(new_path_env) # ... and set the variable back as bytes _os_module.environ[b'PATH'] = new_path_env diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index e9dedaf9da9..2d61487b4f0 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -30,17 +30,17 @@ try: # Python 2 unicode - str = unicode + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str + unicode = str # @ReservedAssignment try: from os import fsencode from os import fsdecode except ImportError: from backports.os import fsencode - from backports.os import fsdecode + from backports.os import fsdecode # @UnusedImport import codecs @@ -53,7 +53,6 @@ import sys import tempfile - from commoncode import filetype from commoncode.filetype import is_rwx from commoncode import system @@ -116,7 +115,7 @@ def create_dir(location): # FIXME: consider using UNC ?\\ paths if on_linux: - location = path_to_bytes(location) + location = fsencode(location) try: os.makedirs(location) chmod(location, RW, recurse=False) @@ -147,20 +146,20 @@ def system_temp_dir(): sc = text.python_safe_name('scancode_' + system.username) temp_dir = os.path.join(tempfile.gettempdir(), sc) if on_linux: - temp_dir = path_to_bytes(temp_dir) + temp_dir = fsencode(temp_dir) create_dir(temp_dir) return temp_dir def get_temp_dir(base_dir, prefix=''): """ - Return the path to a new unique temporary directory, created under - the system-wide `system_temp_dir` temp directory as a subdir of the - base_dir path (a path relative to the `system_temp_dir`). + Return the path to a new existing unique temporary directory, created under + the system-wide `system_temp_dir` temp directory as a subdir of the base_dir + path (a path relative to the `system_temp_dir`). """ if on_linux: - base_dir = path_to_bytes(base_dir) - prefix = path_to_bytes(prefix) + base_dir = fsencode(base_dir) + prefix = fsencode(prefix) base = os.path.join(system_temp_dir(), base_dir) create_dir(base) return tempfile.mkdtemp(prefix=prefix, dir=base) @@ -191,7 +190,7 @@ def _text(location, encoding, universal_new_lines=True): Python2.6 see http://bugs.python.org/issue691291 """ if on_linux: - location = path_to_bytes(location) + location = fsencode(location) with codecs.open(location, 'r', encoding) as f: text = f.read() if universal_new_lines: @@ -216,25 +215,6 @@ def read_text_file(location, universal_new_lines=True): # TODO: move these functions to paths.py or codecs.py -def path_to_unicode(path): - """ - Return a path string `path` as a unicode string. - """ - if isinstance(path, unicode): - return path - if TRACE: logger_debug('path_to_unicode:', fsdecode(path)) - return fsdecode(path) - - -def path_to_bytes(path): - """ - Return a `path` string as a byte string using the filesystem encoding. - """ - if isinstance(path, bytes): - return path - if TRACE: logger_debug('path_to_bytes:' , repr(fsencode(path))) - return fsencode(path) - def is_posixpath(location): """ @@ -398,7 +378,7 @@ def walk(location, ignored=ignore_nothing): - location is a directory or a file: for a file, the file is returned. """ if on_linux: - location = path_to_bytes(location) + location = fsencode(location) # TODO: consider using the new "scandir" module for some speed-up. if TRACE: @@ -443,7 +423,7 @@ def resource_iter(location, ignored=ignore_nothing, with_dirs=True): :return: an iterable of file and directory locations. """ if on_linux: - location = path_to_bytes(location) + location = fsencode(location) for top, dirs, files in walk(location, ignored): if with_dirs: for d in dirs: @@ -469,8 +449,8 @@ def copytree(src, dst): function. See fileutils.py.ABOUT for details. """ if on_linux: - src = path_to_bytes(src) - dst = path_to_bytes(dst) + src = fsencode(src) + dst = fsencode(dst) if not filetype.is_readable(src): chmod(src, R, recurse=False) @@ -518,8 +498,8 @@ def copyfile(src, dst): for details. """ if on_linux: - src = path_to_bytes(src) - dst = path_to_bytes(dst) + src = fsencode(src) + dst = fsencode(dst) if not filetype.is_regular(src): return @@ -539,8 +519,8 @@ def copytime(src, dst): for details. """ if on_linux: - src = path_to_bytes(src) - dst = path_to_bytes(dst) + src = fsencode(src) + dst = fsencode(dst) errors = [] st = os.stat(src) @@ -576,7 +556,7 @@ def chmod(location, flags, recurse=False): if not location or not os.path.exists(location): return if on_linux: - location = path_to_bytes(location) + location = fsencode(location) location = os.path.abspath(location) @@ -606,7 +586,7 @@ def chmod_tree(location, flags): Update permissions recursively in a directory tree `location`. """ if on_linux: - location = path_to_bytes(location) + location = fsencode(location) if filetype.is_dir(location): for top, dirs, files in walk(location): for d in dirs: @@ -624,7 +604,7 @@ def _rm_handler(function, path, excinfo): # @UnusedVariable This retries deleting once before giving up. """ if on_linux: - path = path_to_bytes(path) + path = fsencode(path) if function == os.rmdir: try: chmod(path, RW, recurse=True) @@ -654,7 +634,7 @@ def delete(location, _err_handler=_rm_handler): return if on_linux: - location = path_to_bytes(location) + location = fsencode(location) if os.path.exists(location) or filetype.is_broken_link(location): chmod(os.path.dirname(location), RW, recurse=False) diff --git a/src/commoncode/ignore.py b/src/commoncode/ignore.py index c4a86be930b..111a70166a8 100644 --- a/src/commoncode/ignore.py +++ b/src/commoncode/ignore.py @@ -36,7 +36,7 @@ """ -def is_ignored(location, ignores, unignores, skip_special=True): +def is_ignored(location, ignores, unignores=None, skip_special=True): """ Return a tuple of (pattern , message) if a file at location is ignored or False otherwise. diff --git a/src/commoncode/testcase.py b/src/commoncode/testcase.py index 096f39727bd..73907b1a327 100644 --- a/src/commoncode/testcase.py +++ b/src/commoncode/testcase.py @@ -39,7 +39,7 @@ import zipfile from commoncode import fileutils -from commoncode.fileutils import path_to_bytes +from commoncode.fileutils import fsencode from commoncode import filetype from commoncode.system import on_linux from commoncode.system import on_posix @@ -100,7 +100,7 @@ def to_os_native_path(path): Normalize a path to use the native OS path separator. """ if on_linux: - path = path_to_bytes(path) + path = fsencode(path) path = path.replace(POSIX_PATH_SEP, OS_PATH_SEP) path = path.replace(WIN_PATH_SEP, OS_PATH_SEP) path = path.rstrip(OS_PATH_SEP) @@ -113,8 +113,8 @@ def get_test_loc(test_path, test_data_dir, debug=False, exists=True): location to a test file or directory for this path. No copy is done. """ if on_linux: - test_path = path_to_bytes(test_path) - test_data_dir = path_to_bytes(test_data_dir) + test_path = fsencode(test_path) + test_data_dir = fsencode(test_data_dir) if debug: import inspect @@ -154,8 +154,8 @@ def get_test_loc(self, test_path, copy=False, debug=False): """ test_data_dir = self.test_data_dir if on_linux: - test_path = path_to_bytes(test_path) - test_data_dir = path_to_bytes(test_data_dir) + test_path = fsencode(test_path) + test_data_dir = fsencode(test_data_dir) if debug: import inspect @@ -189,9 +189,9 @@ def get_temp_file(self, extension=None, dir_name='td', file_name='tf'): extension = '.txt' if on_linux: - extension = path_to_bytes(extension) - dir_name = path_to_bytes(dir_name) - file_name = path_to_bytes(file_name) + extension = fsencode(extension) + dir_name = fsencode(dir_name) + file_name = fsencode(file_name) if extension and not extension.startswith(DOT): extension = DOT + extension @@ -213,7 +213,7 @@ def get_temp_dir(self, sub_dir_path=None): if not test_run_temp_dir: test_run_temp_dir = fileutils.get_temp_dir(base_dir='tst', prefix=' ') if on_linux: - test_run_temp_dir = path_to_bytes(test_run_temp_dir) + test_run_temp_dir = fsencode(test_run_temp_dir) new_temp_dir = fileutils.get_temp_dir(base_dir=test_run_temp_dir) @@ -230,8 +230,8 @@ def remove_vcs(self, test_dir): """ vcses = ('CVS', '.svn', '.git', '.hg') if on_linux: - vcses = tuple(path_to_bytes(p) for p in vcses) - test_dir = path_to_bytes(test_dir) + vcses = tuple(fsencode(p) for p in vcses) + test_dir = fsencode(test_dir) for root, dirs, files in os.walk(test_dir): for vcs_dir in vcses: @@ -256,14 +256,14 @@ def __extract(self, test_path, extract_func=None, verbatim=False): """ assert test_path and test_path != '' if on_linux: - test_path = path_to_bytes(test_path) + test_path = fsencode(test_path) test_path = to_os_native_path(test_path) target_path = os.path.basename(test_path) target_dir = self.get_temp_dir(target_path) original_archive = self.get_test_loc(test_path) if on_linux: - target_dir = path_to_bytes(target_dir) - original_archive = path_to_bytes(original_archive) + target_dir = fsencode(target_dir) + original_archive = fsencode(original_archive) extract_func(original_archive, target_dir, verbatim=verbatim) return target_dir @@ -291,8 +291,8 @@ def _extract_tar_raw(test_path, target_dir, to_bytes, *args, **kwargs): """ if to_bytes: # use bytes for paths on ALL OSes (though this may fail on macOS) - target_dir = path_to_bytes(target_dir) - test_path = path_to_bytes(test_path) + target_dir = fsencode(target_dir) + test_path = fsencode(test_path) tar = tarfile.open(test_path) tar.extractall(path=target_dir) tar.close() @@ -309,8 +309,8 @@ def extract_tar(location, target_dir, verbatim=False, *args, **kwargs): """ # always for using bytes for paths on all OSses... tar seems to use bytes internally # and get confused otherwise - location = path_to_bytes(location) - target_dir = path_to_bytes(target_dir) + location = fsencode(location) + target_dir = fsencode(target_dir) with open(location, 'rb') as input_tar: tar = None @@ -337,8 +337,8 @@ def extract_zip(location, target_dir, *args, **kwargs): raise Exception('Incorrect zip file %(location)r' % locals()) if on_linux: - location = path_to_bytes(location) - target_dir = path_to_bytes(target_dir) + location = fsencode(location) + target_dir = fsencode(target_dir) with zipfile.ZipFile(location) as zipf: for info in zipf.infolist(): @@ -364,8 +364,8 @@ def extract_zip_raw(location, target_dir, *args, **kwargs): raise Exception('Incorrect zip file %(location)r' % locals()) if on_linux: - location = path_to_bytes(location) - target_dir = path_to_bytes(target_dir) + location = fsencode(location) + target_dir = fsencode(target_dir) with zipfile.ZipFile(location) as zipf: zipf.extractall(path=target_dir) diff --git a/src/commoncode/timeutils.py b/src/commoncode/timeutils.py index 9db6613508d..643d141f8a5 100644 --- a/src/commoncode/timeutils.py +++ b/src/commoncode/timeutils.py @@ -24,9 +24,9 @@ from __future__ import absolute_import, print_function - from datetime import datetime, tzinfo + """ Time is of the essence: path safe time stamps creation and conversion to datetime objects. @@ -60,7 +60,8 @@ def time2tstamp(dt=None): For times, the ISO 8601 format specifies either a colon : (extended format) or nothing as a separator (basic format). Here Python defaults to using a - colon. We therefore remove all the colons to be file system safe. + colon. We therefore remove all the colons to be safe across filesystems. (a + colon is not a valid path char on Windows) Another character may show up in the ISO representation such as / for time intervals. We could replace the forward slash with a double hyphen (--) as diff --git a/src/extractcode/__init__.py b/src/extractcode/__init__.py index 6c6ed472ac9..ea885fe269c 100644 --- a/src/extractcode/__init__.py +++ b/src/extractcode/__init__.py @@ -33,11 +33,16 @@ import shutil import sys -from commoncode import fileutils +from commoncode.fileutils import as_posixpath +from commoncode.fileutils import create_dir +from commoncode.fileutils import file_name +from commoncode.fileutils import fsencode +from commoncode.fileutils import parent_directory from commoncode.text import toascii from commoncode.system import on_linux -from commoncode.fileutils import path_to_bytes -from commoncode.system import on_linux +from os.path import dirname +from os.path import join +from os.path import exists logger = logging.getLogger(__name__) @@ -47,7 +52,7 @@ # logger.setLevel(logging.DEBUG) -root_dir = os.path.join(os.path.dirname(__file__), 'bin') +root_dir = join(dirname(__file__), 'bin') POSIX_PATH_SEP = b'/' if on_linux else '/' @@ -103,7 +108,7 @@ def is_extraction_path(path): Return True is the path points to an extraction path. """ if on_linux: - path = path_to_bytes(path) + path = fsencode(path) return path and path.rstrip(PATHS_SEPS).endswith(EXTRACT_SUFFIX) @@ -114,8 +119,8 @@ def is_extracted(location): extraction location. """ if on_linux: - location = path_to_bytes(location) - return location and os.path.exists(get_extraction_path(location)) + location = fsencode(location) + return location and exists(get_extraction_path(location)) def get_extraction_path(path): @@ -123,7 +128,7 @@ def get_extraction_path(path): Return a path where to extract. """ if on_linux: - path = path_to_bytes(path) + path = fsencode(path) return path.rstrip(PATHS_SEPS) + EXTRACT_SUFFIX @@ -132,7 +137,7 @@ def remove_archive_suffix(path): Remove all the extracted suffix from a path. """ if on_linux: - path = path_to_bytes(path) + path = fsencode(path) return re.sub(EXTRACT_SUFFIX, EMPTY_STRING, path) @@ -142,25 +147,25 @@ def remove_backslashes_and_dotdots(directory): Return a list of errors if any. """ if on_linux: - directory = path_to_bytes(directory) + directory = fsencode(directory) errors = [] for top, _, files in os.walk(directory): for filename in files: if not (WIN_PATH_SEP in filename or DOTDOT in filename): continue try: - new_path = fileutils.as_posixpath(filename) + new_path = as_posixpath(filename) new_path = new_path.strip(POSIX_PATH_SEP) new_path = posixpath.normpath(new_path) new_path = new_path.replace(DOTDOT, POSIX_PATH_SEP) new_path = new_path.strip(POSIX_PATH_SEP) new_path = posixpath.normpath(new_path) segments = new_path.split(POSIX_PATH_SEP) - directory = os.path.join(top, *segments[:-1]) - fileutils.create_dir(directory) - shutil.move(os.path.join(top, filename), os.path.join(top, *segments)) + directory = join(top, *segments[:-1]) + create_dir(directory) + shutil.move(join(top, filename), join(top, *segments)) except Exception: - errors.append(os.path.join(top, filename)) + errors.append(join(top, filename)) return errors @@ -180,16 +185,16 @@ def new_name(location, is_dir=False): """ assert location if on_linux: - location = path_to_bytes(location) + location = fsencode(location) location = location.rstrip(PATHS_SEPS) assert location - parent = fileutils.parent_directory(location) + parent = parent_directory(location) # all existing files or directory as lower case siblings_lower = set(s.lower() for s in os.listdir(parent)) - filename = fileutils.file_name(location) + filename = file_name(location) # corner case if filename in (DOT, DOT): @@ -197,7 +202,7 @@ def new_name(location, is_dir=False): # if unique, return this if filename.lower() not in siblings_lower: - return os.path.join(parent, filename) + return join(parent, filename) # otherwise seek a unique name if is_dir: @@ -219,7 +224,7 @@ def new_name(location, is_dir=False): if filename.lower() not in siblings_lower: break counter += 1 - return os.path.join(parent, filename) + return join(parent, filename) # TODO: use attrs and slots diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index 436d5441675..e0a170be59d 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -33,6 +33,7 @@ from commoncode import fileutils from commoncode import filetype +from commoncode.system import on_linux import typecode from extractcode import all_kinds @@ -49,8 +50,6 @@ from extractcode import libarchive2 from extractcode.uncompress import uncompress_gzip from extractcode.uncompress import uncompress_bzip2 -from commoncode.system import on_linux -from commoncode.fileutils import path_to_bytes logger = logging.getLogger(__name__) @@ -150,7 +149,7 @@ def get_best_handler(location, kinds=all_kinds): Return the best handler of None for the file at location. """ if on_linux: - location = path_to_bytes(location) + location = fileutils.fsencode(location) location = os.path.abspath(os.path.expanduser(location)) if not filetype.is_file(location): return @@ -166,7 +165,7 @@ def get_handlers(location): extension_matched,) for this `location`. """ if on_linux: - location = path_to_bytes(location) + location = fileutils.fsencode(location) if filetype.is_file(location): T = typecode.contenttype.get_type(location) @@ -187,7 +186,7 @@ def get_handlers(location): exts = handler.extensions if exts: if on_linux: - exts = tuple(path_to_bytes(e) for e in exts) + exts = tuple(fileutils.fsencode(e) for e in exts) extension_matched = exts and location.lower().endswith(exts) if TRACE_DEEP: @@ -311,8 +310,8 @@ def extract_twice(location, target_dir, extractor1, extractor2): covers most common cases. """ if on_linux: - location = path_to_bytes(location) - target_dir = path_to_bytes(target_dir) + location = fileutils.fsencode(location) + target_dir = fileutils.fsencode(target_dir) abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) # extract first the intermediate payload to a temp dir diff --git a/src/packagedcode/recognize.py b/src/packagedcode/recognize.py index a8a78f265e2..220d0164f6d 100644 --- a/src/packagedcode/recognize.py +++ b/src/packagedcode/recognize.py @@ -29,8 +29,8 @@ import sys from commoncode import filetype +from commoncode.fileutils import fsencode from commoncode.system import on_linux -from commoncode.fileutils import path_to_bytes from packagedcode import PACKAGE_TYPES from typecode import contenttype @@ -72,7 +72,7 @@ def recognize_package(location): # Note: default to True if there is nothing to match against metafiles = package_type.metafiles if on_linux: - metafiles = (path_to_bytes(m) for m in metafiles) + metafiles = (fsencode(m) for m in metafiles) if location.endswith(tuple(metafiles)): logger_debug('metafile matching: package_type is of type:', package_type) return package_type.recognize(location) @@ -89,7 +89,7 @@ def recognize_package(location): extensions = package_type.extensions if extensions: if on_linux: - extensions = tuple(path_to_bytes(e) for e in extensions) + extensions = tuple(fsencode(e) for e in extensions) extension_matched = location.lower().endswith(extensions) else: extension_matched = False diff --git a/tests/commoncode/test_fileutils.py b/tests/commoncode/test_fileutils.py index cd6b4ed1c87..c5942b59a42 100644 --- a/tests/commoncode/test_fileutils.py +++ b/tests/commoncode/test_fileutils.py @@ -32,8 +32,8 @@ from commoncode import filetype from commoncode import fileutils from commoncode.fileutils import as_posixpath -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode +from commoncode.fileutils import fsencode +from commoncode.fileutils import fsdecode from commoncode.system import on_linux from commoncode.system import on_posix from commoncode.system import on_mac @@ -306,15 +306,14 @@ def test_resource_name(self): assert 'f.a' == fileutils.resource_name('a/b/d/f/f.a') assert 'f.a' == fileutils.resource_name('f.a') - @skipIf(on_windows, 'Windows FS encoding is ... different') - def test_path_to_unicode_and_path_to_bytes_are_idempotent(self): + @skipIf(on_windows, 'Windows FS encoding is ... different!') + def test_fsdecode_and_fsencode_are_idempotent(self): a = b'foo\xb1bar' b = u'foo\udcb1bar' - assert a == path_to_bytes(path_to_unicode(a)) - assert a == path_to_bytes(path_to_unicode(b)) - assert b == path_to_unicode(path_to_bytes(a)) - assert b == path_to_unicode(path_to_bytes(b)) - + assert a == fsencode(fsdecode(a)) + assert a == fsencode(fsdecode(b)) + assert b == fsdecode(fsencode(a)) + assert b == fsdecode(fsencode(b)) class TestFileUtilsWalk(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/commoncode/test_ignore.py b/tests/commoncode/test_ignore.py index aafd363023b..cc4fb868543 100644 --- a/tests/commoncode/test_ignore.py +++ b/tests/commoncode/test_ignore.py @@ -38,24 +38,8 @@ class IgnoreTest(commoncode.testcase.FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - def check_default(self, test_dir, expected_message): - for top, dirs, files in os.walk(test_dir, topdown=True): - not_ignored = [] - for d in dirs: - p = os.path.join(top, d) - ign = ignore.is_ignored(p, ignore.default_ignores, {}) - if not ign: - not_ignored.append(d) - dirs[:] = not_ignored - - for f in files: - p = os.path.join(top, f) - ign = ignore.is_ignored(p, ignore.default_ignores, {}) - if ign: - assert ign == expected_message - @skipIf(on_mac, 'Return different result on Mac for reasons to investigate') - def test_default_ignores_eclipse1(self): + def test_is_ignored_default_ignores_eclipse1(self): test_dir = self.extract_test_tar('ignore/excludes/eclipse.tgz') test_base = os.path.join(test_dir, 'eclipse') @@ -63,7 +47,7 @@ def test_default_ignores_eclipse1(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: Eclipse IDE artifact' == result - def test_default_ignores_eclipse2(self): + def test_is_ignored_default_ignores_eclipse2(self): test_dir = self.extract_test_tar('ignore/excludes/eclipse.tgz') test_base = os.path.join(test_dir, 'eclipse') @@ -71,7 +55,7 @@ def test_default_ignores_eclipse2(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: Eclipse IDE artifact' == result - def test_default_ignores_eclipse3(self): + def test_is_ignored_default_ignores_eclipse3(self): test_dir = self.extract_test_tar('ignore/excludes/eclipse.tgz') test_base = os.path.join(test_dir, 'eclipse') @@ -79,7 +63,7 @@ def test_default_ignores_eclipse3(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: Eclipse IDE artifact' == result - def test_default_ignores_eclipse4(self): + def test_is_ignored_default_ignores_eclipse4(self): test_dir = self.extract_test_tar('ignore/excludes/eclipse.tgz') test_base = os.path.join(test_dir, 'eclipse') @@ -87,7 +71,7 @@ def test_default_ignores_eclipse4(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: Eclipse IDE artifact' == result - def test_default_ignores_mac1(self): + def test_is_ignored_default_ignores_mac1(self): test_dir = self.extract_test_tar('ignore/excludes/mac.tgz') test_base = os.path.join(test_dir, 'mac') @@ -95,7 +79,7 @@ def test_default_ignores_mac1(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: MacOSX artifact' == result - def test_default_ignores_mac2(self): + def test_is_ignored_default_ignores_mac2(self): test_dir = self.extract_test_tar('ignore/excludes/mac.tgz') test_base = os.path.join(test_dir, 'mac') @@ -103,7 +87,7 @@ def test_default_ignores_mac2(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: MacOSX artifact' == result - def test_default_ignores_mac3(self): + def test_is_ignored_default_ignores_mac3(self): test_dir = self.extract_test_tar('ignore/excludes/mac.tgz') test_base = os.path.join(test_dir, 'mac') @@ -111,7 +95,7 @@ def test_default_ignores_mac3(self): result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: MacOSX artifact' == result - def test_default_ignores_mac4(self): + def test_is_ignored_default_ignores_mac4(self): test_dir = self.extract_test_tar('ignore/excludes/mac.tgz') test_base = os.path.join(test_dir, 'mac') @@ -120,7 +104,7 @@ def test_default_ignores_mac4(self): assert 'Default ignore: MacOSX artifact' == result @skipIf(on_mac, 'Return different result on Mac for reasons to investigate') - def test_default_ignores_mac5(self): + def test_is_ignored_default_ignores_mac5(self): test_dir = self.extract_test_tar('ignore/excludes/mac.tgz') test_base = os.path.join(test_dir, 'mac') @@ -130,14 +114,14 @@ def test_default_ignores_mac5(self): assert 'Default ignore: MacOSX artifact' == result @skipIf(on_mac, 'Return different result on Mac for reasons to investigate') - def test_default_ignores_msft(self): + def test_is_ignored_default_ignores_msft(self): test_dir = self.extract_test_tar('ignore/excludes/msft-vs.tgz') test = os.path.join(test_dir, 'msft-vs/tst.sluo') result = ignore.is_ignored(test, ignore.default_ignores, {}) assert 'Default ignore: Microsoft VS project artifact' == result @skipIf(on_mac, 'Return different result on Mac for reasons to investigate') - def test_skip_vcs_files_and_dirs(self): + def test_is_ignored_skip_vcs_files_and_dirs(self): test_dir = self.extract_test_tar('ignore/vcs.tgz') result = [] for top, dirs, files in os.walk(test_dir, topdown=True): @@ -178,7 +162,7 @@ def test_skip_vcs_files_and_dirs(self): ] assert sorted(expected) == sorted(result) - def test_default_ignore_does_not_skip_one_char_names(self): + def test_fileset_match_default_ignore_does_not_skip_one_char_names(self): # use fileset directly to work on strings not locations from commoncode import fileset tests = [c for c in 'HFS+ Private Data'] + 'HFS+ Private Data'.split() From 4ba3b7760162ec9aa0dcfe8d0fd4e393cb7c73ec Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 09:18:13 +0100 Subject: [PATCH 030/122] Improve base plugins design #787 * use generic get_plugins for all plugin types rather than a function with a unique name * use Resource objects throughout (except for format plugins) * enhance BasePlugin base class: the methods are now setup() and teardown() to be executed at init/exit time, process_resource() to process a single Resource and process_codebase() to process a whole Codebase Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 48 ++++++++++++++++++++++++------------- src/plugincode/output.py | 2 +- src/plugincode/post_scan.py | 5 ++-- src/plugincode/pre_scan.py | 13 ++++++---- 4 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 2ef741012d1..1a41f4aa467 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -30,15 +30,20 @@ class BasePlugin(object): """ - A base class for all scancode plugins. + A base class for all ScanCode plugins. """ - # a short string describing this plugin. Subclass must override + # A short string describing this plugin, used for GUI display. The class + # name is used if not provided. Subclass should override name = None + # Tuple of scanner names that this plugin requires to run its own run + requires = tuple() + def __init__(self, selected_options, active_scan_names=None): """ Initialize a new plugin with a mapping of user `selected_options` (e.g. - keyword arguments) and a list of `active_scan_names`. + CommandOption tuples based on keyword arguments) and a list of + `active_scan_names`. """ self.selected_options = selected_options or {} self.active_scan_names = active_scan_names or [] @@ -54,26 +59,37 @@ def get_plugin_options(cls): def is_enabled(self): """ Return True is this plugin is enabled by user-selected options. - Subclasses must override and implement. + Subclasses must override. """ raise NotImplementedError - def process_one(self, resource): + def setup(self): + """ + Execute some setup for this plugin. This is guaranteed to be called + exactly one time after initialization. Must return True on sucess or + False otherwise. Subclasses can override as needed. + """ + return True + + def teardown(self): + """ + Execute some teardown for this plugin. This is guaranteed to be called + exactly one time when ScanCode exists. Must return True on sucess or + False otherwise. Subclasses can override as needed. + """ + return True + + def process_resource(self, resource): """ - Yield zero, one or more Resource objects from a single `resource` - Resource object. + Process a single `resource` Resource object. Subclasses should override. """ - yield resource + pass - def process_resources(self, resources): + def process_codebase(self, codebase): """ - Return an iterable of Resource objects, possibly transformed, filtered - or enhanced by this plugin from a `resources` iterable of Resource - objects. + Process a `codebase` Codebase object updating its Reousrce as needed. Subclasses should override. """ - for resource in resources: - for res in self.process_one(resource): - if res: - yield res + for resource in codebase.walk(): + self.process_resource(resource) diff --git a/src/plugincode/output.py b/src/plugincode/output.py index 824911e406a..59afd10090e 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -69,7 +69,7 @@ def initialize(): output_plugins.load_setuptools_entrypoints('scancode_output_writers') -def get_format_plugins(): +def get_plugins(): """ Return an ordered mapping of format name --> plugin callable for all the output plugins. The mapping is ordered by sorted key. diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index ffe367b5135..ed155f6a198 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -52,15 +52,16 @@ class PostScanPlugin(BasePlugin): def initialize(): """ + Load and validates plugins. NOTE: this defines the entry points for use in setup.py """ post_scan_plugins.load_setuptools_entrypoints('scancode_post_scan') - for name, plugin in get_post_scan_plugins().items(): + for name, plugin in get_plugins().items(): if not issubclass(plugin, PostScanPlugin): raise Exception('Invalid post-scan plugin "%(name)s": does not extend "plugincode.post_scan.PostScanPlugin".' % locals()) -def get_post_scan_plugins(): +def get_plugins(): """ Return an ordered mapping of "command line option name" --> "plugin callable" diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index d28b61673ec..c720fe53d5a 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -51,14 +51,19 @@ class PreScanPlugin(BasePlugin): def initialize(): - # NOTE: this defines the entry points for use in setup.py + """ + NOTE: this defines the entry points for use in setup.py + Load and validates plugins. + """ pre_scan_plugins.load_setuptools_entrypoints('scancode_pre_scan') - for name, plugin in get_pre_scan_plugins().items(): + for name, plugin in get_plugins().items(): if not issubclass(plugin, PreScanPlugin): - raise Exception('Invalid pre-scan plugin "%(name)s": does not extend "plugincode.pre_scan.PreScanPlugin".' % locals()) + raise Exception( + 'Invalid pre-scan plugin "%(name)s": ' + 'does not extend "plugincode.pre_scan.PreScanPlugin".' % locals()) -def get_pre_scan_plugins(): +def get_plugins(): """ Return an ordered mapping of plugin "name" --> plugin object for all the pre-scan plugins. The mapping is sorted by name. From 9613d653accefec2eddda429c9a9254eda6d6663 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 09:23:49 +0100 Subject: [PATCH 031/122] Refine scan utilities * remove NoOpProgressBar which is not needed when no progress is requested * streamline scan progress event reporting with fixed width file names including moving to utils all functions dealing with progress bars * update tests accordingly including moving cli.py tests to proper util module Signed-off-by: Philippe Ombredanne --- src/scancode/utils.py | 145 ++++++++++++------------ tests/scancode/test_scan_help_groups.py | 82 -------------- tests/scancode/test_scan_utils.py | 118 ++++++++++++++++--- 3 files changed, 176 insertions(+), 169 deletions(-) delete mode 100644 tests/scancode/test_scan_help_groups.py diff --git a/src/scancode/utils.py b/src/scancode/utils.py index 4af4170c473..ee2f35c3a8a 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -23,29 +23,36 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals import click +click.disable_unicode_literals_warning = True from click.utils import echo +from click.termui import style from click._termui_impl import ProgressBar -from commoncode import fileutils -from commoncode.fileutils import path_to_unicode +from commoncode.fileutils import file_name +from commoncode.fileutils import fsdecode +from commoncode.fileutils import splitext -""" -Various CLI UI utilities, many related to Click and progress reporting. -""" - # Python 2 and 3 support try: # Python 2 unicode + str_orig = str + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str + unicode = str # @ReservedAssignment + + +""" +Command line UI utilities for help and and progress reporting. +""" class BaseCommand(click.Command): @@ -83,15 +90,6 @@ def render_progress(self): return super(EnhancedProgressBar, self).render_progress() -class NoOpProgressBar(EnhancedProgressBar): - """ - A ProgressBar-like object that does not show any progress. - """ - def __init__(self, *args, **kwargs): - super(NoOpProgressBar, self).__init__(*args, **kwargs) - self.is_hidden = True - - class ProgressLogger(ProgressBar): """ A subclass of Click ProgressBar providing a verbose line-by-line progress @@ -135,88 +133,74 @@ def render_finish(self): BAR_SEP_LEN = len(BAR_SEP) def progressmanager(iterable=None, length=None, label=None, show_eta=True, - show_percent=None, show_pos=False, item_show_func=None, + show_percent=None, show_pos=True, item_show_func=None, fill_char='#', empty_char='-', bar_template=None, info_sep=BAR_SEP, width=BAR_WIDTH, file=None, color=None, - verbose=False, quiet=False): + verbose=False): - """This function creates an iterable context manager showing progress as a - bar (default) or line-by-line log (if verbose is True) while iterating. + """ + Return an iterable context manager showing progress as a progress bar + (default) or item-by-item log (if verbose is True) while iterating. - Its arguments are similar to Click.termui.progressbar with - these new arguments added at the end of the signature: + Its arguments are similar to Click.termui.progressbar with these new + arguments added at the end of the signature: - :param verbose: if False, display a progress bar, otherwise a progress log - :param quiet: If True, do not display any progress message. + :param verbose: if True, display a progress log. Otherwise, a progress bar. """ - if quiet: - progress_class = NoOpProgressBar - elif verbose: + if verbose: progress_class = ProgressLogger else: progress_class = EnhancedProgressBar bar_template = ('[%(bar)s]' + BAR_SEP + '%(info)s' if bar_template is None else bar_template) - return progress_class(iterable=iterable, length=length, show_eta=show_eta, - show_percent=show_percent, show_pos=show_pos, - item_show_func=item_show_func, fill_char=fill_char, - empty_char=empty_char, bar_template=bar_template, - info_sep=info_sep, file=file, label=label, - width=width, color=color) - - -def get_relative_path(path, len_base_path, base_is_dir): - """ - Return a posix relative path from the posix 'path' relative to a - base path of `len_base_path` length where the base is a directory if - `base_is_dir` True or a file otherwise. - """ - path = path_to_unicode(path) - if base_is_dir: - rel_path = path[len_base_path:] - else: - rel_path = fileutils.file_name(path) - - return rel_path.lstrip('/') + return progress_class(iterable=iterable, length=length, + show_eta=show_eta, show_percent=show_percent, show_pos=show_pos, + item_show_func=item_show_func, fill_char=fill_char, + empty_char=empty_char, bar_template=bar_template, info_sep=info_sep, + file=file, label=label, width=width, color=color) def fixed_width_file_name(path, max_length=25): """ - Return a fixed width file name of at most `max_length` characters - extracted from the `path` string and usable for fixed width display. - If the file_name is longer than `max_length`, it is truncated in the - middle with using three dots "..." as an ellipsis and the extension - is kept. + Return a fixed width file name of at most `max_length` characters computed + from the `path` string and usable for fixed width display. If the `path` + file name is longer than `max_length`, the file name is truncated in the + middle using three dots "..." as an ellipsis and the ext is kept. For example: - >>> short = fixed_width_file_name('0123456789012345678901234.c') - >>> assert '0123456789...5678901234.c' == short + >>> fwfn = fixed_width_file_name('0123456789012345678901234.c') + >>> assert '0123456789...5678901234.c' == fwfn + >>> fwfn = fixed_width_file_name('some/path/0123456789012345678901234.c') + >>> assert '0123456789...5678901234.c' == fwfn + >>> fwfn = fixed_width_file_name('some/sort.c') + >>> assert 'sort.c' == fwfn + >>> fwfn = fixed_width_file_name('some/123456', max_length=5) + >>> assert '' == fwfn """ if not path: return '' # get the path as unicode for display! - path = path_to_unicode(path) - filename = fileutils.file_name(path) + filename = file_name(path) if len(filename) <= max_length: return filename - base_name, extension = fileutils.splitext(filename) - number_of_dots = 3 - len_extension = len(extension) - remaining_length = max_length - len_extension - number_of_dots + base_name, ext = splitext(filename) + dots = 3 + len_ext = len(ext) + remaining_length = max_length - len_ext - dots - if remaining_length < (len_extension + number_of_dots) or remaining_length < 5: + if remaining_length < 5 or remaining_length < (len_ext + dots): return '' prefix_and_suffix_length = abs(remaining_length // 2) prefix = base_name[:prefix_and_suffix_length] - ellipsis = number_of_dots * '.' + ellipsis = dots * '.' suffix = base_name[-prefix_and_suffix_length:] - return '{prefix}{ellipsis}{suffix}{extension}'.format(**locals()) + return '{prefix}{ellipsis}{suffix}{ext}'.format(**locals()) -def compute_fn_max_len(used_width=BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 + BAR_SEP_LEN): +def file_name_max_len(used_width=BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 + BAR_SEP_LEN): """ Return the max length of a path given the current terminal width. @@ -229,12 +213,31 @@ def compute_fn_max_len(used_width=BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 - the word Scanned: 8 chars - one BAR_SEP - the file name proper - The space usage is therefore: BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 + BAR_SEP_LEN + the file name length + The space usage is therefore: + BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 + BAR_SEP_LEN + + the file name length """ term_width, _height = click.get_terminal_size() max_filename_length = term_width - used_width -# if term_width < 70: -# # if we have a small term width that is less than 70 column, we -# # may spill over and damage the progress bar... -# max_filename_length = 10 return max_filename_length + + +def path_progress_message(item, verbose=False, prefix='Scanned: '): + """ + Return a styled message suitable for progress display when processing a path + for an `item` tuple of (location, rid, scan_errors, scan_results) + """ + if not item: + return '' + location, _rid, errors, _results = item + location = fsdecode(location) + progress_line = location + if not verbose: + max_file_name_len = file_name_max_len() + # do not display a file name in progress bar if there is no space available + if max_file_name_len <= 10: + return '' + progress_line = fixed_width_file_name(location, max_file_name_len) + + color = 'red' if errors else 'green' + return style(prefix) + style(progress_line, fg=color) diff --git a/tests/scancode/test_scan_help_groups.py b/tests/scancode/test_scan_help_groups.py deleted file mode 100644 index a3fbc20746f..00000000000 --- a/tests/scancode/test_scan_help_groups.py +++ /dev/null @@ -1,82 +0,0 @@ -# -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - -from os import path - -import click -click.disable_unicode_literals_warning = True -from click.testing import CliRunner - -from commoncode.testcase import FileBasedTesting -from scancode.cli import ScanCommand -from scancode.cli import ScanOption -from scancode.cli_test_utils import run_scan_click - - -class TestHelpGroups(FileBasedTesting): - - test_data_dir = path.join(path.dirname(__file__), 'data') - - def test_scan_help_without_custom_class(self): - @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option') - def scan(opt): - pass - - runner = CliRunner() - result = runner.invoke(scan, ['--help']) - assert 'misc:\n --opt Help text for option\n' in result.output - - def test_scan_help_with_custom_class(self): - @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option', cls=ScanOption) - def scan(opt): - pass - - runner = CliRunner() - result = runner.invoke(scan, ['--help']) - assert 'misc:\n --opt Help text for option\n' in result.output - - def test_scan_help_with_group(self): - @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option', group='core', cls=ScanOption) - def scan(opt): - pass - - runner = CliRunner() - result = runner.invoke(scan, ['--help']) - assert 'core:\n --opt Help text for option\n' in result.output - - def test_scan_cli_help(self): - expected_file = self.get_test_loc('help/help.txt') - result = run_scan_click(['--help']) - regen = False - if regen: - with open(expected_file, 'wb') as ef: - ef.write(result.output) - assert open(expected_file).read() == result.output diff --git a/tests/scancode/test_scan_utils.py b/tests/scancode/test_scan_utils.py index 2ae75ec962f..ced5dee1a9a 100644 --- a/tests/scancode/test_scan_utils.py +++ b/tests/scancode/test_scan_utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,22 +23,25 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals import os import click -from click.testing import CliRunner -from click.termui import progressbar +click.disable_unicode_literals_warning = True -from commoncode.testcase import FileBasedTesting +from click.termui import progressbar +from click.testing import CliRunner -from scancode import utils +from commoncode.testcase import FileDrivenTesting +from scancode import ScanOption +from scancode.cli import ScanCommand +from scancode.utils import fixed_width_file_name -class TestUtils(FileBasedTesting): +class TestUtils(FileDrivenTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_click_progressbar_with_labels(self): @@ -61,13 +64,96 @@ def mycli(): ''' assert expected == result.output - def test_get_relative_path(self): - # plain file without parent - assert 'file' == utils.get_relative_path(path='/file', len_base_path=5, base_is_dir=False) - # plain file in a deep path - assert 'that' == utils.get_relative_path(path='/this/file/that', len_base_path=5, base_is_dir=False) - # plain path with directories - assert 'file/that' == utils.get_relative_path(path='/this/file/that', len_base_path=5, base_is_dir=True) - assert 'that' == utils.get_relative_path(path='/this/file/that', len_base_path=10, base_is_dir=True) - assert 'this/file/that' == utils.get_relative_path(path='/foo//this/file/that', len_base_path=4, base_is_dir=True) +class TestFixedWidthFilename(FileDrivenTesting): + + def test_fixed_width_file_name_with_file_name_larger_than_max_length_is_shortened(self): + test = fixed_width_file_name('0123456789012345678901234.c', 25) + expected = '0123456789...5678901234.c' + assert expected == test + + def test_fixed_width_file_name_with_file_name_smaller_than_max_length_is_not_shortened(self): + file_name = '0123456789012345678901234.c' + test = fixed_width_file_name(file_name, max_length=50) + assert file_name == test + + def test_fixed_width_file_name_with_file_name_at_max_length_is_not_shortened(self): + test = fixed_width_file_name('01234567890123456789012.c', 25) + expected = '01234567890123456789012.c' + assert expected == test + + def test_fixed_width_file_name_with_file_name_smaller_than_max_length_not_shortened(self): + test = fixed_width_file_name('0123456789012345678901.c', 25) + expected = '0123456789012345678901.c' + assert expected == test + + def test_fixed_width_file_name_with_none_filename_return_empty_string(self): + test = fixed_width_file_name(None, 25) + expected = '' + assert expected == test + + def test_fixed_width_file_name_without_extension(self): + test = fixed_width_file_name('012345678901234567890123456', 25) + expected = '01234567890...67890123456' + assert expected == test + + def test_fixed_width_file_name_with_posix_path_without_shortening(self): + test = fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/drupal.js', 25) + expected = 'drupal.js' + assert expected == test + + def test_fixed_width_file_name_with_posix_path_with_shortening(self): + test = fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/012345678901234567890123.c', 25) + expected = '0123456789...4567890123.c' + assert expected == test + + def test_fixed_width_file_name_with_win_path_without_shortening(self): + test = fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\drupal.js', 25) + expected = 'drupal.js' + assert expected == test + + def test_fixed_width_file_name_with_win_path_with_shortening(self): + test = fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\012345678901234567890123.c', 25) + expected = '0123456789...4567890123.c' + assert expected == test + + def test_fixed_width_file_name_with_very_small_file_name_and_long_extension(self): + test = fixed_width_file_name('abc.abcdef', 5) + # FIXME: what is expected is TBD + expected = '' + assert expected == test + + +class TestHelpGroups(FileDrivenTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_scan_help_without_custom_class(self): + @click.command(name='scan', cls=ScanCommand) + @click.option('--opt', is_flag=True, help='Help text for option') + def scan(opt): + pass + + runner = CliRunner() + result = runner.invoke(scan, ['--help']) + assert 'misc:\n --opt Help text for option\n' in result.output + + def test_scan_help_with_custom_class(self): + @click.command(name='scan', cls=ScanCommand) + @click.option('--opt', is_flag=True, help='Help text for option', cls=ScanOption) + def scan(opt): + pass + + runner = CliRunner() + result = runner.invoke(scan, ['--help']) + assert 'misc:\n --opt Help text for option\n' in result.output + + def test_scan_help_with_group(self): + @click.command(name='scan', cls=ScanCommand) + @click.option('--opt', is_flag=True, help='Help text for option', group='core', cls=ScanOption) + def scan(opt): + pass + + runner = CliRunner() + result = runner.invoke(scan, ['--help']) + assert 'core:\n --opt Help text for option\n' in result.output From e891d07bdf01c4f9c4e0397669227519d48b338b Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 09:25:53 +0100 Subject: [PATCH 032/122] Use fsencode/fsdecode throughout #787 * also use plain iterable when no progress is requested * relocate get_relative_path to extract_cli since this is now the only place it is still used Signed-off-by: Philippe Ombredanne --- src/scancode/extract_cli.py | 42 +++++++++++++++++++++--------- tests/scancode/test_extract_cli.py | 6 ++--- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/scancode/extract_cli.py b/src/scancode/extract_cli.py index d0dc23edccf..cac6fc02e4d 100644 --- a/src/scancode/extract_cli.py +++ b/src/scancode/extract_cli.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -33,9 +33,7 @@ click.disable_unicode_literals_warning = True from commoncode import fileutils -from commoncode.fileutils import path_to_unicode from commoncode import filetype -from commoncode.system import on_linux from commoncode.text import toascii from scancode.api import extract_archives @@ -54,7 +52,6 @@ unicode = str - echo_stderr = partial(click.secho, err=True) @@ -130,7 +127,7 @@ def extract_event(item): if verbose: if item.done: return '' - line = source and utils.get_relative_path(path=source, len_base_path=len_base_path, base_is_dir=base_is_dir) or '' + line = source and get_relative_path(path=source, len_base_path=len_base_path, base_is_dir=base_is_dir) or '' else: line = source and fileutils.file_name(source) or '' if not isinstance(line, unicode): @@ -150,7 +147,7 @@ def display_extract_summary(): source = fileutils.as_posixpath(xev.source) if not isinstance(source, unicode): source = toascii(source, translit=True).decode('utf-8', 'replace') - source = utils.get_relative_path(path=source, len_base_path=len_base_path, base_is_dir=base_is_dir) + source = get_relative_path(path=source, len_base_path=len_base_path, base_is_dir=base_is_dir) for e in xev.errors: echo_stderr('ERROR extracting: %(source)s: %(e)s' % locals(), fg='red') for warn in xev.warnings: @@ -171,18 +168,39 @@ def display_extract_summary(): extract_results = [] has_extract_errors = False + extractibles = extract_archives(abs_location, recurse=not shallow) + if not quiet: echo_stderr('Extracting archives...', fg='green') + with utils.progressmanager(extractibles, + item_show_func=extract_event, verbose=verbose) as extraction_events: + + for xev in extraction_events: + if xev.done and (xev.warnings or xev.errors): + has_extract_errors = has_extract_errors or xev.errors + extract_results.append(xev) - with utils.progressmanager(extract_archives(abs_location, recurse=not shallow), item_show_func=extract_event, - verbose=verbose, quiet=quiet) as extraction_events: - for xev in extraction_events: + display_extract_summary() + else: + for xev in extractibles: if xev.done and (xev.warnings or xev.errors): has_extract_errors = has_extract_errors or xev.errors extract_results.append(xev) - if not quiet: - display_extract_summary() - rc = 1 if has_extract_errors else 0 ctx.exit(rc) + + +def get_relative_path(path, len_base_path, base_is_dir): + """ + Return a posix relative path from the posix 'path' relative to a + base path of `len_base_path` length where the base is a directory if + `base_is_dir` True or a file otherwise. + """ + path = fileutils.fsdecode(path) + if base_is_dir: + rel_path = path[len_base_path:] + else: + rel_path = fileutils.file_name(path) + + return rel_path.lstrip('/') diff --git a/tests/scancode/test_extract_cli.py b/tests/scancode/test_extract_cli.py index 4c3e07ee01f..faf5f886e40 100644 --- a/tests/scancode/test_extract_cli.py +++ b/tests/scancode/test_extract_cli.py @@ -38,7 +38,7 @@ from commoncode.system import on_windows from scancode import extract_cli from commoncode.system import on_linux -from commoncode.fileutils import path_to_bytes +from commoncode.fileutils import fsencode test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -189,7 +189,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names_verbose(monk monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) test_dir = test_env.get_test_loc('unicodearch', copy=True) if on_linux: - test_dir = path_to_bytes(test_dir) + test_dir = fsencode(test_dir) runner = CliRunner() result = runner.invoke(extract_cli.extractcode, ['--verbose', test_dir], catch_exceptions=False) assert result.exit_code == 0 @@ -214,7 +214,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names(monkeypatch) monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) test_dir = test_env.get_test_loc('unicodearch', copy=True) if on_linux: - test_dir = path_to_bytes(test_dir) + test_dir = fsencode(test_dir) runner = CliRunner() result = runner.invoke(extract_cli.extractcode, [test_dir], catch_exceptions=False) assert result.exit_code == 0 From 261fcb91e878b197af707452bcd320d2b5a1e047 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 10:42:45 +0100 Subject: [PATCH 033/122] Improve Codebase and Resource implementation #787 * Add Codebase asbstraction as an in-memory tree of Resource objects * Codebase and Resources can be walked, queried, added, removed as needed topdown and bottom up with sorted children. * Root Resource can now have/has scans and info for #543 * Codebase Resource have correct counts of children for #607 and #598 * Files can also have children (this is in preparation for transparent archives extraction/walking for #14) * Initial inventory collection is based on walking the file system once All other accesses are through the Codebase object * Resource hold a scans mapping and have file info directly attached as attributes. * To support simple serialization of Resource, these are not holding references to their parent and children: instead they hold numeric ids, including a Codebase id that can be accessed through a global cache, which is a poor man weak references implementation. * Remove and fold caching into resource.py at the Resource level. Each resource can put_scans and get_scans. This is either using the on-disk cache or just attached in memory to the resource object. * Add minimal resource cache tests Signed-off-by: Philippe Ombredanne --- src/scancode/cache.py | 279 ---------- src/scancode/resource.py | 843 ++++++++++++++++++++++++------ tests/scancode/test_resource.py | 99 ++++ tests/scancode/test_scan_cache.py | 47 -- 4 files changed, 773 insertions(+), 495 deletions(-) delete mode 100644 src/scancode/cache.py create mode 100644 tests/scancode/test_resource.py delete mode 100644 tests/scancode/test_scan_cache.py diff --git a/src/scancode/cache.py b/src/scancode/cache.py deleted file mode 100644 index 3cc1ebd0ffc..00000000000 --- a/src/scancode/cache.py +++ /dev/null @@ -1,279 +0,0 @@ -# -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - -import codecs -from collections import OrderedDict -from functools import partial -import json -from hashlib import sha1 -import os -import posixpath -import sys - -# from commoncode import fileutils -from commoncode.fileutils import as_posixpath -from commoncode.fileutils import create_dir -from commoncode.fileutils import delete -from commoncode.fileutils import get_temp_dir -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode -from commoncode.system import on_linux -from commoncode.timeutils import time2tstamp - -from scancode import scans_cache_dir - - -""" -Cache scan results for a file or directory disk using a file-based cache. - -The approach is to cache the scan of a file using these data structure and files: - - a resources list contains all the Resource objects scanned. - - for each file being scanned, we store a JSON file that contains the - corresponding scan data. This file is named after the hash of its path. - -Once a scan is completed, we iterate the cache to output the final scan results: -First iterate the resources and from the path collect the cached scanned result. -This iterator is then streamed to the final JSON output. - -Finally once a scan is completed the cache is destroyed to free up disk space. - -Internally the cache is organized as a tree of directories named after the first -few characters or a path hash. This is to avoid having having too many files per -directory that can make some filesystems choke as well as having directories -that are too deep or having file paths that are too long which problematic on -some OS. -""" - -# Tracing flags -TRACE = False - -def logger_debug(*args): - pass - -if TRACE: - import logging - - logger = logging.getLogger(__name__) - # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) - logging.basicConfig(stream=sys.stdout) - logger.setLevel(logging.DEBUG) - - def logger_debug(*args): - return logger.debug(' '.join(isinstance(a, unicode) - and a or repr(a) for a in args)) - - -def get_cache_dir(base_cache_dir=scans_cache_dir): - """ - Return a new, created and unique cache storage directory. - """ - create_dir(base_cache_dir) - # create a unique temp directory in cache_dir - prefix = time2tstamp() + u'-' - cache_dir = get_temp_dir(base_cache_dir, prefix=prefix) - if on_linux: - cache_dir = path_to_bytes(cache_dir) - return cache_dir - - -def get_scans_cache_class(base_cache_dir=scans_cache_dir): - """ - Return a new persistent cache class configured with a unique storage - directory. - """ - cache_dir = get_cache_dir(base_cache_dir=base_cache_dir) - sc = ScanFileCache(cache_dir) - sc.setup() - return partial(ScanFileCache, cache_dir) - - -def scan_keys(path): - """ - Return a cache "keys" tripple for a path composed of three - paths segments derived from a checksum. - - For example: - >>> expected = 'fb87db2bb28e9501ac7fdc4812782118f4c94a0f' - >>> assert expected == sha1('/w421/scancode-toolkit2').hexdigest() - >>> expected = ('0', 'c', 'a4f74d39ecbf551b1acfc63dc37bf2c8b9482c') - >>> assert expected == scan_keys('/w421/scancode-toolkit2') - - NOTE: since we use the first character and next two characters as - directories, we create at most 16 dir at the first level and 16 dir at the - second level for each first level directory for a maximum total of 16*16 = - 256 directories. For a million files we would have about 4000 files per - directory on average with this scheme which should keep most file systems - happy and avoid some performance issues when there are too many files in a - single directory. - """ - # ensure that we always pass bytes to the hash function - path = path_to_bytes(path) - hexdigest = sha1(path + b'empty hash').hexdigest() - if on_linux: - hexdigest = bytes(hexdigest) - else: - hexdigest = unicode(hexdigest) - return hexdigest[0], hexdigest[1], hexdigest[2:] - - -class ScanFileCache(object): - """ - A file-based cache for scan results saving results in files and using no - locking. This is NOT thread-safe and NOT multi-process safe but works OK in - our context: we cache the scan for a given file once and read it only a few - times. - """ - def __init__(self, cache_dir): - if on_linux: - self.cache_base_dir = path_to_bytes(cache_dir) - else: - self.cache_base_dir = cache_dir - self.cache_scans_dir = as_posixpath(self.cache_base_dir) - - def setup(self): - """ - Setup the cache: must be called at least once globally after cache - initialization. - """ - create_dir(self.cache_scans_dir) - - def get_cached_scan_path(self, path): - """ - Return the path where to store a scan in the cache given a path. - """ - dir1, dir2, file_name = scan_keys(path) - - if on_linux: - base_path = path_to_bytes(self.cache_scans_dir) - else: - base_path = path_to_unicode(self.cache_scans_dir) - - parent = os.path.join(base_path, dir1, dir2) - create_dir(parent) - - return posixpath.join(parent, file_name) - - def put_scan(self, path, scan_result): - """ - Put scan_result in the cache if not already cached. - """ - scan_path = self.get_cached_scan_path(path) - if not os.path.exists(scan_path): - with codecs.open(scan_path, 'wb', encoding='utf-8') as cached_scan: - json.dump(scan_result, cached_scan, check_circular=False) - if TRACE: - logger_debug( - 'put_scan:', 'scan_path:', scan_path, 'scan_result:', scan_result, '\n') - - def get_scan(self, path): - """ - Return scan results from the cache for a path. - Return None on failure to find the scan results in the cache. - """ - scan_path = self.get_cached_scan_path(path) - if os.path.exists(scan_path): - with codecs.open(scan_path, 'r', encoding='utf-8') as cached_scan: - return json.load(cached_scan, object_pairs_hook=OrderedDict) - - def iterate(self, resources, scan_names, root_dir=None, paths_subset=tuple()): - """ - Yield scan data for all cached scans e.g. the whole cache given a list - of `resources` Resource objects and `scan_names`. - - If a `paths_subset` sequence of paths is provided, then only these paths - are iterated. - """ - if on_linux: - paths_subset = set(path_to_bytes(p) for p in paths_subset) - else: - paths_subset = set(path_to_unicode(p) for p in paths_subset) - - for resource in resources: - resource_path = resource.rel_path - if paths_subset and resource_path not in paths_subset: - continue - - scan_result = OrderedDict() - - # always set the path to what was expected based on strip/full/root args - rooted_path = get_scan_path(resource, root_dir) - scan_result['path'] = rooted_path - - scan_details = self.get_scan(resource_path) - - if scan_details is None: - no_scan_details = ( - 'ERROR: scan details unavailable in cache: ' - 'This is either a bug or processing was aborted with ' - 'CTRL-C.') - scan_result['scan_errors'] = [no_scan_details] - continue - - infos = scan_details.pop('infos', None) - if 'infos' in scan_names and infos: - # info are always collected but only returned if requested - # we flatten these as direct attributes of a file object - # FIXME: this should be done in the scan looo NOT HERE!!! - scan_result.update(infos) - - scan_result.update(scan_details) - - if TRACE: - logger_debug( - 'iterate:', 'scan_result:', scan_result, - 'for resource_path:', rooted_path, '\n') - yield scan_result - - def clear(self, *args): - """ - Purge the cache by deleting the corresponding cached data files. - """ - delete(self.cache_base_dir) - - -def get_scan_path(resource, root_dir): - """ - Return a path to use in the scan results - """ - # FIXME: Resource should handle this paths thingies - resource_path = resource.rel_path - if on_linux: - unicode_path = path_to_unicode(resource_path) - else: - unicode_path = resource_path - - if root_dir: - # must be unicode - if on_linux: - root_dir = path_to_unicode(root_dir) - rooted_path = posixpath.join(root_dir, unicode_path) - else: - rooted_path = unicode_path - rooted_path = as_posixpath(rooted_path) - logger_debug('get_scan_path:', 'rooted_path:', rooted_path) - return rooted_path diff --git a/src/scancode/resource.py b/src/scancode/resource.py index fdb2b0648e9..403bd581f43 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -23,230 +23,735 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals +import codecs from collections import OrderedDict -import os +from functools import partial +import json +from os import walk as os_walk +from os.path import abspath +from os.path import exists +from os.path import expanduser +from os.path import join +from os.path import normpath import traceback +import sys import attr +import yg.lockfile # @UnresolvedImport + +from commoncode.filetype import is_file as filetype_is_file +from commoncode.filetype import is_special -from commoncode.filetype import is_dir -from commoncode.filetype import is_file from commoncode.fileutils import as_posixpath -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode +from commoncode.fileutils import create_dir +from commoncode.fileutils import delete +from commoncode.fileutils import file_name +from commoncode.fileutils import fsdecode +from commoncode.fileutils import fsencode +from commoncode.fileutils import get_temp_dir +from commoncode.fileutils import parent_directory +from commoncode.functional import iter_skip +from commoncode.timeutils import time2tstamp +from commoncode import ignore from commoncode.system import on_linux -from scancode.cache import get_cache_dir -from scancode.utils import get_relative_path +from scancode import cache_dir +from scancode import scans_cache_dir # Python 2 and 3 support try: # Python 2 unicode str_orig = str - bytes = str - str = unicode + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str + unicode = str # @ReservedAssignment """ An abstraction for files and directories used throughout ScanCode. ScanCode deals with a lot of these as they are the basic unit of processing. They are eventually cached or stored and this module hides all the details of iterating -files, path handling, caching or storing the file and directoy medatata. +files, path handling, caching or storing the file and directory medatata. """ -@attr.attributes(slots=True) -class Resource(object): - """ - A resource represent a file or directory with essential "file - information" and the scanned data details. - """ - # LEGACY: TODO: remove - scans_cache_class = attr.attrib(default=None) - is_cached = attr.attrib(default=False, type=bool) - abs_path = attr.attrib(default=None) - base_is_dir = attr.attrib(default=True, type=bool) - len_base_path = attr.attrib(default=0, type=int) - rel_path = attr.attrib(default=None) - # END LEGACY - - name = attr.attrib(default=None) - parent = attr.attrib(default=None) - children = attr.attrib(default=attr.Factory(list)) - - has_infos = attr.attrib(default=False) - infos = attr.attrib(default=attr.Factory(OrderedDict)) - scans = attr.attrib(default=attr.Factory(OrderedDict)) +# Tracing flags +TRACE = False - def __attrs_post_init__(self): - self.scans_cache_class = self.scans_cache_class() - posix_path = as_posixpath(self.abs_path) - # keep the path as relative to the original base_path, always Unicode - self.rel_path = get_relative_path(posix_path, self.len_base_path, self.base_is_dir) - self.infos['path'] = self.rel_path +def logger_debug(*args): + pass - def get_infos(self): - if not self.has_infos: - self.infos.update(scan_infos(self.abs_path)) - self.has_infos = True - return self.infos +if TRACE: + import logging - def walk(self, topdown=True): - """ - Walk this Resource in a manner similar to os.walk - """ - if topdown: - yield self, self.children - for child in self.children: - for sc in child.walk(topdown): - yield sc - if not topdown: - yield self, self.children + logger = logging.getLogger(__name__) + # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) + logging.basicConfig(stream=sys.stdout) + logger.setLevel(logging.DEBUG) + + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, unicode) + and a or repr(a) for a in args)) +# A global cache of codebase objects, keyed by a unique integer ID. -def scan_infos(location): +# We use this weird structure such that a Resource object can reference its +# parent codebase object without actually storing it as an instance variable. +# Instead a Resource only has a pointer to a codebase id and can fetch it from +# this cache with an id lookup. +# This cache is updated when a new codebase object is created or destroyed +# TODO: consider using a class variable instead of a module variable? +_CODEBASES = {} + +_cache_lock_file = join(cache_dir, 'codebases-lockfile') + + +def add_codebase(codebase, cache_lock_file=_cache_lock_file): """ - Scan one file or directory and return file_infos data. This always - contains an extra 'errors' key with a list of error messages, - possibly empty. If `diag` is True, additional diagnostic messages - are included. + Add codebase to codebase cache in a thread- and multiprocess-safe way. + Return the codebase integer id. """ - # FIXME: WE SHOULD PROCESS THIS IS MEMORY AND AS PART OF THE SCAN PROPER... and BOTTOM UP!!!! - # THE PROCESSING TIME OF SIZE AGGREGATION ON DIRECTORY IS WAY WAY TOO HIGH!!! - errors = [] try: - infos = get_file_infos(location) - except Exception as e: - # never fail but instead add an error message. - infos = _empty_file_infos() - errors = ['ERROR: infos: ' + e.message] - errors.append('ERROR: infos: ' + traceback.format_exc()) - # put errors last - infos['scan_errors'] = errors - return infos - - -def get_file_infos(location): + # acquire lock and wait until timeout to get a lock or die + with yg.lockfile.FileLock(cache_lock_file, timeout=10): + global _CODEBASES + if _CODEBASES: + for cid, cached_codebase in _CODEBASES.items(): + if codebase is cached_codebase: + return cid + # get a new cid + new_cid = max(_CODEBASES.viewkeys()) + 1 + else: + # or create a new cid + new_cid = 1 + + _CODEBASES[new_cid] = codebase + return new_cid + + except yg.lockfile.FileLockTimeout: + raise + + +def del_codebase(cid, cache_lock_file=_cache_lock_file): """ - Return a mapping of file information collected from the file or - directory at `location`. + Delete codebase from the codebase cache in a thread- and multiprocess-safe way. + Return the deleted codebase object or None. """ - from commoncode import fileutils - from commoncode import filetype - from commoncode.hash import multi_checksums - from typecode import contenttype - - if on_linux: - location = path_to_bytes(location) - else: - location = path_to_unicode(location) - - infos = OrderedDict() - is_file = filetype.is_file(location) - is_dir = filetype.is_dir(location) - - T = contenttype.get_type(location) + try: + # acquire lock and wait until timeout to get a lock or die + with yg.lockfile.FileLock(cache_lock_file, timeout=10): + global _CODEBASES + return _CODEBASES.pop(cid, None) + except yg.lockfile.FileLockTimeout: + raise - infos['type'] = filetype.get_type(location, short=False) - name = fileutils.file_name(location) - if is_file: - base_name, extension = fileutils.splitext(location) - else: - base_name = name - extension = '' - if on_linux: - infos['name'] = path_to_unicode(name) - infos['base_name'] = path_to_unicode(base_name) - infos['extension'] = path_to_unicode(extension) - else: - infos['name'] = name - infos['base_name'] = base_name - infos['extension'] = extension - - infos['date'] = is_file and filetype.get_last_modified_date(location) or None - infos['size'] = T.size - infos.update(multi_checksums(location, ('sha1', 'md5',))) - infos['files_count'] = is_dir and filetype.get_file_count(location) or None - infos['mime_type'] = is_file and T.mimetype_file or None - infos['file_type'] = is_file and T.filetype_file or None - infos['programming_language'] = is_file and T.programming_language or None - infos['is_binary'] = bool(is_file and T.is_binary) - infos['is_text'] = bool(is_file and T.is_text) - infos['is_archive'] = bool(is_file and T.is_archive) - infos['is_media'] = bool(is_file and T.is_media) - infos['is_source'] = bool(is_file and T.is_source) - infos['is_script'] = bool(is_file and T.is_script) - - return infos - - -# FIXME: this smells bad -def _empty_file_infos(): +def get_codebase(cid): """ - Return an empty mapping of file info, used in case of failure. + Return a codebase object with a `cid` codebaset id or None. """ - infos = OrderedDict() - infos['type'] = None - infos['name'] = None - infos['extension'] = None - infos['date'] = None - infos['size'] = None - infos['sha1'] = None - infos['md5'] = None - infos['files_count'] = None - infos['mime_type'] = None - infos['file_type'] = None - infos['programming_language'] = None - infos['is_binary'] = False - infos['is_text'] = False - infos['is_archive'] = False - infos['is_media'] = False - infos['is_source'] = False - infos['is_script'] = False - return infos + global _CODEBASES + return _CODEBASES.get(cid) class Codebase(object): """ Represent a codebase being scanned. A Codebase is a tree of Resources. """ - def __init__(self, root_location): + + def __init__(self, location, cache_base_dir=scans_cache_dir): """ - Initialize a new codebase rooted as the `root_location` existing - file or directory. - NOTE: no check is made on the location and it must be an existing location. + Initialize a new codebase rooted at the `location` existing file or + directory. """ + self.original_location = location + + if on_linux: + location = fsencode(location) + else: + location = fsdecode(location) + location = abspath(normpath(expanduser(location))) + + # TODO: we should also accept to create "virtual" codebase without a + # backing filesystem location + assert exists(location) - self.location = root_location - # FIXME: encoding??? - self.location_native = path_to_bytes(root_location) - self.is_file = is_file(self.location_native) - self.is_dir = is_dir(self.location_native) - self.cache_dir = get_cache_dir() + self.location = location + self.base_location = parent_directory(location) + + self.is_file = filetype_is_file(location) + + # list of resources in topdown order where the position is the index of + # the resource. The first index, 0, is also the root + self.resources = [] self.root = None - def collect(self): + # list of errors from collecting the codebase details (such as + # unreadable file, etc) + self.errors = [] + + # setup cache + self.cache_base_dir = cache_base_dir + + # this is unique to this run and valid for the lifetime of this codebase + self.cache_dir = get_cache_dir(cache_base_dir) + create_dir(self.cache_dir) + + self.cid = add_codebase(self) + self.populate() + + def walk(self, topdown=True, sort=False, skip_root=False): + """ + Yield all Resources for this Codebase. + Walks the tree top-down in pre-order traversal if `topdown` is True. + Walks the tree bottom-up in post-order traversal if `topdown` is False. + If `sort` is True, each level is sorted by Resource name, directories + first then files. + If `skip_root` is True, the root resource is not returned. + """ + # single resources without children + if not self.root.children_rids: + return [self.root] + + return self.root.walk(topdown, sort, skip_root) + + def get_resource(self, rid): + """ + Return the Resource with `rid` or None if it does not exists. + """ + try: + return self.resources[rid] + except IndexError: + pass + + def add_resource(self, name, parent, is_file=False): + """ + Create and return a new Resource object as a child of the + `parent` resource. + """ + return parent.add_child(name, is_file) + + def remove_resource(self, resource): + """ + Remove the `resource` Resource object and all its children from the + resource tree. Return a list of the removed Resource ids. + """ + if resource.pid is None: + raise Exception( + 'Cannot remove the root resource from codebase:', repr(resource)) + rids = [res.rid for res in resource.walk(topdown=True)] + resources = self.resources + for rid in rids: + resources[rid] = None + + parent = resource.parent() + if parent: + try: + parent.children_rids.remove(resource.rid) + except ValueError: + if TRACE: + logger_debug( + 'Codebase.remove_resource() failed for Resource:', resource, + 'at location:', resource.get_path(absolute=True, decode=True)) + return rids + + def counts(self, update=True, skip_root=False): + """ + Return a tuple of counters (files_count, dirs_count, size) for this + codebase. + If `update` is True, update the codebase counts before returning. + Do not include the root Resource in the counts if `skip_root` is True. + """ + if update: + self.update_counts() + root = self.root + + if skip_root and not self.is_file: + counts = [(c.files_count, c.dirs_count, c.size) for c in root.children()] + files_count, dirs_count, size = map(sum, zip(*counts)) + else: + files_count = root.files_count + dirs_count = root.dirs_count + size = root.size + if self.is_file: + files_count += 1 + else: + dirs_count += 1 + return files_count, dirs_count, size + + def update_counts(self): """ - Return a root Resource for this codebase by walking its root_location. + Update files_count, dirs_count and size attributes of each Resource in + this codebase based on the current state. """ - location = self.location + # note: we walk bottom up to update things in the proper order + for resource in self.walk(topdown=False): + resource._update_children_counts() + + def clear(self): + """ + Purge the codebase cache(s) by deleting the corresponding cached data + files and in-memodyr structures. + """ + delete(self.cache_dir) + del_codebase(self.cid) + + def populate(self): + """ + Populate this codebase with Resource objects. + """ + self.resources = self._collect() + self.root = self.resources[0] + + def _collect(self): + """ + Return a sequence of Resource objects for this codebase by walking its + `location`. The sequence is in topdown order. The first item is the root. + """ + def err(error): + self.errors.append( + 'ERROR: cannot collect files: %(error)s\n' % dict(error=error) + traceback.format_exc() + ) + + cid = self.cid + rloc = self.location + rid = 0 + root = Resource(name=file_name(rloc), rid=rid, pid=None, cid=cid, is_file=self.is_file) + + if TRACE: logger_debug('Codebase.collect: root:', root) + + res_by_loc = {rloc: root} + resources = [root] + + if self.is_file: + # there is nothing else to do + return resources + + # we always ignore VCS and some filetypes. + ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) + + # TODO: this is where we would plug archive walking?? + resources_append = resources.append + for top, dirs, files in os_walk(rloc, topdown=True, onerror=err): + + if is_special(top) or ignored(top): + if TRACE: logger_debug( + 'Codebase.collect: walk: top ignored:', top, 'ignored:', + ignored(top), 'is_special:', is_special(top)) + continue + + parent = res_by_loc[top] + + if TRACE: logger_debug('Codebase.collect: parent:', parent) + + for name in dirs: + loc = join(top, name) + + if is_special(loc) or ignored(loc): + if TRACE: logger_debug( + 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', + ignored(loc), 'is_special:', is_special(loc)) + continue + rid += 1 + res = parent._add_child(name, rid, is_file=False) + res_by_loc[loc] = res + resources_append(res) + if TRACE: logger_debug('Codebase.collect: dir:', res) + + for name in files: + loc = join(top, name) + + if is_special(loc) or ignored(loc): + if TRACE: logger_debug( + 'Codebase.collect: walk: file ignored:', loc, 'ignored:', + ignored(loc), 'is_special:', is_special(loc)) + continue + rid += 1 + res = parent._add_child(name, rid, is_file=True) + res_by_loc[loc] = res + resources_append(res) + if TRACE: logger_debug('Codebase.collect: file:', res) + return resources + + +@attr.attributes(slots=True) +class Resource(object): + """ + A resource represent a file or directory with essential "file information" + and the scanned data details. + + A Resource is a tree that models the fileystem tree structure. + + In order to support lightweight and smaller objects that can be serialized + and deserialized (such as pickled in multiprocessing) without pulling in a + whole object tree, a Resource does not store its related objects directly: + the Codebase it belongs to, its parent Resource and its Resource children + objects are stored only as integer ids. Querying the Resource relationships + and walking the Resources tree requires to lookup the corresponding object + by id in the codebase object. + """ + # the file or directory name in the OS preferred representation (either + # bytes on Linux and Unicode elsewhere) + name = attr.ib() + + # a integer resource id + rid = attr.ib(type=int, repr=False) + # a integer codebase id + cid = attr.ib(type=int, repr=False) + # the root of a Resource tree has a pid==None by convention + pid = attr.ib(type=int, repr=False) + + is_file = attr.ib(default=False, type=bool) + + # a list of rids + children_rids = attr.ib(default=attr.Factory(list), repr=False) + + errors = attr.ib(default=attr.Factory(list), repr=False) + + # a mapping of scan result. Used when scan result is not cached + _scans = attr.ib(default=attr.Factory(OrderedDict), repr=False) + + # tuple of cache keys: dir and file name + cache_keys = attr.ib(default=None, repr=False) + + # external data to serialize + type = attr.ib(default=None, repr=False) + base_name = attr.ib(default=None, repr=False) + extension = attr.ib(default=None, repr=False) + date = attr.ib(default=None, repr=False) + sha1 = attr.ib(default=None, repr=False) + md5 = attr.ib(default=None, repr=False) + mime_type = attr.ib(default=None, repr=False) + file_type = attr.ib(default=None, repr=False) + programming_language = attr.ib(default=None, repr=False) + is_binary = attr.ib(default=False, type=bool, repr=False) + is_text = attr.ib(default=False, type=bool, repr=False) + is_archive = attr.ib(default=False, type=bool, repr=False) + is_media = attr.ib(default=False, type=bool, repr=False) + is_source = attr.ib(default=False, type=bool, repr=False) + is_script = attr.ib(default=False, type=bool, repr=False) + + # These attributes are re/computed for directories and files with children + size = attr.ib(default=0, type=int, repr=False) + files_count = attr.ib(default=0, type=int, repr=False) + dirs_count = attr.ib(default=0, type=int, repr=False) + + def __attrs_post_init__(self): + # build simple cache keys for this resource based on the hex + # representation of the resource id: they are guaranteed to be unique + # within a codebase. + hx = '%08x' % self.rid if on_linux: - location = self.location_native + hx = fsencode(hx) + self.cache_keys = hx[-2:], hx + + def is_root(self): + return self.pid is None + + def _update_children_counts(self): + """ + Compute counts and update self with these counts from direct children. + """ + files, dirs, size = self._children_counts() + if not self.is_file: + # only set the size for directories + self.size = size + self.files_count = files + self.dirs_count = dirs + + def _children_counts(self): + """ + Return a tuple of counters (files_count, dirs_count, size) for the + direct children of this Resource. + + Note: because certain files such as archives can have children, they may + have a files and dirs counts. The size of a directory is aggregated size + of its files (including the count of files inside archives). + """ + files_count = dirs_count = size = 0 + if not self.children_rids: + return files_count, dirs_count, size + + for res in self.children(): + files_count += res.files_count + dirs_count += res.dirs_count + if res.is_file: + files_count += 1 + else: + dirs_count += 1 + size += res.size + return files_count, dirs_count, size + + @property + def codebase(self): + """ + Return the codebase that contains this Resource. + """ + return get_codebase(self.cid) + + def get_cached_path(self, create=False): + """ + Return the path where to get/put a data in the cache given a path. + Create the directories if requested. + """ + cache_sub_dir, cache_file_name = self.cache_keys + parent = join(self.codebase.cache_dir, cache_sub_dir) + if create and not exists(parent): + create_dir(parent) + return join(parent, cache_file_name) + + def get_scans(self, cache=True, _cached_path=None): + """ + Return a `scans` mapping. Ftech from the cache if `cache` is True. + """ + if not cache: + return self._scans + + if not _cached_path: + _cached_path = self.get_cached_path(create=False) + + if not exists(_cached_path): + return OrderedDict() + + # TODO: consider messagepack or protobuf for compact/faster processing + with codecs.open(_cached_path, 'r', encoding='utf-8') as cached: + return json.load(cached, object_pairs_hook=OrderedDict) + + def put_scans(self, scans, update=True, cache=True): + """ + Save the `scans` mapping of scan results for this resource. Does nothing if + `scans` is empty or None. + Return the saved mapping of `scans`, possibly updated or empty. + If `update` is True, existing scans are updated with `scans`. + If `update` is False, `scans` overwrites existing scans. + + If `cache` is True, `scans` are saved in the cache. Otherwise they are + saved in this resource object. + """ + if TRACE: + logger_debug('put_scans: scans:', scans, 'update:', update, 'cache:', cache) + + if not scans: + return OrderedDict() + + if not cache: + if update: + self._scans.update(scans) + else: + self._scans.clear() + self._scans.update(scans) + + if TRACE: logger_debug('put_scans: merged:', self._scans) + return self._scans + + self._scans.clear() + cached_path = self.get_cached_path(create=True) + if update: + existing = self.get_scans(cache, cached_path) + if TRACE: logger_debug( + 'put_scans: cached_path:', cached_path, 'existing:', existing) + existing.update(scans) + + if TRACE: logger_debug('put_scans: merged:', existing) + else: + existing = scans + + # TODO: consider messagepack or protobuf for compact/faster processing + with codecs.open(cached_path, 'wb', encoding='utf-8') as cached_file: + json.dump(existing, cached_file, check_circular=False) + + return existing + + def walk(self, topdown=True, sort=False, skip_root=False): + """ + Yield Resources for this Resource tree. + Walks the tree top-down in pre-order traversal if `topdown` is True. + Walks the tree bottom-up in post-order traversal if `topdown` is False. + If `sort` is True, each level is sorted by Resource name, directories + first then files. + If `skip_root` is True, the root resource is not returned. + """ + # single root resource without children + if self.pid == None and not self.children_rids: + return [self] + + walked = self._walk(topdown, sort) + if skip_root: + skip_first = skip_last = False + if topdown: + skip_first = True + else: + skip_last = True + walked = iter_skip(walked, skip_first, skip_last) + return walked + + def _walk(self, topdown=True, sort=False): + if topdown: + yield self - def on_error(error): - raise error + children = self.children() + if sort and children: + sorter = lambda r: (r.is_file, r.name) + children.sort(key=sorter) - root_dir = Resource() - for top, dirs, files in os.walk( - location, topdown=True, onerror=on_error, followlinks=False): - for dr in dirs: - pass + for child in children: + for subchild in child.walk(topdown, sort): + yield subchild + + if not topdown: + yield self + + def add_child(self, name, is_file=False): + """ + Create and return a child Resource. Add this child to the codebase + resources and to this Resource children. + """ + rid = len(self.codebase.resources) + child = self._add_child(name, rid, is_file) + self.codebse.resources.append(rid) + return child + + def _add_child(self, name, rid, is_file=False): + """ + Create a child Resource with `name` and a `rid` Resource id and add its + id to this Resource children. Return the created child. + """ + res = Resource(name=name, rid=rid, pid=self.rid, cid=self.cid, is_file=is_file) + self.children_rids.append(rid) + return res + + def children(self): + """ + Return a sequence of direct children Resource objects for this Resource + or None. + """ + resources = self.codebase.resources + return [resources[rid] for rid in self.children_rids] + + def parent(self): + """ + Return the parent Resource object for this Resource or None. + """ + if self.pid is not None: + return self.codebase.resources[self.pid] + + def ancestors(self): + """ + Return a sequence of ancestor Resource objects from root to self. + """ + resources = self.codebase.resources + ancestors = [] + ancestors_append = ancestors.append + current = self + # walk up the tree: only the root as a pid==None + while current.pid is not None: + ancestors_append(current) + current = resources[current.pid] + ancestors_append(current) + ancestors.reverse() + return ancestors + + def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): + """ + Return a path to self using the preferred OS encoding (bytes on Linux, + Unicode elsewhere) or Unicode is decode=True. + + - If `absolute` is True, return an absolute path. Otherwise return a + relative path where the first segment is the root name. + + - If `strip_root` is True, return a relative path without the first root + segment. Ignored if `absolute` is True. + + - If `decode` is True, return a Unicode path decoded using the filesytem + encoding. + + - If `posix` is True, ensure that the path uses POSIX slash as + separators, otherwise use the native path separators. + """ + ancestors = self.ancestors() + segments = [a.name for a in ancestors] + if absolute: + base_location = self.codebase.base_location + if posix: + base_location = as_posixpath(base_location) + segments.insert(0, base_location) + + elif strip_root: + if len(segments) > 1: + # we cannot strip the root from the root! + segments = segments[1:] + + path = join(*segments) + if posix: + path = as_posixpath(path) + + if decode: + path = fsdecode(path) + return path + + def set_info(self, info): + """ + Set `info` file information for this Resource. + Info is a list of mappings of file information. + """ + if not info: + return + for inf in info: + for key, value in inf.items(): + setattr(self, key, value) + + def to_dict(self, full_root=False, strip_root=False, with_info=False): + """ + Return a mapping of representing this Resource and its scans. + """ + res = OrderedDict() + res['path'] = fsdecode( + self.get_path(absolute=full_root, strip_root=strip_root, + decode=True, posix=True)) + if with_info: + res['type'] = self.type + res['name'] = fsdecode(self.name) + res['base_name'] = fsdecode(self.base_name) + res['extension'] = self.extension and fsdecode(self.extension) + res['date'] = self.date + res['size'] = self.date + res['sha1'] = self.sha1 + res['md5'] = self.md5 + res['files_count'] = self.files_count + res['dirs_count'] = self.dirs_count + res['mime_type'] = self.mime_type + res['file_type'] = self.file_type + res['programming_language'] = self.programming_language + res['is_binary'] = self.is_binary + res['is_text'] = self.is_text + res['is_archive'] = self.is_archive + res['is_media'] = self.is_media + res['is_source'] = self.is_source + res['is_script'] = self.is_script + res['scan_errors'] = self.errors + res.update(self.get_scans()) + return res + + +def get_cache_dir(cache_base_dir): + """ + Return a new, created and unique cache storage directory path rooted at the + `cache_base_dir` in the OS- preferred representation (either bytes on Linux + and Unicode elsewhere). + """ + create_dir(cache_base_dir) + # create a unique temp directory in cache_dir + prefix = time2tstamp() + u'-' + cache_dir = get_temp_dir(cache_base_dir, prefix=prefix) + if on_linux: + cache_dir = fsencode(cache_dir) + else: + cache_dir = fsdecode(cache_dir) + return cache_dir diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py new file mode 100644 index 00000000000..c7b11f7b865 --- /dev/null +++ b/tests/scancode/test_resource.py @@ -0,0 +1,99 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from collections import OrderedDict +from os.path import dirname +from os.path import exists +from os.path import join + +from commoncode.testcase import FileBasedTesting + +from scancode.resource import Codebase +from commoncode.fileutils import parent_directory + + +class TestCodebaseCache(FileBasedTesting): + test_data_dir = join(dirname(__file__), 'data') + + def test_codebase_cache_basic(self): + test_codebase = self.get_test_loc('cache/package') + codebase = Codebase(test_codebase) + assert codebase.cache_base_dir + assert codebase.cache_dir + root = codebase.root + assert ('00', '00000000') == root.cache_keys + cp = root.get_cached_path(create=False) + assert not exists(cp) + cp = root.get_cached_path(create=True) + assert not exists(cp) + assert exists(parent_directory(cp)) + + assert not root.get_scans(cache=True) + assert not root.get_scans(cache=True) + + scans = OrderedDict(this='that') + scans_put = root.put_scans(scans, cache=True) + assert scans == scans_put + assert scans == root.get_scans(cache=True) + assert not root.get_scans(cache=False) + assert exists (root.get_cached_path(create=False)) + + scans_put = root.put_scans(scans, cache=True) + assert scans == scans_put + assert scans == root.get_scans(cache=True) + assert scans is not root.get_scans(cache=True) + assert exists (root.get_cached_path(create=False)) + + scans = OrderedDict(food='bar') + scans_put = root.put_scans(scans, update=False, cache=True) + assert scans == scans_put + assert scans == root.get_scans(cache=True) + assert scans is not root.get_scans(cache=True) + + scans2 = OrderedDict(this='that') + scans_put = root.put_scans(scans2, update=True, cache=True) + expected = OrderedDict(this='that', food='bar') + assert expected == root.get_scans(cache=True) + assert expected is not root.get_scans(cache=True) + + scans = OrderedDict(food='bar') + scans_put = root.put_scans(scans, update=False, cache=True) + assert scans == scans_put + assert scans == root.get_scans(cache=True) + assert not root.get_scans(cache=False) + assert scans is not root.get_scans(cache=True) + assert exists (root.get_cached_path(create=False)) + + scans2 = OrderedDict(this='that') + scans_put = root.put_scans(scans2, update=True, cache=True) + assert not root.get_scans(cache=False) + expected = OrderedDict(this='that', food='bar') + assert expected == root.get_scans(cache=True) + assert expected is not root.get_scans(cache=True) + assert exists (root.get_cached_path(create=False)) diff --git a/tests/scancode/test_scan_cache.py b/tests/scancode/test_scan_cache.py deleted file mode 100644 index 13ec47bd2a1..00000000000 --- a/tests/scancode/test_scan_cache.py +++ /dev/null @@ -1,47 +0,0 @@ -# -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import print_function -from __future__ import division -from __future__ import unicode_literals - -import os - -from commoncode.testcase import FileBasedTesting - -from scancode.cache import ScanFileCache - - -class TestCache(FileBasedTesting): - test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - - def test_can_cache(self): - test_file = self.get_test_loc('cache/package/package.json') - from scancode import api - package = api.get_package_infos(test_file) - test_dir = self.get_temp_dir() - cache = ScanFileCache(test_dir) - cache.put_scan(path='abc', scan_result=package) - assert package == cache.get_scan(path='abc') From 45cf069a58d965aa55eb58098462a1eab32a1f45 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 12:33:24 +0100 Subject: [PATCH 034/122] Use a Codebase in pre-scan and post-scan plugins #787 * Update pre and post scan plugins to implement process_codebase() * rename and update test modules to match latest code and plugin names * plugin_ignore now removes ignored Resources from the Codebase * plugin_mark_source walks the Codebase tree bottom-up and updates the is_source attribute of directories as needed * plugin_only_findings walks the Codebase tree bottom-up and prunes the Codebase tree from Resource without findings. It also always keeps directory or file nodes in the tree that have children with findings even if they do not have findings themselves: with the new codebase structure, removing a parent would remove the children too. And a child cannot exisy without its parent resource (unless this is the codebase root) Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_ignore.py | 42 ++- src/scancode/plugin_mark_source.py | 47 ++-- src/scancode/plugin_only_findings.py | 43 ++- .../data/{ignore => plugin_ignore}/user.tgz | Bin .../data/{ignore => plugin_ignore}/vcs.tgz | Bin .../JGroups.tgz | Bin .../with_info.expected.json | 94 +++++-- .../without_info.expected.json | 10 +- .../data/plugin_only_findings/basic.tgz | Bin 0 -> 17425 bytes .../expected.json | 36 +++ tests/scancode/test_ignore_files.py | 176 ------------ tests/scancode/test_mark_source.py | 44 --- tests/scancode/test_plugin_ignore.py | 254 ++++++++++++++++++ tests/scancode/test_plugin_mark_source.py | 65 +++++ ...ndings.py => test_plugin_only_findings.py} | 35 ++- 15 files changed, 513 insertions(+), 333 deletions(-) rename tests/scancode/data/{ignore => plugin_ignore}/user.tgz (100%) rename tests/scancode/data/{ignore => plugin_ignore}/vcs.tgz (100%) rename tests/scancode/data/{mark_source => plugin_mark_source}/JGroups.tgz (100%) rename tests/scancode/data/{mark_source => plugin_mark_source}/with_info.expected.json (85%) rename tests/scancode/data/{mark_source => plugin_mark_source}/without_info.expected.json (98%) create mode 100644 tests/scancode/data/plugin_only_findings/basic.tgz rename tests/scancode/data/{only_findings => plugin_only_findings}/expected.json (88%) delete mode 100644 tests/scancode/test_ignore_files.py delete mode 100644 tests/scancode/test_mark_source.py create mode 100644 tests/scancode/test_plugin_ignore.py create mode 100644 tests/scancode/test_plugin_mark_source.py rename tests/scancode/{test_has_findings.py => test_plugin_only_findings.py} (60%) diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 67531791c8c..c5d94dff041 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -25,12 +25,9 @@ from __future__ import absolute_import from __future__ import unicode_literals -from commoncode import fileset -from commoncode.fileutils import parent_directory -from commoncode.system import on_linux +from commoncode.fileset import match from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl -from scancode.cli import ScanOption def is_ignored(location, ignores): @@ -38,7 +35,7 @@ def is_ignored(location, ignores): Return a tuple of (pattern , message) if a file at location is ignored or False otherwise. `ignores` is a mappings of patterns to a reason. """ - return fileset.match(location, includes=ignores, excludes={}) + return match(location, includes=ignores, excludes={}) @pre_scan_impl @@ -48,8 +45,7 @@ class ProcessIgnore(PreScanPlugin): """ name = 'ignore' def __init__(self, selected_options, active_scan_names=None): - PreScanPlugin.__init__( - self, selected_options, active_scan_names=active_scan_names) + PreScanPlugin.__init__(self, selected_options, active_scan_names) ignores = [] for se in selected_options: @@ -60,9 +56,9 @@ def __init__(self, selected_options, active_scan_names=None): pattern: 'User ignore: Supplied by --ignore' for pattern in ignores } - @classmethod def get_plugin_options(cls): + from scancode.cli import ScanOption return [ ScanOption(('--ignore',), multiple=True, @@ -70,19 +66,21 @@ def get_plugin_options(cls): help='Ignore files matching .') ] - def process_resources(self, resources): - # FIXME: this is hacksih at best - ignored_paths = set() - seps = b'/\\' if on_linux else '/\\' - for resource in resources: - abs_path = resource.abs_path.strip(seps) + def process_codebase(self, codebase): + """ + Remove ignored Resources from the resource tree. + """ + resources_to_remove = [] + for resource in codebase.walk(topdown=True): + abs_path = resource.get_path(absolute=True) if is_ignored(abs_path, ignores=self.ignores): - ignored_paths.add(abs_path) - else: - parent = parent_directory(abs_path).strip(seps) - if parent not in ignored_paths: - yield resource + resources_to_remove.append(resource) + removed_rids = set() + for resource in resources_to_remove: + if resource.rid in removed_rids: + continue + pruned_rids = codebase.remove_resource(resource) + removed_rids.update(pruned_rids) def is_enabled(self): - return any(se.value for se in self.selected_options - if se.name == 'ignore') + return any(se.value for se in self.selected_options if se.name == 'ignore') diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index ac5c615f35d..2f6f51271c4 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -24,13 +24,11 @@ from __future__ import absolute_import from __future__ import division +from __future__ import print_function from __future__ import unicode_literals -from os import path - from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl -from scancode.cli import ScanOption @post_scan_impl @@ -45,6 +43,7 @@ class MarkSource(PostScanPlugin): @classmethod def get_plugin_options(cls): + from scancode.cli import ScanOption return [ ScanOption(('--mark-source',), is_flag=True, help=''' @@ -60,30 +59,24 @@ def is_enabled(self): return all(se.value for se in self.selected_options if se.name in ('mark_source', 'infos')) - def process_resources(self, results): - # FIXME: we need to process Resources NOT results mappings!!! - # FIXME: this is forcing all the scan results to be loaded in memory - # and defeats lazy loading from cache - results = list(results) - - # FIXME: this is an nested loop, looping twice on results - # TODO: this may not recursively roll up the is_source flag, as we - # may not iterate bottom up. - for scanned_file in results: - if scanned_file['type'] == 'directory' and scanned_file['files_count'] > 0: - source_files_count = 0 - for scanned_file2 in results: - if path.dirname(scanned_file2['path']) == scanned_file['path']: - if scanned_file2['is_source']: - source_files_count += 1 - mark_source(source_files_count, scanned_file) - yield scanned_file + def process_codebase(self, codebase): + """ + Set the `is_source` to True in directories if they contain over 90% of + source code files at full depth. + """ + codebase.update_counts() + # TODO: these two nested walk() calls are not super efficient + for resource in codebase.walk(topdown=False): + if resource.is_file: + continue + src_count = sum(1 for c in resource.walk(topdown=True) if c.is_file and c.is_source) + files_count = resource.files_count + resource.is_source = is_source_directory(src_count, files_count) -def mark_source(source_files_count, scanned_file): +def is_source_directory(src_count, files_count): """ - Set `is_source` to True for a `scanned_file` directory if - `source_files_count` is >=90% of files_count for this directory. + Return True is this resource is a source directory with at least over 90% of + source code files at full depth. """ - if source_files_count / scanned_file['files_count'] >= 0.9: - scanned_file['is_source'] = True + return src_count / files_count >= 0.9 diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index dbc2d11e888..8e4f3a4d5d8 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -27,51 +27,48 @@ from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl -from scancode.cli import ScanOption @post_scan_impl class OnlyFindings(PostScanPlugin): """ - Only return files or directories with findings for the requested - scans. Files and directories without findings are omitted (not - considering basic file information as findings). + Prune files or directories without scan findings for the requested scans. """ name = 'only-findings' @classmethod def get_plugin_options(cls): + from scancode.cli import ScanOption return [ ScanOption(('--only-findings',), is_flag=True, help=''' Only return files or directories with findings for the requested scans. Files and directories without findings are omitted (not - considering basic file information as findings). - ''') + considering basic file information as findings).''') ] def is_enabled(self): return any(se.value == True for se in self.selected_options if se.name == 'only_findings') - def process_resources(self, results): - # FIXME: this is forcing all the scan results to be loaded in memory - # and defeats lazy loading from cache. Only a different caching - # (e.g. DB) could work here. - # FIXME: We should instead use a generator or use a filter function - # that pass to the scan results loader iterator - active_scan_names = self.active_scan_names - for scanned_file in results: - if has_findings(active_scan_names, scanned_file): - yield scanned_file + def process_codebase(self, codebase): + """ + Remove Resources from codebase bottom-up if they have no scan data, no + errors and no children. + """ + for resource in codebase.walk(topdown=False): + if not has_findings(resource): + # TODO: test me, this is likely a source of bugs??? + codebase.remove_resource(resource) -def has_findings(active_scans, scanned_file): +def has_findings(resource): """ - Return True if the `scanned_file` has findings for any of the - `active_scans` names list (excluding basic file information) - or any errors occured when scanning the file. + Return True if this resource has findings. """ - findings = active_scans + ['scan_errors'] - return any(scanned_file.get(scan_name) for scan_name in findings) + return (resource.errors + or resource.children_rids + or any(resource.get_scans().values()) + # NEVER remove the root resource + or resource.is_root()) diff --git a/tests/scancode/data/ignore/user.tgz b/tests/scancode/data/plugin_ignore/user.tgz similarity index 100% rename from tests/scancode/data/ignore/user.tgz rename to tests/scancode/data/plugin_ignore/user.tgz diff --git a/tests/scancode/data/ignore/vcs.tgz b/tests/scancode/data/plugin_ignore/vcs.tgz similarity index 100% rename from tests/scancode/data/ignore/vcs.tgz rename to tests/scancode/data/plugin_ignore/vcs.tgz diff --git a/tests/scancode/data/mark_source/JGroups.tgz b/tests/scancode/data/plugin_mark_source/JGroups.tgz similarity index 100% rename from tests/scancode/data/mark_source/JGroups.tgz rename to tests/scancode/data/plugin_mark_source/JGroups.tgz diff --git a/tests/scancode/data/mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json similarity index 85% rename from tests/scancode/data/mark_source/with_info.expected.json rename to tests/scancode/data/plugin_mark_source/with_info.expected.json index 5de62945398..38eaaf66b78 100644 --- a/tests/scancode/data/mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -4,8 +4,31 @@ "--infos": true, "--mark-source": true }, - "files_count": 15, + "files_count": 12, "files": [ + { + "path": "JGroups.tgz", + "type": "directory", + "name": "JGroups.tgz", + "base_name": "JGroups.tgz", + "extension": "", + "date": null, + "size": null, + "sha1": null, + "md5": null, + "files_count": 12, + "dirs_count": 3, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, { "path": "JGroups.tgz/JGroups", "type": "directory", @@ -13,10 +36,11 @@ "base_name": "JGroups", "extension": "", "date": null, - "size": 206642, + "size": null, "sha1": null, "md5": null, "files_count": 12, + "dirs_count": 2, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,10 +59,11 @@ "base_name": "licenses", "extension": "", "date": null, - "size": 54552, + "size": null, "sha1": null, "md5": null, "files_count": 5, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -57,10 +82,11 @@ "base_name": "apache-1.1", "extension": ".txt", "date": "2017-08-05", - "size": 2885, + "size": "2017-08-05", "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", "md5": "276982197c941f4cbf3d218546e17ae2", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -79,10 +105,11 @@ "base_name": "apache-2.0", "extension": ".txt", "date": "2017-08-05", - "size": 11560, + "size": "2017-08-05", "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", "md5": "d273d63619c9aeaf15cdaf76422c4f87", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -101,10 +128,11 @@ "base_name": "bouncycastle", "extension": ".txt", "date": "2017-08-05", - "size": 1186, + "size": "2017-08-05", "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", "md5": "9fffd8de865a5705969f62b128381f85", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -123,10 +151,11 @@ "base_name": "cpl-1.0", "extension": ".txt", "date": "2017-08-05", - "size": 11987, + "size": "2017-08-05", "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -145,10 +174,11 @@ "base_name": "lgpl", "extension": ".txt", "date": "2017-08-05", - "size": 26934, + "size": "2017-08-05", "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", "md5": "f14599a2f089f6ff8c97e2baa4e3d575", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -167,10 +197,11 @@ "base_name": "src", "extension": "", "date": null, - "size": 152090, + "size": null, "sha1": null, "md5": null, "files_count": 7, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -189,10 +220,11 @@ "base_name": "FixedMembershipToken", "extension": ".java", "date": "2017-08-05", - "size": 5144, + "size": "2017-08-05", "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", "md5": "aca9640ec8beee21b098bcf8ecc91442", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -211,10 +243,11 @@ "base_name": "GuardedBy", "extension": ".java", "date": "2017-08-05", - "size": 813, + "size": "2017-08-05", "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", "md5": "c5064400f759d3e81771005051d17dc1", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -233,10 +266,11 @@ "base_name": "ImmutableReference", "extension": ".java", "date": "2017-08-05", - "size": 1838, + "size": "2017-08-05", "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", "md5": "48ca3c72fb9a65c771a321222f118b88", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -255,10 +289,11 @@ "base_name": "RATE_LIMITER", "extension": ".java", "date": "2017-08-05", - "size": 3692, + "size": "2017-08-05", "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", "md5": "4626bdbc48871b55513e1a12991c61a8", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -277,10 +312,11 @@ "base_name": "RouterStub", "extension": ".java", "date": "2017-08-05", - "size": 9913, + "size": "2017-08-05", "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", "md5": "eecfe23494acbcd8088c93bc1e83c7f2", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -299,10 +335,11 @@ "base_name": "RouterStubManager", "extension": ".java", "date": "2017-08-05", - "size": 8162, + "size": "2017-08-05", "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", "md5": "20bee9631b7c82a45c250e095352aec7", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -321,10 +358,11 @@ "base_name": "S3_PING", "extension": ".java", "date": "2017-08-05", - "size": 122528, + "size": "2017-08-05", "sha1": "08dba9986f69719970ead3592dc565465164df0d", "md5": "83d8324f37d0e3f120bc89865cf0bd39", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", diff --git a/tests/scancode/data/mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json similarity index 98% rename from tests/scancode/data/mark_source/without_info.expected.json rename to tests/scancode/data/plugin_mark_source/without_info.expected.json index 5d639c1d296..124268ffdad 100644 --- a/tests/scancode/data/mark_source/without_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/without_info.expected.json @@ -4,10 +4,18 @@ "--copyrights": true, "--licenses": true, "--packages": true, + "--infos": true, "--mark-source": true }, - "files_count": 15, + "files_count": 12, "files": [ + { + "path": "JGroups.tgz", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, { "path": "JGroups.tgz/JGroups", "scan_errors": [], diff --git a/tests/scancode/data/plugin_only_findings/basic.tgz b/tests/scancode/data/plugin_only_findings/basic.tgz new file mode 100644 index 0000000000000000000000000000000000000000..e9a24f937b4fd4fdd4fd5ef8fb13a85e182103b6 GIT binary patch literal 17425 zcmV(?K-a$?iwFP`U%FKQ1ME9#bK5wU`Kna;KVWCl6FV*2y6iZf>7JEkIo6J2dv(Og zeo-J2vKaFkg0ies*Z%f>2S`GcoTDq5s;(WSDkeeV;azwqIFZ_O_MiOFUk!dQUmoD! z`pbiw{WtqPsW%P|4qMGez210It2dgp!zbe4$D+l*xlUyw#FID*CW&(8WAAUA@3;mE`0%jxi2Pr^Y{H%g`M2t|L%0S#sUN&NXg(3O?})>rzyIg*KliFzPq&^9 zXG%;X-;Wkvcq^R9Rl?IE#Zk{!LeJwkO423Bp_71n6x}HuGZ!%B4 zC5~kHJ$tZGAF`Sju*qMt)~Dd*hB7L$W$dDhqE_$x4R2hi3Bum_QV^{_wn6M zl!Q}Y<6x;%6==~5ovo*f#bVFl2k^`@R95l9u-r$nrhz)Mr0I8LH_k2MH{kd_oR zbUmD;2@FmQRC-J|^}P~yM6W@MG(3R44>YCH=zyGnq6jDB89{+x7^R?VRd@xqgbx4_ zPO&nPxQZ66>iE(NRKhH5tfK-;T5QQs0b1QTp!b8Y5lmKOjR#({usC z%Mc@Oz%sEfmnCAPa~DPnU%9sm0h6dJLj=OSOEZg8K!qK5uYA~tpozCY1V@Qxf?IpyQhCHFgcr&{ZP-jA&>p~q=g;vG zn~Tf$qWkW;-yICZRbTYpTwnA65J2v?FNeMEpelNoor}?F@A5V9dNdT5S3_~pd(#`j zYs0H5E=Z8pr;4jH@uu7FoWpJVq<7I9z9*ER(?C z7#xyz+8cB(+Pyd3Q*=(3u(asD1ziGb)`nJEo8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UKnt`$`>SgI52prP!vGio0L{N1WB>pF literal 0 HcmV?d00001 diff --git a/tests/scancode/data/only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json similarity index 88% rename from tests/scancode/data/only_findings/expected.json rename to tests/scancode/data/plugin_only_findings/expected.json index d9377448de4..d4f29e463fd 100644 --- a/tests/scancode/data/only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -4,10 +4,32 @@ "--copyrights": true, "--licenses": true, "--packages": true, + "--infos": true, "--only-findings": true }, "files_count": 3, "files": [ + { + "path": "basic.tgz", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, + { + "path": "basic.tgz/basic", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, + { + "path": "basic.tgz/basic/dir", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, { "path": "basic.tgz/basic/dir/e.tar", "scan_errors": [], @@ -60,6 +82,20 @@ } ] }, + { + "path": "basic.tgz/basic/dir2", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, + { + "path": "basic.tgz/basic/dir2/subdir", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, { "path": "basic.tgz/basic/dir2/subdir/bcopy.s", "scan_errors": [], diff --git a/tests/scancode/test_ignore_files.py b/tests/scancode/test_ignore_files.py deleted file mode 100644 index 6e7a36ccf03..00000000000 --- a/tests/scancode/test_ignore_files.py +++ /dev/null @@ -1,176 +0,0 @@ -# -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import unicode_literals - -from os import path - -from commoncode.testcase import FileBasedTesting -from commoncode.ignore import is_ignored -from scancode.cache import get_scans_cache_class -from scancode.cli import CommandOption -from scancode.cli import get_resources -from scancode.plugin_ignore import ProcessIgnore - - -class TestIgnoreFiles(FileBasedTesting): - - test_data_dir = path.join(path.dirname(__file__), 'data') - - def test_ignore_glob_path(self): - test = ( - 'common/src/test/sample.txt', - {'*/src/test/*': 'test ignore'}, - {} - ) - assert is_ignored(*test) - - def test_ignore_single_path(self): - test = ( - 'common/src/test/sample.txt', - {'src/test/sample.txt': 'test ignore'}, - {} - ) - assert is_ignored(*test) - - def test_ignore_single_file(self): - test = ( - 'common/src/test/sample.txt', - {'sample.txt': 'test ignore'}, - {} - ) - assert is_ignored(*test) - - def test_ignore_glob_file(self): - test = ( - 'common/src/test/sample.txt', - {'*.txt': 'test ignore'}, - {} - ) - assert is_ignored(*test) - - def test_resource_paths_with_single_file(self): - - test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugins = [ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('sample.doc',), default=None)] - )] - scan_cache_class = get_scans_cache_class(self.get_temp_dir()) - expected = [ - 'user', - 'user/ignore.doc', - 'user/src', - 'user/src/ignore.doc', - 'user/src/test', - 'user/src/test/sample.txt' - ] - - resources = get_resources(test_dir, scan_cache_class) - for plugin in test_plugins: - resources = plugin.process_resources(resources) - - resources = [resource.rel_path for resource in resources] - assert expected == sorted(resources) - - def test_resource_paths_with_multiple_files(self): - test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugins = [ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('ignore.doc',), default=None)] - )] - scan_cache_class = get_scans_cache_class(self.get_temp_dir()) - expected = [ - 'user', - 'user/src', - 'user/src/test', - 'user/src/test/sample.doc', - 'user/src/test/sample.txt' - ] - resources = get_resources(test_dir, scan_cache_class) - for plugin in test_plugins: - resources = plugin.process_resources(resources) - - resources = [resource.rel_path for resource in resources] - assert expected == sorted(resources) - - def test_resource_paths_with_glob_file(self): - test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugins = [ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('*.doc',), default=None)] - )] - scan_cache_class = get_scans_cache_class(self.get_temp_dir()) - expected = [ - 'user', - 'user/src', - 'user/src/test', - 'user/src/test/sample.txt' - ] - resources = get_resources(test_dir, scan_cache_class) - for plugin in test_plugins: - resources = plugin.process_resources(resources) - - resources = [resource.rel_path for resource in resources] - assert expected == sorted(resources) - - def test_resource_paths_with_glob_path(self): - test_dir = self.extract_test_tar('ignore/user.tgz') - test_plugins = [ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('*/src/test',), default=None)] - )] - scan_cache_class = get_scans_cache_class(self.get_temp_dir()) - expected = [ - 'user', - 'user/ignore.doc', - 'user/src', - 'user/src/ignore.doc' - ] - resources = get_resources(test_dir, scan_cache_class) - for plugin in test_plugins: - resources = plugin.process_resources(resources) - - resources = [resource.rel_path for resource in resources] - assert expected == sorted(resources) - - def test_resource_paths_with_multiple_plugins(self): - test_dir = self.extract_test_tar('ignore/user.tgz') - scan_cache_class = get_scans_cache_class(self.get_temp_dir()) - test_plugins = [ - ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('*.doc',), default=None)] - ), - ProcessIgnore( - [CommandOption(group=None, name='ignore', option='--ignore', value=('*/src/test/*',), default=None)] - ), - ] - expected = [ - 'user', - 'user/src', - 'user/src/test' - ] - resources = get_resources(test_dir, scan_cache_class) - for plugin in test_plugins: - resources = plugin.process_resources(resources) - - resources = [resource.rel_path for resource in resources] - assert expected == sorted(resources) diff --git a/tests/scancode/test_mark_source.py b/tests/scancode/test_mark_source.py deleted file mode 100644 index 03dff2460ca..00000000000 --- a/tests/scancode/test_mark_source.py +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import unicode_literals - -from unittest import TestCase -from scancode.plugin_mark_source import mark_source - - -class TestMarkSource(TestCase): - - def test_mark_source_above_threshold(self): - test_dict = dict(files_count=10, is_source=False) - test_source_file_count = 9 - mark_source(test_source_file_count, test_dict) - assert test_dict['is_source'] - - def test_mark_source_below_threshold(self): - test_dict = dict(files_count=10, is_source=False) - test_source_file_count = 5 - mark_source(test_source_file_count, test_dict) - assert not test_dict['is_source'] diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py new file mode 100644 index 00000000000..73716a824ab --- /dev/null +++ b/tests/scancode/test_plugin_ignore.py @@ -0,0 +1,254 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from os.path import dirname +from os.path import join + +from commoncode.testcase import FileDrivenTesting +from scancode.cli import CommandOption +from scancode.plugin_ignore import is_ignored +from scancode.plugin_ignore import ProcessIgnore +from scancode.cli_test_utils import run_scan_click +from scancode.cli_test_utils import _load_json_result +from scancode.resource import Codebase + + +class TestPluginIgnoreFiles(FileDrivenTesting): + + test_data_dir = join(dirname(__file__), 'data') + + def test_is_ignored_glob_path(self): + location = 'common/src/test/sample.txt' + ignores = {'*/src/test/*': 'test ignore'} + assert is_ignored(location=location, ignores=ignores) + + def test_is_ignored_single_path(self): + location = 'common/src/test/sample.txt' + ignores = {'common/src/test/sample.txt': 'test ignore'} + assert is_ignored(location=location, ignores=ignores) + + def test_is_ignored_single_path_not_matching(self): + location = 'common/src/test/sample.txt' + ignores = {'src/test/sample.txt': 'test ignore'} + assert not is_ignored(location=location, ignores=ignores) + + def test_is_ignored_single_file(self): + location = 'common/src/test/sample.txt' + ignores = {'sample.txt': 'test ignore'} + assert is_ignored(location=location, ignores=ignores) + + def test_is_ignored_glob_file(self): + location = 'common/src/test/sample.txt' + ignores = {'*.txt': 'test ignore'} + assert is_ignored(location=location, ignores=ignores) + + def test_ProcessIgnore_with_single_file(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + option = CommandOption(group=None, name='ignore', option='--ignore', + value=('sample.doc',), default=None) + test_plugin = ProcessIgnore([option]) + expected = [ + 'user', + 'user/ignore.doc', + 'user/src', + 'user/src/ignore.doc', + 'user/src/test', + 'user/src/test/sample.txt' + ] + + codebase = Codebase(test_dir) + test_plugin.process_codebase(codebase) + resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] + assert expected == sorted(resources) + + def test_ProcessIgnore_with_multiple_files(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + option = CommandOption(group=None, name='ignore', option='--ignore', + value=('ignore.doc', 'sample.doc',), default=None) + test_plugin = ProcessIgnore([option]) + expected = [ + 'user', + 'user/src', + 'user/src/test', + 'user/src/test/sample.txt' + ] + + codebase = Codebase(test_dir) + test_plugin.process_codebase(codebase) + resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] + assert expected == sorted(resources) + + def test_ProcessIgnore_with_glob_for_extension(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + option = CommandOption(group=None, name='ignore', option='--ignore', + value=('*.doc',), default=None) + test_plugin = ProcessIgnore([option]) + + expected = [ + 'user', + 'user/src', + 'user/src/test', + 'user/src/test/sample.txt' + ] + + codebase = Codebase(test_dir) + test_plugin.process_codebase(codebase) + resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] + assert expected == sorted(resources) + + def test_ProcessIgnore_with_glob_for_path(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + option = CommandOption(group=None, name='ignore', option='--ignore', + value=('*/src/test',), default=None) + test_plugin = ProcessIgnore([option]) + + expected = [ + 'user', + 'user/ignore.doc', + 'user/src', + 'user/src/ignore.doc' + ] + + codebase = Codebase(test_dir) + test_plugin.process_codebase(codebase) + resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] + assert expected == sorted(resources) + + def test_ProcessIgnore_with_multiple_plugins(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + test_plugins = [ + ProcessIgnore([CommandOption(group=None, name='ignore', option='--ignore', + value=('*.doc',), default=None)]), + ProcessIgnore([CommandOption(group=None, name='ignore', option='--ignore', + value=('*/src/test/*',), default=None)]), + ] + + expected = [ + 'user', + 'user/src', + 'user/src/test' + ] + + codebase = Codebase(test_dir) + for plugin in test_plugins: + plugin.process_codebase(codebase) + + resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] + assert expected == sorted(resources) + + +class TestScanPluginIgnoreFiles(FileDrivenTesting): + + test_data_dir = join(dirname(__file__), 'data') + + def test_scancode_ignore_vcs_files_and_dirs_by_default(self): + test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click(['--copyright', '--strip-root', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + # a single test.tst file and its directory that is not a VCS file should be listed + assert 1 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'vcs', u'vcs/test.txt'] == scan_locs + def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): + test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') + result_file = self.get_temp_file('json') + result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, result_file], + catch_exceptions=False) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + # a single test.tst file and its directory that is not a VCS file should be listed + assert 1 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'vcs', u'vcs/test.txt'] == scan_locs + + def test_scancode_ignore_single_file(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click( + ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + assert 3 == scan_result['files_count'] + # FIXME: add assert 3 == scan_result['dirs_count'] + scan_locs = [x['path'] for x in scan_result['files']] + expected = [ + 'user', + 'user/ignore.doc', + 'user/src', + 'user/src/ignore.doc', + 'user/src/test', + 'user/src/test/sample.txt' + ] + assert expected == scan_locs + + def test_scancode_ignore_multiple_files(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + assert 2 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.doc', u'user/src/test/sample.txt'] == scan_locs + + def test_scancode_ignore_glob_files(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + assert 1 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.txt'] == scan_locs + + def test_scancode_ignore_glob_path(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + assert 2 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'user', u'user/ignore.doc', u'user/src', u'user/src/ignore.doc', u'user/src/test'] == scan_locs + + def test_scancode_multiple_ignores(self): + test_dir = self.extract_test_tar('plugin_ignore/user.tgz') + result_file = self.get_temp_file('json') + + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, result_file]) + assert result.exit_code == 0 + scan_result = _load_json_result(result_file) + assert 0 == scan_result['files_count'] + scan_locs = [x['path'] for x in scan_result['files']] + assert [u'user', u'user/src'] == scan_locs diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py new file mode 100644 index 00000000000..86a4c442ca6 --- /dev/null +++ b/tests/scancode/test_plugin_mark_source.py @@ -0,0 +1,65 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from os.path import dirname +from os.path import join + +from commoncode.testcase import FileDrivenTesting +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click +from scancode.plugin_mark_source import is_source_directory + + +class TestMarkSource(FileDrivenTesting): + + test_data_dir = join(dirname(__file__), 'data') + + def test_is_source_directory_above_threshold(self): + files_count = 10 + src_count = 9 + assert is_source_directory(src_count, files_count) + + def test_is_source_directory_below_threshold(self): + files_count = 10 + src_count = 5 + assert not is_source_directory(src_count, files_count) + + def test_scan_mark_source_without_info(self): + test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_mark_source/without_info.expected.json') + + _result = run_scan_click(['--mark-source', test_dir, result_file]) + check_json_scan(expected_file, result_file, regen=False) + + def test_scan_mark_source_with_info(self): + test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_mark_source/with_info.expected.json') + + _result = run_scan_click(['--info', '--mark-source', test_dir, result_file]) + check_json_scan(expected_file, result_file) diff --git a/tests/scancode/test_has_findings.py b/tests/scancode/test_plugin_only_findings.py similarity index 60% rename from tests/scancode/test_has_findings.py rename to tests/scancode/test_plugin_only_findings.py index be0bd00646f..bc8f2e8ce5a 100644 --- a/tests/scancode/test_has_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -25,25 +25,36 @@ from __future__ import absolute_import from __future__ import unicode_literals -from unittest import TestCase +from os.path import dirname +from os.path import join + +from commoncode.testcase import FileDrivenTesting +from scancode.cli_test_utils import run_scan_click +from scancode.cli_test_utils import check_json_scan from scancode.plugin_only_findings import has_findings +from scancode.resource import Resource -class TestHasFindings(TestCase): +class TestHasFindings(FileDrivenTesting): - def test_has_findings(self): - scanned_file = {'licenses': ['MIT']} - active_scans = ['licenses'] + test_data_dir = join(dirname(__file__), 'data') - assert has_findings(active_scans, scanned_file) + def test_has_findings(self): + resource = Resource('name', 1, 2, 3) + resource.put_scans({'licenses': ['MIT']}, cache=False) + assert has_findings(resource) def test_has_findings_includes_errors(self): - active_scans = [] - scanned_file = { - 'scan_errors': [ + resource = Resource('name', 1, 2, 3) + resource.errors = [ 'ERROR: Processing interrupted: timeout after 10 seconds.' ] - } + assert has_findings(resource) - assert has_findings(active_scans, scanned_file) + def test_scan_only_findings(self): + test_dir = self.extract_test_tar('plugin_only_findings/basic.tgz') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_only_findings/expected.json') + _result = run_scan_click(['--only-findings', test_dir, result_file]) + check_json_scan(expected_file, result_file) From b1949e984e9b0bf850dcfcdbd8fc146f41a51f27 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 12:41:52 +0100 Subject: [PATCH 035/122] Resources are now topdown and sorted by name in outputs #787 * also the root resource has scans and info Signed-off-by: Philippe Ombredanne --- .../data/csv/livescan/expected.csv | 22 ++--- tests/formattedcode/data/csv/srp.csv | 7 +- .../formattedcode/data/csv/tree/expected.csv | 25 +++--- .../data/json/simple-expected.json | 30 ++++++- .../data/json/simple-expected.jsonlines | 31 ++++++- .../data/json/simple-expected.jsonpp | 30 ++++++- .../data/json/tree/expected.json | 48 +++++----- .../data/spdx/license_known/expected.rdf | 36 ++++---- .../spdx/license_known/expected_with_text.rdf | 26 +++--- .../data/spdx/license_ref/expected.rdf | 46 +++++----- .../spdx/license_ref/expected_with_text.rdf | 4 +- .../data/spdx/or_later/expected.rdf | 26 +++--- .../data/spdx/simple/expected.rdf | 18 ++-- .../data/spdx/simple/expected.tv | 2 +- .../formattedcode/data/spdx/tree/expected.rdf | 88 +++++++++---------- .../data/spdx/unicode/expected.rdf | 10 +-- 16 files changed, 262 insertions(+), 187 deletions(-) diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index aeaaa9d531d..0a69702c836 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,5 +1,14 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Resource,type,name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,.rb,2017-10-03,2017-10-03,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, +/license,file,license,,2017-10-03,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,.json,2017-10-03,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, @@ -8,12 +17,3 @@ Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,mime_type, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1014,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, diff --git a/tests/formattedcode/data/csv/srp.csv b/tests/formattedcode/data/csv/srp.csv index 25a06299727..965ced7a341 100644 --- a/tests/formattedcode/data/csv/srp.csv +++ b/tests/formattedcode/data/csv/srp.csv @@ -1,8 +1,9 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder -/srp/srp_vfy.c,,,,, -/srp/srp_vfy.c,,Copyright 2011-2016 The OpenSSL Project,2,2, -/srp/srp_vfy.c,,,2,2,The OpenSSL Project +/srp,,,,, /srp/build.info,,,,, /srp/srp_lib.c,,,,, /srp/srp_lib.c,,Copyright 2011-2016 The OpenSSL Project,2,2, /srp/srp_lib.c,,,2,2,The OpenSSL Project +/srp/srp_vfy.c,,,,, +/srp/srp_vfy.c,,Copyright 2011-2016 The OpenSSL Project,2,2, +/srp/srp_vfy.c,,,2,2,The OpenSSL Project diff --git a/tests/formattedcode/data/csv/tree/expected.csv b/tests/formattedcode/data/csv/tree/expected.csv index f785fa5f70e..7ec9a67980f 100644 --- a/tests/formattedcode/data/csv/tree/expected.csv +++ b/tests/formattedcode/data/csv/tree/expected.csv @@ -1,23 +1,24 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder -/scan/copy1.c,,,,, -/scan/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy1.c,,,1,1,"ACME, Inc." -/scan/copy2.c,,,,, -/scan/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy2.c,,,1,1,"ACME, Inc." -/scan/copy3.c,,,,, -/scan/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy3.c,,,1,1,"ACME, Inc." +/scan,,,,, /scan/subdir,,,,, /scan/subdir/copy1.c,,,,, /scan/subdir/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy1.c,,,1,1,"ACME, Inc." -/scan/subdir/copy4.c,,,,, -/scan/subdir/copy4.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy4.c,,,1,1,"ACME, Inc." /scan/subdir/copy2.c,,,,, /scan/subdir/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy2.c,,,1,1,"ACME, Inc." /scan/subdir/copy3.c,,,,, /scan/subdir/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy3.c,,,1,1,"ACME, Inc." +/scan/subdir/copy4.c,,,,, +/scan/subdir/copy4.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/subdir/copy4.c,,,1,1,"ACME, Inc." +/scan/copy1.c,,,,, +/scan/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy1.c,,,1,1,"ACME, Inc." +/scan/copy2.c,,,,, +/scan/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy2.c,,,1,1,"ACME, Inc." +/scan/copy3.c,,,,, +/scan/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy3.c,,,1,1,"ACME, Inc." diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index 90169700f96..fb14aa63eb4 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -8,16 +8,40 @@ }, "files_count": 1, "files": [ + { + "path": "simple", + "type": "directory", + "name": "simple", + "extension": "", + "size": null, + "sha1": null, + "md5": null, + "files_count": 1, + "dirs_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, { "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", - "base_name": "copyright_acme_c-c", "extension": ".c", - "size": 55, + "size": "2017-10-03", "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 8665f431ebc..7d18e4abcfa 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -9,18 +9,43 @@ "files_count": 1 } }, + { + "files": [ + { + "path": "simple", + "type": "directory", + "name": "simple", + "extension": "", + "size": null, + "sha1": null, + "md5": null, + "files_count": 1, + "dirs_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + } + ] + }, { "files": [ { "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", - "base_name": "copyright_acme_c-c", "extension": ".c", - "size": 55, + "size": "2017-10-03", "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index cb66fa72c88..dbe99ac1684 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -9,16 +9,40 @@ }, "files_count": 1, "files": [ + { + "path": "simple", + "type": "directory", + "name": "simple", + "extension": "", + "size": null, + "sha1": null, + "md5": null, + "files_count": 1, + "dirs_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [] + }, { "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", - "base_name": "copyright_acme_c-c", "extension": ".c", - "size": 55, + "size": "2017-10-03", "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 2fcc3244780..07bd8812eb6 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -7,18 +7,18 @@ "--infos": true, "--strip-root": true }, - "files_count": 8, + "files_count": 4, "files": [ { "path": "copy1.c", "type": "file", "name": "copy1.c", - "base_name": "copy1", "extension": ".c", - "size": 91, + "size": "2017-10-03", "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -49,12 +49,12 @@ "path": "copy2.c", "type": "file", "name": "copy2.c", - "base_name": "copy2", "extension": ".c", - "size": 91, + "size": "2017-10-03", "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -85,12 +85,12 @@ "path": "copy3.c", "type": "file", "name": "copy3.c", - "base_name": "copy3", "extension": ".c", - "size": 91, + "size": "2017-10-03", "sha1": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", "md5": "e999e21c9d7de4d0f943aefbb6f21b99", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -121,12 +121,12 @@ "path": "subdir", "type": "directory", "name": "subdir", - "base_name": "subdir", "extension": "", - "size": 361, + "size": null, "sha1": null, "md5": null, "files_count": 4, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -145,12 +145,12 @@ "path": "subdir/copy1.c", "type": "file", "name": "copy1.c", - "base_name": "copy1", "extension": ".c", - "size": 91, + "size": "2017-10-03", "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -181,12 +181,12 @@ "path": "subdir/copy2.c", "type": "file", "name": "copy2.c", - "base_name": "copy2", "extension": ".c", - "size": 91, + "size": "2017-10-03", "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -217,12 +217,12 @@ "path": "subdir/copy3.c", "type": "file", "name": "copy3.c", - "base_name": "copy3", "extension": ".c", - "size": 84, + "size": "2017-10-03", "sha1": "389af7e629a9853056e42b262d5e30bf4579a74f", "md5": "290627a1387288ef77ae7e07946f3ecf", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -253,12 +253,12 @@ "path": "subdir/copy4.c", "type": "file", "name": "copy4.c", - "base_name": "copy4", "extension": ".c", - "size": 95, + "size": "2017-10-03", "sha1": "58748872d25374160692f1ed7075d0fe80a544b1", "md5": "88e46475db9b1a68f415f6a3544eeb16", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", diff --git a/tests/formattedcode/data/spdx/license_known/expected.rdf b/tests/formattedcode/data/spdx/license_known/expected.rdf index 03d7afda23c..cbd3387e37f 100644 --- a/tests/formattedcode/data/spdx/license_known/expected.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected.rdf @@ -3,19 +3,22 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": [ - null, - null - ], "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan", + "ns1:hasFile": [ + null, + null + ], "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -24,18 +27,15 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": [ { "ns1:File": { @@ -51,10 +51,10 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE", "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + } } }, { @@ -68,13 +68,13 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/apache-2.0.LICENSE", + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - } + "ns1:fileName": "./scan/apache-2.0.LICENSE" } } ], diff --git a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf index ce83519f92e..c40d21c6c85 100644 --- a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf @@ -6,18 +6,20 @@ "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, + "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { + "ns1:hasFile": [ + null, + null + ], "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": [ - null, - null - ], + "ns1:name": "scan", "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -26,16 +28,14 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { @@ -59,9 +59,7 @@ }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", @@ -71,7 +69,9 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/apache-2.0.LICENSE", + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } diff --git a/tests/formattedcode/data/spdx/license_ref/expected.rdf b/tests/formattedcode/data/spdx/license_ref/expected.rdf index 3be5b00f4b4..c710b4990a3 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected.rdf @@ -11,9 +11,17 @@ "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } }, - "ns1:referencesFile": { - "ns1:File": { - "ns1:licenseInfoInFile": [ + "ns1:describesPackage": { + "ns1:Package": { + "ns1:hasFile": null, + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:name": "scan", + "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, @@ -28,34 +36,19 @@ } } ], - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" - } - }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE" + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." } }, "ns1:specVersion": "SPDX-2.1", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:describesPackage": { - "ns1:Package": { - "ns1:name": "scan", - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": null, - "ns1:licenseInfoFromFiles": [ + "ns1:referencesFile": { + "ns1:File": { + "ns1:licenseInfoInFile": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, @@ -70,10 +63,17 @@ } } ], + "ns1:checksum": { + "ns1:Checksum": { + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", + "ns1:algorithm": "SHA1" + } + }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf index 4590e71c31a..2c0f8c378d4 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf @@ -13,14 +13,14 @@ }, "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": null, + "ns1:name": "scan", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan", + "ns1:hasFile": null, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" diff --git a/tests/formattedcode/data/spdx/or_later/expected.rdf b/tests/formattedcode/data/spdx/or_later/expected.rdf index c723b8e20bb..2d43fe9f430 100644 --- a/tests/formattedcode/data/spdx/or_later/expected.rdf +++ b/tests/formattedcode/data/spdx/or_later/expected.rdf @@ -3,6 +3,10 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { "ns1:downloadLocation": { @@ -11,23 +15,22 @@ "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:name": "or_later", "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" }, - "ns1:name": "or_later" + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": null } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" + }, "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca", @@ -37,9 +40,6 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" - }, "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:fileName": "./test.java" } diff --git a/tests/formattedcode/data/spdx/simple/expected.rdf b/tests/formattedcode/data/spdx/simple/expected.rdf index d3b0af43363..7dcc02e8d93 100644 --- a/tests/formattedcode/data/spdx/simple/expected.rdf +++ b/tests/formattedcode/data/spdx/simple/expected.rdf @@ -3,12 +3,9 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, - "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { + "ns1:hasFile": null, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, @@ -19,15 +16,18 @@ "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, + "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:referencesFile": { "ns1:File": { "ns1:checksum": { @@ -45,7 +45,7 @@ "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./simple/test.txt" + "ns1:fileName": "./test.txt" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" diff --git a/tests/formattedcode/data/spdx/simple/expected.tv b/tests/formattedcode/data/spdx/simple/expected.tv index 3f5fe575a66..7ef5f485fd7 100644 --- a/tests/formattedcode/data/spdx/simple/expected.tv +++ b/tests/formattedcode/data/spdx/simple/expected.tv @@ -17,7 +17,7 @@ PackageLicenseConcluded: NOASSERTION PackageLicenseInfoFromFiles: NONE PackageCopyrightText: NONE # File -FileName: ./simple/test.txt +FileName: ./test.txt FileChecksum: SHA1: b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8 LicenseConcluded: NOASSERTION LicenseInfoInFile: NONE diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index ad2c421eb1e..ab0787bb801 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -3,20 +3,15 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "scan", - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:licenseConcluded": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:hasFile": [ @@ -27,19 +22,22 @@ null, null, null - ] + ], + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:name": "scan" } }, "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": [ { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, + "ns1:fileName": "./scan/subdir/copy3.c", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", @@ -49,31 +47,32 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy3.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." } }, { "ns1:File": { - "ns1:fileName": "./scan/copy1.c", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:fileName": "./scan/copy1.c", + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, { "ns1:File": { - "ns1:fileName": "./scan/copy2.c", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", @@ -83,10 +82,11 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/copy2.c", + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." + } } }, { @@ -101,15 +101,17 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." + } } }, { "ns1:File": { - "ns1:fileName": "./scan/subdir/copy2.c", + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", @@ -119,14 +121,15 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy2.c" } }, { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", @@ -136,18 +139,12 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/subdir/copy4.c", "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:fileName": "./scan/subdir/copy4.c" } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", @@ -157,8 +154,11 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/copy3.c", "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy3.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } } ], diff --git a/tests/formattedcode/data/spdx/unicode/expected.rdf b/tests/formattedcode/data/spdx/unicode/expected.rdf index fb927092f95..3d83d4ed444 100644 --- a/tests/formattedcode/data/spdx/unicode/expected.rdf +++ b/tests/formattedcode/data/spdx/unicode/expected.rdf @@ -13,14 +13,14 @@ }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "unicode", + "ns1:hasFile": null, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, + "ns1:name": "unicode", "ns1:licenseInfoFromFiles": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", @@ -40,7 +40,6 @@ }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./et131x.h", "ns1:checksum": { "ns1:Checksum": { "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", @@ -50,14 +49,15 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", "ns1:licenseInfoInFile": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", "ns1:licenseId": "LicenseRef-agere-bsd" } - } + }, + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", + "ns1:fileName": "./et131x.h" } }, "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" From da79dc2452ec6d2e3ab810c29e2c3ff8c473832b Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 16:14:58 +0100 Subject: [PATCH 036/122] Improve plugins and codebase handling in cli #787 * Use a Codebase and Resources throughout, adding new codebase-driven caching * Remove code no longer needed from using a Codebase * Refactor and simplify scan_all() in scan_codebase() as a UI free function. Saving results to cache takes place there now. * Refactor and simplify scan_one(), _scanit() in a single simpler scan_resource() function. Each scanner function is now called in its own interruptible thread * Simplify and improve scan errors handling: error strings now include which scan they are from. * Do not use dummy progressbar if --quiet, just a plain iterator. Do not use a context manager when using a progress bar. * Display an improved scan summary with correct timings and counts for each processing stage * Add new experimental "--no-cache" option to bypass caching scan results on disk and use in-memory storage instead * Walk codebase when calling save_results (format plugins are not using a Codebase yet) * JSON outputs now include dirs_count which is a Resource attribute files_count is never null. The counts are correct. Size is never null. Reintroduce base_name that was removed by mistake. * Fix bug where the size was returned as a date in outputs * Ensure ordering of SPDX format tests is stable Signed-off-by: Philippe Ombredanne --- etc/scripts/testdata/livescan/expected.csv | 40 +- src/scancode/cli.py | 645 ++++++++---------- src/scancode/resource.py | 272 ++++---- .../data/csv/livescan/expected.csv | 38 +- .../data/json/simple-expected.json | 6 +- .../data/json/simple-expected.jsonlines | 6 +- .../data/json/simple-expected.jsonpp | 6 +- .../data/json/tree/expected.json | 24 +- .../data/spdx/license_known/expected.rdf | 52 +- .../spdx/license_known/expected_with_text.rdf | 50 +- .../data/spdx/license_ref/expected.rdf | 66 +- .../spdx/license_ref/expected_with_text.rdf | 66 +- .../data/spdx/or_later/expected.rdf | 30 +- .../data/spdx/simple/expected.rdf | 40 +- .../formattedcode/data/spdx/tree/expected.rdf | 88 +-- .../data/spdx/unicode/expected.rdf | 52 +- tests/formattedcode/test_format_spdx.py | 30 +- .../data/altpath/copyright.expected.json | 3 +- .../data/composer/composer.expected.json | 5 +- .../data/failing/patchelf.expected.json | 3 +- tests/scancode/data/help/help.txt | 2 + tests/scancode/data/info/all.expected.json | 25 +- .../data/info/all.rooted.expected.json | 13 +- tests/scancode/data/info/basic.expected.json | 25 +- .../data/info/basic.rooted.expected.json | 48 +- .../data/info/email_url_info.expected.json | 25 +- .../scancode/data/license_text/test.expected | 1 + .../data/non_utf8/expected-linux.json | 57 +- .../with_info.expected.json | 32 +- ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 5 +- tests/scancode/data/single/iproute.c | 12 + .../data/single/iproute.expected.json | 33 + .../unicodepath.expected-linux.json | 12 +- .../data/weird_file_name/expected-linux.json | 17 +- tests/scancode/test_cli.py | 292 +++----- tests/scancode/test_plugin_only_findings.py | 11 +- tests/scancode/test_resource.py | 96 ++- 37 files changed, 1164 insertions(+), 1064 deletions(-) create mode 100644 tests/scancode/data/single/iproute.c create mode 100644 tests/scancode/data/single/iproute.expected.json diff --git a/etc/scripts/testdata/livescan/expected.csv b/etc/scripts/testdata/livescan/expected.csv index 6a8b9ae74f4..a3e69945d13 100644 --- a/etc/scripts/testdata/livescan/expected.csv +++ b/etc/scripts/testdata/livescan/expected.csv @@ -1,20 +1,20 @@ -Resource,type,name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,.rb,2017-10-03,2017-10-03,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,,2017-10-03,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,.json,2017-10-03,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, +Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1599,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, +/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, diff --git a/src/scancode/cli.py b/src/scancode/cli.py index e528dc19e19..da9de92d2cc 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,8 +23,8 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals # Import early because this import has monkey-patching side effects @@ -40,24 +40,12 @@ import sys from time import time import traceback -from types import GeneratorType import click click.disable_unicode_literals_warning = True -from click.termui import style -from commoncode.filetype import is_dir -from commoncode.fileutils import as_posixpath from commoncode.fileutils import create_dir -from commoncode.fileutils import file_name -from commoncode.fileutils import parent_directory from commoncode.fileutils import PATH_TYPE -from commoncode.fileutils import path_to_bytes -from commoncode.fileutils import path_to_unicode -from commoncode.fileutils import resource_iter -from commoncode import ignore -from commoncode.system import on_linux -from commoncode.text import toascii import plugincode.output import plugincode.post_scan @@ -68,38 +56,33 @@ from scancode.api import DEJACODE_LICENSE_URL from scancode.api import get_copyrights from scancode.api import get_emails -from scancode.api import get_file_infos +from scancode.api import get_file_info from scancode.api import get_licenses from scancode.api import get_package_infos from scancode.api import get_urls -from scancode.api import Resource -from scancode.cache import get_scans_cache_class from scancode.interrupt import DEFAULT_TIMEOUT -from scancode.interrupt import fake_interruptible from scancode.interrupt import interruptible -from scancode.interrupt import TimeoutError +from scancode.resource import Codebase +from scancode.resource import Resource from scancode.utils import BaseCommand -from scancode.utils import compute_fn_max_len -from scancode.utils import fixed_width_file_name from scancode.utils import progressmanager - - -echo_stderr = partial(click.secho, err=True) - +from scancode.utils import path_progress_message # Python 2 and 3 support try: # Python 2 unicode str_orig = str - bytes = str - str = unicode + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str + unicode = str # @ReservedAssignment -# this will init the plugins +echo_stderr = partial(click.secho, err=True) + +# this discovers and validates avialable plugins plugincode.pre_scan.initialize() plugincode.output.initialize() plugincode.post_scan.initialize() @@ -259,8 +242,9 @@ class ScanCommand(BaseCommand): short_usage_help = ''' Try 'scancode --help' for help on options and arguments.''' - def __init__(self, name, context_settings=None, callback=None, - params=None, help=None, epilog=None, short_help=None, + def __init__(self, name, context_settings=None, callback=None, params=None, + help=None, # @ReservedAssignment + epilog=None, short_help=None, options_metavar='[OPTIONS]', add_help_option=True, plugins_by_group=()): @@ -319,7 +303,7 @@ def validate_formats(ctx, param, value): Validate formats and template files. Raise a BadParameter on errors. """ value_lower = value.lower() - if value_lower in plugincode.output.get_format_plugins(): + if value_lower in plugincode.output.get_plugins(): return value_lower # render using a user-provided custom format template if not os.path.isfile(value): @@ -345,8 +329,8 @@ def validate_exclusive(ctx, exclusive_options): # collect plugins for each group and add plugins options to the command # params _plugins_by_group = [ - (PRE_SCAN, plugincode.pre_scan.get_pre_scan_plugins()), - (POST_SCAN, plugincode.post_scan.get_post_scan_plugins()), + (PRE_SCAN, plugincode.pre_scan.get_plugins()), + (POST_SCAN, plugincode.post_scan.get_plugins()), ] @click.command(name='scancode', epilog=epilog_text, cls=ScanCommand, plugins_by_group=_plugins_by_group) @@ -383,7 +367,7 @@ def validate_exclusive(ctx, exclusive_options): @click.option('-f', '--format', is_flag=False, default='json', show_default=True, metavar='', help=('Set format to one of: %s or use ' - 'as the path to a custom template file' % ', '.join(plugincode.output.get_format_plugins())), + 'as the path to a custom template file' % ', '.join(plugincode.output.get_plugins())), callback=validate_formats, group=OUTPUT, cls=ScanOption) @click.option('--verbose', is_flag=True, default=False, help='Print verbose file-by-file progress messages.', group=OUTPUT, cls=ScanOption) @@ -397,10 +381,13 @@ def validate_exclusive(ctx, exclusive_options): @click.option('--diag', is_flag=True, default=False, help='Include additional diagnostic information such as error messages or result details.', group=CORE, cls=ScanOption) @click.option('--timeout', is_flag=False, default=DEFAULT_TIMEOUT, type=float, show_default=True, help='Stop scanning a file if scanning takes longer than a timeout in seconds.', group=CORE, cls=ScanOption) +@click.option('--no-cache', is_flag=True, default=False, is_eager=False, help='Do not use on-disk cache for scan results. Faster but uses more memory.', group=CORE, cls=ScanOption) @click.option('--reindex-licenses', is_flag=True, default=False, is_eager=True, callback=reindex_licenses, help='Force a check and possible reindexing of the cached license index.', group=MISC, cls=ScanOption) -def scancode(ctx, input, output_file, infos, - verbose, quiet, processes, diag, timeout, +def scancode(ctx, + input, # @ReservedAssignment + output_file, infos, + verbose, quiet, processes, diag, timeout, no_cache, *args, **kwargs): """scan the file or directory for license, origin and packages and save results to . @@ -418,9 +405,15 @@ def scancode(ctx, input, output_file, infos, strip_root = kwargs.get('strip_root') full_root = kwargs.get('full_root') - format = kwargs.get('format') + format = kwargs.get('format') # @ReservedAssignment # ## TODO: END FIX when plugins are used everywhere + get_licenses_with_score = partial(get_licenses, + diag=diag, + min_score=kwargs.get('license_score'), + include_text=kwargs.get('license_text'), + license_url_template=kwargs.get('license_url_template')) + # Use default scan options when no scan option is provided # FIXME: this should be removed? use_default_scans = not any([infos, licenses, copyrights, packages, emails, urls]) @@ -429,32 +422,34 @@ def scancode(ctx, input, output_file, infos, # reuse calculated file SHA1s. is_spdx = format in ('spdx-tv', 'spdx-rdf') - get_licenses_with_score = partial(get_licenses, - diag=diag, - min_score=kwargs.get('license_score'), - include_text=kwargs.get('license_text'), - license_url_template=kwargs.get('license_url_template')) - scanners = [ - # FIXME: For "infos" there is no separate scan function, they are always - # gathered, though not always exposed. - Scanner('infos', get_file_infos, infos or is_spdx), - Scanner('licenses', get_licenses_with_score, licenses or use_default_scans), - Scanner('copyrights', get_copyrights, copyrights or use_default_scans), - Scanner('packages', get_package_infos, packages or use_default_scans), - Scanner('emails', get_emails, emails), - Scanner('urls', get_urls, urls) + scanners = [scan for scan in [ + # FIXME: we enable infos at all times!!! + Scanner('infos', get_file_info, True), + Scanner('licenses', get_licenses_with_score, licenses or use_default_scans), + Scanner('copyrights', get_copyrights, copyrights or use_default_scans), + Scanner('packages', get_package_infos, packages or use_default_scans), + Scanner('emails', get_emails, emails), + Scanner('urls', get_urls, urls)] + if scan.is_enabled ] ignored_options = 'verbose', 'quiet', 'processes', 'timeout' all_options = list(get_command_options(ctx, ignores=ignored_options, skip_no_group=True)) + scanner_names = [scan.name for scan in scanners if scan.is_enabled] + scan_names = ', '.join(scanner_names) + if not quiet: + echo_stderr('Scanning files for: %(scan_names)s with %(processes)d process(es)...' % locals()) + + if not quiet and not processes: + echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') + # FIXME: this is terribly hackish :| # FIXUP OPTIONS FOR DEFAULT SCANS options = [] - enabled_scans = {sc.name: sc.is_enabled for sc in scanners} for opt in all_options: - if enabled_scans.get(opt.name): + if opt.name in scanner_names: options.append(opt._replace(value=True)) continue @@ -466,172 +461,225 @@ def scancode(ctx, input, output_file, infos, if opt.value != opt.default: options.append(opt) - active_scans = [scan.name for scan in scanners if scan.is_enabled] - _scans = ', '.join(active_scans) - - if not quiet: - echo_stderr('Scanning files for: %(_scans)s with %(processes)d process(es)...' % locals()) - - if not quiet and not processes: - echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') - - # TODO: new loop - # 1. collect minimally the whole files tree in memory as a Resource tree - # 2. apply the pre scan plugins to this tree - # 3. run the scan proper, save scan details on disk - # 4. apply the post scan plugins to this tree, lazy load as needed the scan - # details from disk. save back updated details on disk - scans_cache_class = get_scans_cache_class() - + processing_start = time() if not quiet: echo_stderr('Collecting file inventory...' % locals(), fg='green') - resources = get_resources(base_path=input, scans_cache_class=scans_cache_class) - resources = list(resources) + # TODO: add progress indicator + codebase = Codebase(location=input, use_cache=not no_cache) + collect_time = time() - processing_start - processing_start = time() + license_indexing_start = time() try: - # WARMUP - indexing_time = 0 + ############################################################### + # SCANNERS SETUP + ############################################################### + license_indexing_time = 0 + # FIXME: this should be moved as the setup() for a license plugin with_licenses = any(sc for sc in scanners if sc.name == 'licenses' and sc.is_enabled) if with_licenses: # build index outside of the main loop for speed # FIXME: REALLY????? this also ensures that forked processes will get the index on POSIX naturally if not quiet: - echo_stderr('Building license detection index...', fg='green', nl=False) + echo_stderr('Building/Loading license detection index...', fg='green', nl=False) + # TODO: add progress indicator from licensedcode.cache import get_index get_index(False) - indexing_time = time() - processing_start + license_indexing_time = time() - license_indexing_start if not quiet: - echo_stderr('Done.', fg='green', nl=True) + echo_stderr('Done.', fg='green') - # PRE + ############################################################### + # PRE-SCAN + ############################################################### pre_scan_start = time() - - for name, plugin in plugincode.pre_scan.get_pre_scan_plugins().items(): - plugin = plugin(all_options, active_scans) + # TODO: add progress indicator + for name, plugin in plugincode.pre_scan.get_plugins().items(): + plugin = plugin(all_options, scanner_names) if plugin.is_enabled(): if not quiet: name = name or plugin.__class__.__name__ echo_stderr('Running pre-scan plugin: %(name)s...' % locals(), fg='green') - resources = plugin.process_resources(resources) + # FIXME: we should always catch errors from plugins properly + plugin.process_codebase(codebase) + codebase.update_counts() pre_scan_time = time() - pre_scan_start - resources = list(resources) - - # SCAN + ############################################################### + # SCANS RUN + ############################################################### scan_start = time() - if not quiet: echo_stderr('Scanning files...', fg='green') - files_count, results, success, paths_with_error = scan_all( - input_path=input, - scanners=scanners, - resources=resources, - verbose=verbose, quiet=quiet, - processes=processes, timeout=timeout, diag=diag, - scans_cache_class=scans_cache_class, - strip_root=strip_root, full_root=full_root) + progress_manager = None + if not quiet: + item_show_func = partial(path_progress_message, verbose=verbose) + progress_manager = partial(progressmanager, + item_show_func=item_show_func, verbose=verbose, file=sys.stderr) + + # TODO: add CLI option to bypass cache entirely + success = scan_codebase(codebase, scanners, processes, timeout, + progress_manager=progress_manager) scan_time = time() - scan_start - files_scanned_per_second = round(float(files_count) / scan_time , 2) - # POST + scanned_count, _, scanned_size = codebase.counts(update=True, skip_root=False) + + ############################################################### + # POST-SCAN + ############################################################### + # TODO: add progress indicator post_scan_start = time() - for name, plugin in plugincode.post_scan.get_post_scan_plugins().items(): - plugin = plugin(all_options, active_scans) + for name, plugin in plugincode.post_scan.get_plugins().items(): + plugin = plugin(all_options, scanner_names) if plugin.is_enabled(): if not quiet: name = name or plugin.__class__.__name__ echo_stderr('Running post-scan plugin: %(name)s...' % locals(), fg='green') # FIXME: we should always catch errors from plugins properly - results = plugin.process_resources(results) + plugin.process_codebase(codebase) + codebase.update_counts() post_scan_time = time() - post_scan_start - # FIXME: computing len needs a list and therefore needs loading it all - # ahead of time this should NOT be needed with a better cache - # architecture!!! - results = list(results) - files_count = len(results) + ############################################################### + # SUMMARY + ############################################################### total_time = time() - processing_start - # SCAN SUMMARY + files_count, dirs_count, size = codebase.counts( + update=True, skip_root=strip_root) if not quiet: - echo_stderr('Scanning done.', fg=paths_with_error and 'red' or 'green') - - # Display errors - if paths_with_error: - if diag: - echo_stderr('Some files failed to scan properly:', fg='red') - # iterate cached results to collect all scan errors - cached_scan = scans_cache_class() - root_dir = _get_root_dir(input, strip_root, full_root) - scan_results = cached_scan.iterate(resources, active_scans, root_dir, paths_subset=paths_with_error) - for scan_result in scan_results: - errored_path = scan_result.get('path', '') - echo_stderr('Path: ' + errored_path, fg='red') - for error in scan_result.get('scan_errors', []): - for emsg in error.splitlines(False): - echo_stderr(' ' + emsg) - echo_stderr('') - else: - echo_stderr('Some files failed to scan properly. Use the --diag option for additional details:', fg='red') - for errored_path in paths_with_error: - echo_stderr(' ' + errored_path, fg='red') - - echo_stderr('Scan statistics: %(files_count)d files scanned in %(total_time)ds.' % locals()) - echo_stderr('Scan options: %(_scans)s with %(processes)d process(es).' % locals()) - echo_stderr('Scanning speed: %(files_scanned_per_second)s files per sec.' % locals()) - echo_stderr('Scanning in: %(scan_time)ds. ' % locals(), nl=False) - echo_stderr('Indexing in: %(indexing_time)ds. ' % locals(), nl=False) - echo_stderr('Pre-scan in: %(pre_scan_time)ds. ' % locals(), nl=False) - echo_stderr('Post-scan in: %(post_scan_time)ds.' % locals(), reset=True) - - # REPORT + display_summary(codebase, scan_names, processes, + total_time, license_indexing_time, + pre_scan_time, + scanned_count, scanned_size, scan_time, + post_scan_time, + files_count, dirs_count, size, + verbose) + + ############################################################### + # FORMATTED REPORTS OUTPUT + ############################################################### if not quiet: echo_stderr('Saving results...', fg='green') + # FIXME: we should have simpler args: a scan "header" and scan results - save_results(scanners, files_count, results, format, options, input, output_file) + # FIXME: we should use Codebase.resources instead of results + with_info = infos or is_spdx + serializer = partial(Resource.to_dict, full_root=full_root, strip_root=strip_root, with_info=with_info) + results = [serializer(res) for res in codebase.walk(topdown=True, sort=True, skip_root=strip_root)] + save_results(results, files_count, format, options, input, output_file) finally: # cleanup - cache = scans_cache_class() - cache.clear() + codebase.clear() rc = 0 if success else 1 ctx.exit(rc) -def scan_all(input_path, scanners, resources, - verbose=False, quiet=False, processes=1, timeout=DEFAULT_TIMEOUT, - diag=False, scans_cache_class=None, - strip_root=False, full_root=False): +def display_summary(codebase, scan_names, processes, + total_time, + license_indexing_time, + pre_scan_time, + scanned_count, scanned_size, scan_time, + post_scan_time, + files_count, dirs_count, size, + verbose): """ - Return a tupple of (files_count, scan_results, success, summary mapping) where - scan_results is an iterable and success is a boolean. - - Run each requested scan proper: each individual file scan is cached - on disk to free memory. Then the whole set of scans is loaded from - the cache and streamed at the end. + Display a scan summary. """ - assert scans_cache_class - scans = [scan.name for scan in scanners if scan.is_enabled] - pool = None + top_errors = codebase.errors + path_errors = [(r.get_path(decode=True, posix=True), r.errors) for r in codebase.walk() if r.errors] + + has_errors = top_errors or path_errors + echo_stderr('Scanning done.', fg=has_errors and 'red' or 'green') + + errors_count = 0 + if has_errors: + echo_stderr('Some files failed to scan properly:', fg='red') + for error in top_errors: + echo_stderr(error) + errors_count += 1 + for errored_path, errors in path_errors: + echo_stderr('Path: ' + errored_path, fg='red') + if not verbose: + continue + for error in errors: + for emsg in error.splitlines(False): + echo_stderr(' ' + emsg, fg='red') + errors_count += 1 + + sym = 'Bytes' + if size >= 1024 * 1024 * 1024: + sym = 'GB' + size = size / (1024 * 1024 * 1024) + elif size >= 1024 * 1024: + sym = 'MB' + size = size / (1024 * 1024) + elif size >= 1024: + sym = 'KB' + size = size / 1024 + size = round(size, 2) + + scan_sym = 'Bytes' + if scanned_size >= 1024 * 1024 * 1024: + scan_sym = 'GB' + scanned_size = scanned_size / (1024 * 1024 * 1024) + elif scanned_size >= 1024 * 1024: + scan_sym = 'MB' + scanned_size = scanned_size / (1024 * 1024) + elif scanned_size >= 1024: + scan_sym = 'KB' + scanned_size = scanned_size / 1024 + size_speed = round(scanned_size / scan_time, 2) + scanned_size = round(scanned_size, 2) + + file_speed = round(float(scanned_count) / scan_time , 2) + + res_count = files_count + dirs_count + echo_stderr('Summary: %(scan_names)s with %(processes)d process(es)' % locals()) + echo_stderr('Total time: %(scanned_count)d files, %(scanned_size).2f %(scan_sym)s ' + 'scanned in %(total_time)d total (excluding format)' % locals()) + echo_stderr('Scan Speed: %(file_speed).2f files/s, %(size_speed).2f %(scan_sym)s/s' % locals()) + echo_stderr('Results: %(res_count)d resources: %(files_count)d files, %(dirs_count)d directories for %(size).2f %(sym)s' % locals()) + echo_stderr('Timings: Indexing: %(license_indexing_time).2fs, ' + 'Pre-scan: %(pre_scan_time).2fs, ' + 'Scan: %(scan_time).2fs, ' + 'Post-scan: %(post_scan_time).2fs' % locals()) + echo_stderr('Errors count: %(errors_count)d' % locals()) + + +def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, + progress_manager=None): + """ + Run the `scanners` on the `codebase`. Return True on success or False + otherwise. Provides optional progress feedback in the UI using the + `progress_manager` callable that accepts an iterable of tuple of (location, + rid, scan_errors, scan_result ) as argument. + """ + + # FIXME: this path computation is super inefficient + # tuples of (absolute location, resource id) + # TODO: should we alk topdown or not??? + resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) + + runner = partial(scan_resource, scanners=scanners, timeout=timeout) - paths_with_error = [] - files_count = 0 + has_info_scanner = any(sc.name == 'infos' for sc in scanners) + lscan = len(scanners) + has_other_scanners = lscan > 1 if has_info_scanner else lscan - scanit = partial(_scanit, scanners=scanners, scans_cache_class=scans_cache_class, - diag=diag, timeout=timeout, processes=processes) + get_resource = codebase.get_resource - max_file_name_len = compute_fn_max_len() - # do not display a file name in progress bar if there is less than 5 chars available. - display_fn = bool(max_file_name_len > 10) + success = True + pool = None + scans = None try: if processes: # maxtasksperchild helps with recycling processes in case of leaks @@ -639,191 +687,96 @@ def scan_all(input_path, scanners, resources, # Using chunksize is documented as much more efficient in the Python doc. # Yet "1" still provides a better and more progressive feedback. # With imap_unordered, results are returned as soon as ready and out of order. - scanned_files = pool.imap_unordered(scanit, resources, chunksize=1) + scans = pool.imap_unordered(runner, resources, chunksize=1) pool.close() else: # no multiprocessing with processes=0 - scanned_files = imap(scanit, resources) - - def scan_event(item): - """Progress event displayed each time a file is scanned""" - if quiet or not item or not display_fn: - return '' - _scan_success, _scanned_path = item - _scanned_path = unicode(toascii(_scanned_path)) - if verbose: - _progress_line = _scanned_path - else: - _progress_line = fixed_width_file_name(_scanned_path, max_file_name_len) - return style('Scanned: ') + style(_progress_line, fg=_scan_success and 'green' or 'red') - - files_count = 0 - with progressmanager( - scanned_files, item_show_func=scan_event, show_pos=True, - verbose=verbose, quiet=quiet, file=sys.stderr) as scanned: - while True: - try: - result = scanned.next() - scan_success, scanned_rel_path = result - if not scan_success: - paths_with_error.append(scanned_rel_path) - files_count += 1 - except StopIteration: - break - except KeyboardInterrupt: - echo_stderr('\nAborted with Ctrl+C!', fg='red') - if pool: - pool.terminate() - break + scans = imap(runner, resources) + + if progress_manager: + scans = progress_manager(scans) + # hack to avoid using a context manager + if hasattr(scans, '__enter__'): + scans.__enter__() + + while True: + try: + location, rid, scan_errors, scan_result = scans.next() + + resource = get_resource(rid) + if not resource: + # this should never happen + msg = ('ERROR: Internal error in scan_codebase: Resource ' + 'at %(location)r is missing from codebase.\n' + 'Scan result not saved:\n%(scan_result)r.' % locals()) + codebase.errors.append(msg) + success = False + continue + + if scan_errors: + success = False + resource.errors.extend(scan_errors) + + if has_info_scanner: + # always set info directly on resources + info = scan_result.pop('infos', []) + resource.set_info(info) + if has_info_scanner and scan_result: + resource.put_scans(scan_result, update=True) + + except StopIteration: + break + except KeyboardInterrupt: + echo_stderr('\nAborted with Ctrl+C!', fg='red') + success = False + if pool: + pool.terminate() + break + finally: if pool: # ensure the pool is really dead to work around a Python 2.7.3 bug: # http://bugs.python.org/issue15101 pool.terminate() - success = not paths_with_error - # finally return an iterator on cached results - cached_scan = scans_cache_class() - root_dir = _get_root_dir(input_path, strip_root, full_root) - ############################################# - # FIXME: we must return Resources here!!!! - ############################################# - return files_count, cached_scan.iterate(resources, scans, root_dir), success, paths_with_error - - -def _get_root_dir(input_path, strip_root=False, full_root=False): - """ - Return a root dir name or None. - On Windows, the path uses POSIX (forward slash) separators. - """ - if strip_root: - return - - scanned_path = os.path.abspath(os.path.normpath(os.path.expanduser(input_path))) - scanned_path = as_posixpath(scanned_path) - if is_dir(scanned_path): - root_dir = scanned_path - else: - root_dir = parent_directory(scanned_path) - root_dir = as_posixpath(root_dir) - - if full_root: - return root_dir - else: - return file_name(root_dir) - - -def _scanit(resource, scanners, scans_cache_class, diag, timeout=DEFAULT_TIMEOUT, processes=1): - """ - Run scans and cache results on disk. Return a tuple of (success, scanned relative - path) where sucess is True on success, False on error. Note that this is really - only a wrapper function used as an execution unit for parallel processing. - """ - success = True - scans_cache = scans_cache_class() - - if processes: - interrupter = interruptible - else: - # fake, non inteerrupting used for debugging when processes=0 - interrupter = fake_interruptible - - scanners = [scanner for scanner in scanners if scanner.is_enabled] - if not scanners: - return success, resource.rel_path - - # DUH???? Skip other scans if already cached - # FIXME: ENSURE we only do this for files not directories - if not resource.is_cached: - # run the scan as an interruptiple task - scans_runner = partial(scan_one, resource.abs_path, scanners, diag) - success, scan_result = interrupter(scans_runner, timeout=timeout) - if not success: - # Use scan errors as the scan result for that file on failure this is - # a top-level error not attachedd to a specific scanner, hence the - # "scan" key is used for these errors - scan_result = {'scan_errors': [scan_result]} - - scans_cache.put_scan(resource.rel_path, scan_result) - - # do not report success if some other errors happened - if scan_result.get('scan_errors'): - success = False - - return success, resource.rel_path - - -def get_resources(base_path, scans_cache_class): - """ - Yield `Resource` objects for all the files found at base_path (either a - directory or file) given an absolute base_path. - """ - if on_linux: - base_path = base_path and path_to_bytes(base_path) - else: - base_path = base_path and path_to_unicode(base_path) - - base_path = os.path.abspath(os.path.normpath(os.path.expanduser(base_path))) - base_is_dir = is_dir(base_path) - len_base_path = len(base_path) - - ignores = ignore.ignores_VCS - if on_linux: - ignores = {path_to_bytes(k): v for k, v in ignores.items()} - else: - ignores = {path_to_unicode(k): v for k, v in ignores.items()} - ignorer = partial(ignore.is_ignored, ignores=ignores, unignores={}, skip_special=True) - - locations = resource_iter(base_path, ignored=ignorer, with_dirs=True) - for abs_path in locations: - resource = Resource( - scans_cache_class=scans_cache_class, - abs_path=abs_path, - base_is_dir=base_is_dir, - len_base_path=len_base_path) - yield resource + if scans and hasattr(scans, 'render_finish'): + # hack to avoid using a context manager + scans.render_finish() + return success -def scan_one(location, scanners, diag=False): +def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT): """ - Scan one file or directory at `location` and return a scan result - mapping, calling every scanner callable in the `scanners` list of Scanners. - - The scan result mapping contain a 'scan_errors' key with a list of - error messages. If `diag` is True, 'scan_errors' error messages also - contain detailed diagnostic information such as a traceback if - available. + Return a tuple of (location, rid, list or errors, mapping of scan results) by running + the `scanners` Scanner objects for the file or directory resource with id + `rid` at `location` provided as a `location_rid` tuple (location, rid). """ - if on_linux: - location = path_to_bytes(location) - else: - location = path_to_unicode(location) + location, rid = location_rid + errors = [] + results = OrderedDict((scanner.name, []) for scanner in scanners) - scan_result = OrderedDict() - scan_errors = [] - for scanner in scanners: + # run each scanner in sequence in its own interruptible + for scanner, scanner_result in zip(scanners, results.values()): try: - scan_details = scanner.function(location) - # consume generators - if isinstance(scan_details, GeneratorType): - scan_details = list(scan_details) - scan_result[scanner.name] = scan_details - except TimeoutError: - raise - except Exception as e: - # never fail but instead add an error message and keep an empty scan: - scan_result[scanner.name] = [] - messages = ['ERROR: ' + scanner.name + ': ' + e.message] - if diag: - messages.append('ERROR: ' + scanner.name + ': ' + traceback.format_exc()) - scan_errors.extend(messages) - - # put errors last, after scans proper - scan_result['scan_errors'] = scan_errors - return scan_result - - -def save_results(scanners, files_count, results, format, options, input, output_file): + runner = partial(scanner.function, location) + error, value = interruptible(runner, timeout=timeout) + if error: + msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + error + errors.append(msg) + if value: + # a scanner function MUST return a sequence + scanner_result.extend(value) + except Exception: + msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + traceback.format_exc() + errors.append(msg) + return location, rid, errors, results + + +def save_results(results, files_count, + format, # @ReservedAssignment + options, + input, # @ReservedAssignment + output_file): """ Save scan results to file or screen. """ @@ -842,21 +795,10 @@ def save_results(scanners, files_count, results, format, options, input, output_ # Write scan results to file or screen as a formatted output ... # ... using a user-provided custom format template - format_plugins = plugincode.output.get_format_plugins() - if format not in format_plugins: - # format may be a custom template file path - if not os.path.isfile(format): - # this check was done before in the CLI validation, but this - # is done again if the function is used directly - echo_stderr('\nInvalid template: must be a file.', fg='red') - else: - from formattedcode import format_templated - # FIXME: carrying an echo function does not make sense - format_templated.write_custom( - results, output_file, _echo=echo_stderr, version=version, template_path=format) + format_plugins = plugincode.output.get_plugins() - # ... or using the selected format plugin - else: + if format in format_plugins: + # use the selected format plugin writer = format_plugins[format] # FIXME: carrying an echo function does not make sense # FIXME: do not use input as a variable name @@ -866,6 +808,19 @@ def save_results(scanners, files_count, results, format, options, input, output_ scanned_files=results, options=opts, input=input, output_file=output_file, _echo=echo_stderr) + return + + # format may be a custom template file path + if not os.path.isfile(format): + # this check was done before in the CLI validation, but this + # is done again if the function is used directly + echo_stderr('\nInvalid template: must be a file.', fg='red') + else: + from formattedcode import format_templated + # FIXME: carrying an echo function does not make sense + format_templated.write_custom( + results, output_file, + _echo=echo_stderr, version=version, template_path=format) def get_command_options(ctx, ignores=(), skip_default=False, skip_no_group=False): diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 403bd581f43..a6fb06a4be6 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -28,6 +28,7 @@ from __future__ import unicode_literals import codecs +from collections import deque from collections import OrderedDict from functools import partial import json @@ -75,10 +76,14 @@ """ -An abstraction for files and directories used throughout ScanCode. ScanCode -deals with a lot of these as they are the basic unit of processing. They are -eventually cached or stored and this module hides all the details of iterating -files, path handling, caching or storing the file and directory medatata. +This module provides Codebase and Resource objects as an abstraction for files +and directories used throughout ScanCode. ScanCode deals with a lot of these as +they are the basic unit of processing. + +A Codebase is a tree of Resource. A Resource represents a file or directory and +holds file information as attributes and scans (optionally cached on-disk). This +module handles all the details of walking files, path handling and caching +scans. """ @@ -100,8 +105,8 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) -# A global cache of codebase objects, keyed by a unique integer ID. +# A global cache of codebase objects, keyed by a unique integer ID. # We use this weird structure such that a Resource object can reference its # parent codebase object without actually storing it as an instance variable. # Instead a Resource only has a pointer to a codebase id and can fetch it from @@ -166,10 +171,14 @@ class Codebase(object): Represent a codebase being scanned. A Codebase is a tree of Resources. """ - def __init__(self, location, cache_base_dir=scans_cache_dir): + def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): """ Initialize a new codebase rooted at the `location` existing file or directory. + + If `use_cache` is True, scans will be cached on-disk in a file for each + Resource in a new unique directory under `cache_base_dir`. Otherwise, + scans are kept as Resource attributes. """ self.original_location = location @@ -183,6 +192,7 @@ def __init__(self, location, cache_base_dir=scans_cache_dir): # backing filesystem location assert exists(location) + # FIXME: what if is_special(location)??? self.location = location self.base_location = parent_directory(location) @@ -198,15 +208,99 @@ def __init__(self, location, cache_base_dir=scans_cache_dir): self.errors = [] # setup cache + self.use_cache = use_cache + self.cache_base_dir = self.cache_dir = None self.cache_base_dir = cache_base_dir + if use_cache: + # this is unique to this run and valid for the lifetime of this codebase + self.cache_dir = get_cache_dir(cache_base_dir) + create_dir(self.cache_dir) - # this is unique to this run and valid for the lifetime of this codebase - self.cache_dir = get_cache_dir(cache_base_dir) - create_dir(self.cache_dir) - + # this updates the global cache using a file lock self.cid = add_codebase(self) + self.populate() + def populate(self): + """ + Populate this codebase with Resource objects for this codebase by + walking its `self.location` in topdown order. + """ + # clear things + self.resources = [] + resources = self.resources + + resources_append = resources.append + + cid = self.cid + rloc = self.location + rid = 0 + self.root = root = Resource( + name=file_name(rloc), rid=rid, pid=None, cid=cid, + is_file=self.is_file, use_cache=self.use_cache) + resources_append(root) + if TRACE: logger_debug('Codebase.collect: root:', root) + + if self.is_file: + # there is nothing else to do + return + + res_by_loc = {rloc: root} + + def err(error): + self.errors.append( + 'ERROR: cannot collect files: %(error)s\n' % dict(error=error) + + traceback.format_exc() + ) + + # we always ignore VCS and some filetypes. + ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) + + # TODO: this is where we would plug archive walking?? + for top, dirs, files in os_walk(rloc, topdown=True, onerror=err): + + if is_special(top) or ignored(top): + # note: by design the root location is NEVER ignored + if TRACE: logger_debug( + 'Codebase.collect: walk: top ignored:', top, 'ignored:', + ignored(top), 'is_special:', is_special(top)) + continue + + parent = res_by_loc[top] + + if TRACE: logger_debug('Codebase.collect: parent:', parent) + + for name in dirs: + loc = join(top, name) + + if is_special(loc) or ignored(loc): + if TRACE: logger_debug( + 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', + ignored(loc), 'is_special:', is_special(loc)) + continue + + rid += 1 + res = parent._add_child(name, rid, is_file=False) + res_by_loc[loc] = res + resources_append(res) + if TRACE: logger_debug('Codebase.collect: dir:', res) + + for name in files: + loc = join(top, name) + + if is_special(loc) or ignored(loc): + if TRACE: logger_debug( + 'Codebase.collect: walk: file ignored:', loc, 'ignored:', + ignored(loc), 'is_special:', is_special(loc)) + continue + + rid += 1 + res = parent._add_child(name, rid, is_file=True) + res_by_loc[loc] = res + resources_append(res) + if TRACE: logger_debug('Codebase.collect: file:', res) + + def walk(self, topdown=True, sort=False, skip_root=False): """ Yield all Resources for this Codebase. @@ -238,6 +332,12 @@ def add_resource(self, name, parent, is_file=False): """ return parent.add_child(name, is_file) + def _get_next_rid(self): + """ + Return the next available resource id. + """ + return len([r for r in self.resources if r is not None]) + def remove_resource(self, resource): """ Remove the `resource` Resource object and all its children from the @@ -303,83 +403,6 @@ def clear(self): delete(self.cache_dir) del_codebase(self.cid) - def populate(self): - """ - Populate this codebase with Resource objects. - """ - self.resources = self._collect() - self.root = self.resources[0] - - def _collect(self): - """ - Return a sequence of Resource objects for this codebase by walking its - `location`. The sequence is in topdown order. The first item is the root. - """ - def err(error): - self.errors.append( - 'ERROR: cannot collect files: %(error)s\n' % dict(error=error) + traceback.format_exc() - ) - - cid = self.cid - rloc = self.location - rid = 0 - root = Resource(name=file_name(rloc), rid=rid, pid=None, cid=cid, is_file=self.is_file) - - if TRACE: logger_debug('Codebase.collect: root:', root) - - res_by_loc = {rloc: root} - resources = [root] - - if self.is_file: - # there is nothing else to do - return resources - - # we always ignore VCS and some filetypes. - ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) - - # TODO: this is where we would plug archive walking?? - resources_append = resources.append - for top, dirs, files in os_walk(rloc, topdown=True, onerror=err): - - if is_special(top) or ignored(top): - if TRACE: logger_debug( - 'Codebase.collect: walk: top ignored:', top, 'ignored:', - ignored(top), 'is_special:', is_special(top)) - continue - - parent = res_by_loc[top] - - if TRACE: logger_debug('Codebase.collect: parent:', parent) - - for name in dirs: - loc = join(top, name) - - if is_special(loc) or ignored(loc): - if TRACE: logger_debug( - 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', - ignored(loc), 'is_special:', is_special(loc)) - continue - rid += 1 - res = parent._add_child(name, rid, is_file=False) - res_by_loc[loc] = res - resources_append(res) - if TRACE: logger_debug('Codebase.collect: dir:', res) - - for name in files: - loc = join(top, name) - - if is_special(loc) or ignored(loc): - if TRACE: logger_debug( - 'Codebase.collect: walk: file ignored:', loc, 'ignored:', - ignored(loc), 'is_special:', is_special(loc)) - continue - rid += 1 - res = parent._add_child(name, rid, is_file=True) - res_by_loc[loc] = res - resources_append(res) - if TRACE: logger_debug('Codebase.collect: file:', res) - return resources - @attr.attributes(slots=True) class Resource(object): @@ -403,11 +426,13 @@ class Resource(object): # a integer resource id rid = attr.ib(type=int, repr=False) - # a integer codebase id - cid = attr.ib(type=int, repr=False) + # the root of a Resource tree has a pid==None by convention pid = attr.ib(type=int, repr=False) + # a integer codebase id + cid = attr.ib(default=None, type=int, repr=False) + is_file = attr.ib(default=False, type=bool) # a list of rids @@ -418,6 +443,8 @@ class Resource(object): # a mapping of scan result. Used when scan result is not cached _scans = attr.ib(default=attr.Factory(OrderedDict), repr=False) + # True is the cache is used. Set at creation time from the codebase settings + use_cache = attr.ib(default=None, type=bool, repr=False) # tuple of cache keys: dir and file name cache_keys = attr.ib(default=None, repr=False) @@ -447,6 +474,8 @@ def __attrs_post_init__(self): # build simple cache keys for this resource based on the hex # representation of the resource id: they are guaranteed to be unique # within a codebase. + if self.use_cache is None: + self.use_cache = self.codebase.use_cache hx = '%08x' % self.rid if on_linux: hx = fsencode(hx) @@ -496,26 +525,29 @@ def codebase(self): """ return get_codebase(self.cid) - def get_cached_path(self, create=False): + def _get_cached_path(self, create=False): """ Return the path where to get/put a data in the cache given a path. Create the directories if requested. + Will fail with an Exception if the codebase `use_cache` is False. """ - cache_sub_dir, cache_file_name = self.cache_keys - parent = join(self.codebase.cache_dir, cache_sub_dir) - if create and not exists(parent): - create_dir(parent) - return join(parent, cache_file_name) + if self.use_cache: + cache_sub_dir, cache_file_name = self.cache_keys + parent = join(self.codebase.cache_dir, cache_sub_dir) + if create and not exists(parent): + create_dir(parent) + return join(parent, cache_file_name) - def get_scans(self, cache=True, _cached_path=None): + def get_scans(self, _cached_path=None): """ - Return a `scans` mapping. Ftech from the cache if `cache` is True. + Return a `scans` mapping. Fetch from the cache if the codebase + `use_cache` is True. """ - if not cache: + if not self.use_cache: return self._scans if not _cached_path: - _cached_path = self.get_cached_path(create=False) + _cached_path = self._get_cached_path(create=False) if not exists(_cached_path): return OrderedDict() @@ -524,24 +556,24 @@ def get_scans(self, cache=True, _cached_path=None): with codecs.open(_cached_path, 'r', encoding='utf-8') as cached: return json.load(cached, object_pairs_hook=OrderedDict) - def put_scans(self, scans, update=True, cache=True): + def put_scans(self, scans, update=True): """ - Save the `scans` mapping of scan results for this resource. Does nothing if - `scans` is empty or None. + Save the `scans` mapping of scan results for this resource. Does nothing + if `scans` is empty or None. Return the saved mapping of `scans`, possibly updated or empty. If `update` is True, existing scans are updated with `scans`. If `update` is False, `scans` overwrites existing scans. - - If `cache` is True, `scans` are saved in the cache. Otherwise they are - saved in this resource object. + If `self.use_cache` is True, `scans` are saved in the cache. + Otherwise they are saved in this resource object. """ if TRACE: - logger_debug('put_scans: scans:', scans, 'update:', update, 'cache:', cache) + logger_debug('put_scans: scans:', scans, 'update:', update, + 'use_cache:', self.use_cache) if not scans: return OrderedDict() - if not cache: + if not self.use_cache: if update: self._scans.update(scans) else: @@ -552,11 +584,12 @@ def put_scans(self, scans, update=True, cache=True): return self._scans self._scans.clear() - cached_path = self.get_cached_path(create=True) + cached_path = self._get_cached_path(create=True) if update: - existing = self.get_scans(cache, cached_path) + existing = self.get_scans(cached_path) if TRACE: logger_debug( 'put_scans: cached_path:', cached_path, 'existing:', existing) + existing.update(scans) if TRACE: logger_debug('put_scans: merged:', existing) @@ -613,9 +646,9 @@ def add_child(self, name, is_file=False): Create and return a child Resource. Add this child to the codebase resources and to this Resource children. """ - rid = len(self.codebase.resources) + rid = self.codebase._get_next_rid() child = self._add_child(name, rid, is_file) - self.codebse.resources.append(rid) + self.codebase.resources.append(rid) return child def _add_child(self, name, rid, is_file=False): @@ -623,7 +656,8 @@ def _add_child(self, name, rid, is_file=False): Create a child Resource with `name` and a `rid` Resource id and add its id to this Resource children. Return the created child. """ - res = Resource(name=name, rid=rid, pid=self.rid, cid=self.cid, is_file=is_file) + res = Resource(name=name, rid=rid, pid=self.rid, cid=self.cid, + is_file=is_file, use_cache=self.use_cache) self.children_rids.append(rid) return res @@ -647,16 +681,15 @@ def ancestors(self): Return a sequence of ancestor Resource objects from root to self. """ resources = self.codebase.resources - ancestors = [] - ancestors_append = ancestors.append + ancestors = deque() + ancestors_append = ancestors.appendleft current = self - # walk up the tree: only the root as a pid==None + # walk up the tree parent tree: only the root as a pid==None while current.pid is not None: ancestors_append(current) current = resources[current.pid] ancestors_append(current) - ancestors.reverse() - return ancestors + return list(ancestors) def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): """ @@ -685,7 +718,8 @@ def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): elif strip_root: if len(segments) > 1: - # we cannot strip the root from the root! + # we cannot ever strip the root from the root when there is only + # one resource! segments = segments[1:] path = join(*segments) @@ -721,7 +755,7 @@ def to_dict(self, full_root=False, strip_root=False, with_info=False): res['base_name'] = fsdecode(self.base_name) res['extension'] = self.extension and fsdecode(self.extension) res['date'] = self.date - res['size'] = self.date + res['size'] = self.size res['sha1'] = self.sha1 res['md5'] = self.md5 res['files_count'] = self.files_count diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index 0a69702c836..6e6ffc0c478 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,19 +1,19 @@ -Resource,type,name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,.rb,2017-10-03,2017-10-03,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,,2017-10-03,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,.json,2017-10-03,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, +Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1014,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, +/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index fb14aa63eb4..354179c2a27 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -12,8 +12,9 @@ "path": "simple", "type": "directory", "name": "simple", + "base_name": "simple", "extension": "", - "size": null, + "size": 55, "sha1": null, "md5": null, "files_count": 1, @@ -36,8 +37,9 @@ "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", + "base_name": "copyright_acme_c-c", "extension": ".c", - "size": "2017-10-03", + "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 7d18e4abcfa..e05565127e3 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -15,8 +15,9 @@ "path": "simple", "type": "directory", "name": "simple", + "base_name": "simple", "extension": "", - "size": null, + "size": 55, "sha1": null, "md5": null, "files_count": 1, @@ -40,8 +41,9 @@ "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", + "base_name": "copyright_acme_c-c", "extension": ".c", - "size": "2017-10-03", + "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index dbe99ac1684..218effa36ce 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -13,8 +13,9 @@ "path": "simple", "type": "directory", "name": "simple", + "base_name": "simple", "extension": "", - "size": null, + "size": 55, "sha1": null, "md5": null, "files_count": 1, @@ -37,8 +38,9 @@ "path": "simple/copyright_acme_c-c.c", "type": "file", "name": "copyright_acme_c-c.c", + "base_name": "copyright_acme_c-c", "extension": ".c", - "size": "2017-10-03", + "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 07bd8812eb6..4a0dd6bfa78 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -13,8 +13,9 @@ "path": "copy1.c", "type": "file", "name": "copy1.c", + "base_name": "copy1", "extension": ".c", - "size": "2017-10-03", + "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, @@ -49,8 +50,9 @@ "path": "copy2.c", "type": "file", "name": "copy2.c", + "base_name": "copy2", "extension": ".c", - "size": "2017-10-03", + "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, @@ -85,8 +87,9 @@ "path": "copy3.c", "type": "file", "name": "copy3.c", + "base_name": "copy3", "extension": ".c", - "size": "2017-10-03", + "size": 91, "sha1": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", "md5": "e999e21c9d7de4d0f943aefbb6f21b99", "files_count": 0, @@ -121,8 +124,9 @@ "path": "subdir", "type": "directory", "name": "subdir", + "base_name": "subdir", "extension": "", - "size": null, + "size": 361, "sha1": null, "md5": null, "files_count": 4, @@ -145,8 +149,9 @@ "path": "subdir/copy1.c", "type": "file", "name": "copy1.c", + "base_name": "copy1", "extension": ".c", - "size": "2017-10-03", + "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, @@ -181,8 +186,9 @@ "path": "subdir/copy2.c", "type": "file", "name": "copy2.c", + "base_name": "copy2", "extension": ".c", - "size": "2017-10-03", + "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, @@ -217,8 +223,9 @@ "path": "subdir/copy3.c", "type": "file", "name": "copy3.c", + "base_name": "copy3", "extension": ".c", - "size": "2017-10-03", + "size": 84, "sha1": "389af7e629a9853056e42b262d5e30bf4579a74f", "md5": "290627a1387288ef77ae7e07946f3ecf", "files_count": 0, @@ -253,8 +260,9 @@ "path": "subdir/copy4.c", "type": "file", "name": "copy4.c", + "base_name": "copy4", "extension": ".c", - "size": "2017-10-03", + "size": 95, "sha1": "58748872d25374160692f1ed7075d0fe80a544b1", "md5": "88e46475db9b1a68f415f6a3544eeb16", "files_count": 0, diff --git a/tests/formattedcode/data/spdx/license_known/expected.rdf b/tests/formattedcode/data/spdx/license_known/expected.rdf index cbd3387e37f..d4e4521afbe 100644 --- a/tests/formattedcode/data/spdx/license_known/expected.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected.rdf @@ -3,22 +3,28 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:hasFile": [ null, null ], + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -27,33 +33,27 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:name": "scan" } }, "ns1:referencesFile": [ { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE", - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } } }, @@ -61,24 +61,24 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/apache-2.0.LICENSE" + } } } ], - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf index c40d21c6c85..d4e4521afbe 100644 --- a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf @@ -3,23 +3,28 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:hasFile": [ null, null ], - "ns1:downloadLocation": { + "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan", "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -28,57 +33,52 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:name": "scan" } }, "ns1:referencesFile": [ { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" } }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + "ns1:fileName": "./scan/cc0-1.0.LICENSE", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + } } }, { "ns1:File": { - "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" } } } ], - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected.rdf b/tests/formattedcode/data/spdx/license_ref/expected.rdf index c710b4990a3..ff18de2701b 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected.rdf @@ -1,26 +1,26 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" - } + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": null, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan", "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -31,23 +31,34 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } ], - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." + "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + } }, "ns1:referencesFile": { "ns1:File": { + "ns1:checksum": { + "ns1:Checksum": { + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" + } + }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseInfoInFile": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -58,25 +69,14 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } - ], - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" - } - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE" + ] } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf index 2c0f8c378d4..757e7ea506f 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf @@ -1,26 +1,26 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" - } + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "scan", + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -31,23 +31,34 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } ], - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." + "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + } }, "ns1:referencesFile": { "ns1:File": { + "ns1:checksum": { + "ns1:Checksum": { + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" + } + }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseInfoInFile": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -58,25 +69,14 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } - ], - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" - } - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE" + ] } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/or_later/expected.rdf b/tests/formattedcode/data/spdx/or_later/expected.rdf index 2d43fe9f430..ba15c1fa3f1 100644 --- a/tests/formattedcode/data/spdx/or_later/expected.rdf +++ b/tests/formattedcode/data/spdx/or_later/expected.rdf @@ -3,48 +3,48 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:specVersion": "SPDX-2.1", "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "or_later", "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": null + "ns1:name": "or_later" } }, "ns1:referencesFile": { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca" } }, + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:fileName": "./test.java", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", - "ns1:fileName": "./test.java" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" + } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/simple/expected.rdf b/tests/formattedcode/data/spdx/simple/expected.rdf index 7dcc02e8d93..cd628e1e064 100644 --- a/tests/formattedcode/data/spdx/simple/expected.rdf +++ b/tests/formattedcode/data/spdx/simple/expected.rdf @@ -3,52 +3,52 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": null, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "simple", "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:name": "simple" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./test.txt", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./test.txt" + } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index ab0787bb801..fdcf8aabf9b 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -3,17 +3,16 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:hasFile": [ null, null, @@ -23,49 +22,50 @@ null, null ], - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { - "ns1:fileName": "./scan/subdir/copy3.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc." + } } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/copy1.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -75,15 +75,15 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/copy2.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -91,17 +91,17 @@ }, { "ns1:File": { - "ns1:fileName": "./scan/subdir/copy1.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -109,60 +109,60 @@ }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy2.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy4.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy4.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/copy3.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } } } ], - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/unicode/expected.rdf b/tests/formattedcode/data/spdx/unicode/expected.rdf index 3d83d4ed444..89592719834 100644 --- a/tests/formattedcode/data/spdx/unicode/expected.rdf +++ b/tests/formattedcode/data/spdx/unicode/expected.rdf @@ -1,66 +1,66 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" - } + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": null, + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "unicode", "ns1:licenseInfoFromFiles": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" } }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc." + "ns1:name": "unicode" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" + } }, "ns1:referencesFile": { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90" } }, + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", + "ns1:fileName": "./et131x.h", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" } - }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", - "ns1:fileName": "./et131x.h" + } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/test_format_spdx.py b/tests/formattedcode/test_format_spdx.py index 545e64c82d2..56e23eeea83 100644 --- a/tests/formattedcode/test_format_spdx.py +++ b/tests/formattedcode/test_format_spdx.py @@ -23,11 +23,12 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals import codecs +from collections import OrderedDict import os import re @@ -70,29 +71,32 @@ def load_and_clean_rdf(location): """ content = codecs.open(location, encoding='utf-8').read() content = strip_variable_text(content) - data = xmltodict.parse(content, dict_constructor=dict) + data = xmltodict.parse(content, dict_constructor=OrderedDict) return sort_nested(data) def sort_nested(data): """ - Return a new dict with any nested list sorted recursively. + Return a new ordered and sorted mapping or sequence from a `data` mapping or + sequence with any nested sequences or mappings sorted recursively. + """ - if isinstance(data, dict): - new_data = {} - for k, v in data.items(): - if isinstance(v, list): - v = sorted(v) - if isinstance(v, dict): + seqtypes = list, tuple + maptypes = OrderedDict, dict + coltypes = seqtypes + maptypes + + if isinstance(data, maptypes): + new_data = OrderedDict() + for k, v in sorted(data.items()): + if isinstance(v, coltypes): v = sort_nested(v) new_data[k] = v return new_data - elif isinstance(data, list): + + elif isinstance(data, seqtypes): new_data = [] for v in sorted(data): - if isinstance(v, list): - v = sort_nested(v) - if isinstance(v, dict): + if isinstance(v, coltypes): v = sort_nested(v) new_data.append(v) return new_data diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index d34ecded2b2..5fcde2f2bd3 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -16,7 +16,8 @@ "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index 2929b1b95bd..4f4006aea81 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -1,12 +1,13 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--packages": true + "--packages": true, + "--infos": true }, "files_count": 1, "files": [ { - "path": "composer/composer.json", + "path": "composer.json", "scan_errors": [], "packages": [ { diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index 8ca24a2fd9c..a20fff0b738 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -2,6 +2,7 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "--copyrights": true, + "--infos": true, "--strip-root": true }, "files_count": 1, @@ -9,7 +10,7 @@ { "path": "patchelf.pdf", "scan_errors": [ - "ERROR: copyrights: unpack requires a string argument of length 8" + "ERROR: for scanner: copyrights:\nERROR: Unknown error:\nTraceback (most recent call last):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/interrupt.py\", line 88, in interruptible\n return NO_ERROR, func(*(args or ()), **(kwargs or {}))\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/api.py\", line 70, in get_copyrights\n for copyrights, authors, _years, holders, start_line, end_line in detect_copyrights(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 70, in detect_copyrights\n for numbered_lines in candidate_lines(analysis.text_lines(location)):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 1269, in candidate_lines\n for line_number, line in enumerate(lines):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/analysis.py\", line 125, in unicode_text_lines_from_pdf\n for line in pdf.get_text_lines(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/pdf.py\", line 57, in get_text_lines\n interpreter.process_page(page)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 852, in process_page\n self.render_contents(page.resources, page.contents, ctm=ctm)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 862, in render_contents\n self.init_resources(resources)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 362, in init_resources\n self.fontmap[fontid] = self.rsrcmgr.get_font(objid, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 212, in get_font\n font = self.get_font(None, subspec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 203, in get_font\n font = PDFCIDFont(self, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 667, in __init__\n BytesIO(self.fontfile.get_data()))\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 386, in __init__\n (ntables, _1, _2, _3) = struct.unpack('>HHHH', fp.read(8))\nerror: unpack requires a string argument of length 8\n" ], "copyrights": [] } diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index 7f6c71b97c1..009821a6cd8 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -70,6 +70,8 @@ Options: error messages or result details. --timeout FLOAT Stop scanning a file if scanning takes longer than a timeout in seconds. [default: 120] + --no-cache Do not use on-disk cache for scan results. Faster but + uses more memory. Examples (use --examples for more): diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 370c4ce6295..6e4cc6adcad 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -6,7 +6,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 11, + "files_count": 6, "files": [ { "path": "basic", @@ -19,6 +19,7 @@ "sha1": null, "md5": null, "files_count": 6, + "dirs_count": 4, "mime_type": null, "file_type": null, "programming_language": null, @@ -42,7 +43,8 @@ "size": 183, "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -67,6 +69,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -90,7 +93,8 @@ "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -115,6 +119,7 @@ "sha1": null, "md5": null, "files_count": 1, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -138,7 +143,8 @@ "size": 8246, "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -163,6 +169,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -187,6 +194,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -210,7 +218,8 @@ "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -277,7 +286,8 @@ "size": 4005, "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -301,7 +311,8 @@ "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index 1f0ba7c8be5..a3f70e1ded3 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -4,10 +4,19 @@ "--copyrights": true, "--licenses": true, "--emails": true, - "--urls": true + "--urls": true, + "--infos": true }, - "files_count": 11, + "files_count": 6, "files": [ + { + "path": "basic.tgz", + "scan_errors": [], + "licenses": [], + "copyrights": [], + "emails": [], + "urls": [] + }, { "path": "basic.tgz/basic", "scan_errors": [], diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index 4c3526d19f1..878f1dfecf7 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -4,7 +4,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 11, + "files_count": 6, "files": [ { "path": "basic", @@ -17,6 +17,7 @@ "sha1": null, "md5": null, "files_count": 6, + "dirs_count": 4, "mime_type": null, "file_type": null, "programming_language": null, @@ -38,7 +39,8 @@ "size": 183, "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -61,6 +63,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -82,7 +85,8 @@ "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -105,6 +109,7 @@ "sha1": null, "md5": null, "files_count": 1, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -126,7 +131,8 @@ "size": 8246, "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -149,6 +155,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -171,6 +178,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -192,7 +200,8 @@ "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -214,7 +223,8 @@ "size": 4005, "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -236,7 +246,8 @@ "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index fb3b4f58b95..072fcacad2b 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -3,8 +3,31 @@ "scancode_options": { "--infos": true }, - "files_count": 11, + "files_count": 6, "files": [ + { + "path": "basic.tgz", + "type": "directory", + "name": "basic.tgz", + "base_name": "basic.tgz", + "extension": "", + "date": null, + "size": 57066, + "sha1": null, + "md5": null, + "files_count": 6, + "dirs_count": 5, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] + }, { "path": "basic.tgz/basic", "type": "directory", @@ -16,6 +39,7 @@ "sha1": null, "md5": null, "files_count": 6, + "dirs_count": 4, "mime_type": null, "file_type": null, "programming_language": null, @@ -37,7 +61,8 @@ "size": 183, "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -60,6 +85,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -81,7 +107,8 @@ "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -104,6 +131,7 @@ "sha1": null, "md5": null, "files_count": 1, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -125,7 +153,8 @@ "size": 8246, "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -148,6 +177,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -170,6 +200,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -191,7 +222,8 @@ "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -213,7 +245,8 @@ "size": 4005, "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -235,7 +268,8 @@ "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index a0508cb1f61..382e83764d7 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -6,7 +6,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 11, + "files_count": 6, "files": [ { "path": "basic", @@ -19,6 +19,7 @@ "sha1": null, "md5": null, "files_count": 6, + "dirs_count": 4, "mime_type": null, "file_type": null, "programming_language": null, @@ -42,7 +43,8 @@ "size": 183, "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -67,6 +69,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -90,7 +93,8 @@ "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -115,6 +119,7 @@ "sha1": null, "md5": null, "files_count": 1, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -138,7 +143,8 @@ "size": 8246, "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -163,6 +169,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 1, "mime_type": null, "file_type": null, "programming_language": null, @@ -187,6 +194,7 @@ "sha1": null, "md5": null, "files_count": 2, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -210,7 +218,8 @@ "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -246,7 +255,8 @@ "size": 4005, "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -276,7 +286,8 @@ "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index 1e4d7aa7621..cf9ffd3c49c 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -2,6 +2,7 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "--licenses": true, + "--infos": true, "--license-text": true, "--strip-root": true }, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index 59dce226ed2..3808cb10fb2 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -4,7 +4,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 19, + "files_count": 18, "files": [ { "path": "non_unicode", @@ -17,6 +17,7 @@ "sha1": null, "md5": null, "files_count": 18, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -38,7 +39,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -60,7 +62,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -82,7 +85,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -104,7 +108,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -126,7 +131,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -148,7 +154,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -170,7 +177,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -192,7 +200,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -214,7 +223,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -236,7 +246,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -258,7 +269,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -280,7 +292,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -302,7 +315,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -324,7 +338,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -346,7 +361,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -368,7 +384,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -390,7 +407,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -412,7 +430,8 @@ "size": 0, "sha1": null, "md5": null, - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index 38eaaf66b78..324efa58026 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -13,7 +13,7 @@ "base_name": "JGroups.tgz", "extension": "", "date": null, - "size": null, + "size": 206642, "sha1": null, "md5": null, "files_count": 12, @@ -36,7 +36,7 @@ "base_name": "JGroups", "extension": "", "date": null, - "size": null, + "size": 206642, "sha1": null, "md5": null, "files_count": 12, @@ -59,7 +59,7 @@ "base_name": "licenses", "extension": "", "date": null, - "size": null, + "size": 54552, "sha1": null, "md5": null, "files_count": 5, @@ -82,7 +82,7 @@ "base_name": "apache-1.1", "extension": ".txt", "date": "2017-08-05", - "size": "2017-08-05", + "size": 2885, "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", "md5": "276982197c941f4cbf3d218546e17ae2", "files_count": 0, @@ -105,7 +105,7 @@ "base_name": "apache-2.0", "extension": ".txt", "date": "2017-08-05", - "size": "2017-08-05", + "size": 11560, "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", "md5": "d273d63619c9aeaf15cdaf76422c4f87", "files_count": 0, @@ -128,7 +128,7 @@ "base_name": "bouncycastle", "extension": ".txt", "date": "2017-08-05", - "size": "2017-08-05", + "size": 1186, "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", "md5": "9fffd8de865a5705969f62b128381f85", "files_count": 0, @@ -151,7 +151,7 @@ "base_name": "cpl-1.0", "extension": ".txt", "date": "2017-08-05", - "size": "2017-08-05", + "size": 11987, "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", "files_count": 0, @@ -174,7 +174,7 @@ "base_name": "lgpl", "extension": ".txt", "date": "2017-08-05", - "size": "2017-08-05", + "size": 26934, "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", "md5": "f14599a2f089f6ff8c97e2baa4e3d575", "files_count": 0, @@ -197,7 +197,7 @@ "base_name": "src", "extension": "", "date": null, - "size": null, + "size": 152090, "sha1": null, "md5": null, "files_count": 7, @@ -220,7 +220,7 @@ "base_name": "FixedMembershipToken", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 5144, "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", "md5": "aca9640ec8beee21b098bcf8ecc91442", "files_count": 0, @@ -243,7 +243,7 @@ "base_name": "GuardedBy", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 813, "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", "md5": "c5064400f759d3e81771005051d17dc1", "files_count": 0, @@ -266,7 +266,7 @@ "base_name": "ImmutableReference", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 1838, "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", "md5": "48ca3c72fb9a65c771a321222f118b88", "files_count": 0, @@ -289,7 +289,7 @@ "base_name": "RATE_LIMITER", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 3692, "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", "md5": "4626bdbc48871b55513e1a12991c61a8", "files_count": 0, @@ -312,7 +312,7 @@ "base_name": "RouterStub", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 9913, "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", "md5": "eecfe23494acbcd8088c93bc1e83c7f2", "files_count": 0, @@ -335,7 +335,7 @@ "base_name": "RouterStubManager", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 8162, "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", "md5": "20bee9631b7c82a45c250e095352aec7", "files_count": 0, @@ -358,7 +358,7 @@ "base_name": "S3_PING", "extension": ".java", "date": "2017-08-05", - "size": "2017-08-05", + "size": 122528, "sha1": "08dba9986f69719970ead3592dc565465164df0d", "md5": "83d8324f37d0e3f120bc89865cf0bd39", "files_count": 0, diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index 6cb51660901..a34186dd249 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -1,12 +1,13 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--packages": true + "--packages": true, + "--infos": true }, "files_count": 1, "files": [ { - "path": "rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm", + "path": "fping-2.4-0.b2.rhfc1.dag.i386.rpm", "scan_errors": [], "packages": [ { diff --git a/tests/scancode/data/single/iproute.c b/tests/scancode/data/single/iproute.c new file mode 100644 index 00000000000..5936d16e935 --- /dev/null +++ b/tests/scancode/data/single/iproute.c @@ -0,0 +1,12 @@ +/* +# Copyright (c) 2010 Patrick McHardy All rights reserved. + + * iplink_vlan.c VLAN device support + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Patrick McHardy + */ \ No newline at end of file diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json new file mode 100644 index 00000000000..afb88207a71 --- /dev/null +++ b/tests/scancode/data/single/iproute.expected.json @@ -0,0 +1,33 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "--infos": true, + "--strip-root": true + }, + "files_count": 1, + "files": [ + { + "path": "iproute.c", + "type": "file", + "name": "iproute.c", + "base_name": "iproute", + "extension": ".c", + "date": "2017-10-03", + "size": 469, + "sha1": "f0f352c14a8d0b0510cbbeae056542ae7f252151", + "md5": "b8e7112a6e82921687fd1e008e72058f", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "C", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index 155e4c9f0a9..a734cce78ef 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -9,7 +9,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 4, + "files_count": 3, "files": [ { "path": "unicodepath", @@ -21,6 +21,7 @@ "sha1": null, "md5": null, "files_count": 3, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -46,7 +47,8 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -72,7 +74,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -98,7 +101,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index 60876d55708..77d5bc2aca4 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -5,7 +5,7 @@ "--infos": true, "--strip-root": true }, - "files_count": 5, + "files_count": 0, "files": [ { "path": "some 'file", @@ -17,7 +17,8 @@ "size": 20, "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -40,7 +41,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -63,7 +65,8 @@ "size": 38, "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -86,7 +89,8 @@ "size": 39, "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -109,7 +113,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index ddc20bea381..5ea7f9ad60b 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -30,25 +30,23 @@ from collections import OrderedDict import json import os -from unittest import TestCase from unittest.case import skipIf -# from click.testing import CliRunner +import click +click.disable_unicode_literals_warning = True from commoncode import fileutils -from commoncode.fileutils import path_to_bytes +from commoncode.fileutils import fsencode from commoncode.testcase import FileDrivenTesting +# from commoncode.testcase import FileBasedTesting from commoncode.system import on_linux from commoncode.system import on_mac from commoncode.system import on_windows -from scancode.cli_test_utils import _load_json_result from scancode.cli_test_utils import check_json_scan from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain -from scancode import cli - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -120,116 +118,6 @@ def test_license_option_detects_licenses(): assert len(open(result_file).read()) > 10 -def test_scancode_skip_vcs_files_and_dirs_by_default(): - test_dir = test_env.extract_test_tar('ignore/vcs.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', test_dir, result_file]) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - # a single test.tst file and its directory that is not a VCS file should be listed - assert 2 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - assert [u'vcs', u'vcs/test.txt'] == scan_locs - - -def test_scancode_skip_single_file(monkeypatch): - test_dir = test_env.extract_test_tar('ignore/user.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click( - ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, result_file], - monkeypatch - ) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - assert 6 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - expected = [ - 'user', - 'user/ignore.doc', - 'user/src', - 'user/src/ignore.doc', - 'user/src/test', - 'user/src/test/sample.txt' - ] - assert expected == scan_locs - - -def test_scancode_skip_multiple_files(monkeypatch): - test_dir = test_env.extract_test_tar('ignore/user.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, result_file], monkeypatch) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - assert 5 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.doc', u'user/src/test/sample.txt'] == scan_locs - - -def test_scancode_skip_glob_files(monkeypatch): - test_dir = test_env.extract_test_tar('ignore/user.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, result_file], monkeypatch) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - assert 4 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.txt'] == scan_locs - - -def test_scancode_skip_glob_path(monkeypatch): - test_dir = test_env.extract_test_tar('ignore/user.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, result_file], monkeypatch) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - assert 5 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/ignore.doc', u'user/src', u'user/src/ignore.doc', u'user/src/test'] == scan_locs - -def test_scancode_multiple_ignores(monkeypatch): - test_dir = test_env.extract_test_tar('ignore/user.tgz') - result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, result_file], monkeypatch) - assert result.exit_code == 0 - scan_result = _load_json_result(result_file) - assert 2 == scan_result['files_count'] - scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/src'] == scan_locs - - -def test_scan_mark_source_without_info(monkeypatch): - test_dir = test_env.extract_test_tar('mark_source/JGroups.tgz') - result_file = test_env.get_temp_file('json') - expected_file = test_env.get_test_loc('mark_source/without_info.expected.json') - - _result = run_scan_click(['--mark-source', test_dir, result_file], monkeypatch) - check_json_scan(expected_file, result_file, regen=False) - - -def test_scan_mark_source_with_info(monkeypatch): - test_dir = test_env.extract_test_tar('mark_source/JGroups.tgz') - result_file = test_env.get_temp_file('json') - expected_file = test_env.get_test_loc('mark_source/with_info.expected.json') - - _result = run_scan_click(['--info', '--mark-source', test_dir, result_file], monkeypatch) - check_json_scan(expected_file, result_file) - - -def test_scan_only_findings(monkeypatch): - test_dir = test_env.extract_test_tar('info/basic.tgz') - result_file = test_env.get_temp_file('json') - expected_file = test_env.get_test_loc('only_findings/expected.json') - - _result = run_scan_click(['--only-findings', test_dir, result_file], monkeypatch) - check_json_scan(expected_file, result_file) - - def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): result = run_scan_click(['--help']) assert 'Usage: scancode [OPTIONS]' in result.output @@ -275,7 +163,7 @@ def test_scan_info_returns_full_root(): assert 'Scanning done' in result.output result_data = json.loads(open(result_file, 'rb').read()) file_paths = [f['path'] for f in result_data['files']] - assert 11 == len(file_paths) + assert 12 == len(file_paths) root = fileutils.as_posixpath(test_dir) assert all(p.startswith(root) for p in file_paths) @@ -296,6 +184,14 @@ def test_scan_info_returns_correct_full_root_with_single_file(): assert fileutils.as_posixpath(test_file) == scanned_file['path'] +def test_scan_info_returns_does_not_strip_root_with_single_file(): + test_file = test_env.get_test_loc('single/iproute.c') + result_file = test_env.get_temp_file('json') + result = run_scan_click(['--info', '--strip-root', test_file, result_file]) + assert result.exit_code == 0 + check_json_scan(test_env.get_test_loc('single/iproute.expected.json'), result_file, regen=False) + + def test_scan_info_license_copyrights(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') @@ -348,20 +244,20 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e assert 'patchelf.pdf' in result.output -def test_scan_with_errors_and_diag_option_includes_full_traceback(): +def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', '--diag', test_file, result_file]) + result = run_scan_click([ '--copyright', test_file, result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output assert 'Some files failed to scan' in result.output assert 'patchelf.pdf' in result.output result_json = json.loads(open(result_file).read()) - expected = 'ERROR: copyrights: unpack requires a string argument of length 8' - assert expected == result_json['files'][0]['scan_errors'][0] - assert result_json['files'][0]['scan_errors'][1].startswith('ERROR: copyrights: Traceback (most recent call') + expected = 'error: unpack requires a string argument of length 8' + assert expected in result_json['files'][0]['scan_errors'][-1] + assert result_json['files'][0]['scan_errors'][0].startswith('ERROR: for scanner: copyrights') def test_failing_scan_return_proper_exit_code(): @@ -445,9 +341,26 @@ def test_scan_works_with_multiple_processes_and_timeouts(): assert result.exit_code == 1 assert 'Scanning done' in result.output expected = [ - [(u'path', u'test1.txt'), (u'scan_errors', [u'ERROR: Processing interrupted: timeout after 0 seconds.'])], - [(u'path', u'test2.txt'), (u'scan_errors', [u'ERROR: Processing interrupted: timeout after 0 seconds.'])], - [(u'path', u'test3.txt'), (u'scan_errors', [u'ERROR: Processing interrupted: timeout after 0 seconds.'])], + [(u'path', u'test1.txt'), + (u'scan_errors', + [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', + u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + (u'copyrights', []) + ], + + [(u'path', u'test2.txt'), + (u'scan_errors', + [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', + u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + (u'copyrights', []) + ], + + [(u'path', u'test3.txt'), + (u'scan_errors', + [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', + u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + (u'copyrights', []) + ] ] result_json = json.loads(open(result_file).read(), object_pairs_hook=OrderedDict) @@ -459,8 +372,8 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): result_file = test_env.get_temp_file('json') if on_linux: - test_dir = path_to_bytes(test_dir) - result_file = path_to_bytes(result_file) + test_dir = fsencode(test_dir) + result_file = fsencode(result_file) args = ['--info', '--license', '--copyright', '--package', '--email', '--url', '--strip-root', @@ -496,7 +409,7 @@ def test_scan_does_not_fail_when_scanning_unicode_test_files_from_express(): # rename the problematic files. test_dir = test_env.extract_test_tar_raw(b'unicode_fixtures.tar.gz') - test_dir = path_to_bytes(test_dir) + test_dir = fsencode(test_dir) args = ['-n0', '--info', '--license', '--copyright', '--package', '--email', '--url', '--strip-root', @@ -586,8 +499,8 @@ def test_scan_can_handle_non_utf8_file_names_on_posix(): result_file = test_env.get_temp_file('json') if on_linux: - test_dir = path_to_bytes(test_dir) - result_file = path_to_bytes(result_file) + test_dir = fsencode(test_dir) + result_file = fsencode(result_file) result = run_scan_click(['-i', '--strip-root', test_dir, result_file]) assert result.exit_code == 0 @@ -628,43 +541,77 @@ def test_scan_can_run_from_other_directory(): check_json_scan(test_env.get_test_loc(expected_file), result_file, strip_dates=True) -def test_scan_logs_errors_messages(): +def test_scan_logs_errors_messages_not_verbosely_on_stderr(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', test_file, ]) + rc, stdout, stderr = run_scan_plain(['-pi', '-n', '0', test_file]) assert rc == 1 - assert 'package.json' in stderr - assert 'delimiter: line 5 column 12' in stdout - assert 'ValueError: Expecting' not in stdout + assert 'Path: errors/package.json' in stderr + assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout + assert "Expecting ':' delimiter: line 5 column 12 (char 143)" not in stderr -def test_scan_logs_errors_messages_with_diag(): +def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) + rc, stdout, stderr = run_scan_plain(['-pi', '-n', '2', test_file]) + assert rc == 1 + assert 'Path: errors/package.json' in stderr + assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout + assert "Expecting ':' delimiter: line 5 column 12 (char 143)" not in stderr - rc, stdout, stderr = run_scan_plain(['-pi', '--diag', test_file, ]) + +def test_scan_logs_errors_messages_verbosely_with_verbose(): + test_file = test_env.get_test_loc('errors', copy=True) + rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '0', test_file, ]) assert rc == 1 assert 'package.json' in stderr + assert 'delimiter: line 5 column 12' in stdout assert 'delimiter: line 5 column 12' in stderr assert 'ValueError: Expecting' in stdout + + +def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): + test_file = test_env.get_test_loc('errors', copy=True) + rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '2', test_file, ]) + assert rc == 1 + assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout + assert 'delimiter: line 5 column 12' in stderr + assert 'ValueError: Expecting' in stdout -def test_scan_progress_display_is_not_damaged_with_long_file_names_orig(monkeypatch): +def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') + rc, stdout, stderr = run_scan_plain(['--copyright', test_dir, result_file]) + assert rc == 0 + expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' + expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' + expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' + assert expected1 not in stdout + assert expected2 not in stdout + assert expected3 not in stdout + assert expected1 not in stderr + assert expected2 not in stderr + assert expected3 not in stderr + +def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): + test_dir = test_env.get_test_loc('long_file_name') + result_file = test_env.get_temp_file('json') result = run_scan_click(['--copyright', test_dir, result_file], monkeypatch) assert result.exit_code == 0 expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' + expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' assert expected1 in result.output assert expected2 in result.output + assert expected3 not in result.output def test_scan_does_scan_php_composer(): test_file = test_env.get_test_loc('composer/composer.json') expected_file = test_env.get_test_loc('composer/composer.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -675,67 +622,16 @@ def test_scan_does_scan_rpm(): test_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm') expected_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(expected_file, result_file, regen=False) -class TestFixedWidthFilename(TestCase): - - def test_fixed_width_file_name_with_file_name_larger_than_max_length_is_shortened(self): - test = cli.fixed_width_file_name('0123456789012345678901234.c', 25) - expected = '0123456789...5678901234.c' - assert expected == test - - def test_fixed_width_file_name_with_file_name_smaller_than_max_length_is_not_shortened(self): - file_name = '0123456789012345678901234.c' - test = cli.fixed_width_file_name(file_name, max_length=50) - assert file_name == test - - def test_fixed_width_file_name_with_file_name_at_max_length_is_not_shortened(self): - test = cli.fixed_width_file_name('01234567890123456789012.c', 25) - expected = '01234567890123456789012.c' - assert expected == test - - def test_fixed_width_file_name_with_file_name_smaller_than_max_length_not_shortened(self): - test = cli.fixed_width_file_name('0123456789012345678901.c', 25) - expected = '0123456789012345678901.c' - assert expected == test - - def test_fixed_width_file_name_with_none_filename_return_empty_string(self): - test = cli.fixed_width_file_name(None, 25) - expected = '' - assert expected == test - - def test_fixed_width_file_name_without_extension(self): - test = cli.fixed_width_file_name('012345678901234567890123456', 25) - expected = '01234567890...67890123456' - assert expected == test - - def test_fixed_width_file_name_with_posix_path_without_shortening(self): - test = cli.fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/drupal.js', 25) - expected = 'drupal.js' - assert expected == test - - def test_fixed_width_file_name_with_posix_path_with_shortening(self): - test = cli.fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/012345678901234567890123.c', 25) - expected = '0123456789...4567890123.c' - assert expected == test - - def test_fixed_width_file_name_with_win_path_without_shortening(self): - test = cli.fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\drupal.js', 25) - expected = 'drupal.js' - assert expected == test - - def test_fixed_width_file_name_with_win_path_with_shortening(self): - test = cli.fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\012345678901234567890123.c', 25) - expected = '0123456789...4567890123.c' - assert expected == test - - def test_fixed_width_file_name_with_very_small_file_name_and_long_extension(self): - test = cli.fixed_width_file_name('abc.abcdef', 5) - # FIXME: what is expected is TBD - expected = '' - assert expected == test +def test_scan_cli_help(regen=False): + expected_file = test_env.get_test_loc('help/help.txt') + result = run_scan_click(['--help']) + if regen: + with open(expected_file, 'wb') as ef: + ef.write(result.output) + assert open(expected_file).read() == result.output diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index bc8f2e8ce5a..b269f078e83 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -40,12 +40,17 @@ class TestHasFindings(FileDrivenTesting): test_data_dir = join(dirname(__file__), 'data') def test_has_findings(self): - resource = Resource('name', 1, 2, 3) - resource.put_scans({'licenses': ['MIT']}, cache=False) + resource = Resource('name', 1, 2, 3, use_cache=False) + resource.put_scans({'licenses': ['MIT']}) + assert has_findings(resource) + + def test_has_findings_with_children(self): + resource = Resource('name', 1, 2, 3, use_cache=False) + resource.children_rids.append(1) assert has_findings(resource) def test_has_findings_includes_errors(self): - resource = Resource('name', 1, 2, 3) + resource = Resource('name', 1, 2, 3, use_cache=False) resource.errors = [ 'ERROR: Processing interrupted: timeout after 10 seconds.' ] diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index c7b11f7b865..37b0d277a67 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -41,59 +41,95 @@ class TestCodebaseCache(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') - def test_codebase_cache_basic(self): + def test_codebase_with_use_cache(self): test_codebase = self.get_test_loc('cache/package') - codebase = Codebase(test_codebase) + codebase = Codebase(test_codebase, use_cache=True) assert codebase.cache_base_dir assert codebase.cache_dir + root = codebase.root + assert ('00', '00000000') == root.cache_keys - cp = root.get_cached_path(create=False) + cp = root._get_cached_path(create=False) assert not exists(cp) - cp = root.get_cached_path(create=True) + cp = root._get_cached_path(create=True) assert not exists(cp) assert exists(parent_directory(cp)) - assert not root.get_scans(cache=True) - assert not root.get_scans(cache=True) + assert not root._scans scans = OrderedDict(this='that') - scans_put = root.put_scans(scans, cache=True) + scans_put = root.put_scans(scans) assert scans == scans_put - assert scans == root.get_scans(cache=True) - assert not root.get_scans(cache=False) - assert exists (root.get_cached_path(create=False)) + assert scans == root.get_scans() + assert not root._scans + assert exists (root._get_cached_path(create=False)) - scans_put = root.put_scans(scans, cache=True) + scans_put = root.put_scans(scans) assert scans == scans_put - assert scans == root.get_scans(cache=True) - assert scans is not root.get_scans(cache=True) - assert exists (root.get_cached_path(create=False)) + assert not root._scans + assert scans == root.get_scans() + assert scans is not root.get_scans() + assert exists (root._get_cached_path(create=False)) scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False, cache=True) + scans_put = root.put_scans(scans, update=False) assert scans == scans_put - assert scans == root.get_scans(cache=True) - assert scans is not root.get_scans(cache=True) + assert not root._scans + assert scans == root.get_scans() + assert scans is not root.get_scans() scans2 = OrderedDict(this='that') - scans_put = root.put_scans(scans2, update=True, cache=True) + scans_put = root.put_scans(scans2, update=True) expected = OrderedDict(this='that', food='bar') - assert expected == root.get_scans(cache=True) - assert expected is not root.get_scans(cache=True) + assert expected == root.get_scans() + assert expected is not root.get_scans() scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False, cache=True) + scans_put = root.put_scans(scans, update=False) assert scans == scans_put - assert scans == root.get_scans(cache=True) - assert not root.get_scans(cache=False) - assert scans is not root.get_scans(cache=True) - assert exists (root.get_cached_path(create=False)) + assert scans == root.get_scans() + assert not root._scans + assert scans is not root.get_scans() + assert exists (root._get_cached_path(create=False)) + + def test_codebase_without_use_cache(self): + test_codebase = self.get_test_loc('cache/package') + codebase = Codebase(test_codebase, use_cache=False) + assert not codebase.cache_dir + + root = codebase.root + + assert ('00', '00000000') == root.cache_keys + assert root._get_cached_path(create=False) is None + + assert not root._scans + + scans = OrderedDict(this='that') + scans_put = root.put_scans(scans) + assert scans == scans_put + assert scans == root.get_scans() + assert scans_put is root.get_scans() + + scans_put = root.put_scans(scans) + assert scans == scans_put + assert scans_put is root.get_scans() + + scans = OrderedDict(food='bar') + scans_put = root.put_scans(scans, update=False) + assert scans == scans_put + assert scans == root.get_scans() + assert scans_put is root.get_scans() scans2 = OrderedDict(this='that') - scans_put = root.put_scans(scans2, update=True, cache=True) - assert not root.get_scans(cache=False) + scans_put = root.put_scans(scans2, update=True) expected = OrderedDict(this='that', food='bar') - assert expected == root.get_scans(cache=True) - assert expected is not root.get_scans(cache=True) - assert exists (root.get_cached_path(create=False)) + assert expected == root.get_scans() + assert expected is not root.get_scans() + + scans = OrderedDict(food='bar') + scans_put = root.put_scans(scans, update=False) + assert scans == scans_put + assert scans == root.get_scans() + assert scans_put is root.get_scans() + assert scans is not root.get_scans() From 024072ce9cdae4f54d55ed976b2d1620a6e4eb01 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 17:19:49 +0100 Subject: [PATCH 037/122] Ensure SPDX RDF tests are always sorted #787 Signed-off-by: Philippe Ombredanne --- tests/formattedcode/data/spdx/tree/expected.rdf | 6 +++--- tests/formattedcode/test_format_spdx.py | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index fdcf8aabf9b..de1f5843f6f 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -80,7 +80,7 @@ } }, "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy1.c", + "ns1:fileName": "./scan/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, @@ -98,7 +98,7 @@ } }, "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy2.c", + "ns1:fileName": "./scan/subdir/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, @@ -116,7 +116,7 @@ } }, "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy2.c", + "ns1:fileName": "./scan/subdir/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, diff --git a/tests/formattedcode/test_format_spdx.py b/tests/formattedcode/test_format_spdx.py index 56e23eeea83..7f1383d41dd 100644 --- a/tests/formattedcode/test_format_spdx.py +++ b/tests/formattedcode/test_format_spdx.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -79,7 +79,6 @@ def sort_nested(data): """ Return a new ordered and sorted mapping or sequence from a `data` mapping or sequence with any nested sequences or mappings sorted recursively. - """ seqtypes = list, tuple maptypes = OrderedDict, dict @@ -91,7 +90,7 @@ def sort_nested(data): if isinstance(v, coltypes): v = sort_nested(v) new_data[k] = v - return new_data + return OrderedDict(sorted(new_data.items())) elif isinstance(data, seqtypes): new_data = [] @@ -99,7 +98,7 @@ def sort_nested(data): if isinstance(v, coltypes): v = sort_nested(v) new_data.append(v) - return new_data + return sorted(new_data) def check_rdf_scan(expected_file, result_file, regen=False): @@ -112,11 +111,13 @@ def check_rdf_scan(expected_file, result_file, regen=False): if regen: expected = result with codecs.open(expected_file, 'w', encoding='utf-8') as o: - json.dump(expected, o, indent=2) + json.dump(result, o, indent=2) else: with codecs.open(expected_file, 'r', encoding='utf-8') as i: - expected = sort_nested(json.load(i)) - assert expected == result + expected = json.load(i, object_pairs_hook=OrderedDict) + expected = load_and_clean_rdf(result_file) + + assert json.dumps(expected, indent=2) == json.dumps(result, indent=2) def load_and_clean_tv(location): From c5014c752d1ee5e89b34d93f1fb3889ac73a2a48 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 12 Jan 2018 18:33:39 +0100 Subject: [PATCH 038/122] Simplify Plugin init arguments * remove active_scan_names from Plugin init arguments * rename selected_options to command_options Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 12 +++++------- src/scancode/plugin_ignore.py | 8 ++++---- src/scancode/plugin_mark_source.py | 2 +- src/scancode/plugin_only_findings.py | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 1a41f4aa467..9323c7eb47b 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -39,15 +39,13 @@ class BasePlugin(object): # Tuple of scanner names that this plugin requires to run its own run requires = tuple() - def __init__(self, selected_options, active_scan_names=None): + def __init__(self, command_options): """ - Initialize a new plugin with a mapping of user `selected_options` (e.g. - CommandOption tuples based on keyword arguments) and a list of - `active_scan_names`. + Initialize a new plugin with a list of user `command_options` (e.g. + CommandOption tuples based on CLI keyword arguments). """ - self.selected_options = selected_options or {} - self.active_scan_names = active_scan_names or [] - + self.command_options = command_options or [] + @classmethod def get_plugin_options(cls): """ diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index c5d94dff041..285ac8ecc84 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -44,11 +44,11 @@ class ProcessIgnore(PreScanPlugin): Ignore files matching the supplied pattern. """ name = 'ignore' - def __init__(self, selected_options, active_scan_names=None): - PreScanPlugin.__init__(self, selected_options, active_scan_names) + def __init__(self, command_options): + super(ProcessIgnore, self).__init__(command_options) ignores = [] - for se in selected_options: + for se in command_options: if se.name == 'ignore': ignores = se.value or [] @@ -83,4 +83,4 @@ def process_codebase(self, codebase): removed_rids.update(pruned_rids) def is_enabled(self): - return any(se.value for se in self.selected_options if se.name == 'ignore') + return any(se.value for se in self.command_options if se.name == 'ignore') diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 2f6f51271c4..289bf06cf67 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -56,7 +56,7 @@ def get_plugin_options(cls): def is_enabled(self): # FIXME: we need infos for this to work, we should use a better way to # express dependencies on one or more scan - return all(se.value for se in self.selected_options + return all(se.value for se in self.command_options if se.name in ('mark_source', 'infos')) def process_codebase(self, codebase): diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 8e4f3a4d5d8..c5a4b391624 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -49,7 +49,7 @@ def get_plugin_options(cls): ] def is_enabled(self): - return any(se.value == True for se in self.selected_options + return any(se.value == True for se in self.command_options if se.name == 'only_findings') def process_codebase(self, codebase): From 1095bf35c9513454c629deb69f2d8e2741c0470c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 16 Jan 2018 14:53:34 +0100 Subject: [PATCH 039/122] Update test data #787 Signed-off-by: Philippe Ombredanne --- .../data/json/simple-expected.json | 8 +-- .../data/json/simple-expected.jsonlines | 2 +- .../data/json/simple-expected.jsonpp | 8 +-- .../data/json/tree/expected.json | 8 +-- .../data/altpath/copyright.expected.json | 4 +- .../data/composer/composer.expected.json | 3 +- .../data/failing/patchelf.expected.json | 3 +- tests/scancode/data/help/help.txt | 32 +++++----- tests/scancode/data/info/all.expected.json | 6 +- .../data/info/all.rooted.expected.json | 9 ++- tests/scancode/data/info/basic.expected.json | 2 +- .../data/info/basic.rooted.expected.json | 2 +- .../data/info/email_url_info.expected.json | 6 +- .../scancode/data/license_text/test.expected | 3 +- .../data/non_utf8/expected-linux.json | 2 +- .../with_info.expected.json | 2 +- .../without_info.expected.json | 4 -- .../data/plugin_only_findings/expected.json | 4 -- ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 3 +- .../data/single/iproute.expected.json | 2 +- .../unicodepath.expected-linux.json | 12 ++-- .../data/weird_file_name/expected-linux.json | 4 +- tests/scancode/test_api.py | 12 ++-- tests/scancode/test_cli.py | 58 +++++++++---------- tests/scancode/test_plugin_ignore.py | 24 ++++---- tests/scancode/test_plugin_only_findings.py | 2 +- tests/scancode/test_scan_utils.py | 16 +++-- 27 files changed, 116 insertions(+), 125 deletions(-) diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index 354179c2a27..0b41e30114c 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -1,10 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--infos": true + "--copyright": true, + "--license": true, + "--package": true, + "--info": true }, "files_count": 1, "files": [ diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index e05565127e3..1e3a926d925 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -3,7 +3,7 @@ "header": { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true, + "--info": true, "--format": "jsonlines" }, "files_count": 1 diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 218effa36ce..201735e574d 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -1,10 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--infos": true, + "--copyright": true, + "--license": true, + "--package": true, + "--info": true, "--format": "json-pp" }, "files_count": 1, diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 4a0dd6bfa78..06031593176 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -1,10 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--infos": true, + "--copyright": true, + "--license": true, + "--package": true, + "--info": true, "--strip-root": true }, "files_count": 4, diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index 5fcde2f2bd3..f4f9f7c2670 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -1,8 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--infos": true, + "--copyright": true, + "--info": true, "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index 4f4006aea81..f2fc3a014af 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -1,8 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--packages": true, - "--infos": true + "--package": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index a20fff0b738..55cd16d503d 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -1,8 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--infos": true, + "--copyright": true, "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index 009821a6cd8..ae6f296754d 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -9,22 +9,22 @@ Usage: scancode [OPTIONS] Options: scans: - -c, --copyright, --copyrights Scan for copyrights. [default] - -l, --license, --licenses Scan for licenses. [default] - -p, --package, --packages Scan for packages. [default] - -e, --email, --emails Scan for emails. - -u, --url, --urls Scan for urls. - -i, --info, --infos Include information such as size, type, etc. - --license-score INTEGER Do not return license matches with scores lower - than this score. A number between 0 and 100. - [default: 0] - --license-text Include the detected licenses matched text. Has - no effect unless --license is requested. - --license-url-template TEXT Set the template URL used for the license - reference URLs. In a template URL, curly braces - ({}) are replaced by the license key. - [default: https://enterprise.dejacode.com/urn/u - rn:dje:license:{}] + -c, --copyright Scan for copyrights. [default] + -l, --license Scan for licenses. [default] + -p, --package Scan for packages. [default] + -e, --email Scan for emails. + -u, --url Scan for urls. + -i, --info Include information such as size, type, etc. + --license-score INTEGER Do not return license matches with scores lower + than this score. A number between 0 and 100. + [default: 0] + --license-text Include the detected licenses matched text. Has + no effect unless --license is requested. + --license-url-template TEXT Set the template URL used for the license + reference URLs. In a template URL, curly braces + ({}) are replaced by the license key. [default: h + ttps://enterprise.dejacode.com/urn/urn:dje:licens + e:{}] output: --strip-root Strip the root directory segment of all paths. The diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 6e4cc6adcad..0be1afecc5c 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -1,9 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--infos": true, + "--copyright": true, + "--license": true, + "--info": true, "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index a3f70e1ded3..8b99b4b29c3 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -1,11 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--emails": true, - "--urls": true, - "--infos": true + "--copyright": true, + "--license": true, + "--email": true, + "--url": true }, "files_count": 6, "files": [ diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index 878f1dfecf7..57135d53fb4 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -1,7 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true, + "--info": true, "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index 072fcacad2b..819be57697b 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -1,7 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true + "--info": true }, "files_count": 6, "files": [ diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index 382e83764d7..62fa81e9689 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -1,9 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--emails": true, - "--urls": true, - "--infos": true, + "--email": true, + "--url": true, + "--info": true, "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index cf9ffd3c49c..7b7550a664a 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -1,8 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--licenses": true, - "--infos": true, + "--license": true, "--license-text": true, "--strip-root": true }, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index 3808cb10fb2..6e5d76f6f82 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -1,7 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true, + "--info": true, "--strip-root": true }, "files_count": 18, diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index 324efa58026..0ff0e0a09a8 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -1,7 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true, + "--info": true, "--mark-source": true }, "files_count": 12, diff --git a/tests/scancode/data/plugin_mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json index 124268ffdad..e27830c78cc 100644 --- a/tests/scancode/data/plugin_mark_source/without_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/without_info.expected.json @@ -1,10 +1,6 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--infos": true, "--mark-source": true }, "files_count": 12, diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index d4f29e463fd..f6d45ca951a 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -1,10 +1,6 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--infos": true, "--only-findings": true }, "files_count": 3, diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index a34186dd249..f6d11cd19f2 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -1,8 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--packages": true, - "--infos": true + "--package": true }, "files_count": 1, "files": [ diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index afb88207a71..abc79d7e830 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -1,7 +1,7 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--infos": true, + "--info": true, "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index a734cce78ef..e2e088ffed8 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -1,12 +1,12 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--licenses": true, - "--packages": true, - "--emails": true, - "--urls": true, - "--infos": true, + "--copyright": true, + "--license": true, + "--package": true, + "--email": true, + "--url": true, + "--info": true, "--strip-root": true }, "files_count": 3, diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index 77d5bc2aca4..938fff328ec 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -1,8 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--copyrights": true, - "--infos": true, + "--copyright": true, + "--info": true, "--strip-root": true }, "files_count": 0, diff --git a/tests/scancode/test_api.py b/tests/scancode/test_api.py index 796378bad84..1c048031819 100644 --- a/tests/scancode/test_api.py +++ b/tests/scancode/test_api.py @@ -37,9 +37,9 @@ class TestAPI(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - def test_get_package_infos_can_pickle(self): + def test_get_package_info_can_pickle(self): test_file = self.get_test_loc('api/package/package.json') - package = api.get_package_infos(test_file) + package = api.get_package_info(test_file) import pickle import cPickle @@ -60,16 +60,16 @@ def test_get_file_info_flag_are_not_null(self): is_key_values = [v for k, v in info.items() if k.startswith('is_')] assert all(v is not None for v in is_key_values) - def test_get_package_infos_works_for_maven_dot_pom(self): + def test_get_package_info_works_for_maven_dot_pom(self): test_file = self.get_test_loc('api/package/p6spy-1.3.pom') - packages = api.get_package_infos(test_file) + packages = api.get_package_info(test_file) assert len(packages) == 1 for package in packages: assert package['version'] == '1.3' - def test_get_package_infos_works_for_maven_pom_dot_xml(self): + def test_get_package_info_works_for_maven_pom_dot_xml(self): test_file = self.get_test_loc('api/package/pom.xml') - packages = api.get_package_infos(test_file) + packages = api.get_package_info(test_file) assert len(packages) == 1 for package in packages: assert package['version'] == '1.3' diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 5ea7f9ad60b..af9b207ca8d 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -63,7 +63,7 @@ def test_package_option_detects_packages(monkeypatch): test_dir = test_env.get_test_loc('package', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--package', test_dir, result_file], monkeypatch) + result = run_scan_click(['--package', test_dir, '--json', result_file], monkeypatch) assert result.exit_code == 0 assert 'Scanning done' in result.output assert os.path.exists(result_file) @@ -75,7 +75,7 @@ def test_verbose_option_with_packages(monkeypatch): test_dir = test_env.get_test_loc('package', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--package', '--verbose', test_dir, result_file], monkeypatch) + result = run_scan_click(['--package', '--verbose', test_dir, '--json', result_file], monkeypatch) assert result.exit_code == 0 assert 'Scanning done' in result.output assert 'package.json' in result.output @@ -88,7 +88,7 @@ def test_copyright_option_detects_copyrights(): test_dir = test_env.get_test_loc('copyright', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--copyright', test_dir, result_file]) + result = run_scan_click(['--copyright', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output assert os.path.exists(result_file) @@ -98,7 +98,7 @@ def test_copyright_option_detects_copyrights(): def test_verbose_option_with_copyrights(monkeypatch): test_dir = test_env.get_test_loc('copyright', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--copyright', '--verbose', test_dir, result_file], monkeypatch) + result = run_scan_click(['--copyright', '--verbose', test_dir, '--json', result_file], monkeypatch) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -111,7 +111,7 @@ def test_license_option_detects_licenses(): test_dir = test_env.get_test_loc('license', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--license', test_dir, result_file]) + result = run_scan_click(['--license', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output assert os.path.exists(result_file) @@ -138,7 +138,7 @@ def test_scan_info_does_collect_infos(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--strip-root', test_dir, result_file]) + result = run_scan_click(['--info', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/basic.expected.json'), result_file) @@ -148,7 +148,7 @@ def test_scan_info_does_collect_infos_with_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', test_dir, result_file]) + result = run_scan_click(['--info', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/basic.rooted.expected.json'), result_file) @@ -157,7 +157,7 @@ def test_scan_info_does_collect_infos_with_root(): def test_scan_info_returns_full_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--full-root', test_dir, result_file]) + result = run_scan_click(['--info', '--full-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -171,7 +171,7 @@ def test_scan_info_returns_full_root(): def test_scan_info_returns_correct_full_root_with_single_file(): test_file = test_env.get_test_loc('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--full-root', test_file, result_file]) + result = run_scan_click(['--info', '--full-root', test_file, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -187,7 +187,7 @@ def test_scan_info_returns_correct_full_root_with_single_file(): def test_scan_info_returns_does_not_strip_root_with_single_file(): test_file = test_env.get_test_loc('single/iproute.c') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--strip-root', test_file, result_file]) + result = run_scan_click(['--info', '--strip-root', test_file, '--json', result_file]) assert result.exit_code == 0 check_json_scan(test_env.get_test_loc('single/iproute.expected.json'), result_file, regen=False) @@ -196,7 +196,7 @@ def test_scan_info_license_copyrights(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--license', '--copyright', '--strip-root', test_dir, result_file]) + result = run_scan_click(['--info', '--license', '--copyright', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/all.expected.json'), result_file) @@ -216,7 +216,7 @@ def test_scan_noinfo_license_copyrights_with_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--email', '--url', '--license', '--copyright', test_dir, result_file]) + result = run_scan_click(['--email', '--url', '--license', '--copyright', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/all.rooted.expected.json'), result_file) @@ -226,7 +226,7 @@ def test_scan_email_url_info(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--email', '--url', '--info', '--strip-root', test_dir, result_file]) + result = run_scan_click(['--email', '--url', '--info', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/email_url_info.expected.json'), result_file) @@ -236,7 +236,7 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', '--strip-root', test_file, result_file]) + result = run_scan_click([ '--copyright', '--strip-root', test_file, '--json', result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('failing/patchelf.expected.json'), result_file) @@ -248,7 +248,7 @@ def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', test_file, result_file]) + result = run_scan_click([ '--copyright', test_file, '--json', result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output assert 'Some files failed to scan' in result.output @@ -264,7 +264,7 @@ def test_failing_scan_return_proper_exit_code(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', test_file, result_file]) + result = run_scan_click([ '--copyright', test_file, '--json', result_file]) assert result.exit_code == 1 @@ -272,7 +272,7 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.html') - result = run_scan_click([ '--copyright', '--format', 'html', test_file, result_file]) + result = run_scan_click([ '--copyright', test_file , '--format-html', result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output @@ -281,7 +281,7 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.app.html') - result = run_scan_click([ '--copyright', '--format', 'html-app', test_file, result_file]) + result = run_scan_click([ '--copyright', test_file, '--format-html-app',result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output @@ -335,7 +335,7 @@ def test_scan_works_with_multiple_processes_and_timeouts(): result = run_scan_click( [ '--copyright', '--processes', '2', '--timeout', '0.000001', - '--strip-root', '--format', 'json', test_dir, result_file], + '--strip-root', '--format', 'json', test_dir, '--json', result_file], ) assert result.exit_code == 1 @@ -377,7 +377,7 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): args = ['--info', '--license', '--copyright', '--package', '--email', '--url', '--strip-root', - test_dir , result_file] + test_dir , '--json', result_file] result = run_scan_click(args) if result.exit_code != 0: raise Exception(result.output, args) @@ -424,7 +424,7 @@ def test_scan_can_handle_licenses_with_unicode_metadata(): test_dir = test_env.get_test_loc('license_with_unicode_meta') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--license', test_dir, result_file]) + result = run_scan_click(['--license', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -468,7 +468,7 @@ def test_scan_can_return_matched_license_text(): expected_file = test_env.get_test_loc('license_text/test.expected') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--license', '--license-text', '--strip-root', test_file, result_file]) + result = run_scan_click(['--license', '--license-text', '--strip-root', test_file, '--json', result_file]) assert result.exit_code == 0 check_json_scan(test_env.get_test_loc(expected_file), result_file) @@ -478,7 +478,7 @@ def test_scan_can_handle_weird_file_names(): test_dir = test_env.extract_test_tar('weird_file_name/weird_file_name.tar.gz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['-c', '-i', '--strip-root', test_dir, result_file]) + result = run_scan_click(['-c', '-i', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert "KeyError: 'sha1'" not in result.output assert 'Scanning done' in result.output @@ -502,7 +502,7 @@ def test_scan_can_handle_non_utf8_file_names_on_posix(): test_dir = fsencode(test_dir) result_file = fsencode(result_file) - result = run_scan_click(['-i', '--strip-root', test_dir, result_file]) + result = run_scan_click(['-i', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -528,7 +528,7 @@ def test_scan_can_run_from_other_directory(): work_dir = os.path.dirname(result_file) rc, stdout, stderr = run_scan_plain( - ['-ci', '--strip-root', test_file, result_file], cwd=work_dir) + ['-ci', '--strip-root', test_file, '--json', result_file], cwd=work_dir) if rc != 0: print() @@ -582,7 +582,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') - rc, stdout, stderr = run_scan_plain(['--copyright', test_dir, result_file]) + rc, stdout, stderr = run_scan_plain(['--copyright', test_dir, '--json', result_file]) assert rc == 0 expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' @@ -598,7 +598,7 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--copyright', test_dir, result_file], monkeypatch) + result = run_scan_click(['--copyright', test_dir, '--json', result_file], monkeypatch) assert result.exit_code == 0 expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' @@ -612,7 +612,7 @@ def test_scan_does_scan_php_composer(): test_file = test_env.get_test_loc('composer/composer.json') expected_file = test_env.get_test_loc('composer/composer.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, result_file]) + result = run_scan_click(['--package', test_file, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(expected_file, result_file) @@ -622,7 +622,7 @@ def test_scan_does_scan_rpm(): test_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm') expected_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, result_file]) + result = run_scan_click(['--package', test_file, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(expected_file, result_file, regen=False) diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 73716a824ab..5e570e9252f 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -68,8 +68,8 @@ def test_is_ignored_glob_file(self): def test_ProcessIgnore_with_single_file(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(group=None, name='ignore', option='--ignore', - value=('sample.doc',), default=None) + option = CommandOption(help_group=None, name='ignore', option='--ignore', + value=('sample.doc',), pretty_value=None) test_plugin = ProcessIgnore([option]) expected = [ 'user', @@ -87,8 +87,8 @@ def test_ProcessIgnore_with_single_file(self): def test_ProcessIgnore_with_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(group=None, name='ignore', option='--ignore', - value=('ignore.doc', 'sample.doc',), default=None) + option = CommandOption(help_group=None, name='ignore', option='--ignore', + value=('ignore.doc', 'sample.doc',), pretty_value=None) test_plugin = ProcessIgnore([option]) expected = [ 'user', @@ -104,8 +104,8 @@ def test_ProcessIgnore_with_multiple_files(self): def test_ProcessIgnore_with_glob_for_extension(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(group=None, name='ignore', option='--ignore', - value=('*.doc',), default=None) + option = CommandOption(help_group=None, name='ignore', option='--ignore', + value=('*.doc',), pretty_value=None) test_plugin = ProcessIgnore([option]) expected = [ @@ -122,8 +122,8 @@ def test_ProcessIgnore_with_glob_for_extension(self): def test_ProcessIgnore_with_glob_for_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(group=None, name='ignore', option='--ignore', - value=('*/src/test',), default=None) + option = CommandOption(help_group=None, name='ignore', option='--ignore', + value=('*/src/test',), pretty_value=None) test_plugin = ProcessIgnore([option]) expected = [ @@ -141,10 +141,10 @@ def test_ProcessIgnore_with_glob_for_path(self): def test_ProcessIgnore_with_multiple_plugins(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') test_plugins = [ - ProcessIgnore([CommandOption(group=None, name='ignore', option='--ignore', - value=('*.doc',), default=None)]), - ProcessIgnore([CommandOption(group=None, name='ignore', option='--ignore', - value=('*/src/test/*',), default=None)]), + ProcessIgnore([CommandOption(help_group=None, name='ignore', option='--ignore', + value=('*.doc',), pretty_value=None)]), + ProcessIgnore([CommandOption(help_group=None, name='ignore', option='--ignore', + value=('*/src/test/*',), pretty_value=None)]), ] expected = [ diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index b269f078e83..f710703bf43 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -61,5 +61,5 @@ def test_scan_only_findings(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_only_findings/expected.json') - _result = run_scan_click(['--only-findings', test_dir, result_file]) + _result = run_scan_click(['--only-findings', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file) diff --git a/tests/scancode/test_scan_utils.py b/tests/scancode/test_scan_utils.py index ced5dee1a9a..b13fa8d0a89 100644 --- a/tests/scancode/test_scan_utils.py +++ b/tests/scancode/test_scan_utils.py @@ -36,7 +36,7 @@ from click.testing import CliRunner from commoncode.testcase import FileDrivenTesting -from scancode import ScanOption +from scancode import CommandLineOption from scancode.cli import ScanCommand from scancode.utils import fixed_width_file_name @@ -136,24 +136,28 @@ def scan(opt): runner = CliRunner() result = runner.invoke(scan, ['--help']) - assert 'misc:\n --opt Help text for option\n' in result.output + from scancode import MISC_GROUP + assert MISC_GROUP + ':\n --opt Help text for option\n' in result.output def test_scan_help_with_custom_class(self): @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option', cls=ScanOption) + @click.option('--opt', is_flag=True, help='Help text for option', cls=CommandLineOption) def scan(opt): pass runner = CliRunner() result = runner.invoke(scan, ['--help']) - assert 'misc:\n --opt Help text for option\n' in result.output + from scancode import MISC_GROUP + assert MISC_GROUP + ':\n --opt Help text for option\n' in result.output def test_scan_help_with_group(self): + from scancode import CORE_GROUP @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option', group='core', cls=ScanOption) + @click.option('--opt', is_flag=True, help='Help text for option', + help_group=CORE_GROUP, cls=CommandLineOption) def scan(opt): pass runner = CliRunner() result = runner.invoke(scan, ['--help']) - assert 'core:\n --opt Help text for option\n' in result.output + assert CORE_GROUP + ':\n --opt Help text for option\n' in result.output From 60dc3fd4b7348a8618b61a15b6f36fe12568f474 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 16 Jan 2018 23:26:53 +0100 Subject: [PATCH 040/122] Update test to use new format options #787 Signed-off-by: Philippe Ombredanne --- etc/scripts/test_json2csv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/scripts/test_json2csv.py b/etc/scripts/test_json2csv.py index 8fcb96f8851..4a25c55d9dc 100644 --- a/etc/scripts/test_json2csv.py +++ b/etc/scripts/test_json2csv.py @@ -214,7 +214,8 @@ def test_can_process_scan_from_json_scan(self): json_file = self.get_temp_file('json') scan_cmd = os.path.join(scancode.root_dir, 'scancode') rc, _stdout, _stderr = execute(scan_cmd, - ['-clip', '--email', '--url', '--strip-root', '--format', 'json', test_dir, json_file]) + ['-clip', '--email', '--url', '--strip-root', test_dir, + '--format-json', json_file]) assert rc == 0 result_file = self.get_temp_file('.csv') with open(result_file, 'wb') as rf: From 4d0d7e3d2459e94c8a938528269cc5ce241adcf7 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 16 Jan 2018 23:27:43 +0100 Subject: [PATCH 041/122] Update functions doc #787 Signed-off-by: Philippe Ombredanne --- src/commoncode/functional.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/commoncode/functional.py b/src/commoncode/functional.py index abe0226a80e..281dee5e831 100644 --- a/src/commoncode/functional.py +++ b/src/commoncode/functional.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -37,6 +37,7 @@ def flatten(seq): flat list of elements. For example:: + >>> flatten([7, (6, [5, [4, ['a'], 3]], 3), 2, 1]) [7, 6, 5, 4, 'a', 3, 3, 2, 1] >>> def gen(): @@ -68,6 +69,7 @@ def pair_chunks(iterable): must contain an even number of elements or it will truncated. For example:: + >>> list(pair_chunks([1, 2, 3, 4, 5, 6])) [(1, 2), (3, 4), (5, 6)] >>> list(pair_chunks([1, 2, 3, 4, 5, 6, 7])) @@ -78,10 +80,11 @@ def pair_chunks(iterable): def memoize(fun): """ - Decorate fun function and cache return values. Arguments must be - hashable. kwargs are not handled. Used to speed up some often executed - functions. - Usage example:: + Decorate `fun` function and cache return values. Arguments must be hashable. + Only args are supported, kwargs are not handled. Used to speed up some often + executed functions. + + For example:: >>> @memoize ... def expensive(*args, **kwargs): @@ -114,7 +117,7 @@ def memoized(*args, **kwargs): # calls with kwargs are not handled and not cached if kwargs: return fun(*args, **kwargs) - # convert any list arg to a tuple + # convert any list args to a tuple args = tuple(tuple(arg) if isinstance(arg, (ListType, tuple, array)) else arg for arg in args) try: @@ -128,10 +131,11 @@ def memoized(*args, **kwargs): def memoize_to_attribute(attr_name, _test=False): """ - Decorate a method and cache return values in attr_name of the parent object. + Decorate a method and cache return values in `attr_name` of the parent object. Used to speed up some often called methods that cache their values in instance variables. - Usage example:: + + For example:: >>> class Obj(object): ... def __init__(self): @@ -169,10 +173,11 @@ def wrapper(self, *args, **kwargs): def memoize_gen(fun): """ - Decorate fun generator function and cache return values. Arguments must be + Decorate `fun` generator function and cache return values. Arguments must be hashable. kwargs are not handled. Used to speed up some often executed functions. - Usage example:: + + For example:: >>> @memoize ... def expensive(*args, **kwargs): From 74282991114f6036eb12001e53d3f16acab5a933 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 16 Jan 2018 23:28:22 +0100 Subject: [PATCH 042/122] Add new timed function decorator to time execution #787 Signed-off-by: Philippe Ombredanne --- src/commoncode/timeutils.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/commoncode/timeutils.py b/src/commoncode/timeutils.py index 643d141f8a5..37790f1b05a 100644 --- a/src/commoncode/timeutils.py +++ b/src/commoncode/timeutils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -24,7 +24,11 @@ from __future__ import absolute_import, print_function -from datetime import datetime, tzinfo +from datetime import datetime +from datetime import tzinfo +from functools import update_wrapper +from functools import wraps +from time import time """ @@ -100,3 +104,20 @@ def tstamp2time(stamp): if 0 <= microsec <= 999999: datim = datim.replace(microsecond=microsec) return datim + + +def timed(fun): + """ + Decorate `fun` callable to return a tuple of (timing, result) where timing + is a function execution time in seconds as a float and result is the value + returned by calling `fun`. + + Note: this decorator will not work as expected for functions that return + generators. + """ + @wraps(fun) + def _timed(*args, **kwargs): + start = time() + result = fun(*args, **kwargs) + return time() - start, result + return update_wrapper(_timed, fun) From 6f1ddd22db1ba7210d92b89e2f07c2961df1d72a Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 13:33:05 +0100 Subject: [PATCH 043/122] Improve handling of re._MAXCACHE Signed-off-by: Philippe Ombredanne --- src/cluecode/copyrights.py | 3 ++- src/commoncode/__init__.py | 30 +++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index 28bc3db1c1c..faeecb4b8a7 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -30,8 +30,9 @@ import os import re - +# importand: this sets re._MAXCACHE import commoncode + from textcode import analysis from cluecode import copyrights_hint diff --git a/src/commoncode/__init__.py b/src/commoncode/__init__.py index 096c946c0db..0eaadbbdb2a 100644 --- a/src/commoncode/__init__.py +++ b/src/commoncode/__init__.py @@ -26,19 +26,23 @@ from __future__ import print_function from __future__ import unicode_literals -# set re and fnmatch _MAXCACHE to 1M to cache regex compiled aggressively -# their default is 100 and many utilities and libraries use a lot of regex -import re -remax = getattr(re, '_MAXCACHE', 0) -if remax < 1000000: - setattr(re, '_MAXCACHE', 1000000) -del remax +def set_re_max_cache(max_cache=1000000): + """ + Set re and fnmatch _MAXCACHE to 1M to cache regex compiled aggressively + their default is 100 and many utilities and libraries use a lot of regex + """ + import re + import fnmatch + + remax = getattr(re, '_MAXCACHE', 0) + if remax < max_cache: + setattr(re, '_MAXCACHE', max_cache) -import fnmatch + + fnmatchmax = getattr(fnmatch, '_MAXCACHE', 0) + if fnmatchmax < max_cache: + setattr(fnmatch, '_MAXCACHE', max_cache) -fnmatchmax = getattr(fnmatch, '_MAXCACHE', 0) -if fnmatchmax < 1000000: - setattr(fnmatch, '_MAXCACHE', 1000000) -del fnmatchmax -del re + +set_re_max_cache() \ No newline at end of file From c6a0317d722c08d656e63bfdb9afe3d19983d8de Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 14:49:04 +0100 Subject: [PATCH 044/122] Restore correct SPDX output tests results #787 Signed-off-by: Philippe Ombredanne --- .../data/spdx/license_known/expected.rdf | 56 ++++---- .../spdx/license_known/expected_with_text.rdf | 70 +++++----- .../data/spdx/license_ref/expected.rdf | 56 ++++---- .../spdx/license_ref/expected_with_text.rdf | 58 ++++---- .../data/spdx/or_later/expected.rdf | 24 ++-- .../data/spdx/simple/expected.rdf | 34 ++--- .../data/spdx/simple/expected.tv | 2 +- .../formattedcode/data/spdx/tree/expected.rdf | 130 +++++++++--------- .../data/spdx/unicode/expected.rdf | 74 +++++----- 9 files changed, 252 insertions(+), 252 deletions(-) diff --git a/tests/formattedcode/data/spdx/license_known/expected.rdf b/tests/formattedcode/data/spdx/license_known/expected.rdf index d4e4521afbe..49602d49c82 100644 --- a/tests/formattedcode/data/spdx/license_known/expected.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected.rdf @@ -3,18 +3,14 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:hasFile": [ null, null @@ -22,63 +18,67 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" } ], "ns1:name": "scan" } }, + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" } } }, { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - } + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE" } } ], - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf index d4e4521afbe..22cdd8c71e5 100644 --- a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf @@ -3,26 +3,13 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": [ - null, - null - ], - "ns1:licenseConcluded": { + "ns1:name": "scan", + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ @@ -33,52 +20,65 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:name": "scan" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": [ + null, + null + ] } }, + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - } + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/apache-2.0.LICENSE" } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - } + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE" } } ], - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected.rdf b/tests/formattedcode/data/spdx/license_ref/expected.rdf index ff18de2701b..f12c0f93321 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected.rdf @@ -1,61 +1,59 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + } }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:hasFile": null, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, - "ns1:licenseConcluded": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { + "ns1:name": "scan", + "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, - { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } + }, + { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:name": "scan" + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." } }, - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" - } + "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:referencesFile": { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, @@ -69,14 +67,16 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } } - ] + ], + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE" } }, - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf index 757e7ea506f..3745b692426 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf @@ -1,82 +1,82 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + } }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:hasFile": null, - "ns1:licenseConcluded": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } } ], + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:name": "scan" } }, - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" - } + "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:referencesFile": { "ns1:File": { + "ns1:fileName": "./scan/NOTICE", "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:licenseInfoInFile": [ { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment" } } ] } }, - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/or_later/expected.rdf b/tests/formattedcode/data/spdx/or_later/expected.rdf index ba15c1fa3f1..9b319226c3a 100644 --- a/tests/formattedcode/data/spdx/or_later/expected.rdf +++ b/tests/formattedcode/data/spdx/or_later/expected.rdf @@ -3,48 +3,48 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:name": "or_later", "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" }, - "ns1:name": "or_later" + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": null } }, + "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": { "ns1:File": { + "ns1:fileName": "./test.java", "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca" + "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", - "ns1:fileName": "./test.java", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" } } }, - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/simple/expected.rdf b/tests/formattedcode/data/spdx/simple/expected.rdf index cd628e1e064..35bf0c8305c 100644 --- a/tests/formattedcode/data/spdx/simple/expected.rdf +++ b/tests/formattedcode/data/spdx/simple/expected.rdf @@ -3,52 +3,52 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "ns1:name": "simple", + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:name": "simple" + "ns1:hasFile": null } }, + "ns1:specVersion": "SPDX-2.1", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:referencesFile": { "ns1:File": { + "ns1:fileName": "./simple/test.txt", "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8" + "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./test.txt", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" } } }, - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/simple/expected.tv b/tests/formattedcode/data/spdx/simple/expected.tv index 7ef5f485fd7..3f5fe575a66 100644 --- a/tests/formattedcode/data/spdx/simple/expected.tv +++ b/tests/formattedcode/data/spdx/simple/expected.tv @@ -17,7 +17,7 @@ PackageLicenseConcluded: NOASSERTION PackageLicenseInfoFromFiles: NONE PackageCopyrightText: NONE # File -FileName: ./test.txt +FileName: ./simple/test.txt FileChecksum: SHA1: b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8 LicenseConcluded: NOASSERTION LicenseInfoInFile: NONE diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index de1f5843f6f..65e40a151aa 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -3,87 +3,59 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, - "ns1:describesPackage": { - "ns1:Package": { - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": [ - null, - null, - null, - null, - null, - null, - null - ], - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:name": "scan" - } - }, "ns1:referencesFile": [ { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f" + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy1.c" } }, { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy2.c" } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/subdir/copy1.c", + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -91,17 +63,17 @@ }, { "ns1:File": { + "ns1:fileName": "./scan/copy3.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" + "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -111,15 +83,15 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" + "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:fileName": "./scan/subdir/copy4.c", + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -129,40 +101,68 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1" + "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy4.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy3.c" } }, { "ns1:File": { + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, "ns1:checksum": { "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f" + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", + "ns1:algorithm": "SHA1" } }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - } + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy2.c" } } ], - "ns1:specVersion": "SPDX-2.1" + "ns1:specVersion": "SPDX-2.1", + "ns1:describesPackage": { + "ns1:Package": { + "ns1:hasFile": [ + null, + null, + null, + null, + null, + null, + null + ], + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:name": "scan", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + } + } + }, + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/unicode/expected.rdf b/tests/formattedcode/data/spdx/unicode/expected.rdf index 89592719834..6a5babd4fbf 100644 --- a/tests/formattedcode/data/spdx/unicode/expected.rdf +++ b/tests/formattedcode/data/spdx/unicode/expected.rdf @@ -1,66 +1,66 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", + "ns1:licenseId": "LicenseRef-agere-bsd" + } + }, + "ns1:referencesFile": { + "ns1:File": { + "ns1:licenseInfoInFile": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", + "ns1:licenseId": "LicenseRef-agere-bsd" + } + }, + "ns1:checksum": { + "ns1:Checksum": { + "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", + "ns1:algorithm": "SHA1" + } + }, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", + "ns1:fileName": "./et131x.h" + } + }, + "ns1:specVersion": "SPDX-2.1", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, "ns1:licenseInfoFromFiles": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "ns1:licenseId": "LicenseRef-agere-bsd", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", + "ns1:licenseId": "LicenseRef-agere-bsd" } }, - "ns1:name": "unicode" - } - }, - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "ns1:licenseId": "LicenseRef-agere-bsd", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" - } - }, - "ns1:referencesFile": { - "ns1:File": { - "ns1:checksum": { - "ns1:Checksum": { - "ns1:algorithm": "SHA1", - "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90" - } - }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", - "ns1:fileName": "./et131x.h", + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseInfoInFile": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "ns1:licenseId": "LicenseRef-agere-bsd", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" - } - } + "ns1:name": "unicode" } }, - "ns1:specVersion": "SPDX-2.1" + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" } } } \ No newline at end of file From f5c7a97d0904258863c2f31b88cef04a65f157b3 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:43:07 +0100 Subject: [PATCH 045/122] Add new plugin system for output #787 #789 * each plugin just process a Codebase (though there is still some code left to cleanup) * renamed options to --output * multiple outputs are now possible for #789 Signed-off-by: Philippe Ombredanne --- etc/scripts/test_json2csv.py | 2 +- src/formattedcode/format_json.py | 71 ---- .../{format_csv.py => output_csv.py} | 46 ++- .../{format_templated.py => output_html.py} | 377 +++++++++++------- src/formattedcode/output_json.py | 100 +++++ ...ormat_jsonlines.py => output_jsonlines.py} | 57 +-- .../{format_spdx.py => output_spdx.py} | 125 ++++-- src/plugincode/output.py | 229 +++++++++-- .../data/json/simple-expected.json | 6 +- .../data/json/simple-expected.jsonlines | 5 +- .../data/json/simple-expected.jsonpp | 7 +- .../data/json/tree/expected.json | 6 +- .../data/spdx/license_known/expected.rdf | 56 +-- .../spdx/license_known/expected_with_text.rdf | 70 ++-- .../data/spdx/license_ref/expected.rdf | 56 +-- .../spdx/license_ref/expected_with_text.rdf | 58 +-- .../data/spdx/or_later/expected.rdf | 24 +- .../data/spdx/simple/expected.rdf | 34 +- .../data/spdx/simple/expected.tv | 2 +- .../formattedcode/data/spdx/tree/expected.rdf | 130 +++--- .../data/spdx/unicode/expected.rdf | 74 ++-- ...{test_format_csv.py => test_output_csv.py} | 15 +- ...est_format_json.py => test_output_json.py} | 12 +- ..._jsonlines.py => test_output_jsonlines.py} | 4 +- ...est_format_spdx.py => test_output_spdx.py} | 56 +-- ..._templated.py => test_output_templated.py} | 23 +- 26 files changed, 1013 insertions(+), 632 deletions(-) delete mode 100644 src/formattedcode/format_json.py rename src/formattedcode/{format_csv.py => output_csv.py} (87%) rename src/formattedcode/{format_templated.py => output_html.py} (52%) create mode 100644 src/formattedcode/output_json.py rename src/formattedcode/{format_jsonlines.py => output_jsonlines.py} (50%) rename src/formattedcode/{format_spdx.py => output_spdx.py} (68%) rename tests/formattedcode/{test_format_csv.py => test_output_csv.py} (94%) rename tests/formattedcode/{test_format_json.py => test_output_json.py} (89%) rename tests/formattedcode/{test_format_jsonlines.py => test_output_jsonlines.py} (96%) rename tests/formattedcode/{test_format_spdx.py => test_output_spdx.py} (88%) rename tests/formattedcode/{test_format_templated.py => test_output_templated.py} (85%) diff --git a/etc/scripts/test_json2csv.py b/etc/scripts/test_json2csv.py index 4a25c55d9dc..da708fcc060 100644 --- a/etc/scripts/test_json2csv.py +++ b/etc/scripts/test_json2csv.py @@ -215,7 +215,7 @@ def test_can_process_scan_from_json_scan(self): scan_cmd = os.path.join(scancode.root_dir, 'scancode') rc, _stdout, _stderr = execute(scan_cmd, ['-clip', '--email', '--url', '--strip-root', test_dir, - '--format-json', json_file]) + '--output-json', json_file]) assert rc == 0 result_file = self.get_temp_file('.csv') with open(result_file, 'wb') as rf: diff --git a/src/formattedcode/format_json.py b/src/formattedcode/format_json.py deleted file mode 100644 index 7eb8d272235..00000000000 --- a/src/formattedcode/format_json.py +++ /dev/null @@ -1,71 +0,0 @@ -# -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import unicode_literals - -from collections import OrderedDict - -import simplejson - -from plugincode.output import scan_output_writer - - -""" -Output plugins to write scan results as JSON. -""" - -@scan_output_writer -def write_json_compact(files_count, version, notice, scanned_files, options, output_file, *args, **kwargs): - """ - Write scan output formatted as compact JSON. - """ - _write_json(files_count, version, notice, scanned_files, options, output_file, pretty=False) - - -@scan_output_writer -def write_json_pretty_printed(files_count, version, notice, scanned_files, options, output_file, *args, **kwargs): - """ - Write scan output formatted as pretty-printed JSON. - """ - _write_json(files_count, version, notice, scanned_files, options, output_file, pretty=True) - - -def _write_json(files_count, version, notice, scanned_files, options, output_file, pretty=False): - scan = OrderedDict([ - ('scancode_notice', notice), - ('scancode_version', version), - ('scancode_options', options), - ('files_count', files_count), - ('files', scanned_files), - ]) - kwargs = dict(iterable_as_array=True, encoding='utf-8') - if pretty: - kwargs['indent'] = 2 * ' ' - else: - kwargs['separators'] = (',', ':',) - - # FIXME: Why do we wrap the output in unicode? Test output when we do not wrap the output in unicode - output_file.write(unicode(simplejson.dumps(scan, **kwargs))) - output_file.write('\n') diff --git a/src/formattedcode/format_csv.py b/src/formattedcode/output_csv.py similarity index 87% rename from src/formattedcode/format_csv.py rename to src/formattedcode/output_csv.py index a5782919a24..49648bc642b 100644 --- a/src/formattedcode/format_csv.py +++ b/src/formattedcode/output_csv.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -29,22 +29,38 @@ from collections import OrderedDict +import click import unicodecsv -from plugincode.output import scan_output_writer +from plugincode.output import output +from plugincode.output import OutputPlugin +from scancode import CommandLineOption +from scancode import OUTPUT_GROUP -""" -Output plugin to write scan results as CSV. -""" +@output +class CsvOutput(OutputPlugin): + options = [ + CommandLineOption(('--output-csv',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as CSV to FILE.', + help_group=OUTPUT_GROUP) + ] -@scan_output_writer -def write_csv(scanned_files, output_file, *args, **kwargs): - """ - Write scan output formatted as CSV. - """ - scan_results = list(scanned_files) + def is_enabled(self): + return self.is_command_option_enabled('output_csv') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_csv').value + self.create_parent_directory(output_file) + return write_csv(results, output_file) + + +def write_csv(results, output_file): + # FIXMe: this is reading all in memory + results = list(results) headers = OrderedDict([ ('info', []), @@ -56,7 +72,7 @@ def write_csv(scanned_files, output_file, *args, **kwargs): ]) # note: FIXME: headers are collected as a side effect and this is not great - rows = list(flatten_scan(scan_results, headers)) + rows = list(flatten_scan(results, headers)) ordered_headers = [] for key_group in headers.values(): @@ -126,11 +142,11 @@ def collect_keys(mapping, key_group): continue if k == 'score': - # normalize the string representation of this number + # normalize score with two decimal values val = '{:.2f}'.format(val) - # lines are present in multiple scans: keep their column name as not scan-specific - # Prefix othe columns with license__ + # lines are present in multiple scans: keep their column name as + # not scan-specific. Prefix othe columns with license__ if k not in ('start_line', 'end_line',): k = 'license__' + k lic[k] = val diff --git a/src/formattedcode/format_templated.py b/src/formattedcode/output_html.py similarity index 52% rename from src/formattedcode/format_templated.py rename to src/formattedcode/output_html.py index 9774dcdacef..fa620a15a45 100644 --- a/src/formattedcode/format_templated.py +++ b/src/formattedcode/output_html.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,19 +23,37 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import print_function from __future__ import division +from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict import codecs from operator import itemgetter -import os - -import simplejson as json - -from commoncode import fileutils -from plugincode.output import scan_output_writer +from os.path import abspath +from os.path import basename +from os.path import dirname +from os.path import exists +from os.path import expanduser +from os.path import isfile +from os.path import join + +import click +import simplejson + +from commoncode.fileutils import PATH_TYPE +from commoncode.fileutils import as_posixpath +from commoncode.fileutils import copytree +from commoncode.fileutils import delete +from commoncode.fileutils import file_name +from commoncode.fileutils import file_base_name +from commoncode.fileutils import fsencode +from commoncode.fileutils import parent_directory +from commoncode.system import on_linux +from plugincode.output import output +from plugincode.output import OutputPlugin +from scancode import CommandLineOption +from scancode import OUTPUT_GROUP """ @@ -46,152 +64,120 @@ """ -@scan_output_writer -def write_html(scanned_files, output_file, _echo, version, *args, **kwargs): - """ - Write scan output formatted as plain HTML page. - """ - _write_templated(scanned_files, output_file, _echo, version, template_or_format='html', raise_ex=False) +@output +class HtmlOutput(OutputPlugin): + options = [ + CommandLineOption(('--output-html',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as HTML to FILE.', + help_group=OUTPUT_GROUP) + ] -def write_custom(scanned_files, output_file, _echo, version, template_path): - """ - Write scan output formatted with a custom template. - NOTE: this is NOT a plugin, but a built-in - """ - _write_templated(scanned_files, output_file, _echo, version, template_or_format=template_path, raise_ex=True) + def is_enabled(self): + return self.is_command_option_enabled('output_html') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_html').value + self.create_parent_directory(output_file) + write_templated(output_file, results, version, template_or_format='html') -def _write_templated(scanned_files, output_file, _echo, version, template_or_format, raise_ex=False): +# TODO: Implmenet me as a proper callback with partial +def validate_together(ctx, options): + """ + Validate that a list of `options` names are all provided. + Raise a UsageError on errors. + """ + ctx_params = ctx.params + requested_options = [ctx_params[eop] for eop in options if ctx_params[eop]] + if len(options) != requested_options: + msg = ' and '.join('`' + eo.replace('_', '-') + '`' for eo in options) + msg += ' options are required to be set together. You must use set all of them.' + raise click.UsageError(msg) + + +@output +class CustomTemplateOutput(OutputPlugin): + + options = [ + CommandLineOption(('--output-custom',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output to FILE formatted with ' + 'the custom Jinja template file.', + help_group=OUTPUT_GROUP), + + CommandLineOption(('--custom-template',), + type=click.Path( + exists=True, file_okay=True, dir_okay=False, + readable=True, path_type=PATH_TYPE), + default=None, + metavar='FILE', + help='Use this Jinja template FILE as a custom template.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return ( + self.is_command_option_enabled('output_custom') + and self.is_command_option_enabled('custom_template') + ) + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_custom').value + self.create_parent_directory(output_file) + template_path = self.get_command_option('custom_template').value + if on_linux: + template_path = fsencode(template_path) + write_templated(output_file, results, version, template_or_format=template_path) + + +@output +class HtmlAppOutput(OutputPlugin): + """ + Write scan output formatted as a mini HTML application. + """ + options = [ + CommandLineOption(('--output-html-app',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as a mini HTML application FILE.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('output_html_app') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_html_app').value + scanned_path = codebase.location + self.create_parent_directory(output_file) + output_file.write(as_html_app(output_file, scanned_path, version)) + create_html_app_assets(results, output_file) + + +def write_templated(output_file, results, version, template_or_format): """ Write scan output using a template or a format. Optionally raise an exception on errors. """ - for template_chunk in as_template(scanned_files, version, template=template_or_format): + for template_chunk in as_template(results, version, template_or_format=template_or_format): try: output_file.write(template_chunk) except Exception: import traceback - extra_context = 'ERROR: Failed to write output for: ' + repr(template_chunk) - extra_context += '\n' + traceback.format_exc() - _echo(extra_context, fg='red') - if raise_ex: - # NOTE: this is a tad brutal to raise here, but helps - # the template authors - raise - - -@scan_output_writer -def write_html_app(scanned_files, input, output_file, _echo, version, *args, **kwargs): - """ - Write scan output formatted as a mini HTML application. - """ - output_file.write(as_html_app(input, version, output_file)) - try: - create_html_app_assets(scanned_files, output_file) - except HtmlAppAssetCopyWarning: - _echo('\nHTML app creation skipped when printing to stdout.', fg='yellow') - except HtmlAppAssetCopyError: - _echo('\nFailed to create HTML app.', fg='red') - - -def create_html_app_assets(results, output_file): - """ - Given an html-app output_file, create the corresponding `_files` - directory and copy the assets to this directory. The target - directory is deleted if it exists. - - Raise HtmlAppAssetCopyWarning if the output_file is or - HtmlAppAssetCopyError if the copy was not possible. - """ - try: - if is_stdout(output_file): - raise HtmlAppAssetCopyWarning() - assets_dir = os.path.join(get_template_dir('html-app'), 'assets') - - # delete old assets - tgt_dirs = get_html_app_files_dirs(output_file) - target_dir = os.path.join(*tgt_dirs) - if os.path.exists(target_dir): - fileutils.delete(target_dir) - - # copy assets - fileutils.copytree(assets_dir, target_dir) - - # write json data - root_path, assets_dir = get_html_app_files_dirs(output_file) - with codecs.open(os.path.join(root_path, assets_dir, 'data.json'), 'wb', encoding='utf-8') as f: - f.write('data=') - json.dump(results, f, iterable_as_array=True) - - # create help file - with codecs.open(os.path.join(root_path, assets_dir, 'help.html'), 'wb', encoding='utf-8') as f: - f.write(get_html_app_help(os.path.basename(output_file.name))) - except HtmlAppAssetCopyWarning, w: - raise w - except Exception, e: - raise HtmlAppAssetCopyError(e) - - -def as_html_app(scanned_path, version, output_file): - """ - Return an HTML string built from a list of results and the html-app template. - """ - template = get_template(get_template_dir('html-app')) - _, assets_dir = get_html_app_files_dirs(output_file) - - return template.render(assets_dir=assets_dir, scanned_path=scanned_path, version=version) - - -def get_html_app_help(output_filename): - """ - Return an HTML string containing the html-app help page with a - reference back to the main app page. - """ - template = get_template(get_template_dir('html-app'), - template_name='help_template.html') - - return template.render(main_app=output_filename) + msg = 'ERROR: Failed to write output for: ' + repr(template_chunk) + msg += '\n' + traceback.format_exc() + raise Exception(msg) -class HtmlAppAssetCopyWarning(Exception): - pass - - -class HtmlAppAssetCopyError(Exception): - pass - - -def is_stdout(output_file): - return output_file.name == '' - - -def get_html_app_files_dirs(output_file): - """ - Return a tuple of (parent_dir, dir_name) directory named after the - `output_file` file object file_base_name (stripped from extension) and a - `_files` suffix Return empty strings if output is to stdout. - """ - if is_stdout(output_file): - return '', '' - - file_name = output_file.name - parent_dir = os.path.dirname(file_name) - dir_name = fileutils.file_base_name(file_name) + '_files' - return parent_dir, dir_name - - -# -# Common utilities for templated scans outputs: html, html-app and -# custom templates. -# - -# FIXME: no HTML default! def get_template(templates_dir, template_name='template.html'): """ - Given a template directory, load and return the template file in the template_name - file found in that directory. + Given a `templates_dir` template directory, load and return the template + file for the `template_name` file found in that directory. """ from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader(templates_dir)) @@ -199,20 +185,19 @@ def get_template(templates_dir, template_name='template.html'): return template -def get_template_dir(format): +def get_template_dir(format_code): """ - Given a format string return the corresponding standard template - directory. + Return the template directory of a built-in template for a `format_code` + string. """ - return os.path.join(os.path.dirname(__file__), 'templates', format) + return join(dirname(__file__), 'templates', format_code) -# FIXME: no HTML default! -def as_template(scanned_files, version, template): +def as_template(results, version, template_or_format): """ - Return an string built from a list of `scanned_files` results and - the provided `template` identifier. The template defaults to the standard HTML - template format or can point to the path of a custom template file. + Return an string built from a list of `results` and the provided `template` + identifier. The template_or_format is either a built-in template format code + (e.g. "html") or the path of a custom template file. """ # FIXME: This code is highly coupled with actual scans and may not # support adding new scans at all @@ -220,14 +205,14 @@ def as_template(scanned_files, version, template): from licensedcode.cache import get_licenses_db # FIXME: factor out the html vs custom from this function: we should get a template path - if template == 'html': + if template_or_format == 'html': template = get_template(get_template_dir('html')) else: # load a custom template - tpath = fileutils.as_posixpath(os.path.abspath(os.path.expanduser(template))) - assert os.path.isfile(tpath) - tdir = fileutils.parent_directory(tpath) - tfile = fileutils.file_name(tpath) + tpath = as_posixpath(abspath(expanduser(template_or_format))) + assert isfile(tpath) + tdir = parent_directory(tpath) + tfile = file_name(tpath) template = get_template(tdir, tfile) converted = OrderedDict() @@ -242,7 +227,7 @@ def as_template(scanned_files, version, template): EMAILS = 'emails' # Create a flattened data dict keyed by path - for scanned_file in scanned_files: + for scanned_file in results: path = scanned_file['path'] results = [] if COPYRIGHTS in scanned_file: @@ -292,3 +277,91 @@ def as_template(scanned_files, version, template): } return template.generate(files=files, licenses=licenses, version=version) + + +def create_html_app_assets(results, output_file): + """ + Given an html-app output_file, create the corresponding `_files` + directory and copy the assets to this directory. The target + directory is deleted if it exists. + + Raise HtmlAppAssetCopyWarning if the output_file is or + HtmlAppAssetCopyError if the copy was not possible. + """ + try: + if is_stdout(output_file): + raise HtmlAppAssetCopyWarning() + assets_dir = join(get_template_dir('html-app'), 'assets') + + # delete old assets + tgt_dirs = get_html_app_files_dirs(output_file) + target_dir = join(*tgt_dirs) + if exists(target_dir): + delete(target_dir) + + # copy assets + copytree(assets_dir, target_dir) + + # write json data + # FIXME: this should a regular JSON scan format + root_path, assets_dir = get_html_app_files_dirs(output_file) + with codecs.open(join(root_path, assets_dir, 'data.json'), 'wb', encoding='utf-8') as f: + f.write('data=') + simplejson.dump(results, f, iterable_as_array=True) + + # create help file + with codecs.open(join(root_path, assets_dir, 'help.html'), 'wb', encoding='utf-8') as f: + f.write(get_html_app_help(basename(output_file.name))) + except HtmlAppAssetCopyWarning, w: + raise w + except Exception, e: + raise HtmlAppAssetCopyError(e) + + +def as_html_app(output_file, scanned_path, version,): + """ + Return an HTML string built from a list of results and the html-app template. + """ + template = get_template(get_template_dir('html-app')) + _, assets_dir = get_html_app_files_dirs(output_file) + + return template.render(assets_dir=assets_dir, scanned_path=scanned_path, version=version) + + +def get_html_app_help(output_filename): + """ + Return an HTML string containing the html-app help page with a + reference back to the main app page. + """ + template = get_template(get_template_dir('html-app'), + template_name='help_template.html') + + return template.render(main_app=output_filename) + + +class HtmlAppAssetCopyWarning(Exception): + pass + + +class HtmlAppAssetCopyError(Exception): + pass + + +def is_stdout(output_file): + return output_file.name == '' + + +def get_html_app_files_dirs(output_file): + """ + Return a tuple of (parent_dir, dir_name) directory named after the + `output_file` file-like object file_base_name (stripped from extension) and + a `_files` suffix Return empty strings if output is to stdout. + """ + if is_stdout(output_file): + return '', '' + + # FIXME: what if there is no name attribute?? + file_name = output_file.name + parent_dir = dirname(file_name) + dir_name = file_base_name(file_name) + '_files' + return parent_dir, dir_name diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py new file mode 100644 index 00000000000..84c1d6e0c4a --- /dev/null +++ b/src/formattedcode/output_json.py @@ -0,0 +1,100 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from collections import OrderedDict + +import click +import simplejson + +from plugincode.output import output +from plugincode.output import OutputPlugin +from scancode import CommandLineOption +from scancode import OUTPUT_GROUP + +""" +Output plugins to write scan results as JSON. +""" + + +@output +class JsonCompactOutput(OutputPlugin): + + options = [ + CommandLineOption(('--json', '--output-json',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as compact JSON to FILE.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('output_json') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_json').value + self.create_parent_directory(output_file) + write_json(results, output_file, files_count, version, notice, options, pretty=False) + + +@output +class JsonPrettyOutput(OutputPlugin): + + options = [ + CommandLineOption(('--json-pp', '--output-json-pp',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as pretty-printed JSON to FILE.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('output_json_pp') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_json_pp').value + self.create_parent_directory(output_file) + write_json(results, output_file, files_count, version, notice, options, pretty=True) + + +def write_json(results, output_file, files_count, version, notice, options, pretty=False): + scan = OrderedDict([ + ('scancode_notice', notice), + ('scancode_version', version), + ('scancode_options', options), + ('files_count', files_count), + ('files', results), + ]) + + kwargs = dict(iterable_as_array=True, encoding='utf-8') + if pretty: + kwargs['indent'] = 2 * b' ' + else: + kwargs['separators'] = (b',', b':',) + + # FIXME: Why do we wrap the output in unicode? Test output when we do not wrap the output in unicode + output_file.write(simplejson.dumps(scan, **kwargs)) + output_file.write(b'\n') diff --git a/src/formattedcode/format_jsonlines.py b/src/formattedcode/output_jsonlines.py similarity index 50% rename from src/formattedcode/format_jsonlines.py rename to src/formattedcode/output_jsonlines.py index e79b572acdc..d7f6cbb507d 100644 --- a/src/formattedcode/format_jsonlines.py +++ b/src/formattedcode/output_jsonlines.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -27,34 +27,45 @@ from collections import OrderedDict +import click import simplejson -from plugincode.output import scan_output_writer +from plugincode.output import output +from plugincode.output import OutputPlugin +from scancode import CommandLineOption +from scancode import OUTPUT_GROUP -""" -Output plugins to write scan results as JSON Lines. -""" +@output +class JsonLinesOutput(OutputPlugin): + options = [ + CommandLineOption(('--output-json-lines',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as JSON Lines to FILE.', + help_group=OUTPUT_GROUP) + ] -@scan_output_writer -def write_jsonlines(files_count, version, notice, scanned_files, options, output_file, *args, **kwargs): - """ - Write scan output formatted as JSON Lines. - """ - header = dict(header=OrderedDict([ - ('scancode_notice', notice), - ('scancode_version', version), - ('scancode_options', options), - ('files_count', files_count) - ])) + def is_enabled(self): + return self.is_command_option_enabled('output_json_lines') - kwargs = dict(iterable_as_array=True, encoding='utf-8', separators=(',', ':',)) + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_json_lines').value + self.create_parent_directory(output_file) + header = dict(header=OrderedDict([ + ('scancode_notice', notice), + ('scancode_version', version), + ('scancode_options', options), + ('files_count', files_count) + ])) - output_file.write(simplejson.dumps(header, **kwargs)) - output_file.write('\n') - - for scanned_file in scanned_files: - scanned_file_line = {'files': [scanned_file]} - output_file.write(simplejson.dumps(scanned_file_line, **kwargs)) + kwargs = dict( + iterable_as_array=True, encoding='utf-8', separators=(',', ':',)) + output_file.write(simplejson.dumps(header, **kwargs)) output_file.write('\n') + + for scanned_file in results: + scanned_file_line = {'files': [scanned_file]} + output_file.write(simplejson.dumps(scanned_file_line, **kwargs)) + output_file.write('\n') diff --git a/src/formattedcode/format_spdx.py b/src/formattedcode/output_spdx.py similarity index 68% rename from src/formattedcode/format_spdx.py rename to src/formattedcode/output_spdx.py index 622a051f2f9..5372f0291aa 100644 --- a/src/formattedcode/format_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -27,9 +27,15 @@ from __future__ import division from __future__ import unicode_literals -import os from os.path import abspath - +from os.path import basename +from os.path import dirname +from os.path import isdir +from os.path import isfile +from os.path import join +import sys + +import click from spdx.checksum import Algorithm from spdx.creationinfo import Tool from spdx.document import Document @@ -41,39 +47,102 @@ from spdx.utils import SPDXNone from spdx.version import Version -from plugincode.output import scan_output_writer +from plugincode.output import output +from plugincode.output import OutputPlugin +from scancode import CommandLineOption +from scancode import OUTPUT_GROUP + +# Python 2 and 3 support +try: + # Python 2 + unicode + str_orig = str + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment +except NameError: + # Python 3 + unicode = str # @ReservedAssignment + + +# Tracing flags +TRACE = False +TRACE_DEEP = False + +def logger_debug(*args): + pass + +if TRACE or TRACE_DEEP: + import logging + + logger = logging.getLogger(__name__) + logging.basicConfig(stream=sys.stdout) + logger.setLevel(logging.DEBUG) + + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, unicode) + and a or repr(a) for a in args)) """ Output plugins to write scan results in SPDX format. """ -@scan_output_writer -def write_spdx_tag_value(files_count, version, notice, scanned_files, input, output_file, *args, **kwargs): - """ - Write scan output formatted as SPDX Tag/Value. - """ - write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=True) +@output +class SpdxTvOutput(OutputPlugin): + needs_info = True -@scan_output_writer -def write_spdx_rdf(files_count, version, notice, scanned_files, input, output_file, *args, **kwargs): - """ - Write scan output formatted as SPDX RDF. - """ - write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=False) + options = [ + CommandLineOption(('--output-spdx-tv',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as SPDX Tag/Value to FILE. ' + 'Implies running the --info scan.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('output_spdx_tv') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_spdx_tv').value + self.create_parent_directory(output_file) + input_file = codebase.location + write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True) + + +@output +class SpdxRdfOutput(OutputPlugin): + + options = [ + CommandLineOption(('--output-spdx-rdf',), + type=click.File(mode='wb', lazy=False), + metavar='FILE', + help='Write scan output formatted as SPDX RDF to FILE. ' + 'Implies running the --info scan.', + help_group=OUTPUT_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('output_spdx_rdf') + + def save_results(self, codebase, results, files_count, version, notice, options): + output_file = self.get_command_option('output_spdx_rdf').value + self.create_parent_directory(output_file) + input_file = codebase.location + write_spdx(output_file, results, version, notice, input_file, as_tagvalue=False) -def write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=True): +def write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True): """ Write scan output formatted as SPDX Tag/value or RDF. """ - absinput = abspath(input) + absinput = abspath(input_file) - if os.path.isdir(absinput): + if isdir(absinput): input_path = absinput else: - input_path = os.path.dirname(absinput) + input_path = dirname(absinput) doc = Document(Version(2, 1), License.from_identifier('CC0-1.0')) doc.comment = notice @@ -82,7 +151,7 @@ def write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=T doc.creation_info.set_created_now() package = doc.package = Package( - name=os.path.basename(input_path), + name=basename(input_path), download_location=NoAssert() ) @@ -92,14 +161,15 @@ def write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=T all_files_have_no_license = True all_files_have_no_copyright = True - for file_data in scanned_files: + # FIXME: this should walk the codebase instead!!! + for file_data in results: # Construct the absolute path in case we need to access the file # to calculate its SHA1. - file_entry = File(os.path.join(input_path, file_data.get('path'))) + file_entry = File(join(input_path, file_data.get('path'))) file_sha1 = file_data.get('sha1') if not file_sha1: - if os.path.isfile(file_entry.name): + if isfile(file_entry.name): # Calculate the SHA1 in case it is missing, e.g. for empty files. file_sha1 = file_entry.calc_chksum() else: @@ -125,7 +195,8 @@ def write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=T licenseref_id = 'LicenseRef-' + license_key spdx_license = ExtractedLicense(licenseref_id) spdx_license.name = file_license.get('short_name') - comment = 'See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/%s.yml\n' % license_key + comment = ('See details at https://github.com/nexB/scancode-toolkit' + '/blob/develop/src/licensedcode/data/licenses/%s.yml\n' % license_key) spdx_license.comment = comment text = file_license.get('matched_text') # always set some text, even if we did not extract the matched text @@ -203,9 +274,9 @@ def write_spdx(version, notice, scanned_files, input, output_file, as_tagvalue=T package.conc_lics = NoAssert() if as_tagvalue: - from spdx.writers.tagvalue import write_document + from spdx.writers.tagvalue import write_document # @UnusedImport else: - from spdx.writers.rdf import write_document + from spdx.writers.rdf import write_document # @Reimport # The spdx-tools write_document returns either: # - unicode for tag values diff --git a/src/plugincode/output.py b/src/plugincode/output.py index 59afd10090e..aa6f8b48148 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,56 +23,217 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import +from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict -import sys +from functools import partial +from os.path import abspath +from os.path import dirname +from os.path import expanduser +from sys import stderr +from sys import stdout -from pluggy import HookimplMarker -from pluggy import HookspecMarker -from pluggy import PluginManager +from commoncode.fileutils import create_dir +from commoncode.fileutils import fsdecode +from commoncode.system import on_linux +from plugincode import CodebasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker +from scancode.resource import Resource -scan_output_spec = HookspecMarker('scan_output_writer') -scan_output_writer = HookimplMarker('scan_output_writer') +# Python 2 and 3 support +try: + # Python 2 + unicode + str_orig = str + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment +except NameError: + # Python 3 + unicode = str # @ReservedAssignment -# FIXME: simplify the hooskpec -@scan_output_spec -def write_output(files_count, version, notice, scanned_files, options, input, output_file, _echo): - """ - Write the `scanned_files` scan results in the format supplied by - the --format command line option. - Parameters: - - `file_count`: the number of files and directories scanned. - - `version`: ScanCode version - - `notice`: ScanCode notice - - `scanned_files`: an iterable of scan results for each file - - `options`: a mapping of key by command line option to a flag True - if this option was enabled. - - `input`: the original input path scanned. - - `output_file`: an opened, file-like object to write the output to. - - `_echo`: a funtion to echo strings to stderr. This will be removedd in the future. - """ +# Tracing flags +TRACE = False +TRACE_DEEP = False + +def logger_debug(*args): pass +if TRACE or TRACE_DEEP: + import logging + + logger = logging.getLogger(__name__) + logging.basicConfig(stream=stdout) + logger.setLevel(logging.DEBUG) -output_plugins = PluginManager('scan_output_writer') -output_plugins.add_hookspecs(sys.modules[__name__]) + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, unicode) + and a or repr(a) for a in args)) -def initialize(): +stage = 'output' +entrypoint = 'scancode_output' + +output_spec = HookspecMarker(project_name=stage) +output = HookimplMarker(project_name=stage) + + +@output_spec +class OutputPlugin(CodebasePlugin): """ - NOTE: this defines the entry points for use in setup.py + Base plugin class for scan output formatters all output plugins must extend. """ - output_plugins.load_setuptools_entrypoints('scancode_output_writers') + + # TODO: pass own command options name/values as concrete kwargs + def process_codebase(self, codebase, **kwargs): + """ + FIXME: this is a stopgap, intermediate implementation + Write scan output for the `codebase`. + """ + serializer = partial(Resource.to_dict, + full_root=codebase.full_root, + strip_root=codebase.strip_root, + with_info=codebase.with_info) + + filtered_rids = codebase.filtered_rids + if TRACE_DEEP: + logger_debug('OutputPlugin.process_codebase: filtered_rids:', filtered_rids) + resources = [res for res in codebase.walk( + topdown=True, sort=True, skip_root=codebase.strip_root) + # we apply any filter plugins here + if res.rid not in filtered_rids + ] + # TODO: add dirs to results + files_count, _dirs_count = codebase.resource_counts(resources) + + results = [serializer(res) + for res in codebase.walk(topdown=True, sort=True, skip_root=codebase.strip_root) + # we apply any filter plugins here + if res.rid not in filtered_rids + ] + + version = codebase.summary['scancode_version'] + notice = codebase.summary['scancode_notice'] + + # TODO: consider getting this from the codebase? + options = get_pretty_options(self.command_options, self._test_mode) + + return self.save_results(codebase, results, files_count, version, notice, options) + + def save_results(self, codebase, results, files_count, version, notice, options, *args, **kwargs): + """ + FIXME: this is a stopgap, intermediate implementation + Write scan `results` to `output_file` + """ + raise NotImplementedError + + def create_parent_directory(self, output_file): + """ + Create parent directory for the `output_file` file-like object if needed. + """ + # FIXME: this IS NOT RIGHT!!! + + # We use this to check if this is a real filesystem file or not. + # note: sys.stdout.name == '' so it has a name. + has_name = hasattr(output, 'name') + output_is_real_file = output not in (stdout, stderr) and has_name + if output_is_real_file: + # we are writing to a real filesystem file: create directories! + parent_dir = dirname(output_file.name) + if parent_dir: + create_dir(abspath(expanduser(parent_dir))) + + def setup_output_file(self, output_file): + """ + Return `output_file` fully resolved and in the proper OS encoding. + Create intermediate directoties if needed. + """ + if on_linux: + output_file = fsdecode(output_file) + output_file = abspath(expanduser(output_file)) + self.create_parent_directory(output_file) + return output_file -def get_plugins(): +def get_pretty_options(command_options, generic_paths=False): """ - Return an ordered mapping of format name --> plugin callable for all - the output plugins. The mapping is ordered by sorted key. - This is the main API for other code to access format plugins. + Return a sorted mapping of {CLI option: pretty value string} for the + `command_options` list of CommandOption as in: + {"--license": True, "input": ~some/path} + + Skip options with with None or empty seq values or a value set to its + default. Skip eager and hidden options. + + If `generic_paths` is True, click.File and click.Path parameters are made + "generic" replacing their value with a placeholder. This is used mostly for + testing. """ - return OrderedDict(sorted(output_plugins.list_name_plugin())) + import click + + if TRACE: + logger_debug('get_pretty_options: generic_paths', generic_paths) + args = [] + options = [] + for option in command_options: + value = option.value + param = option.param + if value == param.default: + continue + + if param.is_eager: + continue + + if value is None: + continue + + # not yet in Click 6.7 or param.hidden: + if option.name == 'test_mode': + continue + + if value in (tuple(), [],): + # option with multiple values, the value is a tuple + continue + + if isinstance(param.type, click.Path) and generic_paths: + value = '' + + if isinstance(param.type, click.File): + if generic_paths: + value = '' + else: + # the value cannot be displayed as-is as this may be an opened file- + # like object + vname = getattr(value, 'name', None) + if vname: + value = vname + else: + value = '' + + # coerce to string for non-basic supported types + if not (value in (True, False, None) + or isinstance(value, (str, unicode, bytes, tuple, list, dict, OrderedDict))): + value = repr(value) + + # opts is a list of CLI options as in "--strip-root": the last opt is + # the CLI option long form by convention + cli_opt = param.opts[-1] + + if isinstance(param, click.Argument): + args.append((cli_opt, value)) + else: + options.append((cli_opt, value)) + + return OrderedDict(sorted(args) + sorted(options)) + + +output_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=OutputPlugin +) diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index 0b41e30114c..be20daa4941 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -1,10 +1,12 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, + "--info": true, "--license": true, - "--package": true, - "--info": true + "--output-json": "", + "--package": true }, "files_count": 1, "files": [ diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 1e3a926d925..0d35388d521 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -3,8 +3,9 @@ "header": { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, - "--format": "jsonlines" + "--output-json-lines": "" }, "files_count": 1 } @@ -61,4 +62,4 @@ } ] } -] \ No newline at end of file +] diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 201735e574d..c52b0f17f2d 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -1,11 +1,12 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, - "--package": true, "--info": true, - "--format": "json-pp" + "--license": true, + "--output-json-pp": "", + "--package": true }, "files_count": 1, "files": [ diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 06031593176..4693bb787c1 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -1,13 +1,15 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, + "--info": true, "--license": true, "--package": true, - "--info": true, + "--output-json-pp": "", "--strip-root": true }, - "files_count": 4, + "files_count": 7, "files": [ { "path": "copy1.c", diff --git a/tests/formattedcode/data/spdx/license_known/expected.rdf b/tests/formattedcode/data/spdx/license_known/expected.rdf index 49602d49c82..d4e4521afbe 100644 --- a/tests/formattedcode/data/spdx/license_known/expected.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected.rdf @@ -3,12 +3,16 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:licenseDeclared": { + "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:hasFile": [ @@ -18,67 +22,63 @@ "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], "ns1:name": "scan" } }, - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { - "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/cc0-1.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" } }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + "ns1:fileName": "./scan/apache-2.0.LICENSE", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + } } } ], - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf index 22cdd8c71e5..d4e4521afbe 100644 --- a/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_known/expected_with_text.rdf @@ -3,15 +3,28 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "scan", - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": [ + null, + null + ], + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" @@ -20,65 +33,52 @@ "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": [ - null, - null - ] + "ns1:name": "scan" } }, - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": [ { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada" } }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:copyrightText": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:fileName": "./scan/apache-2.0.LICENSE" + "ns1:fileName": "./scan/cc0-1.0.LICENSE", + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + } } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "172444e7c137eb5cd3cae530aca0879c90f7fada", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "2b8b815229aa8a61e483fb4ba0588b8b6c491890" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./scan/apache-2.0.LICENSE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:fileName": "./scan/cc0-1.0.LICENSE" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + } } } ], - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected.rdf b/tests/formattedcode/data/spdx/license_ref/expected.rdf index f12c0f93321..ff18de2701b 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected.rdf @@ -1,59 +1,61 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" - } + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { - "ns1:hasFile": null, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:licenseDeclared": { + "ns1:hasFile": null, + "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "scan", - "ns1:licenseConcluded": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ { "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, + { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } - }, - { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" } ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others." + "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + } }, "ns1:referencesFile": { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" } }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, @@ -67,16 +69,14 @@ { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } - ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:fileName": "./scan/NOTICE" + ] } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf index 3745b692426..757e7ea506f 100644 --- a/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf +++ b/tests/formattedcode/data/spdx/license_ref/expected_with_text.rdf @@ -1,82 +1,82 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" - } + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:hasFile": null, - "ns1:licenseDeclared": { + "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:downloadLocation": { + "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } ], - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, "ns1:name": "scan" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" + } }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./scan/NOTICE", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "f9c28fa2714ad0c2e36d3e5561afb0031fa76831" } }, + "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", + "ns1:fileName": "./scan/NOTICE", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2017 nexB Inc. and others.", "ns1:licenseInfoInFile": [ { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" }, { - "@rdf:resource": "http://spdx.org/licenses/Apache-2.0" + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "The ScanCode software is licensed under the Apache License version 2.0.\nData generated with ScanCode require an acknowledgment.\nScanCode is a trademark of nexB Inc.\n\nYou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\nWhen you publish or redistribute any data created with ScanCode or any ScanCode\nderivative work, you must accompany this data with the following acknowledgment:\n\n Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n OR CONDITIONS OF ANY KIND, either express or implied. No content created from\n ScanCode should be considered or used as legal advice. Consult an Attorney\n for any legal advice.\n ScanCode is a free software code scanning tool from nexB Inc. and others.\n Visit https://github.com/nexB/scancode-toolkit/ for support and download", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml", - "ns1:licenseId": "LicenseRef-scancode-acknowledgment" + "ns1:licenseId": "LicenseRef-scancode-acknowledgment", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/scancode-acknowledgment.yml" } } ] } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/or_later/expected.rdf b/tests/formattedcode/data/spdx/or_later/expected.rdf index 9b319226c3a..ba15c1fa3f1 100644 --- a/tests/formattedcode/data/spdx/or_later/expected.rdf +++ b/tests/formattedcode/data/spdx/or_later/expected.rdf @@ -3,48 +3,48 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "or_later", "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:hasFile": null + "ns1:name": "or_later" } }, - "ns1:specVersion": "SPDX-2.1", "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./test.java", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "0c5bf934430394112921e7a1a8128176606d32ca" } }, + "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", + "ns1:fileName": "./test.java", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright 2010, Red Hat, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/licenses/LGPL-2.1+" } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/simple/expected.rdf b/tests/formattedcode/data/spdx/simple/expected.rdf index 35bf0c8305c..cd628e1e064 100644 --- a/tests/formattedcode/data/spdx/simple/expected.rdf +++ b/tests/formattedcode/data/spdx/simple/expected.rdf @@ -3,52 +3,52 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", + "ns1:dataLicense": { + "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" + }, "ns1:describesPackage": { "ns1:Package": { - "ns1:name": "simple", - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" }, "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoFromFiles": { "@rdf:resource": "http://spdx.org/rdf/terms#none" }, - "ns1:hasFile": null + "ns1:name": "simple" } }, - "ns1:specVersion": "SPDX-2.1", - "ns1:dataLicense": { - "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" - }, "ns1:referencesFile": { "ns1:File": { - "ns1:fileName": "./simple/test.txt", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8" } }, + "ns1:copyrightText": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:fileName": "./test.txt", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/simple/expected.tv b/tests/formattedcode/data/spdx/simple/expected.tv index 3f5fe575a66..7ef5f485fd7 100644 --- a/tests/formattedcode/data/spdx/simple/expected.tv +++ b/tests/formattedcode/data/spdx/simple/expected.tv @@ -17,7 +17,7 @@ PackageLicenseConcluded: NOASSERTION PackageLicenseInfoFromFiles: NONE PackageCopyrightText: NONE # File -FileName: ./simple/test.txt +FileName: ./test.txt FileChecksum: SHA1: b8a793cce3c3a4cd3a4646ddbe86edd542ed0cd8 LicenseConcluded: NOASSERTION LicenseInfoInFile: NONE diff --git a/tests/formattedcode/data/spdx/tree/expected.rdf b/tests/formattedcode/data/spdx/tree/expected.rdf index 65e40a151aa..de1f5843f6f 100644 --- a/tests/formattedcode/data/spdx/tree/expected.rdf +++ b/tests/formattedcode/data/spdx/tree/expected.rdf @@ -3,59 +3,87 @@ "@xmlns:ns1": "http://spdx.org/rdf/terms#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ns1:SpdxDocument": { + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, + "ns1:describesPackage": { + "ns1:Package": { + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:downloadLocation": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:hasFile": [ + null, + null, + null, + null, + null, + null, + null + ], + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseDeclared": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, + "ns1:licenseInfoFromFiles": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + }, + "ns1:name": "scan" + } + }, "ns1:referencesFile": [ { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy1.c" + } } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/copy2.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } }, { "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/subdir/copy1.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -63,17 +91,17 @@ }, { "ns1:File": { - "ns1:fileName": "./scan/copy3.c", "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy1.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -83,15 +111,15 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy2.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:fileName": "./scan/subdir/copy4.c", - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" } @@ -101,68 +129,40 @@ "ns1:File": { "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "389af7e629a9853056e42b262d5e30bf4579a74f", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "58748872d25374160692f1ed7075d0fe80a544b1" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/subdir/copy4.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, "ns1:licenseInfoInFile": { "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy3.c" + } } }, { "ns1:File": { - "ns1:licenseInfoInFile": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, "ns1:checksum": { "ns1:Checksum": { - "ns1:checksumValue": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", - "ns1:algorithm": "SHA1" + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f" } }, + "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", + "ns1:fileName": "./scan/copy3.c", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:fileName": "./scan/subdir/copy2.c" + "ns1:licenseInfoInFile": { + "@rdf:resource": "http://spdx.org/rdf/terms#none" + } } } ], - "ns1:specVersion": "SPDX-2.1", - "ns1:describesPackage": { - "ns1:Package": { - "ns1:hasFile": [ - null, - null, - null, - null, - null, - null, - null - ], - "ns1:licenseDeclared": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:name": "scan", - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2000 ACME, Inc.", - "ns1:licenseInfoFromFiles": { - "@rdf:resource": "http://spdx.org/rdf/terms#none" - }, - "ns1:downloadLocation": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - } - } - }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/data/spdx/unicode/expected.rdf b/tests/formattedcode/data/spdx/unicode/expected.rdf index 6a5babd4fbf..89592719834 100644 --- a/tests/formattedcode/data/spdx/unicode/expected.rdf +++ b/tests/formattedcode/data/spdx/unicode/expected.rdf @@ -1,66 +1,66 @@ { "rdf:RDF": { "@xmlns:ns1": "http://spdx.org/rdf/terms#", - "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "@xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "@xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#", "ns1:SpdxDocument": { - "ns1:hasExtractedLicensingInfo": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" - } - }, - "ns1:referencesFile": { - "ns1:File": { - "ns1:licenseInfoInFile": { - "ns1:ExtractedLicensingInfo": { - "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" - } - }, - "ns1:checksum": { - "ns1:Checksum": { - "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90", - "ns1:algorithm": "SHA1" - } - }, - "ns1:licenseConcluded": { - "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" - }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", - "ns1:fileName": "./et131x.h" - } - }, - "ns1:specVersion": "SPDX-2.1", + "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS", "ns1:dataLicense": { "@rdf:resource": "http://spdx.org/licenses/CC0-1.0" }, "ns1:describesPackage": { "ns1:Package": { + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", "ns1:downloadLocation": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, + "ns1:hasFile": null, + "ns1:licenseConcluded": { + "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" + }, "ns1:licenseDeclared": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:hasFile": null, "ns1:licenseInfoFromFiles": { "ns1:ExtractedLicensingInfo": { "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", - "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml", - "ns1:licenseId": "LicenseRef-agere-bsd" + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" } }, - "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.", + "ns1:name": "unicode" + } + }, + "ns1:hasExtractedLicensingInfo": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" + } + }, + "ns1:referencesFile": { + "ns1:File": { + "ns1:checksum": { + "ns1:Checksum": { + "ns1:algorithm": "SHA1", + "ns1:checksumValue": "3903b654c47ea95203567230d72093ad1c5c4b90" + } + }, + "ns1:copyrightText": "Copyright (c) 2005 Agere Systems Inc.\nCopyright (c) 2005 Agere Systems Inc.", + "ns1:fileName": "./et131x.h", "ns1:licenseConcluded": { "@rdf:resource": "http://spdx.org/rdf/terms#noassertion" }, - "ns1:name": "unicode" + "ns1:licenseInfoInFile": { + "ns1:ExtractedLicensingInfo": { + "ns1:extractedText": "SOFTWARE LICENSE\n *\n * This software is provided subject to the following terms and conditions,\n * which you should read carefully before using the software. Using this\n * software indicates your acceptance of these terms and conditions. If you do\n * not agree with these terms and conditions, do not use the software.\n *\n * [Copyright] \u00a9 [2005] [Agere] [Systems] [Inc].\n * [All] [rights] [reserved].\n *\n * Redistribution and use in source or binary forms, with or without\n * modifications, are permitted provided that the following conditions are met:\n *\n * . Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following Disclaimer as comments in the code as\n * well as in the documentation and/or other materials provided with the\n * distribution.\n *\n * . Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following Disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * . Neither the name of Agere Systems Inc. nor the names of the contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * Disclaimer\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY\n * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN\n * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE", + "ns1:licenseId": "LicenseRef-agere-bsd", + "rdfs:comment": "See details at https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/agere-bsd.yml" + } + } } }, - "@rdf:about": "http://www.spdx.org/tools#SPDXANALYSIS" + "ns1:specVersion": "SPDX-2.1" } } } \ No newline at end of file diff --git a/tests/formattedcode/test_format_csv.py b/tests/formattedcode/test_output_csv.py similarity index 94% rename from tests/formattedcode/test_format_csv.py rename to tests/formattedcode/test_output_csv.py index d2f0e7195be..68a12da100c 100644 --- a/tests/formattedcode/test_format_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -38,7 +38,10 @@ from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain -from formattedcode.format_csv import flatten_scan +from formattedcode.output_csv import flatten_scan + +from plugincode import output +output._TEST_MODE = True test_env = FileDrivenTesting() @@ -193,7 +196,7 @@ def test_csv_minimal(): test_dir = test_env.get_test_loc('csv/srp') result_file = test_env.get_temp_file('csv') expected_file = test_env.get_test_loc('csv/srp.csv') - result = run_scan_click(['--copyright', '--format', 'csv', test_dir, result_file]) + result = run_scan_click(['--copyright', test_dir, '--output-csv', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output check_csvs(result_file, expected_file) @@ -203,7 +206,8 @@ def test_csv_tree(): test_dir = test_env.get_test_loc('csv/tree/scan') result_file = test_env.get_temp_file('csv') expected_file = test_env.get_test_loc('csv/tree/expected.csv') - result = run_scan_click(['--copyright', '--format', 'csv', test_dir, result_file]) + result = run_scan_click(['--copyright', test_dir, + '--output-csv', result_file]) assert result.exit_code == 0 check_csvs(result_file, expected_file) @@ -211,9 +215,8 @@ def test_csv_tree(): def test_can_process_live_scan_with_all_options(): test_dir = test_env.get_test_loc('csv/livescan/scan') result_file = test_env.get_temp_file('csv') - rc, stdout, stderr = run_scan_plain( - ['-clip', '--email', '--url', '--strip-root', '--format', 'csv', - test_dir, result_file]) + rc, stdout, stderr = run_scan_plain(['-clip', '--email', '--url', + '--strip-root', test_dir, '--output-csv', result_file]) try: assert rc == 0 except: diff --git a/tests/formattedcode/test_format_json.py b/tests/formattedcode/test_output_json.py similarity index 89% rename from tests/formattedcode/test_format_json.py rename to tests/formattedcode/test_output_json.py index 62629d71f85..d3050b73049 100644 --- a/tests/formattedcode/test_format_json.py +++ b/tests/formattedcode/test_output_json.py @@ -33,6 +33,8 @@ from scancode.cli_test_utils import check_json_scan from scancode.cli_test_utils import run_scan_click +from plugincode import output +output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -42,7 +44,7 @@ def test_json_pretty_print(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - result = run_scan_click(['-clip', '--format', 'json-pp', test_dir, result_file]) + result = run_scan_click(['-clip', test_dir, '--output-json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -54,12 +56,12 @@ def test_json_compact(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - result = run_scan_click(['-clip', '--format', 'json', test_dir, result_file]) + result = run_scan_click(['-clip', test_dir, '--output-json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output with open(result_file, 'rb') as res: - assert len(res.read().splitlines())==1 + assert len(res.read().splitlines()) == 1 expected = test_env.get_test_loc('json/simple-expected.json') check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) @@ -70,7 +72,7 @@ def test_scan_output_does_not_truncate_copyright_json(): result_file = test_env.get_temp_file('test.json') result = run_scan_click( - ['-clip', '--strip-root', '--format', 'json', test_dir, result_file]) + ['-clip', '--strip-root', test_dir, '--output-json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -83,7 +85,7 @@ def test_scan_output_does_not_truncate_copyright_with_json_to_stdout(): result_file = test_env.get_temp_file('test.json') result = run_scan_click( - ['-clip', '--strip-root', '--format', 'json', test_dir, result_file]) + ['-clip', '--strip-root', test_dir, '--output-json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output diff --git a/tests/formattedcode/test_format_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py similarity index 96% rename from tests/formattedcode/test_format_jsonlines.py rename to tests/formattedcode/test_output_jsonlines.py index abb191634b9..98dad78b626 100644 --- a/tests/formattedcode/test_format_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -35,6 +35,8 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click +from plugincode import output +output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -92,7 +94,7 @@ def test_jsonlines(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('jsonline') - result = run_scan_click(['-i', '--format', 'jsonlines', test_dir, result_file]) + result = run_scan_click(['-i', test_dir, '--output-json-lines', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output diff --git a/tests/formattedcode/test_format_spdx.py b/tests/formattedcode/test_output_spdx.py similarity index 88% rename from tests/formattedcode/test_format_spdx.py rename to tests/formattedcode/test_output_spdx.py index 7f1383d41dd..be5f41d1417 100644 --- a/tests/formattedcode/test_format_spdx.py +++ b/tests/formattedcode/test_output_spdx.py @@ -150,70 +150,70 @@ def test_spdx_rdf_basic(): test_file = test_env.get_test_loc('spdx/simple/test.txt') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/simple/expected.rdf') - result = run_scan_click(['--format', 'spdx-rdf', test_file, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_file, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_tv_basic(): test_dir = test_env.get_test_loc('spdx/simple/test.txt') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/simple/expected.tv') - result = run_scan_click(['--format', 'spdx-tv', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_rdf_with_known_licenses(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_known/expected.rdf') - result = run_scan_click(['--format', 'spdx-rdf', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_rdf_with_license_ref(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_ref/expected.rdf') - result = run_scan_click(['--format', 'spdx-rdf', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_tv_with_known_licenses(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_known/expected.tv') - result = run_scan_click(['--format', 'spdx-tv', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_tv_with_license_ref(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_ref/expected.tv') - result = run_scan_click(['--format', 'spdx-tv', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_rdf_with_known_licenses_with_text(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_known/expected_with_text.rdf') - result = run_scan_click(['--format', 'spdx-rdf', '--license-text', test_dir, result_file]) - assert result.exit_code == 0 + result = run_scan_click([ '-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) + assert result.exit_code == 0 def test_spdx_rdf_with_license_ref_with_text(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_ref/expected_with_text.rdf') - result = run_scan_click(['--format', 'spdx-rdf', '--license-text', test_dir, result_file]) + result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) assert result.exit_code == 0 check_rdf_scan(expected_file, result_file) @@ -222,7 +222,7 @@ def test_spdx_tv_with_known_licenses_with_text(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_known/expected_with_text.tv') - result = run_scan_click(['--format', 'spdx-tv', '--license-text', test_dir, result_file]) + result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) assert result.exit_code == 0 check_tv_scan(expected_file, result_file) @@ -231,7 +231,7 @@ def test_spdx_tv_with_license_ref_with_text(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_ref/expected_with_text.tv') - result = run_scan_click(['--format', 'spdx-tv', '--license-text', test_dir, result_file]) + result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) assert result.exit_code == 0 check_tv_scan(expected_file, result_file) @@ -240,7 +240,7 @@ def test_spdx_tv_tree(): test_dir = test_env.get_test_loc('spdx/tree/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/tree/expected.tv') - result = run_scan_click(['--format', 'spdx-tv', test_dir, result_file]) + result = run_scan_click(['-clip', test_dir, '--output-spdx-tv', result_file]) assert result.exit_code == 0 check_tv_scan(expected_file, result_file) @@ -249,7 +249,7 @@ def test_spdx_rdf_tree(): test_dir = test_env.get_test_loc('spdx/tree/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/tree/expected.rdf') - result = run_scan_click(['--format', 'spdx-rdf', test_dir, result_file]) + result = run_scan_click(['-clip', test_dir, '--output-spdx-rdf', result_file]) assert result.exit_code == 0 check_rdf_scan(expected_file, result_file) @@ -260,9 +260,9 @@ def test_spdx_tv_with_unicode_license_text_does_not_fail(): expected_file = test_env.get_test_loc('spdx/unicode/expected.tv') rc, stdout, stderr = run_scan_plain([ '--license', '--copyright', '--info', - '--format', 'spdx-tv', '--strip-root', '--license-text', - '--diag', - test_file, result_file + '--strip-root', '--license-text', + '--license-diag', + test_file, '--output-spdx-tv', result_file ]) if rc != 0: print('stdout', stdout) @@ -277,9 +277,9 @@ def test_spdx_rdf_with_unicode_license_text_does_not_fail(): expected_file = test_env.get_test_loc('spdx/unicode/expected.rdf') rc, stdout, stderr = run_scan_plain([ '--license', '--copyright', '--info', - '--format', 'spdx-rdf', '--strip-root', '--license-text', - '--diag', - test_file, result_file + '--strip-root', '--license-text', + '--license-diag', + test_file, '--output-spdx-rdf', result_file ]) if rc != 0: print('stdout', stdout) @@ -294,9 +294,9 @@ def test_spdx_rdf_with_or_later_license_does_not_fail(): expected_file = test_env.get_test_loc('spdx/or_later/expected.rdf') rc, stdout, stderr = run_scan_plain([ '--license', '--copyright', '--info', - '--format', 'spdx-rdf', '--strip-root', '--license-text', - '--diag', - test_file, result_file + '--strip-root', '--license-text', + '--license-diag', + test_file, '--output-spdx-rdf', result_file ]) if rc != 0: print('stdout', stdout) diff --git a/tests/formattedcode/test_format_templated.py b/tests/formattedcode/test_output_templated.py similarity index 85% rename from tests/formattedcode/test_format_templated.py rename to tests/formattedcode/test_output_templated.py index edf1181e177..b044ceef1f7 100644 --- a/tests/formattedcode/test_format_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -35,6 +35,8 @@ from scancode import __version__ from scancode.cli_test_utils import run_scan_click +from plugincode import output +output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -44,7 +46,7 @@ def test_paths_are_posix_paths_in_html_app_format_output(): test_dir = test_env.get_test_loc('templated/simple') result_file = test_env.get_temp_file(extension='html', file_name='test_html') - result = run_scan_click(['--copyright', '--format', 'html-app', test_dir, result_file]) + result = run_scan_click(['--copyright', test_dir, '--output-html-app', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -59,7 +61,7 @@ def test_paths_are_posix_in_html_format_output(): test_dir = test_env.get_test_loc('templated/simple') result_file = test_env.get_temp_file('html') - result = run_scan_click(['--copyright', '--format', 'html', test_dir, result_file]) + result = run_scan_click(['--copyright', test_dir, '--output-html', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output results = open(result_file).read() @@ -71,11 +73,12 @@ def test_scanned_path_is_present_in_html_app_output(): test_dir = test_env.get_test_loc('templated/html_app') result_file = test_env.get_temp_file('test.html') - result = run_scan_click(['--copyright', '--format', 'html-app', test_dir, result_file]) + result = run_scan_click(['--copyright', '--output-html-app', result_file, test_dir]) assert result.exit_code == 0 assert 'Scanning done' in result.output results = open(result_file).read() + assert 'ScanCode scan results for: %(test_dir)s' % locals() in results assert '
' % locals() in results assert 'scan results for:' % locals() in results @@ -88,8 +91,8 @@ def test_scan_html_output_does_not_truncate_copyright_html(): result_file = test_env.get_temp_file('test.html') result = run_scan_click( - ['-clip', '--strip-root', '--format', 'html', '-n', '3', - test_dir, result_file]) + ['-clip', '--strip-root', '-n', '3', test_dir, + '--output-html', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -129,9 +132,11 @@ def test_custom_format_with_custom_filename_fails_for_directory(): test_dir = test_env.get_temp_dir('html') result_file = test_env.get_temp_file('html') - result = run_scan_click(['--format', test_dir, test_dir, result_file]) + result = run_scan_click(['--custom-template', test_dir, + '--output-custom', result_file, + test_dir]) assert result.exit_code != 0 - assert 'Unknwow or invalid template file path' in result.output + assert 'Invalid value for "--custom-template": Path' in result.output def test_custom_format_with_custom_filename(): @@ -139,7 +144,9 @@ def test_custom_format_with_custom_filename(): custom_template = test_env.get_test_loc('templated/sample-template.html') result_file = test_env.get_temp_file('html') - result = run_scan_click(['--format', custom_template, test_dir, result_file]) + result = run_scan_click(['--custom-template', custom_template, + '--output-custom', result_file, + test_dir]) assert result.exit_code == 0 results = open(result_file).read() assert 'Custom Template' in results From b160cd7e56d530201fc6e607654960ddb10d6071 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:45:39 +0100 Subject: [PATCH 046/122] Add new output_filter stage and plugins #787 * an output filter can filter the codebase resource tree (including breaking its tree shape) and is processed just before output * the only_findings plugins has been recated as a filter Signed-off-by: Philippe Ombredanne --- src/plugincode/output_filter.py | 65 ++++++++++++ .../data/plugin_only_findings/expected.json | 100 +++++++++++------- tests/scancode/test_plugin_only_findings.py | 9 +- 3 files changed, 135 insertions(+), 39 deletions(-) create mode 100644 src/plugincode/output_filter.py diff --git a/src/plugincode/output_filter.py b/src/plugincode/output_filter.py new file mode 100644 index 00000000000..1e0e0981dd8 --- /dev/null +++ b/src/plugincode/output_filter.py @@ -0,0 +1,65 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from plugincode import BasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker + + +stage = 'output_filter' +entrypoint = 'scancode_output_filter' + +output_filter_spec = HookspecMarker(project_name=stage) +output_filter_impl = HookimplMarker(project_name=stage) + + +@output_filter_spec +class OutputFilterPlugin(BasePlugin): + """ + Base plugin class for Resource output filter plugins that all output filter + plugins must extend. + """ + + # TODO: pass own command options name/values as concrete kwargs + def process_resource(self, resource, **kwargs): + """ + Return True is the `resource` should be kept, False if it should omitted + aka. filtered out of the Resource stream. + Subclasses must override. + """ + raise NotImplementedError + + +output_filter_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=OutputFilterPlugin +) diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index f6d45ca951a..db1bbb4bbe0 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -1,33 +1,37 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--only-findings": true + "input": "", + "--copyright": true, + "--info": true, + "--license": true, + "--only-findings": true, + "--output-json": "", + "--package": true }, "files_count": 3, "files": [ - { - "path": "basic.tgz", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] - }, - { - "path": "basic.tgz/basic", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] - }, - { - "path": "basic.tgz/basic/dir", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] - }, { "path": "basic.tgz/basic/dir/e.tar", + "type": "file", + "name": "e.tar", + "base_name": "e", + "extension": ".tar", + "date": "2015-06-19", + "size": 10240, + "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", + "md5": "393e789f4e4b2be93a46d0619380b445", + "files_count": 0, + "dirs_count": 0, + "mime_type": "application/x-tar", + "file_type": "POSIX tar archive (GNU)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": true, + "is_media": false, + "is_source": false, + "is_script": false, "scan_errors": [], "licenses": [], "copyrights": [], @@ -78,22 +82,27 @@ } ] }, - { - "path": "basic.tgz/basic/dir2", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] - }, - { - "path": "basic.tgz/basic/dir2/subdir", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] - }, { "path": "basic.tgz/basic/dir2/subdir/bcopy.s", + "type": "file", + "name": "bcopy.s", + "base_name": "bcopy", + "extension": ".s", + "date": "2015-06-19", + "size": 32452, + "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", + "md5": "e1c66adaf6b8aa90e348668ac4869a61", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/x-c", + "file_type": "C source, ASCII text, with CRLF line terminators", + "programming_language": "GAS", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, "scan_errors": [], "licenses": [ { @@ -144,6 +153,25 @@ }, { "path": "basic.tgz/basic/main.c", + "type": "file", + "name": "main.c", + "base_name": "main", + "extension": ".c", + "date": "2015-06-19", + "size": 1940, + "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", + "md5": "8d0a3b3fe1c96a49af2a66040193291b", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/x-c", + "file_type": "C source, ASCII text", + "programming_language": "C", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, "scan_errors": [], "licenses": [ { diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index f710703bf43..0d18991d617 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -34,6 +34,9 @@ from scancode.plugin_only_findings import has_findings from scancode.resource import Resource +from plugincode import output +output._TEST_MODE = True + class TestHasFindings(FileDrivenTesting): @@ -47,7 +50,7 @@ def test_has_findings(self): def test_has_findings_with_children(self): resource = Resource('name', 1, 2, 3, use_cache=False) resource.children_rids.append(1) - assert has_findings(resource) + assert not has_findings(resource) def test_has_findings_includes_errors(self): resource = Resource('name', 1, 2, 3, use_cache=False) @@ -61,5 +64,5 @@ def test_scan_only_findings(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_only_findings/expected.json') - _result = run_scan_click(['--only-findings', test_dir, '--json', result_file]) - check_json_scan(expected_file, result_file) + _result = run_scan_click(['-clip','--only-findings', test_dir, '--json', result_file]) + check_json_scan(expected_file, result_file, regen=False) From a19d6258cd92831d16351fbb86ca31dad6cf825c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:46:29 +0100 Subject: [PATCH 047/122] Add new housekeeping stage and plugins #787 * housekeeping plugins only expose eager options and do not run any scan Signed-off-by: Philippe Ombredanne --- src/plugincode/housekeeping.py | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/plugincode/housekeeping.py diff --git a/src/plugincode/housekeeping.py b/src/plugincode/housekeeping.py new file mode 100644 index 00000000000..f9a475c6223 --- /dev/null +++ b/src/plugincode/housekeeping.py @@ -0,0 +1,64 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from plugincode import BasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker + + +stage = 'housekeeping' +entrypoint = 'scancode_housekeeping' + +housekeeping_spec = HookspecMarker(project_name=stage) +housekeeping_impl = HookimplMarker(project_name=stage) + + +@housekeeping_spec +class HousekeepingPlugin(BasePlugin): + """ + Base plugin class for miscellaneous housekeeping plugins that are executed + eagerly and exclusively of all other options. + They must define only eager option flags that run with a Click callback + options. They scan nothing. + """ + pass + + def is_enabled(self): + """ + By design and because they are executed eagerly through a callback, an + HousekeepingPlugin is never "enabled" during scan processing. + """ + return False + + +housekeeping_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=HousekeepingPlugin +) From 861e9a1a08744f8b6e20b59faeebf53643ee01bb Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:50:50 +0100 Subject: [PATCH 048/122] Add new scan stage and plugins #787 #552 #698 * A scan plugin handles the scan of one resource at a time * Existing scans have been reworked as plugins Signed-off-by: Philippe Ombredanne --- src/plugincode/scan.py | 72 +++++++++++++++++++ src/scancode/plugin_copyright.py | 55 +++++++++++++++ src/scancode/plugin_email.py | 55 +++++++++++++++ src/scancode/plugin_license.py | 114 +++++++++++++++++++++++++++++++ src/scancode/plugin_package.py | 55 +++++++++++++++ src/scancode/plugin_url.py | 55 +++++++++++++++ 6 files changed, 406 insertions(+) create mode 100644 src/plugincode/scan.py create mode 100644 src/scancode/plugin_copyright.py create mode 100644 src/scancode/plugin_email.py create mode 100644 src/scancode/plugin_license.py create mode 100644 src/scancode/plugin_package.py create mode 100644 src/scancode/plugin_url.py diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py new file mode 100644 index 00000000000..1584628efd7 --- /dev/null +++ b/src/plugincode/scan.py @@ -0,0 +1,72 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from plugincode import BasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker + + +stage = 'scan' +entrypoint = 'scancode_scan' + +scan_spec = HookspecMarker(stage) +scan_impl = HookimplMarker(stage) + + +@scan_spec +class ScanPlugin(BasePlugin): + """ + A scan plugin base class that all scan plugins must extend. A scan plugin + provides a single `get_scanner()` method that returns a scanner function. + The key under which scan results are retruned for a scanner is the plugin + "name" attribute. This attribute is set automatically as the "entrypoint" + name used for this plugin. + """ + + # a relative sort order number (integer or float). In scan results, results + # from scanners are sorted by this sorted_order then by "key" which is the + # scanner plugin name + sort_order = 100 + + # TODO: pass own command options name/values as concrete kwargs + def get_scanner(self, **kwargs): + """ + Return a scanner callable that takes a single `location` argument. + This callable (typically a bare function) should carry as little state + as possible as it may be executed through multiprocessing. + Subclasses must override. + """ + raise NotImplementedError + + +scan_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=ScanPlugin +) diff --git a/src/scancode/plugin_copyright.py b/src/scancode/plugin_copyright.py new file mode 100644 index 00000000000..6922ebb6f44 --- /dev/null +++ b/src/scancode/plugin_copyright.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP + + +@scan_impl +class CopyrightScanner(ScanPlugin): + """ + Scan a Resource for copyrights. + """ + sort_order = 4 + + options = [ + CommandLineOption(('-c', '--copyright',), + is_flag=True, default=False, + help='Scan for copyrights.', + help_group=SCAN_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('copyright') + + def get_scanner(self, **kwargs): + from scancode.api import get_copyrights + return get_copyrights diff --git a/src/scancode/plugin_email.py b/src/scancode/plugin_email.py new file mode 100644 index 00000000000..fc3e95a3ff4 --- /dev/null +++ b/src/scancode/plugin_email.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import OTHER_SCAN_GROUP + + +@scan_impl +class EmailScanner(ScanPlugin): + """ + Scan a Resource for emails. + """ + sort_order = 8 + + options = [ + CommandLineOption(('-e', '--email',), + is_flag=True, default=False, + help='Scan for emails.', + help_group=OTHER_SCAN_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('email') + + def get_scanner(self, **kwargs): + from scancode.api import get_emails + return get_emails diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py new file mode 100644 index 00000000000..b8616865cdd --- /dev/null +++ b/src/scancode/plugin_license.py @@ -0,0 +1,114 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from functools import partial + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from plugincode.housekeeping import HousekeepingPlugin +from plugincode.housekeeping import housekeeping_impl +from scancode import CommandLineOption +from scancode import MISC_GROUP +from scancode import SCAN_OPTIONS_GROUP +from scancode import SCAN_GROUP +from scancode.api import DEJACODE_LICENSE_URL + + +@scan_impl +class LicenseScanner(ScanPlugin): + """ + Scan a Resource for licenses. + """ + sort_order = 2 + + options = [ + CommandLineOption(('-l', '--license'), + is_flag=True, default=False, + help='Scan for licenses.', + help_group=SCAN_GROUP), + + CommandLineOption(('--license-score',), + type=int, default=0, show_default=True, + help='Do not return license matches with a score lower than this score. ' + 'A number between 0 and 100.', + help_group=SCAN_OPTIONS_GROUP), + + CommandLineOption(('--license-text',), + is_flag=True, default=False, + help='Include the detected licenses matched text.', + help_group=SCAN_OPTIONS_GROUP), + + CommandLineOption(('--license-url-template',), + default=DEJACODE_LICENSE_URL, show_default=True, + help='Set the template URL used for the license reference URLs. ' + 'Curly braces ({}) are replaced by the license key.', + help_group=SCAN_OPTIONS_GROUP), + + CommandLineOption(('--license-diag',), + is_flag=True, default=False, + help='Include diagnostic information in license scan results.', + help_group=SCAN_OPTIONS_GROUP), + ] + + def is_enabled(self): + return self.is_command_option_enabled('license') + + def get_scanner(self, license_score=0, license_text=False, + license_url_template=DEJACODE_LICENSE_URL, license_diag=False, **kwargs): + from scancode.api import get_licenses + return partial(get_licenses, min_score=license_score, + include_text=license_text, diag=license_diag, + license_url_template=license_url_template) + + + +def reindex_licenses(ctx, param, value): + if not value or ctx.resilient_parsing: + return + + # TODO: check for temp file configuration and use that for the cache!!! + from licensedcode.cache import reindex + import click + click.echo('Checking and rebuilding the license index...') + reindex() + click.echo('Done.') + ctx.exit() + + +@housekeeping_impl +class LicenseIndexer(HousekeepingPlugin): + + options = [ + CommandLineOption( + ('--reindex-licenses',), + is_eager=True, is_flag=True, default=False, + callback=reindex_licenses, + help='Check the license index cache and reindex if needed.', + help_group=MISC_GROUP) + ] diff --git a/src/scancode/plugin_package.py b/src/scancode/plugin_package.py new file mode 100644 index 00000000000..bf009963150 --- /dev/null +++ b/src/scancode/plugin_package.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP + + +@scan_impl +class PackageScanner(ScanPlugin): + """ + Scan a Resource for Package manifests. + """ + sort_order = 6 + + options = [ + CommandLineOption(('-p', '--package',), + is_flag=True, default=False, + help='Scan for packages.', + help_group=SCAN_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('package') + + def get_scanner(self, **kwargs): + from scancode.api import get_package_info + return get_package_info diff --git a/src/scancode/plugin_url.py b/src/scancode/plugin_url.py new file mode 100644 index 00000000000..7dad1b20456 --- /dev/null +++ b/src/scancode/plugin_url.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import OTHER_SCAN_GROUP + + +@scan_impl +class UrlScanner(ScanPlugin): + """ + Scan a Resource for URLs. + """ + sort_order = 10 + + options = [ + CommandLineOption(('-u', '--url',), + is_flag=True, default=False, + help='Scan for urls.', + help_group=OTHER_SCAN_GROUP) + ] + + def is_enabled(self): + return self.is_command_option_enabled('url') + + def get_scanner(self, **kwargs): + from scancode.api import get_urls + return get_urls From 5b5c85cae56fb891d64ca0519624d9752b9d2c06 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:51:22 +0100 Subject: [PATCH 049/122] Add new output_filter stage and plugins #787 * an output filter can filter the codebase resource tree (including breaking its tree shape) and is processed just before output * the only_findings plugins has been recated as a filter Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_only_findings.py | 51 +++++++++++----------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index c5a4b391624..f40238448f6 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -25,50 +25,39 @@ from __future__ import absolute_import from __future__ import unicode_literals -from plugincode.post_scan import PostScanPlugin -from plugincode.post_scan import post_scan_impl +from plugincode.output_filter import OutputFilterPlugin +from plugincode.output_filter import output_filter_impl +from scancode import CommandLineOption +from scancode import OUTPUT_FILTER_GROUP -@post_scan_impl -class OnlyFindings(PostScanPlugin): +@output_filter_impl +class OnlyFindings(OutputFilterPlugin): """ - Prune files or directories without scan findings for the requested scans. + Filter files or directories without scan findings for the requested scans. """ - name = 'only-findings' - - @classmethod - def get_plugin_options(cls): - from scancode.cli import ScanOption - return [ - ScanOption(('--only-findings',), is_flag=True, - help=''' - Only return files or directories with findings for the requested - scans. Files and directories without findings are omitted (not - considering basic file information as findings).''') - ] + options = [ + CommandLineOption(('--only-findings',), is_flag=True, + help='Only return files or directories with findings for the ' + 'requested scans. Files and directories without findings are ' + 'omitted (file information is not treated as findings).', + help_group=OUTPUT_FILTER_GROUP) + ] def is_enabled(self): - return any(se.value == True for se in self.command_options - if se.name == 'only_findings') + return self.is_command_option_enabled('only_findings') - def process_codebase(self, codebase): + def process_resource(self, resource): """ - Remove Resources from codebase bottom-up if they have no scan data, no - errors and no children. + Return True if `resource` has finding e.g. if they have no scan data, no + errors. """ - for resource in codebase.walk(topdown=False): - if not has_findings(resource): - # TODO: test me, this is likely a source of bugs??? - codebase.remove_resource(resource) + return has_findings(resource) def has_findings(resource): """ Return True if this resource has findings. """ - return (resource.errors - or resource.children_rids - or any(resource.get_scans().values()) - # NEVER remove the root resource - or resource.is_root()) + return any(resource.get_scans().values() + resource.errors) From c7ec2977a5537619ed8b8ce299b0a8b37713f387 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:52:05 +0100 Subject: [PATCH 050/122] Update pre and post-scan plugins to new architecture * and refactor existing plugins to this approach Signed-off-by: Philippe Ombredanne --- src/plugincode/post_scan.py | 53 +++++++------------- src/plugincode/pre_scan.py | 54 +++++++------------- src/scancode/plugin_ignore.py | 79 +++++++++++++++++------------- src/scancode/plugin_mark_source.py | 32 +++++------- 4 files changed, 93 insertions(+), 125 deletions(-) diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index ed155f6a198..f165598d8f9 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -25,47 +25,30 @@ from __future__ import absolute_import from __future__ import unicode_literals -from collections import OrderedDict -import sys +from plugincode import CodebasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker -from pluggy import HookimplMarker -from pluggy import HookspecMarker -from pluggy import PluginManager -from plugincode import BasePlugin +stage = 'post_scan' +entrypoint = 'scancode_post_scan' - -post_scan_spec = HookspecMarker('post_scan') -post_scan_impl = HookimplMarker('post_scan') +post_scan_spec = HookspecMarker(project_name=stage) +post_scan_impl = HookimplMarker(project_name=stage) @post_scan_spec -class PostScanPlugin(BasePlugin): +class PostScanPlugin(CodebasePlugin): """ - A post-scan plugin base class. + A post-scan plugin base class that all post-scan plugins must extend. """ + pass -post_scan_plugins = PluginManager('post_scan') -post_scan_plugins.add_hookspecs(sys.modules[__name__]) - - -def initialize(): - """ - Load and validates plugins. - NOTE: this defines the entry points for use in setup.py - """ - post_scan_plugins.load_setuptools_entrypoints('scancode_post_scan') - for name, plugin in get_plugins().items(): - if not issubclass(plugin, PostScanPlugin): - raise Exception('Invalid post-scan plugin "%(name)s": does not extend "plugincode.post_scan.PostScanPlugin".' % locals()) - - -def get_plugins(): - """ - Return an ordered mapping of - "command line option name" --> "plugin callable" - for all the post_scan plugins. The mapping is sorted by option name. - This is the main API for other code to access post_scan plugins. - """ - return OrderedDict(sorted(post_scan_plugins.list_name_plugin())) +post_scan_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=PostScanPlugin +) diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index c720fe53d5a..913fe57f0fc 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -25,48 +25,30 @@ from __future__ import absolute_import from __future__ import unicode_literals -from collections import OrderedDict -import sys +from plugincode import CodebasePlugin +from plugincode import PluginManager +from plugincode import HookimplMarker +from plugincode import HookspecMarker -from pluggy import HookimplMarker -from pluggy import HookspecMarker -from pluggy import PluginManager -from plugincode import BasePlugin +stage = 'pre_scan' +entrypoint = 'scancode_pre_scan' - -pre_scan_spec = HookspecMarker('pre_scan') -pre_scan_impl = HookimplMarker('pre_scan') +pre_scan_spec = HookspecMarker(stage) +pre_scan_impl = HookimplMarker(stage) @pre_scan_spec -class PreScanPlugin(BasePlugin): +class PreScanPlugin(CodebasePlugin): """ - A pre-scan plugin base class. + A pre-scan plugin base class that all pre-scan plugins must extend. """ + pass -pre_scan_plugins = PluginManager('pre_scan') -pre_scan_plugins.add_hookspecs(sys.modules[__name__]) - - -def initialize(): - """ - NOTE: this defines the entry points for use in setup.py - Load and validates plugins. - """ - pre_scan_plugins.load_setuptools_entrypoints('scancode_pre_scan') - for name, plugin in get_plugins().items(): - if not issubclass(plugin, PreScanPlugin): - raise Exception( - 'Invalid pre-scan plugin "%(name)s": ' - 'does not extend "plugincode.pre_scan.PreScanPlugin".' % locals()) - - -def get_plugins(): - """ - Return an ordered mapping of plugin "name" --> plugin object - for all the pre-scan plugins. The mapping is sorted by name. - This is the main API for other code to access pre-scan plugins. - """ - return OrderedDict(sorted(pre_scan_plugins.list_name_plugin())) +pre_scan_plugins = PluginManager( + stage=stage, + module_qname=__name__, + entrypoint=entrypoint, + plugin_base_class=PreScanPlugin +) diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 285ac8ecc84..1e2f78db10f 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -25,17 +25,13 @@ from __future__ import absolute_import from __future__ import unicode_literals +from functools import partial + from commoncode.fileset import match from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl - - -def is_ignored(location, ignores): - """ - Return a tuple of (pattern , message) if a file at location is ignored or - False otherwise. `ignores` is a mappings of patterns to a reason. - """ - return match(location, includes=ignores, excludes={}) +from scancode import CommandLineOption +from scancode import PRE_SCAN_GROUP @pre_scan_impl @@ -43,44 +39,57 @@ class ProcessIgnore(PreScanPlugin): """ Ignore files matching the supplied pattern. """ - name = 'ignore' - def __init__(self, command_options): - super(ProcessIgnore, self).__init__(command_options) - ignores = [] - for se in command_options: - if se.name == 'ignore': - ignores = se.value or [] + options = [ + CommandLineOption(('--ignore',), + multiple=True, + metavar='', + help='Ignore files matching .', + help_group=PRE_SCAN_GROUP) + ] - self.ignores = { - pattern: 'User ignore: Supplied by --ignore' for pattern in ignores - } - - @classmethod - def get_plugin_options(cls): - from scancode.cli import ScanOption - return [ - ScanOption(('--ignore',), - multiple=True, - metavar='', - help='Ignore files matching .') - ] + def is_enabled(self): + return self.is_command_option_enabled('ignore') def process_codebase(self, codebase): """ Remove ignored Resources from the resource tree. """ + ignore_opt = self.get_command_option('ignore') + ignores = ignore_opt and ignore_opt.value or [] + if not ignores: + return + + ignores = { + pattern: 'User ignore: Supplied by --ignore' for pattern in ignores + } + + ignorable = partial(is_ignored, ignores=ignores) resources_to_remove = [] + resources_to_remove_append = resources_to_remove.append + + # first walk top down the codebase and collect ignored resource ids for resource in codebase.walk(topdown=True): - abs_path = resource.get_path(absolute=True) - if is_ignored(abs_path, ignores=self.ignores): - resources_to_remove.append(resource) + # FIXME: this should absolute==False!! + if ignorable(resource.get_path(absolute=True)): + resources_to_remove_append(resource) + + # then remove the collected ignored resource ids (that may remove whole + # trees at once) in a second step removed_rids = set() + removed_rids_update = removed_rids.update + remove_resource = codebase.remove_resource + for resource in resources_to_remove: if resource.rid in removed_rids: continue - pruned_rids = codebase.remove_resource(resource) - removed_rids.update(pruned_rids) + pruned_rids = remove_resource(resource) + removed_rids_update(pruned_rids) - def is_enabled(self): - return any(se.value for se in self.command_options if se.name == 'ignore') + +def is_ignored(location, ignores): + """ + Return a tuple of (pattern , message) if a file at location is ignored or + False otherwise. `ignores` is a mappings of patterns to a reason. + """ + return match(location, includes=ignores, excludes={}) diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 289bf06cf67..8db50a17dd0 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -29,6 +29,8 @@ from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl +from scancode import CommandLineOption +from scancode import POST_SCAN_GROUP @post_scan_impl @@ -39,39 +41,31 @@ class MarkSource(PostScanPlugin): Has no effect unless the --info scan is requested. """ - name = 'mark-source' + needs_info = True - @classmethod - def get_plugin_options(cls): - from scancode.cli import ScanOption - return [ - ScanOption(('--mark-source',), is_flag=True, - help=''' - Set the "is_source" flag to true for directories that contain - over 90% of source files as direct children. - Has no effect unless the --info scan is requested. - ''') - ] + options = [ + CommandLineOption(('--mark-source',), + is_flag=True,default=False, + help='Set the "is_source" to true for directories that contain ' + 'over 90% of source files as children and descendants. ' + 'Implies running the --info scan.', + help_group=POST_SCAN_GROUP) + ] def is_enabled(self): - # FIXME: we need infos for this to work, we should use a better way to - # express dependencies on one or more scan - return all(se.value for se in self.command_options - if se.name in ('mark_source', 'infos')) + return self.is_command_option_enabled('mark_source') def process_codebase(self, codebase): """ Set the `is_source` to True in directories if they contain over 90% of source code files at full depth. """ - codebase.update_counts() # TODO: these two nested walk() calls are not super efficient for resource in codebase.walk(topdown=False): if resource.is_file: continue src_count = sum(1 for c in resource.walk(topdown=True) if c.is_file and c.is_source) - files_count = resource.files_count - resource.is_source = is_source_directory(src_count, files_count) + resource.is_source = is_source_directory(src_count, resource.files_count) def is_source_directory(src_count, files_count): From 60bdb243bbb3fbd714c8330c107a2bc092f8415e Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 17 Jan 2018 22:57:55 +0100 Subject: [PATCH 051/122] New plugin and CLi architecture #787 #552 This is a major update of the code scancode processing. The scancode CLI has been reworked such that: * each plugin can have as many options as needed * plugins are organizaed by stages. New stages have been added for output_filter, scan and housekeeping * plugins work on a Codebase or a Resource which is an in-memory representation of a scanned filesystem Signed-off-by: Philippe Ombredanne --- setup.py | 110 +- src/plugincode/__init__.py | 293 +++- src/scancode/__init__.py | 38 +- src/scancode/api.py | 50 +- src/scancode/cli.py | 1265 ++++++++++------- src/scancode/cli_test_utils.py | 16 +- src/scancode/resource.py | 82 +- src/scancode/utils.py | 7 +- .../data/altpath/copyright.expected.json | 2 + .../data/composer/composer.expected.json | 2 + .../data/failing/patchelf.expected.json | 4 +- tests/scancode/data/help/help.txt | 145 +- tests/scancode/data/info/all.expected.json | 4 +- .../data/info/all.rooted.expected.json | 4 +- tests/scancode/data/info/basic.expected.json | 2 + .../data/info/basic.rooted.expected.json | 4 +- .../data/info/email_url_info.expected.json | 6 +- .../scancode/data/license_text/test.expected | 2 + .../data/non_utf8/expected-linux.json | 2 + .../scancode/data/non_utf8/expected-mac.json | 61 +- .../scancode/data/non_utf8/expected-win.json | 4 +- .../with_info.expected.json | 4 +- .../without_info.expected.json | 809 +++++------ ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 2 + .../data/single/iproute.expected.json | 2 + .../unicodepath.expected-linux.json | 10 +- .../unicodepath/unicodepath.expected-mac.json | 22 +- .../unicodepath/unicodepath.expected-win.json | 22 +- .../data/weird_file_name/expected-linux.json | 4 +- .../data/weird_file_name/expected-mac.json | 21 +- .../data/weird_file_name/expected-win.json | 21 +- tests/scancode/test_cli.py | 77 +- tests/scancode/test_extract_cli.py | 4 +- tests/scancode/test_plugin_ignore.py | 36 +- tests/scancode/test_plugin_mark_source.py | 7 +- 35 files changed, 1851 insertions(+), 1293 deletions(-) diff --git a/setup.py b/setup.py index cfb4b883a09..04d9d16bec0 100644 --- a/setup.py +++ b/setup.py @@ -200,39 +200,93 @@ def read(*names, **kwargs): 'extractcode = scancode.extract_cli:extractcode', ], - # scancode_output_writers is an entry point to define plugins - # that write a scan output in a given format. - # See the plugincode.output module for details and doc. - # note: the "name" of the entrypoint (e.g "html") becomes the - # ScanCode command line --format option used to enable a given - # format plugin - 'scancode_output_writers': [ - 'html = formattedcode.format_templated:write_html', - 'html-app = formattedcode.format_templated:write_html_app', - 'json = formattedcode.format_json:write_json_compact', - 'json-pp = formattedcode.format_json:write_json_pretty_printed', - 'spdx-tv = formattedcode.format_spdx:write_spdx_tag_value', - 'spdx-rdf = formattedcode.format_spdx:write_spdx_rdf', - 'csv = formattedcode.format_csv:write_csv', - 'jsonlines = formattedcode.format_jsonlines:write_jsonlines', + # scancode_pre_scan is the entry point for pre_scan plugins executed + # before the scans. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # See also plugincode.pre_scan module for details and doc. + 'scancode_pre_scan': [ + 'ignore = scancode.plugin_ignore:ProcessIgnore', + ], + + # scancode_scan is the entry point for scan plugins that run a scan + # after the pre_scan plugins and before the post_scan plugins. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # IMPORTANT: The plugin-name is also the "scan key" used in scan results + # for this scanner. + # + # See also plugincode.scan module for details and doc. + 'scancode_scan': [ + 'licenses = scancode.plugin_license:LicenseScanner', + 'copyrights = scancode.plugin_copyright:CopyrightScanner', + 'packages = scancode.plugin_package:PackageScanner', + 'emails = scancode.plugin_email:EmailScanner', + 'urls = scancode.plugin_url:UrlScanner', ], - # scancode_post_scan is an entry point for post_scan_plugins. - # See plugincode.post_scan module for details and doc. - # note: for simple plugins, the "name" of the entrypoint - # (e.g only-findings) becomes the ScanCode CLI boolean flag - # used to enable the plugin + # scancode_post_scan is the entry point for post_scan plugins executed + # after the scan plugins and before the output plugins. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # See also plugincode.post_scan module for details and doc. 'scancode_post_scan': [ - 'only-findings = scancode.plugin_only_findings:OnlyFindings', 'mark-source = scancode.plugin_mark_source:MarkSource', ], - # scancode_pre_scan is an entry point to define pre_scan plugins. - # See plugincode.pre_scan module for details and doc. - # note: the "name" of the entrypoint (e.g ignore) will be used for - # the option name which passes the input to the given pre_scan plugin - 'scancode_pre_scan': [ - 'ignore = scancode.plugin_ignore:ProcessIgnore', - ] + # scancode_output_filter is the entry point for filter plugins executed + # after the post-scan plugins and used by the output plugins to + # exclude/filter certain files or directories from the codebase. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # See also plugincode.post_scan module for details and doc. + 'scancode_output_filter': [ + 'only-findings2 = scancode.plugin_only_findings:OnlyFindings', + ], + + # scancode_output is the entry point for ouput plugins that write a scan + # output in a given format at the end of a scan. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # See also plugincode._output module for details and doc. + 'scancode_output': [ + 'html = formattedcode.output_html:HtmlOutput', + 'html-app = formattedcode.output_html:HtmlAppOutput', + 'json = formattedcode.output_json:JsonCompactOutput', + 'json-pp = formattedcode.output_json:JsonPrettyOutput', + 'spdx-tv = formattedcode.output_spdx:SpdxTvOutput', + 'spdx-rdf = formattedcode.output_spdx:SpdxRdfOutput', + 'csv = formattedcode.output_csv:CsvOutput', + 'jsonlines = formattedcode.output_jsonlines:JsonLinesOutput', + 'template = formattedcode.output_html:CustomTemplateOutput', + ], + + # scancode_housekeeping is the entry point for miscellaneous eager + # housekeeping plugins that only run their own Click callback instead of + # running the scans. + # + # Each entry hast this form: + # plugin-name = fully.qualified.module:PluginClass + # where plugin-name must be a unique name for this entrypoint. + # + # See also plugincode.housekeeping module for details and doc. + 'scancode_housekeeping': [ + 'ignore = scancode.plugin_license:LicenseIndexer', + ], }, ) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 9323c7eb47b..af2f38b34f3 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -27,67 +27,298 @@ from __future__ import print_function from __future__ import unicode_literals +from collections import OrderedDict +import sys + +from pluggy import HookimplMarker +from pluggy import HookspecMarker +from pluggy import PluginManager as PluggyPluginManager +from scancode import CommandLineOption + class BasePlugin(object): """ A base class for all ScanCode plugins. """ - # A short string describing this plugin, used for GUI display. The class - # name is used if not provided. Subclass should override + # List of stage:name strings that this plugin requires to run before it + # runs. + # Subclasses should set this as needed + requires = [] + + # List of CommandLineOption CLI options for this plugin. + # Subclasses should set this as needed + options = [] + + # flag set to True once this plugin class has been initialized by calling it + # setup() class method. + # This is set automatically when a plugin class is loaded in its manager. + # Subclasses must not set this. + initialized = False + + # stage string for this plugin. + # This is set automatically when a plugin class is loaded in its manager. + # Subclasses must not set this. + stage = None + + # name string under which this plugin is registered. + # This is set automatically when a plugin class is loaded in its manager. + # Subclasses must not set this. name = None + + # set to True for testing + _test_mode = False - # Tuple of scanner names that this plugin requires to run its own run - requires = tuple() - def __init__(self, command_options): + def __init__(self, command_options, *args, **kwargs): """ Initialize a new plugin with a list of user `command_options` (e.g. CommandOption tuples based on CLI keyword arguments). + Plugins can override as needed (still calling super). """ + self.options_by_name = {o.name: o for o in self.options} + self.command_options = command_options or [] - - @classmethod - def get_plugin_options(cls): - """ - Return a list of `ScanOption` objects for this plugin. - Subclasses must override and implement. - """ - raise NotImplementedError + self.command_options_by_name = {co.name: co for co in command_options} - def is_enabled(self): + # mapping of scan summary data and statistics. + # This is populated automatically on the plugin instance. + # Subclasses must not set this. + self.summary = OrderedDict() + + # TODO: pass own command options name/values as concrete kwargs + def is_enabled(self, **kwargs): """ Return True is this plugin is enabled by user-selected options. Subclasses must override. """ raise NotImplementedError - def setup(self): + # TODO: pass own command options name/values as concrete kwargs + def setup(self, **kwargs): """ Execute some setup for this plugin. This is guaranteed to be called - exactly one time after initialization. Must return True on sucess or - False otherwise. Subclasses can override as needed. + exactly one time at initialization if this plugin is enabled. + Must raise an Exception on failure. + Subclasses can override as needed. """ - return True + pass - def teardown(self): + # NOTE: Other methods below should NOT be overriden. + + @property + def qname(self): """ - Execute some teardown for this plugin. This is guaranteed to be called - exactly one time when ScanCode exists. Must return True on sucess or - False otherwise. Subclasses can override as needed. + Return the qualified name of this plugin. """ - return True + return '{self.stage}:{self.name}'.format(self=self) - def process_resource(self, resource): + def get_option(self, name): """ - Process a single `resource` Resource object. - Subclasses should override. + Return the CommandLineOption of this plugin with `name` or None. """ - pass + return self.options_by_name.get(name) - def process_codebase(self, codebase): + def get_command_option(self, name): + """ + Return a global CommandOption with `name` or None. + """ + return self.command_options_by_name.get(name) + + def is_command_option_enabled(self, name): + """ + Return True if the CommandOption with `name` is enabled. + """ + opt = self.get_command_option(name) + if opt: + return opt.value + + def get_own_command_options(self): + """ + Return a mapping of {name: CommandOption} that belong to this plugin. + """ + return {nco: co for nco, co in self.command_options_by_name.items() + if nco in self.options_by_name} + + def get_own_command_options_kwargs(self): + """ + Return a mapping of {name: value} for CommandOption objects that belong + to this plugin and suitable to use as kwargs for a function or method + call. + """ + return {nco: co.value for nco, co in self.get_own_command_options().items()} + + def is_active(self, plugins, *args, **kwargs): + """ + Return True is this plugin is enabled meaning it is enabled and all its + required plugins are enabled. + """ + return (self.is_enabled() + and all(p.is_enabled() for p in self.requirements(plugins))) + + def requirements(self, plugins, resolved=None): + """ + Return a tuple of (original list of `plugins` arg, as-is, list of unique + required plugins by this plugin recursively) given a `plugins` list of all + plugins and an optional list of already `resolved` plugins. + + Raise an Exception if there are inconsistencies in the plugins graph, + such as self-referencing plugins, missing plugins or requirements + cycles. + """ + if resolved is None: + resolved = [] + + qname = self.qname + required_qnames = unique(qn for qn in self.requires if qn != qname) + plugins_by_qname = {p.qname: p for p in plugins} + resolved_by_qname = {p.qname: p for p in resolved} + + direct_requirements = [] + for required_qname in self.requires: + + if required_qname == self.name: + raise Exception( + 'Plugin %(qname)r cannot require itself.' % locals()) + + if required_qname not in plugins_by_qname: + raise Exception( + 'Missing required plugin %(required_qname)r ' + 'for plugin %(qname)r.' % locals()) + + if required_qname in resolved_by_qname: + # already satisfied + continue + + required = plugins_by_qname[required_qname] + direct_requirements.append(required) + resolved.append(required) + + for required in direct_requirements: + plugins, resolved = required.walk_requirements(plugins, resolved) + + if self in resolved: + req_chain = ' -> '.join(p.qname for p in resolved) + raise Exception( + 'Requirements for plugin %(qname)r are circular: ' + '%(req_chain)s.' % locals()) + + return plugins, resolved + + +class CodebasePlugin(BasePlugin): + """ + Base class for plugins that process a whole codebase at once. + """ + # flag set to True if this plugin needs file information available to run. + # Subclasses should set this as needed. + needs_info = False + + def process_codebase(self, codebase, *args, **kwargs): """ Process a `codebase` Codebase object updating its Reousrce as needed. Subclasses should override. """ - for resource in codebase.walk(): - self.process_resource(resource) + raise NotImplementedError + + +def unique(iterable): + """ + Return a sequence of unique items in `iterable` keeping their original order. + """ + seen = set() + uni = [] + for item in iterable: + if item in seen: + continue + uni.append(item) + seen.add(item) + return uni + + +class PluginManager(object): + """ + A PluginManager class for plugins. + """ + + # a global managers cache as a mapping of {stage: manager instance} + managers = {} + + def __init__(self, stage, module_qname, entrypoint, plugin_base_class): + """ + Initialize this manager for the `stage` string in + module `module_qname` with plugins loaded from the setuptools + `entrypoint` that must subclass `plugin_base_class`. + """ + self.manager = PluggyPluginManager(project_name=stage) + self.managers[stage] = self + + self.stage = stage + self.entrypoint = entrypoint + self.plugin_base_class = plugin_base_class + self.manager.add_hookspecs(sys.modules[module_qname]) + + # set to True once this manager is initialized by running its setup() + self.initialized = False + + # mapping of {plugin.name: plugin_class} for all the plugins of this + # manager + self.plugin_classes = OrderedDict() + + @classmethod + def setup_all(cls): + """ + Setup the plugins enviroment. + Must be called once to initialize all the plugins of all managers. + """ + plugin_classes = [] + plugin_options = [] + for _stage, manager in cls.managers.items(): + mplugin_classes, mplugin_options = manager.setup() + plugin_classes.extend(mplugin_classes) + plugin_options.extend(mplugin_options) + return plugin_classes, plugin_options + + def setup(self): + """ + Return a tuple of (list of all plugin classes, list of all options of + all plugin classes). + + Load and validate available plugins for this PluginManager from its + assigned `entrypoint`. Raise an Exception if a plugin is not valid such + that when it does not subcclass the manager `plugin_base_class`. + Must be called once to setup the plugins if this manager. + """ + if self.initialized: + return + + entrypoint = self.entrypoint + self.manager.load_setuptools_entrypoints(entrypoint) + stage = self.stage + + plugin_options = [] + for name, plugin_class in self.manager.list_name_plugin(): + + if not issubclass(plugin_class, self.plugin_base_class): + qname = '%(entrypoint)s:%(name)s' % locals() + raise Exception( + 'Invalid plugin: %(qname)r: %(plugin_class)r ' + 'must extend %(plugin_base_class)r.' % locals()) + + + for option in plugin_class.options: + if not isinstance(option, CommandLineOption): + qname = '%(entrypoint)s:%(name)s' % locals() + oname = option.name + clin = CommandLineOption + raise Exception( + 'Invalid plugin: %(qname)r: option %(oname)r ' + 'must extend %(clin)r.' % locals()) + plugin_options.append(option) + + plugin_class.stage = stage + plugin_class.name = name + + self.plugin_classes[name] = plugin_class + + self.initialized = True + return self.plugin_classes.values(), plugin_options diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index c75ca34b5d1..b1cc5c71fb9 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -25,6 +25,7 @@ from __future__ import print_function from __future__ import absolute_import +from collections import namedtuple from os.path import dirname from os.path import abspath from os.path import getsize @@ -55,21 +56,44 @@ __version__ = '2.2.1' -class ScanOption(click.Option): +# CLI help groups +SCAN_GROUP = 'primary scans' +SCAN_OPTIONS_GROUP = 'scan options' +OTHER_SCAN_GROUP = 'other scans' +OUTPUT_GROUP = 'output formats' +OUTPUT_FILTER_GROUP = 'output filters' +OUTPUT_CONTROL_GROUP = 'output control' +PRE_SCAN_GROUP = 'pre-scan' +POST_SCAN_GROUP = 'post-scan' +MISC_GROUP = 'miscellaneous' +CORE_GROUP = 'core' + + +# Holds a CLI option actual name/value and its corresponding +# click.Parameter instance +CommandOption = namedtuple('CommandOption', 'help_group name value param') + +# Holds a scan plugin result "key and the corresponding function. +# click.Parameter instance +Scanner = namedtuple('Scanner', 'key function') + + +class CommandLineOption(click.Option): """ - Allow an extra param `group` to be set which can be used - to determine to which group the option belongs. + An option with an extra `help_group` attribute that tells which CLI help group + the option belongs. """ def __init__(self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, group=None, expose_value=True, **attrs): + type=None, help=None, expose_value=True, + help_group=MISC_GROUP, + **attrs): - super(ScanOption, self).__init__(param_decls, show_default, + super(CommandLineOption, self).__init__(param_decls, show_default, prompt, confirmation_prompt, hide_input, is_flag, flag_value, multiple, count, allow_from_autoenv, type, help, **attrs) - - self.group = group + self.help_group = help_group diff --git a/src/scancode/api.py b/src/scancode/api.py index 75c02efb29e..c8488aafdf8 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,19 +22,20 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import print_function from __future__ import absolute_import +from __future__ import division +from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from os.path import getsize -from commoncode.hash import multi_checksums from commoncode.filetype import get_last_modified_date from commoncode.filetype import get_type as get_simple_type from commoncode.filetype import is_file as filetype_is_file from commoncode.fileutils import file_name from commoncode.fileutils import splitext +from commoncode.hash import multi_checksums from commoncode.system import on_linux from typecode.contenttype import get_type @@ -42,26 +43,14 @@ """ Main scanning functions. -Each scanner is a function that accepts a location and returns an iterable of -results. +Each scanner is a function that accepts a location and returns a sequence of +mappings as results. Note: this API is unstable and still evolving. """ -def extract_archives(location, recurse=True): - """ - Extract any archives found at `location` and yield ExtractEvents. If - `recurse` is True, extracts nested archives-in- archives - recursively. - """ - from extractcode.extract import extract - from extractcode import default_kinds - for xevent in extract(location, kinds=default_kinds, recurse=recurse): - yield xevent - - -def get_copyrights(location): +def get_copyrights(location, **kwargs): """ Return a list of mappings for copyright detected in the file at `location`. """ @@ -79,7 +68,7 @@ def get_copyrights(location): return results -def get_emails(location): +def get_emails(location, **kwargs): """ Return a list of mappings for emails detected in the file at `location`. """ @@ -96,7 +85,7 @@ def get_emails(location): return results -def get_urls(location): +def get_urls(location, **kwargs): """ Return a list of mappings for urls detected in the file at `location`. """ @@ -118,7 +107,7 @@ def get_urls(location): def get_licenses(location, min_score=0, include_text=False, diag=False, - license_url_template=DEJACODE_LICENSE_URL): + license_url_template=DEJACODE_LICENSE_URL, **kwargs): """ Return a list of mappings for licenses detected in the file at `location`. @@ -182,7 +171,7 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, return results -def get_package_infos(location): +def get_package_info(location, **kwargs): """ Return a list of mappings for package information detected in the file at `location`. @@ -195,7 +184,7 @@ def get_package_infos(location): return results -def get_file_info(location): +def get_file_info(location, **kwargs): """ Return a list of mappings for file information collected for the file or directory at `location`. @@ -231,3 +220,18 @@ def get_file_info(location): result['is_script'] = bool(collector.is_script) return results + + +def extract_archives(location, recurse=True): + """ + Yield ExtractEvent while extracting archive(s) and compressed files at + `location`. If `recurse` is True, extract nested archives-in-archives + recursively. + Archives and compressed files are extracted in a directory named + "-extract" created in the same directory as the archive. + Note: this API is returning an iterable and NOT a sequence. + """ + from extractcode.extract import extract + from extractcode import default_kinds + for xevent in extract(location, kinds=default_kinds, recurse=recurse): + yield xevent diff --git a/src/scancode/cli.py b/src/scancode/cli.py index da9de92d2cc..a760922c3ad 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -30,13 +30,12 @@ # Import early because this import has monkey-patching side effects from scancode.pool import get_pool -from collections import namedtuple from collections import OrderedDict from functools import partial from itertools import imap -import os -from os.path import expanduser from os.path import abspath +from os.path import dirname +from os.path import join import sys from time import time import traceback @@ -44,29 +43,40 @@ import click click.disable_unicode_literals_warning = True -from commoncode.fileutils import create_dir from commoncode.fileutils import PATH_TYPE +from commoncode.timeutils import time2tstamp -import plugincode.output -import plugincode.post_scan -import plugincode.pre_scan +from plugincode import CommandLineOption +from plugincode import PluginManager + +# these are important to register plugin managers +from plugincode import housekeeping +from plugincode import pre_scan +from plugincode import scan +from plugincode import post_scan +from plugincode import output_filter +from plugincode import output from scancode import __version__ as version -from scancode import ScanOption -from scancode.api import DEJACODE_LICENSE_URL -from scancode.api import get_copyrights -from scancode.api import get_emails +from scancode import CORE_GROUP +from scancode import MISC_GROUP +from scancode import OTHER_SCAN_GROUP +from scancode import OUTPUT_GROUP +from scancode import OUTPUT_FILTER_GROUP +from scancode import OUTPUT_CONTROL_GROUP +from scancode import POST_SCAN_GROUP +from scancode import PRE_SCAN_GROUP +from scancode import SCAN_GROUP +from scancode import SCAN_OPTIONS_GROUP +from scancode import CommandOption +from scancode import Scanner from scancode.api import get_file_info -from scancode.api import get_licenses -from scancode.api import get_package_infos -from scancode.api import get_urls from scancode.interrupt import DEFAULT_TIMEOUT from scancode.interrupt import interruptible from scancode.resource import Codebase -from scancode.resource import Resource from scancode.utils import BaseCommand -from scancode.utils import progressmanager from scancode.utils import path_progress_message +from scancode.utils import progressmanager # Python 2 and 3 support try: @@ -80,16 +90,26 @@ unicode = str # @ReservedAssignment -echo_stderr = partial(click.secho, err=True) +# Tracing flags +TRACE = False +TRACE_DEEP = False -# this discovers and validates avialable plugins -plugincode.pre_scan.initialize() -plugincode.output.initialize() -plugincode.post_scan.initialize() +def logger_debug(*args): + pass +if TRACE or TRACE_DEEP: + import logging -CommandOption = namedtuple('CommandOption', 'group, name, option, value, default') -Scanner = namedtuple('Scanner', 'name function is_enabled') + logger = logging.getLogger(__name__) + logging.basicConfig(stream=sys.stdout) + logger.setLevel(logging.DEBUG) + + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, unicode) + and a or repr(a) for a in args)) + + +echo_stderr = partial(click.secho, err=True) info_text = ''' @@ -98,7 +118,7 @@ ''' -notice_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'NOTICE') +notice_path = join(abspath(dirname(__file__)), 'NOTICE') notice_text = open(notice_path).read() delimiter = '\n\n\n' @@ -111,14 +131,6 @@ notice = acknowledgment_text.strip().replace(' ', '') -# CLI help groups -SCANS = 'scans' -OUTPUT = 'output' -PRE_SCAN = 'pre-scan' -POST_SCAN = 'post-scan' -MISC = 'misc' -CORE = 'core' - def print_about(ctx, param, value): if not value or ctx.resilient_parsing: @@ -127,64 +139,71 @@ def print_about(ctx, param, value): ctx.exit() +# FIXME: this should be pushed out in some external help or pushed down in plugins. +# FIXME: the glob story is very weird!!! examples_text = ''' Scancode command lines examples: (Note for Windows: use '\\' back slash instead of '/' forward slash for paths.) -Scan the 'samples' directory for licenses and copyrights. Save scan results to -an HTML app file for interactive scan results navigation. When the scan is done, -open 'scancode_result.html' in your web browser. Note that additional app files -are saved in a directory named 'scancode_result_files': - - scancode --format html-app samples/ scancode_result.html - -Scan a directory for licenses and copyrights. Save scan results to an -HTML file: - - scancode --format html samples/zlib scancode_result.html - Scan a single file for copyrights. Print scan results to stdout as JSON: - scancode --copyright samples/zlib/zlib.h + scancode --copyright samples/zlib/zlib.h --json Scan a single file for licenses, print verbose progress to stderr as each file is scanned. Save scan to a JSON file: - scancode --license --verbose samples/zlib/zlib.h licenses.json + scancode --license --verbose samples/zlib/zlib.h --json licenses.json Scan a directory explicitly for licenses and copyrights. Redirect JSON scan results to a file: - scancode -f json -l -c samples/zlib/ > scan.json + scancode --json -l -c samples/zlib/ > scan.json -Scan a directory while ignoring a single file. Print scan results to stdout as JSON: +Scan a directory while ignoring a single file. +Print scan results to stdout as JSON: - scancode --ignore README samples/ + scancode --json --ignore README samples/ -Scan a directory while ignoring all files with txt extension. Print scan results to -stdout as JSON (It is recommended to use quoted glob patterns to prevent pattern -expansion by the shell): +Scan a directory while ignoring all files with .txt extension. +Print scan results to stdout as JSON. +It is recommended to use quotes around glob patterns to prevent pattern +expansion by the shell: - scancode --ignore "*.txt" samples/ + scancode --json --ignore "*.txt" samples/ Special characters supported in GLOB pattern: -* matches everything -? matches any single character -[seq] matches any character in seq -[!seq] matches any character not in seq +- * matches everything +- ? matches any single character +- [seq] matches any character in seq +- [!seq] matches any character not in seq + +For a literal match, wrap the meta-characters in brackets. +For example, '[?]' matches the character '?'. +For details on GLOB patterns see https://en.wikipedia.org/wiki/Glob_(programming). -For a literal match, wrap the meta-characters in brackets. For example, '[?]' matches the character '?'. -For glob see https://en.wikipedia.org/wiki/Glob_(programming). +Note: Glob patterns cannot be applied to path as strings. +For example, this will not ignore "samples/JGroups/licenses". -Note: Glob patterns cannot be applied to path as strings, for e.g. - scancode --ignore "samples*licenses" samples/ -will not ignore "samples/JGroups/licenses". + scancode --json --ignore "samples*licenses" samples/ -Scan a directory while ignoring multiple files (or glob patterns). Print the scan -results to stdout as JSON: - scancode --ignore README --ignore "*.txt" samples/ +Scan a directory while ignoring multiple files (or glob patterns). +Print the scan results to stdout as JSON: + + scancode --json --ignore README --ignore "*.txt" samples/ + +Scan the 'samples' directory for licenses and copyrights. Save scan results to +an HTML app file for interactive scan results navigation. When the scan is done, +open 'scancode_result.html' in your web browser. Note that additional app files +are saved in a directory named 'scancode_result_files': + + scancode --output-html-app scancode_result.html samples/ + +Scan a directory for licenses and copyrights. Save scan results to an +HTML file: + + scancode --output-html scancode_result.html samples/zlib To extract archives, see the 'extractcode' command instead. ''' @@ -204,30 +223,20 @@ def print_version(ctx, param, value): ctx.exit() -def reindex_licenses(ctx, param, value): - if not value or ctx.resilient_parsing: - return - from licensedcode import cache - click.echo('Checking and rebuilding the license index...') - cache.reindex() - click.echo('Done.') - ctx.exit() - - +# FIXME: this should be pushed out in some external help or pushed down in plugins. epilog_text = '''Examples (use --examples for more): \b Scan the 'samples' directory for licenses and copyrights. Save scan results to a JSON file: - scancode --format json samples scancode_result.json + scancode --license --copyright --output-json=scancode_result.json samples \b -Scan the 'samples' directory for licenses and copyrights. Save scan results to -an HTML app file for interactive web browser results navigation. Additional app -files are saved to the 'myscan_files' directory: +Scan the 'samples' directory for licenses and package manifests. Print scan +results on screen as pretty-formatted JSON: - scancode --format html-app samples myscan.html + scancode --json-pp --license --package samples Note: when you run scancode, a progress bar is displayed with a counter of the number of files processed. Use --verbose to display file-by-file progress. @@ -236,9 +245,10 @@ def reindex_licenses(ctx, param, value): class ScanCommand(BaseCommand): """ - A command class that is aware of ScanCode plugins and provides help where - each option is grouped by group. + A command class that is aware of ScanCode options that provides enhanced + help where each option is grouped by group. """ + short_usage_help = ''' Try 'scancode --help' for help on options and arguments.''' @@ -246,434 +256,605 @@ def __init__(self, name, context_settings=None, callback=None, params=None, help=None, # @ReservedAssignment epilog=None, short_help=None, options_metavar='[OPTIONS]', add_help_option=True, - plugins_by_group=()): + plugin_options=()): + """ + Create a new ScanCommand using the `plugin_options` list of + CommandLineOption instances. + """ super(ScanCommand, self).__init__(name, context_settings, callback, - params, help, epilog, short_help, options_metavar, add_help_option) - - for group, plugins in plugins_by_group: - for pname, plugin in sorted(plugins.items()): - for option in plugin.get_plugin_options(): - if not isinstance(option, ScanOption): - raise Exception( - 'Invalid plugin option "%(pname)s": option is not ' - 'an instance of "ScanOption".' % locals()) - - # normalize the help text, which may otherwise be messy - option.help = option.help and ' '.join(option.help.split()) - option.group = group - # this makes the plugin options "known" from the command - self.params.append(option) + params, help, epilog, short_help, options_metavar, add_help_option) + + # this makes the options "known" to the command + self.params.extend(plugin_options) def format_options(self, ctx, formatter): """ Overridden from click.Command to write all options into the formatter in - groups they belong to. If a group is not specified, add the option to - MISC group. + help_groups they belong to. If a group is not specified, add the option + to MISC_GROUP group. """ # this mapping defines the CLI help presentation order - groups = OrderedDict([ - (SCANS, []), - (OUTPUT, []), - (PRE_SCAN, []), - (POST_SCAN, []), - (MISC, []), - (CORE, []), + help_groups = OrderedDict([ + (SCAN_GROUP, []), + (OTHER_SCAN_GROUP, []), + (SCAN_OPTIONS_GROUP, []), + (OUTPUT_GROUP, []), + (OUTPUT_FILTER_GROUP, []), + (OUTPUT_CONTROL_GROUP, []), + (PRE_SCAN_GROUP, []), + (POST_SCAN_GROUP, []), + (CORE_GROUP, []), + (MISC_GROUP, []), ]) for param in self.get_params(ctx): # Get the list of option's name and help text help_record = param.get_help_record(ctx) if help_record: - if getattr(param, 'group', None): - groups[param.group].append(help_record) + if getattr(param, 'help_group', None): + # if we have a group, organize options by group + help_groups[param.help_group].append(help_record) else: # use the misc group if no group is defined - groups['misc'].append(help_record) + help_groups[MISC_GROUP].append(help_record) with formatter.section('Options'): - for group, option in groups.items(): - if option: - with formatter.section(group): - formatter.write_dl(option) - - -def validate_formats(ctx, param, value): - """ - Validate formats and template files. Raise a BadParameter on errors. - """ - value_lower = value.lower() - if value_lower in plugincode.output.get_plugins(): - return value_lower - # render using a user-provided custom format template - if not os.path.isfile(value): - raise click.BadParameter( - 'Unknwow or invalid template file path: "%(value)s" ' - 'does not exist or is not readable.' % locals()) - return value + for group, option in help_groups.items(): + if not option: + continue + with formatter.section(group): + formatter.write_dl(option) +# TODO: Implmenet me as a proper callback with partial def validate_exclusive(ctx, exclusive_options): """ - Validate mutually exclusive options. - Raise a UsageError with on errors. + Validate a list of mutually `exclusive_options` names. + Raise a UsageError on errors. """ ctx_params = ctx.params - selected_options = [ctx_params[eop] for eop in exclusive_options if ctx_params[eop]] - if len(selected_options) > 1: + options = [ctx_params[eop] for eop in exclusive_options if ctx_params[eop]] + if len(options) > 1: msg = ' and '.join('`' + eo.replace('_', '-') + '`' for eo in exclusive_options) msg += ' are mutually exclusion options. You can use only one of them.' raise click.UsageError(msg) -# collect plugins for each group and add plugins options to the command -# params -_plugins_by_group = [ - (PRE_SCAN, plugincode.pre_scan.get_plugins()), - (POST_SCAN, plugincode.post_scan.get_plugins()), -] +# IMPORTANT: this discovers, loads and validates all available plugins +plugin_classes, plugin_options = PluginManager.setup_all() + + +def print_plugins(ctx, param, value): + if not value or ctx.resilient_parsing: + return + for plugin_cls in sorted(plugin_classes, key=lambda pc: (pc.stage, pc.name)): + click.echo('Plugin: scancode_{self.stage}:{self.name}'.format(self=plugin_cls), nl=False) + click.echo(' class: {self.__module__}:{self.__name__}'.format(self=plugin_cls)) + requires = ', '.join(plugin_cls.requires) + click.echo(' requires: {}'.format(requires), nl=False) + needs_info = getattr(plugin_cls, 'needs_info', False) + if needs_info: + click.echo(' needs_info: yes') + else: + click.echo('') + click.echo(' doc: {self.__doc__}'.format(self=plugin_cls)) + click.echo(' options:'.format(self=plugin_cls)) + for option in plugin_cls.options: + name = option.name + opts = ', '.join(option.opts) + help_group = option.help_group + click.echo(' {help_group!s}, {name!s}: {opts}'.format(**locals())) + click.echo('') + ctx.exit() + + +@click.command(name='scancode', + epilog=epilog_text, + cls=ScanCommand, + plugin_options=plugin_options) -@click.command(name='scancode', epilog=epilog_text, cls=ScanCommand, plugins_by_group=_plugins_by_group) @click.pass_context # ensure that the input path is bytes on Linux, unicode elsewhere -@click.argument('input', metavar='', type=click.Path(exists=True, readable=True, path_type=PATH_TYPE)) -@click.argument('output_file', default='-', metavar='', type=click.File(mode='wb', lazy=False)) - -# Note that click's 'default' option is set to 'false' here despite these being documented to be enabled by default in -# order to more elegantly enable all of these (see code below) if *none* of the command line options are specified. -@click.option('-c', '--copyright', '--copyrights', is_flag=True, default=False, help='Scan for copyrights. [default]', group=SCANS, cls=ScanOption) -@click.option('-l', '--license', '--licenses', is_flag=True, default=False, help='Scan for licenses. [default]', group=SCANS, cls=ScanOption) -@click.option('-p', '--package', '--packages', is_flag=True, default=False, help='Scan for packages. [default]', group=SCANS, cls=ScanOption) - -@click.option('-e', '--email', '--emails', is_flag=True, default=False, help='Scan for emails.', group=SCANS, cls=ScanOption) -@click.option('-u', '--url', '--urls', is_flag=True, default=False, help='Scan for urls.', group=SCANS, cls=ScanOption) -@click.option('-i', '--info', '--infos', is_flag=True, default=False, help='Include information such as size, type, etc.', group=SCANS, cls=ScanOption) - -@click.option('--license-score', is_flag=False, default=0, type=int, show_default=True, - help='Do not return license matches with scores lower than this score. A number between 0 and 100.', group=SCANS, cls=ScanOption) -@click.option('--license-text', is_flag=True, default=False, - help='Include the detected licenses matched text. Has no effect unless --license is requested.', group=SCANS, cls=ScanOption) -@click.option('--license-url-template', is_flag=False, default=DEJACODE_LICENSE_URL, show_default=True, - help='Set the template URL used for the license reference URLs. In a template URL, curly braces ({}) are replaced by the license key.', group=SCANS, cls=ScanOption) -@click.option('--strip-root', is_flag=True, default=False, - help='Strip the root directory segment of all paths. The default is to always ' - 'include the last directory segment of the scanned path such that all paths have a common root directory. ' - 'This cannot be combined with `--full-root` option.', group=OUTPUT, cls=ScanOption) -@click.option('--full-root', is_flag=True, default=False, - help='Report full, absolute paths. The default is to always ' - 'include the last directory segment of the scanned path such that all paths have a common root directory. ' - 'This cannot be combined with the `--strip-root` option.', group=OUTPUT, cls=ScanOption) - -@click.option('-f', '--format', is_flag=False, default='json', show_default=True, metavar='', - help=('Set format to one of: %s or use ' - 'as the path to a custom template file' % ', '.join(plugincode.output.get_plugins())), - callback=validate_formats, group=OUTPUT, cls=ScanOption) - -@click.option('--verbose', is_flag=True, default=False, help='Print verbose file-by-file progress messages.', group=OUTPUT, cls=ScanOption) -@click.option('--quiet', is_flag=True, default=False, help='Do not print summary or progress messages.', group=OUTPUT, cls=ScanOption) - -@click.help_option('-h', '--help', group=CORE, cls=ScanOption) -@click.option('-n', '--processes', is_flag=False, default=1, type=int, show_default=True, help='Scan using n parallel processes.', group=CORE, cls=ScanOption) -@click.option('--examples', is_flag=True, is_eager=True, callback=print_examples, help=('Show command examples and exit.'), group=CORE, cls=ScanOption) -@click.option('--about', is_flag=True, is_eager=True, callback=print_about, help='Show information about ScanCode and licensing and exit.', group=CORE, cls=ScanOption) -@click.option('--version', is_flag=True, is_eager=True, callback=print_version, help='Show the version and exit.', group=CORE, cls=ScanOption) - -@click.option('--diag', is_flag=True, default=False, help='Include additional diagnostic information such as error messages or result details.', group=CORE, cls=ScanOption) -@click.option('--timeout', is_flag=False, default=DEFAULT_TIMEOUT, type=float, show_default=True, help='Stop scanning a file if scanning takes longer than a timeout in seconds.', group=CORE, cls=ScanOption) -@click.option('--no-cache', is_flag=True, default=False, is_eager=False, help='Do not use on-disk cache for scan results. Faster but uses more memory.', group=CORE, cls=ScanOption) -@click.option('--reindex-licenses', is_flag=True, default=False, is_eager=True, callback=reindex_licenses, help='Force a check and possible reindexing of the cached license index.', group=MISC, cls=ScanOption) - -def scancode(ctx, - input, # @ReservedAssignment - output_file, infos, - verbose, quiet, processes, diag, timeout, no_cache, +@click.argument('input', metavar=' ', + type=click.Path(exists=True, readable=True, path_type=PATH_TYPE)) + +@click.option('-i', '--info', + is_flag=True, default=False, + help='Scan for file information (size, type, checksums, etc).', + help_group=OTHER_SCAN_GROUP, cls=CommandLineOption) + +@click.option('--strip-root', + is_flag=True, default=False, + help='Strip the root directory segment of all paths. The default is to ' + 'always include the last directory segment of the scanned path such ' + 'that all paths have a common root directory.', + help_group=OUTPUT_CONTROL_GROUP, cls=CommandLineOption) + +@click.option('--full-root', + is_flag=True, default=False, + help='Report full, absolute paths. The default is to always ' + 'include the last directory segment of the scanned path such that all ' + 'paths have a common root directory.', + help_group=OUTPUT_CONTROL_GROUP, cls=CommandLineOption) + +@click.option('--verbose', + is_flag=True, default=False, + help='Print progress as file-by-file path instead of a progress bar. ' + 'Print a verbose scan summary.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--quiet', + is_flag=True, default=False, + help='Do not print summary or progress.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.help_option('-h', '--help', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('-n', '--processes', + type=int, default=1, + metavar='INT', + help='Set the number of parallel processes to use. ' + 'Disable parallel processing if 0. [default: 1]', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--examples', + is_flag=True, is_eager=True, + callback=print_examples, + help=('Show command examples and exit.'), + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--about', + is_flag=True, is_eager=True, + callback=print_about, + help='Show information about ScanCode and licensing and exit.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--version', + is_flag=True, is_eager=True, + callback=print_version, + help='Show the version and exit.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--timeout', + type=float, default=DEFAULT_TIMEOUT, + metavar='', + help='Stop an unfinished file scan after a timeout in seconds. ' + '[default: %d]' % DEFAULT_TIMEOUT, + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--plugins', + is_flag=True, is_eager=True, + callback=print_plugins, + help='Print the list of available ScanCode plugins.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--no-cache', + is_flag=True, default=False, + help='Do not use on-disk cache for intermediate results. Uses more memory.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--timing', + is_flag=True, default=False, + help='Collect execution timing for each scan and scanned file.', + help_group=CORE_GROUP, cls=CommandLineOption) + +@click.option('--temp-dir', + type=click.Path( + exists=True, file_okay=False, dir_okay=True, + readable=True, path_type=PATH_TYPE), + default=None, + metavar='DIR', + help='Set the path to the temporary directory to use for ScanCode ' + 'cache and temporary files.', + help_group=CORE_GROUP, + cls=CommandLineOption) + +@click.option('--test-mode', + is_flag=True, default=False, + # not yet supported in Click 6.7 + # hidden = True, + help='Run ScanCode in a special "test mode". Only for testing.', + help_group=MISC_GROUP, cls=CommandLineOption) + + +def scancode(ctx, input, info, # @ReservedAssignment + strip_root, full_root, + verbose, quiet, + processes, timeout, + no_cache, + timing, + temp_dir, + test_mode, *args, **kwargs): - """scan the file or directory for license, origin and packages and save results to . + """scan the file or directory for license, origin and packages and save results to FILE(s) using one or more ouput format option. - The scan results are printed to stdout if is not provided. Error and progress is printed to stderr. """ - validate_exclusive(ctx, ['strip_root', 'full_root']) - - # ## TODO: FIX when plugins are used everywhere - copyrights = kwargs.get('copyrights') - licenses = kwargs.get('licenses') - packages = kwargs.get('packages') - emails = kwargs.get('emails') - urls = kwargs.get('urls') - - strip_root = kwargs.get('strip_root') - full_root = kwargs.get('full_root') - format = kwargs.get('format') # @ReservedAssignment - # ## TODO: END FIX when plugins are used everywhere - - get_licenses_with_score = partial(get_licenses, - diag=diag, - min_score=kwargs.get('license_score'), - include_text=kwargs.get('license_text'), - license_url_template=kwargs.get('license_url_template')) - - # Use default scan options when no scan option is provided - # FIXME: this should be removed? - use_default_scans = not any([infos, licenses, copyrights, packages, emails, urls]) - - # FIXME: A hack to force info being exposed for SPDX output in order to - # reuse calculated file SHA1s. - is_spdx = format in ('spdx-tv', 'spdx-rdf') - - - scanners = [scan for scan in [ - # FIXME: we enable infos at all times!!! - Scanner('infos', get_file_info, True), - Scanner('licenses', get_licenses_with_score, licenses or use_default_scans), - Scanner('copyrights', get_copyrights, copyrights or use_default_scans), - Scanner('packages', get_package_infos, packages or use_default_scans), - Scanner('emails', get_emails, emails), - Scanner('urls', get_urls, urls)] - if scan.is_enabled - ] - - ignored_options = 'verbose', 'quiet', 'processes', 'timeout' - all_options = list(get_command_options(ctx, ignores=ignored_options, skip_no_group=True)) - - scanner_names = [scan.name for scan in scanners if scan.is_enabled] - scan_names = ', '.join(scanner_names) - if not quiet: - echo_stderr('Scanning files for: %(scan_names)s with %(processes)d process(es)...' % locals()) - - if not quiet and not processes: - echo_stderr('Disabling multi-processing and multi-threading...', fg='yellow') - - # FIXME: this is terribly hackish :| - # FIXUP OPTIONS FOR DEFAULT SCANS - options = [] - for opt in all_options: - if opt.name in scanner_names: - options.append(opt._replace(value=True)) - continue - # do not report option set to defaults or with an empty list value - if isinstance(opt.value, (list, tuple)): - if opt.value: - options.append(opt) - continue - if opt.value != opt.default: - options.append(opt) + # notes: the above docstring of this function is used in the CLI help Here is + # it's actual docstring: + """ + Return a return code of 0 on success or 1 on error from running all the + scanning "stages" in the `input` file and saving results inthe `format` format + to `output_file`. + The scanning stages are: + + - `inventory`: collect the codebase inventory resources tree for the `input`. + This is a built-in stage that does not accept plugins. + + - `setup`: as part of the plugins system, each plugin is loaded and + its `setup` class method is called if it is enabled. + + - `pre-scan`: each enabled pre-scan plugin `process_codebase(codebase)` + method is called to update/transforme the whole codebase + + - `scan`: the codebase is walked and each enabled scan plugin + `process_resource(resource.location)` method is called for each codebase + resource. + + - `post-scan`: each enabled post-scan plugin `process_codebase(codebase)` + method is called to update/transforme the whole codebase + + # !!!!!TODO: this is not yet true!!!! + - `output`: each enabled output plugin `process_codebase(codebase)` + method is called to create an output for the codebase + + This function is the main CLI entry point. + The other arguments are: + + - `quiet` and `verbose`: boolean flags: Do not display any message if + `quiet` is True. Otherwise, display extra verbose messages if `quiet` is + False and `verbose` is True. These two options are mutually exclusive. + + - `strip_root` and `full_root`: boolean flags: In the outputs, strip the + first path segment of a file if `strip_root` is True unless the `input` is + a single file. If `full_root` is True report the path as an absolute path. + These coptions are mutually exclusive. + + - `processes`: int: run the scan using up to this number of processes in + parallel. If 0, disable the multiprocessing machinery. + + - `timeout`: float: intterup the scan of a file if it does not finish within + `timeout` seconds. This applied to each file and scan individually (e.g. + if the license scan is interrupted they other scans may complete, each + withing the timeout) + + - `no_cache`: boolean flag: disable on-disk caching of intermediate scan + results and store these in memory instead if True + + - `timing`: boolean flag: collect per-scan and per-file scan timings if + True. + + - `temp_dir`: path to a non-default temporary directory fo caching and other + temporary files. If not provided, the default is used. + + Other **kwargs are passed down to plugins as CommandOption indirectly + through Click context machinery. + """ + + success = True + codebase = None processing_start = time() - if not quiet: - echo_stderr('Collecting file inventory...' % locals(), fg='green') - # TODO: add progress indicator - codebase = Codebase(location=input, use_cache=not no_cache) - collect_time = time() - processing_start - license_indexing_start = time() + # UTC start timestamp + scan_start = time2tstamp() + try: - ############################################################### - # SCANNERS SETUP - ############################################################### - license_indexing_time = 0 - # FIXME: this should be moved as the setup() for a license plugin - with_licenses = any(sc for sc in scanners if sc.name == 'licenses' and sc.is_enabled) - if with_licenses: - # build index outside of the main loop for speed - # FIXME: REALLY????? this also ensures that forked processes will get the index on POSIX naturally - if not quiet: - echo_stderr('Building/Loading license detection index...', fg='green', nl=False) - # TODO: add progress indicator - from licensedcode.cache import get_index - get_index(False) - license_indexing_time = time() - license_indexing_start + validate_exclusive(ctx, ['strip_root', 'full_root']) + validate_exclusive(ctx, ['quiet', 'verbose']) + + if not processes and not quiet: + echo_stderr('Disabling multi-processing.', fg='yellow') + + ############################################################################ + # 1. get command options and create all plugin instances + ############################################################################ + command_options = sorted(get_command_options(ctx)) + if TRACE_DEEP: + logger_debug('scancode: command_options:') + for co in command_options: + logger_debug(' scancode: command_option:', co) + + enabled_plugins = OrderedDict() + + for stage, manager in PluginManager.managers.items(): + if stage == housekeeping.stage: + continue + + enabled_plugins[stage] = stage_plugins = OrderedDict() + for name, plugin_cls in manager.plugin_classes.items(): + # TODO: manage errors: this will error out loudly if there are errors + plugin = plugin_cls(command_options) + if plugin.is_enabled(): + # Set special test mode flag that plugins can leverage + plugin._test_mode = test_mode + stage_plugins[name] = plugin + + # these are plugin instances, not classes + pre_scan_plugins = enabled_plugins[pre_scan.stage] + scanner_plugins = enabled_plugins[scan.stage] + post_scan_plugins = enabled_plugins[post_scan.stage] + output_filter_plugins = enabled_plugins[output_filter.stage] + output_plugins = enabled_plugins[output.stage] + + if not output_plugins: + msg = ('Missing output option(s): at least one output ' + 'option is needed to save scan results.') + raise click.UsageError(msg) + ctx.exit(1) + + if not scanner_plugins and not info: + # Use default info scan when no scan option is requested + info = True + for co in command_options: + if co.name == 'info': + co._replace(value=True) + + # TODO: check for plugin dependencies and if a plugin is ACTIVE!!! + + ############################################################################ + # 2. setup enabled plugins + ############################################################################ + + setup_timings = OrderedDict() + plugins_setup_start = time() + # TODO: add progress indicator + if not quiet and not verbose: + echo_stderr('Setup plugins...', fg='green') + for stage, stage_plugins in enabled_plugins.items(): + for name, plugin in stage_plugins.items(): + plugin_setup_start = time() + if not quiet and verbose: + echo_stderr('Setup plugin: %(stage)s:%(name)s...' % locals(), + fg='green') + plugin.setup() + + timing_key = 'setup_%(stage)s_%(name)s' % locals() + setup_timings[timing_key] = time() - plugin_setup_start + + setup_timings['setup'] = time() - plugins_setup_start + + ############################################################################ + # 3. collect codebase inventory + ############################################################################ + + if not quiet: + echo_stderr('Collect file inventory...', fg='green') + + # TODO: add progress indicator + # note: inventory timing collection is built in Codebase initialization + codebase = Codebase(location=input, use_cache=not no_cache) + if TRACE: logger_debug('scancode: codebase.use_cache:', codebase.use_cache) + + codebase.strip_root = strip_root + codebase.full_root = full_root + + codebase.timings.update(setup_timings) + + # TODO: thse are noy YET used in outputs!! + codebase.summary['scancode_notice'] = notice + codebase.summary['scancode_version'] = version + # TODO: this is NOT the pretty options + codebase.summary['scancode_options'] = command_options + + ############################################################################ + # 4. if any prescan plugins needs_info run an info scan first + ############################################################################ + + # do we need to collect info before prescan? + pre_scan_needs_info = any(p.needs_info for p in pre_scan_plugins.values()) + + info_is_collected = False + + if pre_scan_needs_info: + info_start = time() + + progress_manager = None if not quiet: - echo_stderr('Done.', fg='green') + echo_stderr('Collect file information for pre-scans ' + 'with %(processes)d process(es)...' % locals()) + item_show_func = partial(path_progress_message, verbose=verbose) + progress_manager = partial(progressmanager, + item_show_func=item_show_func, verbose=verbose, file=sys.stderr) + + scanners = [Scanner(key='infos', function=get_file_info)] + # TODO: add CLI option to bypass cache entirely + info_success = scan_codebase(codebase, scanners, processes, timeout, + with_timing=timing, with_info=True, progress_manager=progress_manager) + + codebase.timings['collect-info'] = time() - info_start + info_is_collected = True + + success = success and info_success + + ############################################################################ + # 5. run prescans + ############################################################################ - ############################################################### - # PRE-SCAN - ############################################################### pre_scan_start = time() + if not quiet and not verbose and pre_scan_plugins: + echo_stderr('Run pre-scan plugins...', fg='green') + # TODO: add progress indicator - for name, plugin in plugincode.pre_scan.get_plugins().items(): - plugin = plugin(all_options, scanner_names) - if plugin.is_enabled(): - if not quiet: - name = name or plugin.__class__.__name__ - echo_stderr('Running pre-scan plugin: %(name)s...' % locals(), fg='green') - # FIXME: we should always catch errors from plugins properly - plugin.process_codebase(codebase) - codebase.update_counts() - - pre_scan_time = time() - pre_scan_start - - ############################################################### - # SCANS RUN - ############################################################### + # FIXME: we should always catch errors from plugins properly + for name, plugin in pre_scan_plugins.items(): + plugin_prescan_start = time() + if verbose: + echo_stderr('Run pre-scan plugin: %(name)s...' % locals(), + fg='green') + + plugin.process_codebase(codebase) + codebase.update_counts() + timing_key = 'prescan_%(name)s' % locals() + setup_timings[timing_key] = time() - plugin_prescan_start + + codebase.timings['pre-scan'] = time() - pre_scan_start + + ############################################################################ + # 6. run scans. + ############################################################################ + scan_start = time() - if not quiet: - echo_stderr('Scanning files...', fg='green') + scanners = [] + # add info is requested or needed but not yet collected + stages_needs_info = any(p.needs_info for p in + (post_scan_plugins.values() + output_plugins.values())) - progress_manager = None - if not quiet: - item_show_func = partial(path_progress_message, verbose=verbose) - progress_manager = partial(progressmanager, - item_show_func=item_show_func, verbose=verbose, file=sys.stderr) + with_info = info or stages_needs_info + codebase.with_info = with_info + if not info_is_collected and with_info: + scanners = [Scanner(key='infos', function=get_file_info)] - # TODO: add CLI option to bypass cache entirely - success = scan_codebase(codebase, scanners, processes, timeout, - progress_manager=progress_manager) + scan_sorter = lambda s: (s.sort_order, s.name) + for scanner in sorted(scanner_plugins.values(), key=scan_sorter): + scanner_kwargs = scanner.get_own_command_options_kwargs() + func = scanner.get_scanner(**scanner_kwargs) + scanners.append(Scanner(key=scanner.name, function=func)) - scan_time = time() - scan_start + if TRACE_DEEP: logger_debug('scancode: scanners:', scanners) - scanned_count, _, scanned_size = codebase.counts(update=True, skip_root=False) + if scanners: + scan_names = ', '.join(s.key for s in scanners) + + if not quiet: + echo_stderr('Scan files for: %(scan_names)s ' + 'with %(processes)d process(es)...' % locals()) + + progress_manager = None + if not quiet: + item_show_func = partial(path_progress_message, verbose=verbose) + progress_manager = partial(progressmanager, + item_show_func=item_show_func, verbose=verbose, file=sys.stderr) + + # TODO: add CLI option to bypass cache entirely + scan_success = scan_codebase(codebase, scanners, processes, timeout, + with_timing=timing, with_info=with_info, progress_manager=progress_manager) + + scanned_count, _, scanned_size = codebase.counts( + update=True, skip_root=False) + + codebase.summary['scan_names'] = scan_names + codebase.summary['scanned_count'] = scanned_count + codebase.summary['scanned_size'] = scanned_size + codebase.timings['scan'] = time() - scan_start + + success = success and scan_success + + ############################################################################ + # 7. run postscans + ############################################################################ - ############################################################### - # POST-SCAN - ############################################################### - # TODO: add progress indicator post_scan_start = time() + # TODO: add progress indicator + # FIXME: we should always catch errors from plugins properly + if not quiet and not verbose and post_scan_plugins: + echo_stderr('Run post-scan plugins...', fg='green') + for name, plugin in post_scan_plugins.items(): + if not quiet and verbose: + echo_stderr('Run post-scan plugin: %(name)s...' % locals(), fg='green') + + plugin.process_codebase(codebase) + codebase.update_counts() + + codebase.timings['post-scan'] = time() - post_scan_start + + ############################################################################ + # 8. apply output filters + ############################################################################ + output_filter_start = time() + # TODO: add progress indicator + # FIXME: we should always catch errors from plugins properly + if not quiet and not verbose and output_filter_plugins: + echo_stderr('Run output filter plugins...', fg='green') + + filters = tuple(plugin.process_resource for plugin in output_filter_plugins.values()) + if filters: + # This is a set of resource ids to filter out from the final outputs + filtered_rids_add = codebase.filtered_rids.add + for rid, resource in codebase.get_resources_with_rid(): + if all(to_keep(resource) for to_keep in filters): + continue + filtered_rids_add(rid) + + codebase.timings['output-filter'] = time() - post_scan_start - for name, plugin in plugincode.post_scan.get_plugins().items(): - plugin = plugin(all_options, scanner_names) - if plugin.is_enabled(): - if not quiet: - name = name or plugin.__class__.__name__ - echo_stderr('Running post-scan plugin: %(name)s...' % locals(), fg='green') - # FIXME: we should always catch errors from plugins properly - plugin.process_codebase(codebase) - codebase.update_counts() + ############################################################################ + # 9. run outputs + ############################################################################ + output_start = time() + # TODO: add progress indicator + # FIXME: we should always catch errors from plugins properly + + if not quiet and not verbose: + echo_stderr('Save results...' , fg='green') - post_scan_time = time() - post_scan_start + for name, plugin in output_plugins.items(): + if not quiet and verbose: + echo_stderr('Save results as: %(name)s...' % locals(), fg='green') + plugin.process_codebase(codebase) + codebase.update_counts() - ############################################################### - # SUMMARY - ############################################################### - total_time = time() - processing_start + codebase.timings['output'] = time() - output_start - files_count, dirs_count, size = codebase.counts( - update=True, skip_root=strip_root) + ############################################################################ + # 9. display summary + ############################################################################ + codebase.timings['total'] = time() - processing_start + # TODO: compute summary for output plugins too?? if not quiet: + echo_stderr('Scanning done.', fg='green' if success else 'red') display_summary(codebase, scan_names, processes, - total_time, license_indexing_time, - pre_scan_time, - scanned_count, scanned_size, scan_time, - post_scan_time, - files_count, dirs_count, size, - verbose) - - ############################################################### - # FORMATTED REPORTS OUTPUT - ############################################################### - if not quiet: - echo_stderr('Saving results...', fg='green') - - # FIXME: we should have simpler args: a scan "header" and scan results - # FIXME: we should use Codebase.resources instead of results - with_info = infos or is_spdx - serializer = partial(Resource.to_dict, full_root=full_root, strip_root=strip_root, with_info=with_info) - results = [serializer(res) for res in codebase.walk(topdown=True, sort=True, skip_root=strip_root)] - save_results(results, files_count, format, options, input, output_file) + skip_root=strip_root, verbose=verbose) finally: - # cleanup - codebase.clear() + # cleanup including cache cleanup + if codebase: + codebase.clear() rc = 0 if success else 1 ctx.exit(rc) -def display_summary(codebase, scan_names, processes, - total_time, - license_indexing_time, - pre_scan_time, - scanned_count, scanned_size, scan_time, - post_scan_time, - files_count, dirs_count, size, - verbose): - """ - Display a scan summary. +def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, + with_timing=False, with_info=False, progress_manager=None): """ - top_errors = codebase.errors - path_errors = [(r.get_path(decode=True, posix=True), r.errors) for r in codebase.walk() if r.errors] + Run the `scanners` Scanner object on the `codebase` Codebase. Return True on + success or False otherwise. - has_errors = top_errors or path_errors - echo_stderr('Scanning done.', fg=has_errors and 'red' or 'green') + Run the `scanners` ing multiprocessing with `processes` number of + processes allocating one process per scanned `codebase` Resource. - errors_count = 0 - if has_errors: - echo_stderr('Some files failed to scan properly:', fg='red') - for error in top_errors: - echo_stderr(error) - errors_count += 1 - for errored_path, errors in path_errors: - echo_stderr('Path: ' + errored_path, fg='red') - if not verbose: - continue - for error in errors: - for emsg in error.splitlines(False): - echo_stderr(' ' + emsg, fg='red') - errors_count += 1 - - sym = 'Bytes' - if size >= 1024 * 1024 * 1024: - sym = 'GB' - size = size / (1024 * 1024 * 1024) - elif size >= 1024 * 1024: - sym = 'MB' - size = size / (1024 * 1024) - elif size >= 1024: - sym = 'KB' - size = size / 1024 - size = round(size, 2) - - scan_sym = 'Bytes' - if scanned_size >= 1024 * 1024 * 1024: - scan_sym = 'GB' - scanned_size = scanned_size / (1024 * 1024 * 1024) - elif scanned_size >= 1024 * 1024: - scan_sym = 'MB' - scanned_size = scanned_size / (1024 * 1024) - elif scanned_size >= 1024: - scan_sym = 'KB' - scanned_size = scanned_size / 1024 - size_speed = round(scanned_size / scan_time, 2) - scanned_size = round(scanned_size, 2) - - file_speed = round(float(scanned_count) / scan_time , 2) - - res_count = files_count + dirs_count - echo_stderr('Summary: %(scan_names)s with %(processes)d process(es)' % locals()) - echo_stderr('Total time: %(scanned_count)d files, %(scanned_size).2f %(scan_sym)s ' - 'scanned in %(total_time)d total (excluding format)' % locals()) - echo_stderr('Scan Speed: %(file_speed).2f files/s, %(size_speed).2f %(scan_sym)s/s' % locals()) - echo_stderr('Results: %(res_count)d resources: %(files_count)d files, %(dirs_count)d directories for %(size).2f %(sym)s' % locals()) - echo_stderr('Timings: Indexing: %(license_indexing_time).2fs, ' - 'Pre-scan: %(pre_scan_time).2fs, ' - 'Scan: %(scan_time).2fs, ' - 'Post-scan: %(post_scan_time).2fs' % locals()) - echo_stderr('Errors count: %(errors_count)d' % locals()) + Run each scanner function for up to `timeout` seconds and fail it otherwise. + If `with_timing` is True, per-scanner execution time (as a float in seconds) + is added to the `scan_timings` mapping of each Resource as {scanner.key: + execution time}. -def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, - progress_manager=None): - """ - Run the `scanners` on the `codebase`. Return True on success or False - otherwise. Provides optional progress feedback in the UI using the - `progress_manager` callable that accepts an iterable of tuple of (location, - rid, scan_errors, scan_result ) as argument. + Provide optional progress feedback in the UI using the `progress_manager` + callable that accepts an iterable of tuple of (location, rid, scan_errors, + scan_result ) as argument. """ # FIXME: this path computation is super inefficient # tuples of (absolute location, resource id) # TODO: should we alk topdown or not??? + resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) runner = partial(scan_resource, scanners=scanners, timeout=timeout) - has_info_scanner = any(sc.name == 'infos' for sc in scanners) + has_info_scanner = with_info lscan = len(scanners) has_other_scanners = lscan > 1 if has_info_scanner else lscan + if TRACE: + logger_debug('scan_codebase: scanners:', '\n'.join(repr(s) for s in scanners)) + logger_debug('scan_codebase: has_other_scanners:', bool(has_other_scanners)) get_resource = codebase.get_resource @@ -701,8 +882,11 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, while True: try: - location, rid, scan_errors, scan_result = scans.next() - + if with_timing: + location, rid, scan_errors, scan_result, scan_time, scan_result, scan_timings = scans.next() + else: + location, rid, scan_errors, scan_time, scan_result = scans.next() + if TRACE_DEEP: logger_debug('scan_codebase: results:', scan_result) resource = get_resource(rid) if not resource: # this should never happen @@ -721,8 +905,11 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, # always set info directly on resources info = scan_result.pop('infos', []) resource.set_info(info) - if has_info_scanner and scan_result: + if TRACE: logger_debug('scan_codebase: set_info:', info) + + if has_other_scanners and scan_result: resource.put_scans(scan_result, update=True) + if TRACE: logger_debug('scan_codebase: pu_scans:', scan_result) except StopIteration: break @@ -745,118 +932,174 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, return success -def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT): +def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=False): """ - Return a tuple of (location, rid, list or errors, mapping of scan results) by running - the `scanners` Scanner objects for the file or directory resource with id - `rid` at `location` provided as a `location_rid` tuple (location, rid). + Return a tuple of (location, rid, errors, scan_time, scan_results) + by running the `scanners` Scanner objects for the file or directory resource + with id `rid` at `location` provided as a `location_rid` tuple of (location, + rid) for up to `timeout` seconds. + In the returned tuple: + - `errors` is a list of error strings + - `scan_time` is the duration in seconds as float to run all scans for this resource + - `scan_results` is a mapping of scan results keyed by scanner name. + + If `with_timing` is True, the execution time of each scanner is also + collected as a float in seconds and the returned tuple contains an extra + trailing item as a mapping of {scanner.key: execution time}. """ + scan_time = time() + + if with_timing: + timings = OrderedDict((scanner.key, 0) for scanner in scanners) + location, rid = location_rid errors = [] - results = OrderedDict((scanner.name, []) for scanner in scanners) + results = OrderedDict((scanner.key, []) for scanner in scanners) # run each scanner in sequence in its own interruptible for scanner, scanner_result in zip(scanners, results.values()): + if with_timing: + start = time() try: - runner = partial(scanner.function, location) - error, value = interruptible(runner, timeout=timeout) + error, value = interruptible( + partial(scanner.function, location), timeout=timeout) if error: - msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + error + msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + error errors.append(msg) if value: # a scanner function MUST return a sequence scanner_result.extend(value) except Exception: - msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + traceback.format_exc() + msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + traceback.format_exc() errors.append(msg) - return location, rid, errors, results + finally: + scan_time = time() - scan_time + if with_timing: + timings[scanner.key] = time() - start + + if with_timing: + return location, rid, errors, scan_time, results, timings + else: + return location, rid, errors, scan_time, results -def save_results(results, files_count, - format, # @ReservedAssignment - options, - input, # @ReservedAssignment - output_file): +def display_summary(codebase, scan_names, processes, skip_root, verbose): """ - Save scan results to file or screen. + Display a scan summary. """ + counts = codebase.counts(update=False, skip_root=skip_root) - # note: in tests, sys.stdout is not used, but is instead some io - # wrapper with no name attributes. We use this to check if this is a - # real filesystem file or not. - # note: sys.stdout.name == '' so it has a name. - is_real_file = hasattr(output_file, 'name') - - if output_file != sys.stdout and is_real_file: - # we are writing to a real filesystem file: create directories! - parent_dir = os.path.dirname(output_file.name) - if parent_dir: - create_dir(abspath(expanduser(parent_dir))) - - # Write scan results to file or screen as a formatted output ... - # ... using a user-provided custom format template - format_plugins = plugincode.output.get_plugins() - - if format in format_plugins: - # use the selected format plugin - writer = format_plugins[format] - # FIXME: carrying an echo function does not make sense - # FIXME: do not use input as a variable name - # FIXME: do NOT pass options around, but a header instead - opts = OrderedDict([(o.option, o.value) for o in options]) - writer(files_count=files_count, version=version, notice=notice, - scanned_files=results, - options=opts, - input=input, output_file=output_file, _echo=echo_stderr) - return + initial_files_count = codebase.summary.get('initial_files_count', 0) + initial_dirs_count = codebase.summary.get('initial_dirs_count', 0) + initial_res_count = initial_files_count + initial_dirs_count - # format may be a custom template file path - if not os.path.isfile(format): - # this check was done before in the CLI validation, but this - # is done again if the function is used directly - echo_stderr('\nInvalid template: must be a file.', fg='red') - else: - from formattedcode import format_templated - # FIXME: carrying an echo function does not make sense - format_templated.write_custom( - results, output_file, - _echo=echo_stderr, version=version, template_path=format) + final_files_count, final_dirs_count, final_size = counts + final_res_count = final_files_count + final_dirs_count + + top_errors = codebase.errors + path_errors = [(r.get_path(decode=True, posix=True), r.errors) for r in codebase.walk() if r.errors] + + has_errors = top_errors or path_errors + + errors_count = 0 + if has_errors: + echo_stderr('Some files failed to scan properly:', fg='red') + for error in top_errors: + echo_stderr(error) + errors_count += 1 + for errored_path, errors in path_errors: + echo_stderr('Path: ' + errored_path, fg='red') + if not verbose: + continue + for error in errors: + for emsg in error.splitlines(False): + echo_stderr(' ' + emsg, fg='red') + errors_count += 1 + + scanned_size = codebase.summary.get('scanned_size', 0) + scan_time = codebase.timings.get('scan', 0.) + scan_size_speed = format_size(scanned_size / scan_time) + scanned_count = codebase.summary.get('scanned_count', 0) + scan_file_speed = round(float(scanned_count) / scan_time , 2) + final_size = format_size(final_size) + + echo_stderr('Summary: %(scan_names)s with %(processes)d process(es)' % locals()) + echo_stderr('Errors count: %(errors_count)d' % locals()) + echo_stderr('Scan Speed: %(scan_file_speed).2f files/sec. %(scan_size_speed)s/sec.' % locals()) + + echo_stderr('Initial counts: %(initial_res_count)d resource(s): ' + '%(initial_files_count)d file(s) ' + 'and %(initial_dirs_count)d directorie(s)' % locals()) + + echo_stderr('Final counts: %(final_res_count)d resource(s): ' + '%(final_files_count)d file(s) ' + 'and %(final_dirs_count)d directorie(s) ' + 'for %(final_size)s' % locals()) + echo_stderr('Timings:') + for key, value, in codebase.timings.items(): + if value > 0.1: + echo_stderr(' %(key)s: %(value).2fs' % locals()) + # TODO: if timing was requested display per-scan/per-file stats -def get_command_options(ctx, ignores=(), skip_default=False, skip_no_group=False): + +def format_size(size): + """ + Return a human-readable value for the `size` int or float. + + For example: + >>> format_size(0) + u'0 Byte' + >>> format_size(1) + u'1 Byte' + >>> format_size(0.123) + u'0.1 Byte' + >>> format_size(123) + u'123 Bytes' + >>> format_size(1023) + u'1023 Bytes' + >>> format_size(1024) + u'1 KB' + >>> format_size(2567) + u'2.51 KB' + >>> format_size(2567000) + u'2.45 MB' + >>> format_size(1024*1024) + u'1 MB' + >>> format_size(1024*1024*1024) + u'1 GB' + >>> format_size(1024*1024*1024*12.3) + u'12.30 GB' + """ + if not size: + return '0 Byte' + if size < 1: + return '%(size).1f Byte' % locals() + if size == 1: + return '%(size)d Byte' % locals() + size = float(size) + for symbol in ('Bytes', 'KB', 'MB', 'GB', 'TB'): + if size < 1024: + if int(size) == float(size): + return '%(size)d %(symbol)s' % locals() + return '%(size).2f %(symbol)s' % locals() + size = size / 1024. + return '%(size).2f %(symbol)s' % locals() + + +def get_command_options(ctx): """ - Yield CommandOption tuples for each Click option in the `ctx` Click context. - Ignore: - - eager flags, - - Parameter with a "name" listed in the `ignores` sequence - - Parameters whose value is the default if `skip_default` is True - - Parameters without a group if `skip_no_group` is True + Yield CommandOption tuples for each click.Option option in the `ctx` Click + context. Ignore eager flags. """ param_values = ctx.params for param in ctx.command.params: - if param.is_eager: continue - - group = getattr(param, 'group', None) - if skip_no_group and not group: + if param.name == 'test_mode': continue + help_group = getattr(param, 'help_group', None) name = param.name - if ignores and name in ignores: - continue - - # opts is a list, the last one is the long form by convention - option = param.opts[-1] - value = param_values.get(name) - # for opened file args that may have a name - if value and hasattr(value, 'name'): - value = getattr(value, 'name', None) - - default = param.default - - if skip_default and value == default: - continue - - yield CommandOption(group, name, option, value, default) + yield CommandOption(help_group, name, value, param) diff --git a/src/scancode/cli_test_utils.py b/src/scancode/cli_test_utils.py index ddac798bf6d..6f323734408 100644 --- a/src/scancode/cli_test_utils.py +++ b/src/scancode/cli_test_utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -86,14 +86,18 @@ def run_scan_plain(options, cwd=None): """ Run a scan as a plain subprocess. Return rc, stdout, stderr. """ + from commoncode.command import execute import scancode + + if '--test-mode' not in options: + options.append('--test-mode') + scmd = b'scancode' if on_linux else 'scancode' - from commoncode.command import execute scan_cmd = os.path.join(scancode.root_dir, scmd) return execute(scan_cmd, options, cwd=cwd) -def run_scan_click(options, monkeypatch=None, catch_exceptions=False): +def run_scan_click(options, monkeypatch=None): """ Run a scan as a Click-controlled subprocess If monkeypatch is provided, a tty with a size (80, 43) is mocked. @@ -103,8 +107,12 @@ def run_scan_click(options, monkeypatch=None, catch_exceptions=False): from click.testing import CliRunner from scancode import cli + if '--test-mode' not in options: + options.append('--test-mode') + if monkeypatch: monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) monkeypatch.setattr(click , 'get_terminal_size', lambda : (80, 43,)) runner = CliRunner() - return runner.invoke(cli.scancode, options, catch_exceptions=catch_exceptions) + + return runner.invoke(cli.scancode, options, catch_exceptions=False) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index a6fb06a4be6..72fe7182a53 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -38,6 +38,7 @@ from os.path import expanduser from os.path import join from os.path import normpath +from time import time import traceback import sys @@ -171,6 +172,8 @@ class Codebase(object): Represent a codebase being scanned. A Codebase is a tree of Resources. """ + # TODO: add populate progress manager!!! + def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): """ Initialize a new codebase rooted at the `location` existing file or @@ -180,6 +183,7 @@ def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): Resource in a new unique directory under `cache_base_dir`. Otherwise, scans are kept as Resource attributes. """ + start = time() self.original_location = location if on_linux: @@ -207,6 +211,19 @@ def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): # unreadable file, etc) self.errors = [] + # mapping of scan summary data and statistics at the codebase level such + # as ScanCode version, notice, command options, etc. + # This is populated automatically as the scan progresses. + self.summary = OrderedDict() + + # total processing time from start to finish, across all stages. + # This is populated automatically. + self.total_time = 0 + + # mapping of timings for scan stage as {stage: time in seconds as float} + # This is populated automatically. + self.timings = OrderedDict() + # setup cache self.use_cache = use_cache self.cache_base_dir = self.cache_dir = None @@ -221,10 +238,29 @@ def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): self.populate() + self.timings['inventory'] = time() - start + files_count, dirs_count = self.resource_counts() + self.summary['initial_files_count'] = files_count + self.summary['initial_dirs_count'] = dirs_count + + # Flag set to True if file information was requested for results output + self.with_info = False + + # Flag set to True is strip root was requested for results output + self.strip_root = False + # Flag set to True is full root was requested for results output + self.full_root = False + + # set of resource rid to exclude from outputs + # This is populated automatically. + self.filtered_rids = set() + + def populate(self): """ Populate this codebase with Resource objects for this codebase by - walking its `self.location` in topdown order. + walking its `location` topdown, returning directories then files, each + in sorted order. """ # clear things self.resources = [] @@ -270,7 +306,7 @@ def err(error): if TRACE: logger_debug('Codebase.collect: parent:', parent) - for name in dirs: + for name in sorted(dirs): loc = join(top, name) if is_special(loc) or ignored(loc): @@ -285,7 +321,7 @@ def err(error): resources_append(res) if TRACE: logger_debug('Codebase.collect: dir:', res) - for name in files: + for name in sorted(files): loc = join(top, name) if is_special(loc) or ignored(loc): @@ -395,6 +431,34 @@ def update_counts(self): for resource in self.walk(topdown=False): resource._update_children_counts() + def resource_counts(self, resources=None): + """ + Return a tuple of quick counters (files_count, dirs_count) for this + codebase or an optional list of resources. + """ + resources = resources or self.resources + + files_count = 0 + dirs_count = 0 + for res in resources: + if res is None: + continue + if res.is_file: + files_count += 1 + else: + dirs_count += 1 + return files_count, dirs_count + + def get_resources_with_rid(self): + """ + Return an iterable of (rid, resource) for all the resources. + The order is topdown. + """ + for rid, res in enumerate(self.resources): + if res is None: + continue + yield rid, res + def clear(self): """ Purge the codebase cache(s) by deleting the corresponding cached data @@ -470,11 +534,16 @@ class Resource(object): files_count = attr.ib(default=0, type=int, repr=False) dirs_count = attr.ib(default=0, type=int, repr=False) + # Duration in seconds as float to run all scans for this resource + scan_time = attr.ib(default=0, repr=False) + # mapping of timings for each scan as {scan_key: duration in seconds as a float} + scan_timings = attr.ib(default=None, repr=False) + def __attrs_post_init__(self): # build simple cache keys for this resource based on the hex # representation of the resource id: they are guaranteed to be unique # within a codebase. - if self.use_cache is None: + if self.use_cache is None and hasattr(self.codebase, 'use_cache'): self.use_cache = self.codebase.use_cache hx = '%08x' % self.rid if on_linux: @@ -521,7 +590,7 @@ def _children_counts(self): @property def codebase(self): """ - Return the codebase that contains this Resource. + Return this Resource codebase from the global cache. """ return get_codebase(self.cid) @@ -583,6 +652,7 @@ def put_scans(self, scans, update=True): if TRACE: logger_debug('put_scans: merged:', self._scans) return self._scans + # from here on we use_cache! self._scans.clear() cached_path = self._get_cached_path(create=True) if update: @@ -635,7 +705,7 @@ def _walk(self, topdown=True, sort=False): children.sort(key=sorter) for child in children: - for subchild in child.walk(topdown, sort): + for subchild in child._walk(topdown, sort): yield subchild if not topdown: diff --git a/src/scancode/utils.py b/src/scancode/utils.py index ee2f35c3a8a..b84857353c5 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -225,11 +225,12 @@ def file_name_max_len(used_width=BAR_WIDTH + BAR_SEP_LEN + 7 + BAR_SEP_LEN + 8 + def path_progress_message(item, verbose=False, prefix='Scanned: '): """ Return a styled message suitable for progress display when processing a path - for an `item` tuple of (location, rid, scan_errors, scan_results) + for an `item` tuple of (location, rid, scan_errors, *other items) """ if not item: return '' - location, _rid, errors, _results = item + location = item[0] + errors = item[2] location = fsdecode(location) progress_line = location if not verbose: diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index f4f9f7c2670..fa922c94bd4 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -1,8 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, "--info": true, + "--output-json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index f2fc3a014af..2921734880b 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -1,6 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", + "--output-json": "", "--package": true }, "files_count": 1, diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index 55cd16d503d..a106bf717e1 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -1,7 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, + "--output-json": "", "--strip-root": true }, "files_count": 1, @@ -9,7 +11,7 @@ { "path": "patchelf.pdf", "scan_errors": [ - "ERROR: for scanner: copyrights:\nERROR: Unknown error:\nTraceback (most recent call last):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/interrupt.py\", line 88, in interruptible\n return NO_ERROR, func(*(args or ()), **(kwargs or {}))\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/api.py\", line 70, in get_copyrights\n for copyrights, authors, _years, holders, start_line, end_line in detect_copyrights(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 70, in detect_copyrights\n for numbered_lines in candidate_lines(analysis.text_lines(location)):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 1269, in candidate_lines\n for line_number, line in enumerate(lines):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/analysis.py\", line 125, in unicode_text_lines_from_pdf\n for line in pdf.get_text_lines(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/pdf.py\", line 57, in get_text_lines\n interpreter.process_page(page)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 852, in process_page\n self.render_contents(page.resources, page.contents, ctm=ctm)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 862, in render_contents\n self.init_resources(resources)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 362, in init_resources\n self.fontmap[fontid] = self.rsrcmgr.get_font(objid, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 212, in get_font\n font = self.get_font(None, subspec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 203, in get_font\n font = PDFCIDFont(self, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 667, in __init__\n BytesIO(self.fontfile.get_data()))\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 386, in __init__\n (ntables, _1, _2, _3) = struct.unpack('>HHHH', fp.read(8))\nerror: unpack requires a string argument of length 8\n" + "ERROR: for scanner: copyrights:\nERROR: Unknown error:\nTraceback (most recent call last):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/interrupt.py\", line 88, in interruptible\n return NO_ERROR, func(*(args or ()), **(kwargs or {}))\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/api.py\", line 59, in get_copyrights\n for copyrights, authors, _years, holders, start_line, end_line in detect_copyrights(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 71, in detect_copyrights\n for numbered_lines in candidate_lines(analysis.text_lines(location)):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 1270, in candidate_lines\n for line_number, line in enumerate(lines):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/analysis.py\", line 125, in unicode_text_lines_from_pdf\n for line in pdf.get_text_lines(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/pdf.py\", line 57, in get_text_lines\n interpreter.process_page(page)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 852, in process_page\n self.render_contents(page.resources, page.contents, ctm=ctm)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 862, in render_contents\n self.init_resources(resources)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 362, in init_resources\n self.fontmap[fontid] = self.rsrcmgr.get_font(objid, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 212, in get_font\n font = self.get_font(None, subspec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 203, in get_font\n font = PDFCIDFont(self, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 667, in __init__\n BytesIO(self.fontfile.get_data()))\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 386, in __init__\n (ntables, _1, _2, _3) = struct.unpack('>HHHH', fp.read(8))\nerror: unpack requires a string argument of length 8\n" ], "copyrights": [] } diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index ae6f296754d..c8b8f1427c3 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -1,90 +1,111 @@ -Usage: scancode [OPTIONS] +Usage: scancode [OPTIONS] scan the file or directory for license, origin and packages and save - results to . + results to FILE(s) using one or more ouput format option. - The scan results are printed to stdout if is not provided. Error and progress is printed to stderr. Options: - scans: - -c, --copyright Scan for copyrights. [default] - -l, --license Scan for licenses. [default] - -p, --package Scan for packages. [default] - -e, --email Scan for emails. - -u, --url Scan for urls. - -i, --info Include information such as size, type, etc. - --license-score INTEGER Do not return license matches with scores lower + primary scans: + -l, --license Scan for licenses. + -p, --package Scan for packages. + -c, --copyright Scan for copyrights. + + other scans: + -i, --info Scan for file information (size, type, checksums, etc). + -e, --email Scan for emails. + -u, --url Scan for urls. + + scan options: + --license-score INTEGER Do not return license matches with a score lower than this score. A number between 0 and 100. [default: 0] - --license-text Include the detected licenses matched text. Has - no effect unless --license is requested. + --license-text Include the detected licenses matched text. --license-url-template TEXT Set the template URL used for the license - reference URLs. In a template URL, curly braces - ({}) are replaced by the license key. [default: h - ttps://enterprise.dejacode.com/urn/urn:dje:licens - e:{}] - - output: - --strip-root Strip the root directory segment of all paths. The - default is to always include the last directory segment - of the scanned path such that all paths have a common - root directory. This cannot be combined with `--full- - root` option. - --full-root Report full, absolute paths. The default is to always - include the last directory segment of the scanned path - such that all paths have a common root directory. This - cannot be combined with the `--strip-root` option. - -f, --format Set format to one of: csv, html, html- - app, json, json-pp, jsonlines, spdx-rdf, spdx-tv or use - as the path to a custom template file - [default: json] - --verbose Print verbose file-by-file progress messages. - --quiet Do not print summary or progress messages. + reference URLs. Curly braces ({}) are replaced by + the license key. [default: https://enterprise.de + jacode.com/urn/urn:dje:license:{}] + --license-diag Include diagnostic information in license scan + results. - pre-scan: - --ignore Ignore files matching . + output formats: + --json-pp, --output-json-pp FILE + Write scan output formatted as pretty-printed + JSON to FILE. + --output-spdx-rdf FILE Write scan output formatted as SPDX RDF to + FILE. Implies running the --info scan. + --output-spdx-tv FILE Write scan output formatted as SPDX Tag/Value + to FILE. Implies running the --info scan. + --output-html-app FILE Write scan output formatted as a mini HTML + application FILE. + --output-json-lines FILE Write scan output formatted as JSON Lines to + FILE. + --json, --output-json FILE Write scan output formatted as compact JSON to + FILE. + --output-html FILE Write scan output formatted as HTML to FILE. + --output-custom FILE Write scan output to FILE formatted with the + custom Jinja template file. + --custom-template FILE Use this Jinja template FILE as a custom + template. + --output-csv FILE Write scan output formatted as CSV to FILE. - post-scan: - --mark-source Set the "is_source" flag to true for directories that contain - over 90% of source files as direct children. Has no effect - unless the --info scan is requested. + output filters: --only-findings Only return files or directories with findings for the requested scans. Files and directories without findings are - omitted (not considering basic file information as findings). + omitted (file information is not treated as findings). - misc: - --reindex-licenses Force a check and possible reindexing of the cached - license index. + output control: + --strip-root Strip the root directory segment of all paths. The default is to + always include the last directory segment of the scanned path + such that all paths have a common root directory. + --full-root Report full, absolute paths. The default is to always include + the last directory segment of the scanned path such that all + paths have a common root directory. + + pre-scan: + --ignore Ignore files matching . + + post-scan: + --mark-source Set the "is_source" to true for directories that contain over + 90% of source files as children and descendants. Implies + running the --info scan. core: - -h, --help Show this message and exit. - -n, --processes INTEGER Scan using n parallel processes. [default: - 1] - --examples Show command examples and exit. - --about Show information about ScanCode and licensing and - exit. - --version Show the version and exit. - --diag Include additional diagnostic information such as - error messages or result details. - --timeout FLOAT Stop scanning a file if scanning takes longer than a - timeout in seconds. [default: 120] - --no-cache Do not use on-disk cache for scan results. Faster but - uses more memory. + --verbose Print progress as file-by-file path instead of a + progress bar. Print a verbose scan summary. + --quiet Do not print summary or progress. + -h, --help Show this message and exit. + -n, --processes INT Set the number of parallel processes to use. Disable + parallel processing if 0. [default: 1] + --examples Show command examples and exit. + --about Show information about ScanCode and licensing and exit. + --version Show the version and exit. + --timeout Stop an unfinished file scan after a timeout in seconds. + [default: 120] + --plugins Print the list of available ScanCode plugins. + --no-cache Do not use on-disk cache for intermediate results. Uses + more memory. + --timing Collect execution timing for each scan and scanned file. + --temp-dir DIR Set the path to the temporary directory to use for + ScanCode cache and temporary files. + + miscellaneous: + --test-mode Run ScanCode in a special "test mode". Only for testing. + --reindex-licenses Check the license index cache and reindex if needed. Examples (use --examples for more): Scan the 'samples' directory for licenses and copyrights. Save scan results to a JSON file: - scancode --format json samples scancode_result.json + scancode --license --copyright --output-json=scancode_result.json + samples - Scan the 'samples' directory for licenses and copyrights. Save scan results to - an HTML app file for interactive web browser results navigation. Additional app - files are saved to the 'myscan_files' directory: + Scan the 'samples' directory for licenses and package manifests. Print scan + results on screen as pretty-formatted JSON: - scancode --format html-app samples myscan.html + scancode --json-pp --license --package samples Note: when you run scancode, a progress bar is displayed with a counter of the number of files processed. Use --verbose to display file-by-file diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 0be1afecc5c..17db28a3504 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -1,9 +1,11 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, "--info": true, + "--license": true, + "--output-json": "", "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index 8b99b4b29c3..ada751d2ed2 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -1,9 +1,11 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, "--email": true, + "--license": true, + "--output-json": "", "--url": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index 57135d53fb4..e06865981dd 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -1,7 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, + "--output-json": "", "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index 819be57697b..d97c0690e64 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -1,7 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--info": true + "input": "", + "--info": true, + "--output-json": "" }, "files_count": 6, "files": [ diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index 62fa81e9689..92dce82e917 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -1,10 +1,12 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--email": true, - "--url": true, "--info": true, - "--strip-root": true + "--strip-root": true, + "--output-json": "", + "--url": true }, "files_count": 6, "files": [ diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index 7b7550a664a..f7e2d7b72aa 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -1,8 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--license": true, "--license-text": true, + "--output-json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index 6e5d76f6f82..adc181a8a18 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -1,7 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, + "--output-json": "", "--strip-root": true }, "files_count": 18, diff --git a/tests/scancode/data/non_utf8/expected-mac.json b/tests/scancode/data/non_utf8/expected-mac.json index 9ea7d26c4ef..2ab56cfa3cb 100644 --- a/tests/scancode/data/non_utf8/expected-mac.json +++ b/tests/scancode/data/non_utf8/expected-mac.json @@ -1,12 +1,12 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, - "--format": "json", - "--license-score": 0, + "--output-json": "", "--strip-root": true }, - "files_count": 19, + "files_count": 18, "files": [ { "path": "non_unicode", @@ -15,6 +15,7 @@ "extension": "", "file_type": null, "files_count": 18, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -36,7 +37,8 @@ "date": "2017-07-14", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -57,7 +59,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -79,7 +82,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -101,7 +105,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -123,7 +128,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -145,7 +151,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -167,7 +174,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -189,7 +197,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -211,7 +220,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -233,7 +243,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -255,7 +266,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -277,7 +289,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -299,7 +312,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -321,7 +335,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -343,7 +358,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -365,7 +381,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -387,7 +404,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -409,7 +427,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, diff --git a/tests/scancode/data/non_utf8/expected-win.json b/tests/scancode/data/non_utf8/expected-win.json index b5e12bcd430..295971d6268 100644 --- a/tests/scancode/data/non_utf8/expected-win.json +++ b/tests/scancode/data/non_utf8/expected-win.json @@ -1,9 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--format": "json", + "input": "", "--info": true, - "--license-score": 0, + "--output-json": "", "--strip-root": true }, "files_count": 19, diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index 0ff0e0a09a8..cfe9c6e9fa2 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -1,8 +1,10 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, - "--mark-source": true + "--mark-source": true, + "--output-json": "" }, "files_count": 12, "files": [ diff --git a/tests/scancode/data/plugin_mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json index e27830c78cc..6c2099eb886 100644 --- a/tests/scancode/data/plugin_mark_source/without_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/without_info.expected.json @@ -1,542 +1,379 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { - "--mark-source": true + "input": "", + "--mark-source": true, + "--output-json": "" }, "files_count": 12, "files": [ { "path": "JGroups.tgz", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] + "type": "directory", + "name": "JGroups.tgz", + "base_name": "JGroups.tgz", + "extension": "", + "date": null, + "size": 206642, + "sha1": null, + "md5": null, + "files_count": 12, + "dirs_count": 3, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] + "type": "directory", + "name": "JGroups", + "base_name": "JGroups", + "extension": "", + "date": null, + "size": 206642, + "sha1": null, + "md5": null, + "files_count": 12, + "dirs_count": 2, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] + "type": "directory", + "name": "licenses", + "base_name": "licenses", + "extension": "", + "date": null, + "size": 54552, + "sha1": null, + "md5": null, + "files_count": 5, + "dirs_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses/apache-1.1.txt", - "scan_errors": [], - "licenses": [ - { - "key": "apache-1.1", - "score": 100.0, - "short_name": "Apache 1.1", - "category": "Permissive", - "owner": "Apache Software Foundation", - "homepage_url": "http://www.apache.org/licenses/", - "text_url": "http://apache.org/licenses/LICENSE-1.1", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:apache-1.1", - "spdx_license_key": "Apache-1.1", - "spdx_url": "https://spdx.org/licenses/Apache-1.1", - "start_line": 2, - "end_line": 56, - "matched_rule": { - "identifier": "apache-1.1.SPDX.RULE", - "license_choice": false, - "licenses": [ - "apache-1.1" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright (c) 2000 The Apache Software Foundation." - ], - "holders": [ - "The Apache Software Foundation." - ], - "authors": [], - "start_line": 4, - "end_line": 5 - }, - { - "statements": [], - "holders": [], - "authors": [ - "the Apache Software Foundation" - ], - "start_line": 20, - "end_line": 23 - } - ], - "packages": [] + "type": "file", + "name": "apache-1.1.txt", + "base_name": "apache-1.1", + "extension": ".txt", + "date": "2017-08-05", + "size": 2885, + "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", + "md5": "276982197c941f4cbf3d218546e17ae2", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses/apache-2.0.txt", - "scan_errors": [], - "licenses": [ - { - "key": "apache-2.0", - "score": 100.0, - "short_name": "Apache 2.0", - "category": "Permissive", - "owner": "Apache Software Foundation", - "homepage_url": "http://www.apache.org/licenses/", - "text_url": "http://www.apache.org/licenses/LICENSE-2.0", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0", - "spdx_license_key": "Apache-2.0", - "spdx_url": "https://spdx.org/licenses/Apache-2.0", - "start_line": 2, - "end_line": 202, - "matched_rule": { - "identifier": "apache-2.0_easyeclipse.RULE", - "license_choice": false, - "licenses": [ - "apache-2.0" - ] - } - } - ], - "copyrights": [], - "packages": [] + "type": "file", + "name": "apache-2.0.txt", + "base_name": "apache-2.0", + "extension": ".txt", + "date": "2017-08-05", + "size": 11560, + "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", + "md5": "d273d63619c9aeaf15cdaf76422c4f87", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses/bouncycastle.txt", - "scan_errors": [], - "licenses": [ - { - "key": "mit", - "score": 100.0, - "short_name": "MIT License", - "category": "Permissive", - "owner": "MIT", - "homepage_url": "http://opensource.org/licenses/mit-license.php", - "text_url": "http://opensource.org/licenses/mit-license.php", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:mit", - "spdx_license_key": "MIT", - "spdx_url": "https://spdx.org/licenses/MIT", - "start_line": 7, - "end_line": 18, - "matched_rule": { - "identifier": "mit.LICENSE", - "license_choice": false, - "licenses": [ - "mit" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)" - ], - "holders": [ - "Legion Of The Bouncy Castle (http://www.bouncycastle.org)" - ], - "authors": [], - "start_line": 5, - "end_line": 5 - } - ], - "packages": [] + "type": "file", + "name": "bouncycastle.txt", + "base_name": "bouncycastle", + "extension": ".txt", + "date": "2017-08-05", + "size": 1186, + "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", + "md5": "9fffd8de865a5705969f62b128381f85", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses/cpl-1.0.txt", - "scan_errors": [], - "licenses": [ - { - "key": "cpl-1.0", - "score": 99.94, - "short_name": "CPL 1.0", - "category": "Copyleft Limited", - "owner": "IBM", - "homepage_url": "http://www.eclipse.org/legal/cpl-v10.html", - "text_url": "http://www.eclipse.org/legal/cpl-v10.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:cpl-1.0", - "spdx_license_key": "CPL-1.0", - "spdx_url": "https://spdx.org/licenses/CPL-1.0", - "start_line": 1, - "end_line": 212, - "matched_rule": { - "identifier": "cpl-1.0.SPDX.RULE", - "license_choice": false, - "licenses": [ - "cpl-1.0" - ] - } - } - ], - "copyrights": [], - "packages": [] + "type": "file", + "name": "cpl-1.0.txt", + "base_name": "cpl-1.0", + "extension": ".txt", + "date": "2017-08-05", + "size": 11987, + "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", + "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/licenses/lgpl.txt", - "scan_errors": [], - "licenses": [ - { - "key": "lgpl-2.1-plus", - "score": 100.0, - "short_name": "LGPL 2.1 or later", - "category": "Copyleft Limited", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "text_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:lgpl-2.1-plus", - "spdx_license_key": "LGPL-2.1+", - "spdx_url": "https://spdx.org/licenses/LGPL-2.1", - "start_line": 1, - "end_line": 502, - "matched_rule": { - "identifier": "lgpl-2.1-plus_2.RULE", - "license_choice": false, - "licenses": [ - "lgpl-2.1-plus" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright (c) 1991, 1999 Free Software Foundation, Inc." - ], - "holders": [ - "Free Software Foundation, Inc." - ], - "authors": [], - "start_line": 4, - "end_line": 7 - }, - { - "statements": [ - "copyrighted by the Free Software Foundation" - ], - "holders": [ - "the Free Software Foundation" - ], - "authors": [], - "start_line": 427, - "end_line": 433 - }, - { - "statements": [], - "holders": [], - "authors": [ - "James Random Hacker." - ], - "start_line": 496, - "end_line": 497 - } - ], - "packages": [] + "type": "file", + "name": "lgpl.txt", + "base_name": "lgpl", + "extension": ".txt", + "date": "2017-08-05", + "size": 26934, + "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", + "md5": "f14599a2f089f6ff8c97e2baa4e3d575", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src", - "scan_errors": [], - "licenses": [], - "copyrights": [], - "packages": [] + "type": "directory", + "name": "src", + "base_name": "src", + "extension": "", + "date": null, + "size": 152090, + "sha1": null, + "md5": null, + "files_count": 7, + "dirs_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/FixedMembershipToken.java", - "scan_errors": [], - "licenses": [ - { - "key": "lgpl-2.1-plus", - "score": 100.0, - "short_name": "LGPL 2.1 or later", - "category": "Copyleft Limited", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "text_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:lgpl-2.1-plus", - "spdx_license_key": "LGPL-2.1+", - "spdx_url": "https://spdx.org/licenses/LGPL-2.1", - "start_line": 7, - "end_line": 20, - "matched_rule": { - "identifier": "lgpl-2.1-plus_59.RULE", - "license_choice": false, - "licenses": [ - "lgpl-2.1-plus" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright 2005, JBoss Inc." - ], - "holders": [ - "JBoss Inc." - ], - "authors": [], - "start_line": 2, - "end_line": 5 - }, - { - "statements": [], - "holders": [], - "authors": [ - "Chris Mills (millsy@jboss.com)" - ], - "start_line": 51, - "end_line": 51 - } - ], - "packages": [] + "type": "file", + "name": "FixedMembershipToken.java", + "base_name": "FixedMembershipToken", + "extension": ".java", + "date": "2017-08-05", + "size": 5144, + "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", + "md5": "aca9640ec8beee21b098bcf8ecc91442", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/GuardedBy.java", - "scan_errors": [], - "licenses": [ - { - "key": "cc-by-2.5", - "score": 70.0, - "short_name": "CC-BY-2.5", - "category": "Permissive", - "owner": "Creative Commons", - "homepage_url": "http://creativecommons.org/licenses/by/2.5/", - "text_url": "http://creativecommons.org/licenses/by/2.5/legalcode", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:cc-by-2.5", - "spdx_license_key": "CC-BY-2.5", - "spdx_url": "https://spdx.org/licenses/CC-BY-2.5", - "start_line": 10, - "end_line": 11, - "matched_rule": { - "identifier": "cc-by-2.5_4.RULE", - "license_choice": false, - "licenses": [ - "cc-by-2.5" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright (c) 2005 Brian Goetz and Tim Peierls" - ], - "holders": [ - "Brian Goetz and Tim Peierls" - ], - "authors": [], - "start_line": 9, - "end_line": 12 - }, - { - "statements": [], - "holders": [], - "authors": [ - "Bela Ban" - ], - "start_line": 14, - "end_line": 17 - } - ], - "packages": [] + "type": "file", + "name": "GuardedBy.java", + "base_name": "GuardedBy", + "extension": ".java", + "date": "2017-08-05", + "size": 813, + "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", + "md5": "c5064400f759d3e81771005051d17dc1", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/ImmutableReference.java", - "scan_errors": [], - "licenses": [ - { - "key": "lgpl-2.1-plus", - "score": 100.0, - "short_name": "LGPL 2.1 or later", - "category": "Copyleft Limited", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "text_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:lgpl-2.1-plus", - "spdx_license_key": "LGPL-2.1+", - "spdx_url": "https://spdx.org/licenses/LGPL-2.1", - "start_line": 7, - "end_line": 20, - "matched_rule": { - "identifier": "lgpl-2.1-plus_59.RULE", - "license_choice": false, - "licenses": [ - "lgpl-2.1-plus" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright 2010, Red Hat, Inc." - ], - "holders": [ - "Red Hat, Inc." - ], - "authors": [], - "start_line": 2, - "end_line": 5 - }, - { - "statements": [], - "holders": [], - "authors": [ - "Brian Stansberry" - ], - "start_line": 29, - "end_line": 29 - } - ], - "packages": [] + "type": "file", + "name": "ImmutableReference.java", + "base_name": "ImmutableReference", + "extension": ".java", + "date": "2017-08-05", + "size": 1838, + "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", + "md5": "48ca3c72fb9a65c771a321222f118b88", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/RATE_LIMITER.java", - "scan_errors": [], - "licenses": [], - "copyrights": [ - { - "statements": [], - "holders": [], - "authors": [ - "Bela Ban" - ], - "start_line": 14, - "end_line": 17 - } - ], - "packages": [] + "type": "file", + "name": "RATE_LIMITER.java", + "base_name": "RATE_LIMITER", + "extension": ".java", + "date": "2017-08-05", + "size": 3692, + "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", + "md5": "4626bdbc48871b55513e1a12991c61a8", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/RouterStub.java", - "scan_errors": [], - "licenses": [], - "copyrights": [ - { - "statements": [], - "holders": [], - "authors": [ - "Bela Ban" - ], - "start_line": 22, - "end_line": 24 - } - ], - "packages": [] + "type": "file", + "name": "RouterStub.java", + "base_name": "RouterStub", + "extension": ".java", + "date": "2017-08-05", + "size": 9913, + "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", + "md5": "eecfe23494acbcd8088c93bc1e83c7f2", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/RouterStubManager.java", - "scan_errors": [], - "licenses": [ - { - "key": "lgpl-2.1-plus", - "score": 100.0, - "short_name": "LGPL 2.1 or later", - "category": "Copyleft Limited", - "owner": "Free Software Foundation (FSF)", - "homepage_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "text_url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:lgpl-2.1-plus", - "spdx_license_key": "LGPL-2.1+", - "spdx_url": "https://spdx.org/licenses/LGPL-2.1", - "start_line": 7, - "end_line": 20, - "matched_rule": { - "identifier": "lgpl-2.1-plus_59.RULE", - "license_choice": false, - "licenses": [ - "lgpl-2.1-plus" - ] - } - } - ], - "copyrights": [ - { - "statements": [ - "Copyright 2009, Red Hat Middleware LLC" - ], - "holders": [ - "Red Hat Middleware LLC" - ], - "authors": [], - "start_line": 2, - "end_line": 5 - } - ], - "packages": [] + "type": "file", + "name": "RouterStubManager.java", + "base_name": "RouterStubManager", + "extension": ".java", + "date": "2017-08-05", + "size": 8162, + "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", + "md5": "20bee9631b7c82a45c250e095352aec7", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] }, { "path": "JGroups.tgz/JGroups/src/S3_PING.java", - "scan_errors": [], - "licenses": [ - { - "key": "public-domain", - "score": 10.0, - "short_name": "Public Domain", - "category": "Public Domain", - "owner": "Unspecified", - "homepage_url": "http://www.linfo.org/publicdomain.html", - "text_url": "", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:public-domain", - "spdx_license_key": "", - "spdx_url": "", - "start_line": 1649, - "end_line": 1649, - "matched_rule": { - "identifier": "public-domain.LICENSE", - "license_choice": false, - "licenses": [ - "public-domain" - ] - } - }, - { - "key": "public-domain", - "score": 10.0, - "short_name": "Public Domain", - "category": "Public Domain", - "owner": "Unspecified", - "homepage_url": "http://www.linfo.org/publicdomain.html", - "text_url": "", - "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:public-domain", - "spdx_license_key": "", - "spdx_url": "", - "start_line": 1692, - "end_line": 1692, - "matched_rule": { - "identifier": "public-domain.LICENSE", - "license_choice": false, - "licenses": [ - "public-domain" - ] - } - } - ], - "copyrights": [ - { - "statements": [], - "holders": [], - "authors": [ - "Bela Ban" - ], - "start_line": 35, - "end_line": 38 - }, - { - "statements": [], - "holders": [], - "authors": [ - "Robert Harder", - "rob@iharder.net" - ], - "start_line": 1697, - "end_line": 1700 - } - ], - "packages": [] + "type": "file", + "name": "S3_PING.java", + "base_name": "S3_PING", + "extension": ".java", + "date": "2017-08-05", + "size": 122528, + "sha1": "08dba9986f69719970ead3592dc565465164df0d", + "md5": "83d8324f37d0e3f120bc89865cf0bd39", + "files_count": 0, + "dirs_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index f6d11cd19f2..0f3412c0a0f 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -1,6 +1,8 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", + "--output-json": "", "--package": true }, "files_count": 1, diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index abc79d7e830..1a6b66f37dd 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -1,7 +1,9 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--info": true, + "--output-json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index e2e088ffed8..daf9814ef0b 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -1,13 +1,15 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, - "--package": true, "--email": true, - "--url": true, "--info": true, - "--strip-root": true + "--license": true, + "--output-json": "", + "--package": true, + "--strip-root": true, + "--url": true }, "files_count": 3, "files": [ diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json index 2148ad88e03..b1d52686b84 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json @@ -1,17 +1,17 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, - "--package": true, "--email": true, - "--url": true, "--info": true, - "--license-score": 0, + "--license": true, + "--output-json": "", + "--package": true, "--strip-root": true, - "--format": "json" + "--url": true }, - "files_count": 4, + "files_count": 3, "files": [ { "path": "unicodepath", @@ -24,6 +24,7 @@ "sha1": null, "md5": null, "files_count": 3, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -50,7 +51,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -77,7 +79,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -104,7 +107,8 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index 82ba666dcbb..4000f1303ab 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -1,17 +1,17 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, - "--license": true, - "--package": true, "--email": true, - "--url": true, "--info": true, - "--license-score": 0, + "--license": true, + "--output-json": "", + "--package": true, "--strip-root": true, - "--format": "json" + "--url": true }, - "files_count": 4, + "files_count": 3, "files": [ { "path": "unicodepath", @@ -23,6 +23,7 @@ "sha1": null, "md5": null, "files_count": 3, + "dirs_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -48,7 +49,8 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -74,7 +76,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -100,7 +103,8 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index 938fff328ec..e315afbb629 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -1,11 +1,13 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, "--info": true, + "--output-json": "", "--strip-root": true }, - "files_count": 0, + "files_count": 5, "files": [ { "path": "some 'file", diff --git a/tests/scancode/data/weird_file_name/expected-mac.json b/tests/scancode/data/weird_file_name/expected-mac.json index ee28dbb6552..5603b9a0dce 100644 --- a/tests/scancode/data/weird_file_name/expected-mac.json +++ b/tests/scancode/data/weird_file_name/expected-mac.json @@ -1,11 +1,11 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--output-json": "", + "--strip-root": true }, "files_count": 5, "files": [ @@ -19,7 +19,8 @@ "size": 20, "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -42,7 +43,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -65,7 +67,8 @@ "size": 38, "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -88,7 +91,8 @@ "size": 39, "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -111,7 +115,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", diff --git a/tests/scancode/data/weird_file_name/expected-win.json b/tests/scancode/data/weird_file_name/expected-win.json index 4c28553bf3d..9e973dea37b 100644 --- a/tests/scancode/data/weird_file_name/expected-win.json +++ b/tests/scancode/data/weird_file_name/expected-win.json @@ -1,11 +1,11 @@ { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { + "input": "", "--copyright": true, "--info": true, - "--license-score": 0, - "--strip-root": true, - "--format": "json" + "--output-json": "", + "--strip-root": true }, "files_count": 5, "files": [ @@ -18,7 +18,8 @@ "size": 39, "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -40,7 +41,8 @@ "size": 20, "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -62,7 +64,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -84,7 +87,8 @@ "size": 38, "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -106,7 +110,8 @@ "size": 21, "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index af9b207ca8d..55b38b19211 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -47,6 +47,9 @@ from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain +from plugincode import output +output._TEST_MODE = True + test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -205,7 +208,7 @@ def test_scan_info_license_copyrights(): def test_scan_license_with_url_template(): test_dir = test_env.get_test_loc('license_url', copy=True) - result = run_scan_click(['--license', '--license-url-template', 'https://example.com/urn:{}', test_dir]) + result = run_scan_click(['--license', '--license-url-template', 'https://example.com/urn:{}', test_dir, '--json', '-']) assert result.exit_code == 0 assert 'Scanning done' in result.output assert 'https://example.com/urn:apache-1.0' in result.output @@ -272,16 +275,17 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.html') - result = run_scan_click([ '--copyright', test_file , '--format-html', result_file]) - assert result.exit_code == 1 + result = run_scan_click([ '--copyright', test_file , '--output-html', result_file]) + print(result.output) assert 'Scanning done' in result.output + assert result.exit_code == 1 def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_errors_and_keep_trucking_with_html_app(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.app.html') - result = run_scan_click([ '--copyright', test_file, '--format-html-app',result_file]) + result = run_scan_click([ '--copyright', test_file, '--output-html-app', result_file]) assert result.exit_code == 1 assert 'Scanning done' in result.output @@ -291,11 +295,11 @@ def test_scan_works_with_multiple_processes(): # run the same scan with one or three processes result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', '--format', 'json', test_dir, result_file_1]) + result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--output-json', result_file_1]) assert result1.exit_code == 0 result_file_3 = test_env.get_temp_file('json') - result3 = run_scan_click([ '--copyright', '--processes', '3', '--format', 'json', test_dir, result_file_3]) + result3 = run_scan_click([ '--copyright', '--processes', '3', test_dir, '--output-json', result_file_3]) assert result3.exit_code == 0 res1 = json.loads(open(result_file_1).read()) res3 = json.loads(open(result_file_3).read()) @@ -307,12 +311,12 @@ def test_scan_works_with_no_processes_in_single_threaded_mode(): # run the same scan with zero or one process result_file_0 = test_env.get_temp_file('json') - result0 = run_scan_click([ '--copyright', '--processes', '0', '--format', 'json', test_dir, result_file_0]) + result0 = run_scan_click([ '--copyright', '--processes', '0', test_dir, '--output-json', result_file_0]) assert result0.exit_code == 0 - assert 'Disabling multi-processing and multi-threading...' in result0.output + assert 'Disabling multi-processing.' in result0.output result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', '--format', 'json', test_dir, result_file_1]) + result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--output-json', result_file_1]) assert result1.exit_code == 0 res0 = json.loads(open(result_file_0).read()) res1 = json.loads(open(result_file_1).read()) @@ -335,7 +339,7 @@ def test_scan_works_with_multiple_processes_and_timeouts(): result = run_scan_click( [ '--copyright', '--processes', '2', '--timeout', '0.000001', - '--strip-root', '--format', 'json', test_dir, '--json', result_file], + '--strip-root', test_dir, '--json', result_file], ) assert result.exit_code == 1 @@ -343,24 +347,19 @@ def test_scan_works_with_multiple_processes_and_timeouts(): expected = [ [(u'path', u'test1.txt'), (u'scan_errors', - [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', - u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), (u'copyrights', []) ], - [(u'path', u'test2.txt'), (u'scan_errors', - [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', - u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), (u'copyrights', []) ], - [(u'path', u'test3.txt'), (u'scan_errors', - [u'ERROR: for scanner: infos:\nERROR: Processing interrupted: timeout after 0 seconds.', - u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), + [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), (u'copyrights', []) - ] + ], ] result_json = json.loads(open(result_file).read(), object_pairs_hook=OrderedDict) @@ -412,9 +411,9 @@ def test_scan_does_not_fail_when_scanning_unicode_test_files_from_express(): test_dir = fsencode(test_dir) args = ['-n0', '--info', '--license', '--copyright', - '--package', '--email', '--url', '--strip-root', + '--package', '--email', '--url', '--strip-root', '--json', '-', test_dir] - result = run_scan_click(args, catch_exceptions=False) + result = run_scan_click(args) if result.exit_code != 0: raise Exception(result.output, args) assert 'Scanning done' in result.output @@ -431,34 +430,34 @@ def test_scan_can_handle_licenses_with_unicode_metadata(): def test_scan_quiet_to_file_does_not_echo_anything(): test_dir = test_env.extract_test_tar('info/basic.tgz') - result1_file = test_env.get_temp_file('json') + result_file = test_env.get_temp_file('json') - result1 = run_scan_click(['--quiet', '--info', test_dir, result1_file]) - assert result1.exit_code == 0 - assert not result1.output + result = run_scan_click(['--quiet', '--info', test_dir, '--json', result_file]) + assert not result.output + assert result.exit_code == 0 def test_scan_quiet_to_stdout_only_echoes_json_results(): test_dir = test_env.extract_test_tar('info/basic.tgz') - result1_file = test_env.get_temp_file('json') + result_file = test_env.get_temp_file('json') - result1 = run_scan_click(['--quiet', '--info', test_dir, result1_file]) - assert result1.exit_code == 0 - assert not result1.output + result_to_file = run_scan_click(['--quiet', '--info', test_dir, '--json-pp', result_file]) + assert result_to_file.exit_code == 0 + assert not result_to_file.output # also test with an output of JSON to stdout - result2 = run_scan_click(['--quiet', '--info', test_dir]) - assert result2.exit_code == 0 + result_to_stdout = run_scan_click(['--quiet', '--info', test_dir, '--json-pp', '-']) + assert result_to_stdout.exit_code == 0 # outputs to file or stdout should be identical - result1_output = open(result1_file).read() - assert result1_output == result2.output + result1_output = open(result_file).read() + assert result1_output == result_to_stdout.output -def test_scan_verbose_does_not_echo_ansi_escapes(): +def test_scan_verbose_to_stdout_does_not_echo_ansi_escapes(): test_dir = test_env.extract_test_tar('info/basic.tgz') - result = run_scan_click(['--verbose', '--info', test_dir]) + result = run_scan_click(['--verbose', '--info', test_dir, '--json', '-']) assert result.exit_code == 0 assert '[?' not in result.output @@ -543,7 +542,7 @@ def test_scan_can_run_from_other_directory(): def test_scan_logs_errors_messages_not_verbosely_on_stderr(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '-n', '0', test_file]) + rc, stdout, stderr = run_scan_plain(['-pi', '-n', '0', test_file, '--json', '-']) assert rc == 1 assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -552,7 +551,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr(): def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '-n', '2', test_file]) + rc, stdout, stderr = run_scan_plain(['-pi', '-n', '2', test_file, '--json', '-']) assert rc == 1 assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -561,7 +560,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing( def test_scan_logs_errors_messages_verbosely_with_verbose(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '0', test_file, ]) + rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '0', test_file, '--json', '-']) assert rc == 1 assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout @@ -571,7 +570,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose(): def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '2', test_file, ]) + rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '2', test_file, '--json', '-']) assert rc == 1 assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout diff --git a/tests/scancode/test_extract_cli.py b/tests/scancode/test_extract_cli.py index faf5f886e40..5b0ffca8154 100644 --- a/tests/scancode/test_extract_cli.py +++ b/tests/scancode/test_extract_cli.py @@ -191,7 +191,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names_verbose(monk if on_linux: test_dir = fsencode(test_dir) runner = CliRunner() - result = runner.invoke(extract_cli.extractcode, ['--verbose', test_dir], catch_exceptions=False) + result = runner.invoke(extract_cli.extractcode, ['--verbose', test_dir]) assert result.exit_code == 0 assert 'Sanders' in result.output @@ -216,7 +216,7 @@ def test_extractcode_command_can_extract_archive_with_unicode_names(monkeypatch) if on_linux: test_dir = fsencode(test_dir) runner = CliRunner() - result = runner.invoke(extract_cli.extractcode, [test_dir], catch_exceptions=False) + result = runner.invoke(extract_cli.extractcode, [test_dir]) assert result.exit_code == 0 uni_arch = b'unicodepath.tgz' if on_linux else 'unicodepath.tgz' diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 5e570e9252f..624572ecd3b 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -36,6 +36,9 @@ from scancode.cli_test_utils import _load_json_result from scancode.resource import Codebase +from plugincode import output +output._TEST_MODE = True + class TestPluginIgnoreFiles(FileDrivenTesting): @@ -68,8 +71,7 @@ def test_is_ignored_glob_file(self): def test_ProcessIgnore_with_single_file(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', option='--ignore', - value=('sample.doc',), pretty_value=None) + option = CommandOption(help_group=None, name='ignore', value=('sample.doc',), param=None) test_plugin = ProcessIgnore([option]) expected = [ 'user', @@ -87,8 +89,7 @@ def test_ProcessIgnore_with_single_file(self): def test_ProcessIgnore_with_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', option='--ignore', - value=('ignore.doc', 'sample.doc',), pretty_value=None) + option = CommandOption(help_group=None, name='ignore', value=('ignore.doc', 'sample.doc',), param=None) test_plugin = ProcessIgnore([option]) expected = [ 'user', @@ -104,8 +105,7 @@ def test_ProcessIgnore_with_multiple_files(self): def test_ProcessIgnore_with_glob_for_extension(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', option='--ignore', - value=('*.doc',), pretty_value=None) + option = CommandOption(help_group=None, name='ignore', value=('*.doc',), param=None) test_plugin = ProcessIgnore([option]) expected = [ @@ -122,8 +122,7 @@ def test_ProcessIgnore_with_glob_for_extension(self): def test_ProcessIgnore_with_glob_for_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', option='--ignore', - value=('*/src/test',), pretty_value=None) + option = CommandOption(help_group=None, name='ignore', value=('*/src/test',), param=None) test_plugin = ProcessIgnore([option]) expected = [ @@ -141,10 +140,8 @@ def test_ProcessIgnore_with_glob_for_path(self): def test_ProcessIgnore_with_multiple_plugins(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') test_plugins = [ - ProcessIgnore([CommandOption(help_group=None, name='ignore', option='--ignore', - value=('*.doc',), pretty_value=None)]), - ProcessIgnore([CommandOption(help_group=None, name='ignore', option='--ignore', - value=('*/src/test/*',), pretty_value=None)]), + ProcessIgnore([CommandOption(help_group=None, name='ignore', value=('*.doc',), param=None)]), + ProcessIgnore([CommandOption(help_group=None, name='ignore', value=('*/src/test/*',), param=None)]), ] expected = [ @@ -169,7 +166,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', test_dir, result_file]) + result = run_scan_click(['--copyright', '--strip-root', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should be listed @@ -179,8 +176,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, result_file], - catch_exceptions=False) + result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should be listed @@ -193,7 +189,7 @@ def test_scancode_ignore_single_file(self): result_file = self.get_temp_file('json') result = run_scan_click( - ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, result_file]) + ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 3 == scan_result['files_count'] @@ -213,7 +209,7 @@ def test_scancode_ignore_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] @@ -224,7 +220,7 @@ def test_scancode_ignore_glob_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 1 == scan_result['files_count'] @@ -235,7 +231,7 @@ def test_scancode_ignore_glob_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] @@ -246,7 +242,7 @@ def test_scancode_multiple_ignores(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, '--output-json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 0 == scan_result['files_count'] diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py index 86a4c442ca6..2fbd64f172c 100644 --- a/tests/scancode/test_plugin_mark_source.py +++ b/tests/scancode/test_plugin_mark_source.py @@ -33,6 +33,9 @@ from scancode.cli_test_utils import run_scan_click from scancode.plugin_mark_source import is_source_directory +from plugincode import output +output._TEST_MODE = True + class TestMarkSource(FileDrivenTesting): @@ -53,7 +56,7 @@ def test_scan_mark_source_without_info(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/without_info.expected.json') - _result = run_scan_click(['--mark-source', test_dir, result_file]) + _result = run_scan_click(['--mark-source', test_dir, '--output-json', result_file]) check_json_scan(expected_file, result_file, regen=False) def test_scan_mark_source_with_info(self): @@ -61,5 +64,5 @@ def test_scan_mark_source_with_info(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/with_info.expected.json') - _result = run_scan_click(['--info', '--mark-source', test_dir, result_file]) + _result = run_scan_click(['--info', '--mark-source', test_dir, '--output-json', result_file]) check_json_scan(expected_file, result_file) From 72bfdbd5f5604dd71f13d04174da31dbb1ec7d1e Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 18 Jan 2018 16:51:13 +0100 Subject: [PATCH 052/122] Fix typo in configure message Signed-off-by: Philippe Ombredanne --- etc/configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/configure.py b/etc/configure.py index 44cada3448a..7d5bb6448f0 100644 --- a/etc/configure.py +++ b/etc/configure.py @@ -213,7 +213,7 @@ def create_virtualenv(std_python, root_dir, tpp_dirs, quiet=False): def activate(root_dir): """ Activate a virtualenv in the current process.""" - print("* Activating ...") + #print("* Activating...") bin_dir = os.path.join(root_dir, 'bin') activate_this = os.path.join(bin_dir, 'activate_this.py') with open(activate_this) as f: From f66f13d27b904a6a5633cc9f4db9b70317fb00d8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 18 Jan 2018 16:51:59 +0100 Subject: [PATCH 053/122] Update release script output options #787 Signed-off-by: Philippe Ombredanne --- etc/release/release.sh | 43 ++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/etc/release/release.sh b/etc/release/release.sh index 2e8684d6fe7..a4f03caf795 100755 --- a/etc/release/release.sh +++ b/etc/release/release.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved. +# Copyright (c) 2018 nexB Inc. http://www.nexb.com/ - All rights reserved. # # ScanCode release script @@ -52,17 +52,36 @@ function test_scan { # this is needed for the zip chmod o+x scancode extractcode - # minimal test: update when new scans are available - ./scancode --quiet -lcip apache-2.0.LICENSE test_scan.json - echo "TEST JSON passed: ./scancode --quiet -lcip apache-2.0.LICENSE test_scan.json" - ./scancode --quiet -lcip --format json-pp apache-2.0.LICENSE test_scan.json - echo "TEST JSON-PP passed: ./scancode --quiet -lcip --format json-pp apache-2.0.LICENSE test_scan.json" - ./scancode --quiet -lcip --format html apache-2.0.LICENSE test_scan.html - echo "TEST HTML passed: ./scancode --quiet -lcip --format html apache-2.0.LICENSE test_scan.html" - ./scancode --quiet -lcip --format html-app apache-2.0.LICENSE test_scan_app.html - echo "TEST HTML-APP passed: ./scancode --quiet -lcip --format html-app apache-2.0.LICENSE test_scan_app.html" - ./extractcode --quiet samples/arch - echo "TEST EXTRACTCODE passed: ./extractcode --quiet samples/arch" + # minimal tests: update when new scans are available + cmd="./scancode --quiet -lcip apache-2.0.LICENSE --json test_scan.json" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" + + cmd="./scancode --quiet -lcip apache-2.0.LICENSE --json-pp test_scan.json" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" + + cmd="./scancode --quiet -lcip apache-2.0.LICENSE --output-html test_scan.html" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" + + cmd="./scancode --quiet -lcip apache-2.0.LICENSE --output-html-app test_scan_app.html" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" + + cmd="./scancode --quiet -lcip apache-2.0.LICENSE --output-spdx-tv test_scan.spdx" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" + + cmd="./extractcode --quiet samples/arch" + echo "RUNNING TEST: $cmd" + $cmd + echo "TEST PASSED" # cleanup cd .. From d69e9592eb4ecf1952cf3b374c7f84bafec6978c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 18 Jan 2018 20:09:56 +0100 Subject: [PATCH 054/122] Improve CLI options handling #787 * ensure that a File option used in output cannot bet set to the value of a command line option. This is done with FileOptionType, a click.File subclass that verifies that a file name is not one of the avaialble options and fails if this is the case. Reported by @JonoYang * move CommandLineOption to scancode.__init__.py * add new args to CommandLineOption: requires and conflicts. Each are a sequence of other option names that either conflict with this option or are require to be set with this option. --strip-root, --full-root, --verbose, --quiet and plugin options with option dependencies are now using this feature. The CLI fails early if requirements are not met or conflicts exist. Added a few simple tests for this. * add new sort_order arg to CommandLineOption and used it to set a relative sort order for options helps in a help group * add new documentation CLI help_group for help and other related options. Reorganized CLI help * renamed json-realted output CLI options to plain json-* Signed-off-by: Philippe Ombredanne --- etc/scripts/test_json2csv.py | 2 +- src/formattedcode/output_csv.py | 10 +- src/formattedcode/output_html.py | 43 ++-- src/formattedcode/output_json.py | 20 +- src/formattedcode/output_jsonlines.py | 11 +- src/formattedcode/output_spdx.py | 12 +- src/plugincode/__init__.py | 4 +- src/plugincode/scan.py | 4 +- src/scancode/__init__.py | 231 +++++++++++++++++- src/scancode/cli.py | 176 ++++++------- src/scancode/plugin_copyright.py | 3 +- src/scancode/plugin_ignore.py | 3 +- src/scancode/plugin_license.py | 15 +- src/scancode/plugin_mark_source.py | 2 +- src/scancode/plugin_package.py | 3 +- .../data/json/simple-expected.json | 2 +- .../data/json/simple-expected.jsonlines | 2 +- .../data/json/simple-expected.jsonpp | 2 +- .../data/json/tree/expected.json | 2 +- tests/formattedcode/test_output_json.py | 8 +- tests/formattedcode/test_output_jsonlines.py | 2 +- .../data/altpath/copyright.expected.json | 2 +- .../data/composer/composer.expected.json | 2 +- .../data/failing/patchelf.expected.json | 2 +- tests/scancode/data/help/help.txt | 79 +++--- tests/scancode/data/info/all.expected.json | 2 +- .../data/info/all.rooted.expected.json | 2 +- tests/scancode/data/info/basic.expected.json | 2 +- .../data/info/basic.rooted.expected.json | 2 +- .../data/info/email_url_info.expected.json | 2 +- .../scancode/data/license_text/test.expected | 2 +- .../data/non_utf8/expected-linux.json | 2 +- .../scancode/data/non_utf8/expected-mac.json | 2 +- .../scancode/data/non_utf8/expected-win.json | 58 +++-- .../with_info.expected.json | 2 +- .../without_info.expected.json | 2 +- .../data/plugin_only_findings/expected.json | 2 +- ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 2 +- .../data/single/iproute.expected.json | 2 +- .../unicodepath.expected-linux.json | 2 +- .../unicodepath/unicodepath.expected-mac.json | 2 +- .../unicodepath/unicodepath.expected-win.json | 2 +- .../data/weird_file_name/expected-linux.json | 2 +- .../data/weird_file_name/expected-mac.json | 2 +- .../data/weird_file_name/expected-win.json | 2 +- tests/scancode/test_cli.py | 47 +++- tests/scancode/test_plugin_ignore.py | 16 +- tests/scancode/test_plugin_mark_source.py | 4 +- tests/scancode/test_scan_utils.py | 11 +- 49 files changed, 532 insertions(+), 284 deletions(-) diff --git a/etc/scripts/test_json2csv.py b/etc/scripts/test_json2csv.py index da708fcc060..d083b76aac8 100644 --- a/etc/scripts/test_json2csv.py +++ b/etc/scripts/test_json2csv.py @@ -215,7 +215,7 @@ def test_can_process_scan_from_json_scan(self): scan_cmd = os.path.join(scancode.root_dir, 'scancode') rc, _stdout, _stderr = execute(scan_cmd, ['-clip', '--email', '--url', '--strip-root', test_dir, - '--output-json', json_file]) + '--json', json_file]) assert rc == 0 result_file = self.get_temp_file('.csv') with open(result_file, 'wb') as rf: diff --git a/src/formattedcode/output_csv.py b/src/formattedcode/output_csv.py index 49648bc642b..5188cc2a8f1 100644 --- a/src/formattedcode/output_csv.py +++ b/src/formattedcode/output_csv.py @@ -29,24 +29,26 @@ from collections import OrderedDict -import click import unicodecsv from plugincode.output import output from plugincode.output import OutputPlugin from scancode import CommandLineOption +from scancode import FileOptionType from scancode import OUTPUT_GROUP + @output class CsvOutput(OutputPlugin): options = [ CommandLineOption(('--output-csv',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as CSV to FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as CSV to FILE.', + help_group=OUTPUT_GROUP, + sort_order= 30), ] def is_enabled(self): diff --git a/src/formattedcode/output_html.py b/src/formattedcode/output_html.py index fa620a15a45..c37275c7bfb 100644 --- a/src/formattedcode/output_html.py +++ b/src/formattedcode/output_html.py @@ -53,9 +53,9 @@ from plugincode.output import output from plugincode.output import OutputPlugin from scancode import CommandLineOption +from scancode import FileOptionType from scancode import OUTPUT_GROUP - """ Output plugins to write scan results using templates such as HTML. @@ -69,10 +69,11 @@ class HtmlOutput(OutputPlugin): options = [ CommandLineOption(('--output-html',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as HTML to FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as HTML to FILE.', + help_group=OUTPUT_GROUP, + sort_order=50), ] def is_enabled(self): @@ -84,39 +85,28 @@ def save_results(self, codebase, results, files_count, version, notice, options) write_templated(output_file, results, version, template_or_format='html') -# TODO: Implmenet me as a proper callback with partial -def validate_together(ctx, options): - """ - Validate that a list of `options` names are all provided. - Raise a UsageError on errors. - """ - ctx_params = ctx.params - requested_options = [ctx_params[eop] for eop in options if ctx_params[eop]] - if len(options) != requested_options: - msg = ' and '.join('`' + eo.replace('_', '-') + '`' for eo in options) - msg += ' options are required to be set together. You must use set all of them.' - raise click.UsageError(msg) - - @output class CustomTemplateOutput(OutputPlugin): options = [ CommandLineOption(('--output-custom',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), + requires=['custom_template'], metavar='FILE', help='Write scan output to FILE formatted with ' 'the custom Jinja template file.', - help_group=OUTPUT_GROUP), + help_group=OUTPUT_GROUP, + sort_order=60), CommandLineOption(('--custom-template',), type=click.Path( exists=True, file_okay=True, dir_okay=False, readable=True, path_type=PATH_TYPE), - default=None, + requires=['output_custom'], metavar='FILE', help='Use this Jinja template FILE as a custom template.', - help_group=OUTPUT_GROUP) + help_group=OUTPUT_GROUP, + sort_order=65), ] def is_enabled(self): @@ -137,14 +127,15 @@ def save_results(self, codebase, results, files_count, version, notice, options) @output class HtmlAppOutput(OutputPlugin): """ - Write scan output formatted as a mini HTML application. + Write scan output as a mini HTML application. """ options = [ CommandLineOption(('--output-html-app',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as a mini HTML application FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as a mini HTML application to FILE.', + help_group=OUTPUT_GROUP, + sort_order=70), ] def is_enabled(self): diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py index 84c1d6e0c4a..f11e9eb861e 100644 --- a/src/formattedcode/output_json.py +++ b/src/formattedcode/output_json.py @@ -27,12 +27,12 @@ from collections import OrderedDict -import click import simplejson from plugincode.output import output from plugincode.output import OutputPlugin from scancode import CommandLineOption +from scancode import FileOptionType from scancode import OUTPUT_GROUP """ @@ -44,11 +44,12 @@ class JsonCompactOutput(OutputPlugin): options = [ - CommandLineOption(('--json', '--output-json',), - type=click.File(mode='wb', lazy=False), + CommandLineOption(('--json', 'output_json',), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as compact JSON to FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as compact JSON to FILE.', + help_group=OUTPUT_GROUP, + sort_order= 10), ] def is_enabled(self): @@ -64,11 +65,12 @@ def save_results(self, codebase, results, files_count, version, notice, options) class JsonPrettyOutput(OutputPlugin): options = [ - CommandLineOption(('--json-pp', '--output-json-pp',), - type=click.File(mode='wb', lazy=False), + CommandLineOption(('--json-pp', 'output_json_pp',), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as pretty-printed JSON to FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as pretty-printed JSON to FILE.', + help_group=OUTPUT_GROUP, + sort_order= 10), ] def is_enabled(self): diff --git a/src/formattedcode/output_jsonlines.py b/src/formattedcode/output_jsonlines.py index d7f6cbb507d..32e36c47038 100644 --- a/src/formattedcode/output_jsonlines.py +++ b/src/formattedcode/output_jsonlines.py @@ -27,12 +27,12 @@ from collections import OrderedDict -import click import simplejson from plugincode.output import output from plugincode.output import OutputPlugin from scancode import CommandLineOption +from scancode import FileOptionType from scancode import OUTPUT_GROUP @@ -40,11 +40,12 @@ class JsonLinesOutput(OutputPlugin): options = [ - CommandLineOption(('--output-json-lines',), - type=click.File(mode='wb', lazy=False), + CommandLineOption(('--json-lines','output_json_lines',), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as JSON Lines to FILE.', - help_group=OUTPUT_GROUP) + help='Write scan output as JSON Lines to FILE.', + help_group=OUTPUT_GROUP, + sort_order= 15), ] def is_enabled(self): diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index 5372f0291aa..835bdd96297 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -35,7 +35,6 @@ from os.path import join import sys -import click from spdx.checksum import Algorithm from spdx.creationinfo import Tool from spdx.document import Document @@ -50,6 +49,7 @@ from plugincode.output import output from plugincode.output import OutputPlugin from scancode import CommandLineOption +from scancode import FileOptionType from scancode import OUTPUT_GROUP # Python 2 and 3 support @@ -94,9 +94,9 @@ class SpdxTvOutput(OutputPlugin): options = [ CommandLineOption(('--output-spdx-tv',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as SPDX Tag/Value to FILE. ' + help='Write scan output as SPDX Tag/Value to FILE. ' 'Implies running the --info scan.', help_group=OUTPUT_GROUP) ] @@ -116,9 +116,9 @@ class SpdxRdfOutput(OutputPlugin): options = [ CommandLineOption(('--output-spdx-rdf',), - type=click.File(mode='wb', lazy=False), + type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output formatted as SPDX RDF to FILE. ' + help='Write scan output as SPDX RDF to FILE. ' 'Implies running the --info scan.', help_group=OUTPUT_GROUP) ] @@ -135,7 +135,7 @@ def save_results(self, codebase, results, files_count, version, notice, options) def write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True): """ - Write scan output formatted as SPDX Tag/value or RDF. + Write scan output as SPDX Tag/value or RDF. """ absinput = abspath(input_file) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index af2f38b34f3..7fffe18068d 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -64,7 +64,7 @@ class BasePlugin(object): # This is set automatically when a plugin class is loaded in its manager. # Subclasses must not set this. name = None - + # set to True for testing _test_mode = False @@ -104,7 +104,7 @@ def setup(self, **kwargs): pass # NOTE: Other methods below should NOT be overriden. - + @property def qname(self): """ diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py index 1584628efd7..5ea12edd915 100644 --- a/src/plugincode/scan.py +++ b/src/plugincode/scan.py @@ -47,10 +47,10 @@ class ScanPlugin(BasePlugin): "name" attribute. This attribute is set automatically as the "entrypoint" name used for this plugin. """ - + # a relative sort order number (integer or float). In scan results, results # from scanners are sorted by this sorted_order then by "key" which is the - # scanner plugin name + # scanner plugin name. This is also used in the CLI UI sort_order = 100 # TODO: pass own command options name/values as concrete kwargs diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index b1cc5c71fb9..cba072672ca 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,21 +22,37 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import print_function from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals from collections import namedtuple +from itertools import chain from os.path import dirname from os.path import abspath from os.path import getsize from os.path import getmtime from os.path import join from os.path import exists +from types import BooleanType import click +from click.types import BoolParamType from commoncode import fileutils +# Python 2 and 3 support +try: + # Python 2 + unicode + str_orig = str + bytes = str # @ReservedAssignment + str = unicode # @ReservedAssignment +except NameError: + # Python 3 + unicode = str # @ReservedAssignment + scan_src_dir = abspath(dirname(__file__)) src_dir = dirname(scan_src_dir) @@ -56,6 +72,24 @@ __version__ = '2.2.1' +# Tracing flags +TRACE = False + +def logger_debug(*args): + pass + +if TRACE: + import logging + import sys + logger = logging.getLogger(__name__) + logging.basicConfig(stream=sys.stdout) + logger.setLevel(logging.DEBUG) + + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, (unicode, str)) + and a or repr(a) for a in args)) + + # CLI help groups SCAN_GROUP = 'primary scans' SCAN_OPTIONS_GROUP = 'scan options' @@ -66,6 +100,7 @@ PRE_SCAN_GROUP = 'pre-scan' POST_SCAN_GROUP = 'post-scan' MISC_GROUP = 'miscellaneous' +DOC_GROUP = 'documentation' CORE_GROUP = 'core' @@ -80,20 +115,204 @@ class CommandLineOption(click.Option): """ - An option with an extra `help_group` attribute that tells which CLI help group - the option belongs. + An option with extra args and attributes to control CLI help options + grouping, co-required and conflicting options (e.g. mutually exclusive). """ + # args are from Click 6.7 def __init__(self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, expose_value=True, + type=None, help=None, + # custom additions # + # a string that set the CLI help group for this option help_group=MISC_GROUP, + # a relative sort order number (integer or float) for this + # option within a help group: the sort is by increasing + # sort_order then by option declaration. + sort_order = 100, + # a sequence of other option name strings that this option + # requires to be set + requires=(), + # a sequence of other option name strings that this option + # conflicts with if they are set + conflicts=(), **attrs): super(CommandLineOption, self).__init__(param_decls, show_default, prompt, confirmation_prompt, hide_input, is_flag, flag_value, - multiple, count, allow_from_autoenv, type, help, **attrs) + multiple, count, allow_from_autoenv, + type, help, **attrs) + self.help_group = help_group + self.sort_order = sort_order + self.requires = requires + self.conflicts = conflicts + + def __repr__(self, *args, **kwargs): + name = self.name + opt = self.opts[-1] + help_group = self.help_group + requires = self.requires + conflicts = self.conflicts + + return ('CommandLineOption' % locals()) + + def validate_dependencies(self, ctx, value): + """ + Validate `value` against declared `requires` or `conflicts` dependencies. + """ + _validate_option_dependencies(ctx, self, value, self.requires, required=True) + _validate_option_dependencies(ctx, self, value, self.conflicts, required=False) + + +def validate_option_dependencies(ctx): + """ + Validate all CommandLineOption dependencies in the `ctx` Click context. + Ignore eager flags. + """ + values = ctx.params + if TRACE: + logger_debug('validate_option_dependencies: values:') + for va in sorted(values.items()): + logger_debug(' ', va) + + for param in ctx.command.params: + if param.is_eager: + continue + if not isinstance(param, CommandLineOption): + if TRACE: + logger_debug(' validate_option_dependencies: skip param:', param) + continue + value = values.get(param.name) + if TRACE: + logger_debug(' validate_option_dependencies: param:', param, 'value:', value) + param.validate_dependencies(ctx, value) + + +def _validate_option_dependencies(ctx, param, value, + other_option_names, required=False): + """ + Validate the `other_option_names` option dependencies and return a + UsageError if the `param` `value` is set to a not-None non-default value and + if: + - `required` is True and the `other_option_names` options are not set with a + not-None value in the `ctx` context. + - `required` is False and any of the `other_option_names` options are set + with a not-None, non-default value in the `ctx` context. + """ + if not other_option_names: + return + + def _is_set(_value, _default, typ): + if type in (BooleanType, BoolParamType): + return _value + return bool(_value is not None and _value != _default) + + is_set = _is_set(value, param.default, param.type) + + if TRACE: + logger_debug() + logger_debug('Checking param:', param) + logger_debug(' value:', value, 'is_set:' , is_set) + + if not is_set: + return + + oparams_by_name = {oparam.name: oparam for oparam in ctx.command.params} + oparams = [] + missing_onames = [] + + for oname in other_option_names: + oparam = oparams_by_name.get(oname) + if not oparam: + missing_onames.append(oparam) + else: + oparams.append(oparam) + + if TRACE: + logger_debug() + logger_debug(' Available other params:') + for oparam in oparams: + logger_debug(' other param:', oparam) + logger_debug(' value:', ctx.params.get(oparam.name)) + if required: + logger_debug(' missing names:', missing_onames) + + if required and missing_onames: + opt = param.opts[-1] + oopts = [oparam.opts[-1] for oparam in oparams] + omopts = ['--' + oname.replace('_', '-') for oname in missing_onames] + oopts.extend(omopts) + oopts = ', '.join(oopts) + msg = ('The option %(opt)s requires the option(s) %(all_opts)s.' + 'and is missing %(omopts)s. ' + 'You must set all of these options if you use this option.' % locals()) + raise click.UsageError(msg) + + if TRACE: + logger_debug() + logger_debug(' Checking other params:') + + opt = param.opts[-1] + + for oparam in oparams: + ovalue = ctx.params.get(oparam.name) + ois_set = _is_set(ovalue, oparam.default, oparam.type) + + if TRACE: + logger_debug(' Checking oparam:', oparam) + logger_debug(' value:', ovalue, 'ois_set:' , ois_set) + + # by convention the last opt is the long form + oopt = oparam.opts[-1] + oopts = ', '.join(oparam.opts[-1] for oparam in oparams) + all_opts = '%(opt)s and %(oopts)s' % locals() + if required and not ois_set: + msg = ('The option %(opt)s requires the option(s) %(oopts)s ' + 'and is missing %(oopt)s. ' + 'You must set all of these options if you use this option.' % locals()) + raise click.UsageError(msg) + + if not required and ois_set: + msg = ('The option %(opt)s cannot be used together with the %(oopts)s option(s) ' + 'and %(oopt)s is used. ' + 'You can set only one of these options at a time.' % locals()) + raise click.UsageError(msg) + + +def get_command_options(ctx): + """ + Yield CommandOption tuples for each click.Option option in the `ctx` Click + context. Ignore eager flags. + """ + param_values = ctx.params + for param in ctx.command.params: + if param.is_eager: + continue + if param.name == 'test_mode': + continue + + help_group = getattr(param, 'help_group', None) + name = param.name + value = param_values.get(name) + yield CommandOption(help_group, name, value, param) + + +class FileOptionType(click.File): + """ + A click.File subclass that ensures that a file name is not set to an + existing option parameter to avoid mistakes. + """ + def convert(self, value, param, ctx): + known_opts = set(chain.from_iterable(p.opts for p in ctx.command.params + if isinstance(p, click.Option))) + if value in known_opts: + self.fail('Illegal file name conflicting with an option name: %s. ' + 'Use the special "-" file name to print results on screen/stdout.' + % (click.types.filename_to_ui(value), + ), param, ctx) + return click.File.convert(self, value, param, ctx) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index a760922c3ad..c2ca5d5f8d8 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -59,6 +59,7 @@ from scancode import __version__ as version from scancode import CORE_GROUP +from scancode import DOC_GROUP from scancode import MISC_GROUP from scancode import OTHER_SCAN_GROUP from scancode import OUTPUT_GROUP @@ -68,8 +69,9 @@ from scancode import PRE_SCAN_GROUP from scancode import SCAN_GROUP from scancode import SCAN_OPTIONS_GROUP -from scancode import CommandOption +from scancode import get_command_options from scancode import Scanner +from scancode import validate_option_dependencies from scancode.api import get_file_info from scancode.interrupt import DEFAULT_TIMEOUT from scancode.interrupt import interruptible @@ -228,15 +230,16 @@ def print_version(ctx, param, value): \b Scan the 'samples' directory for licenses and copyrights. -Save scan results to a JSON file: +Save scan results to the 'scancode_result.json' JSON file: - scancode --license --copyright --output-json=scancode_result.json samples + scancode --license --copyright --json=scancode_result.json samples \b Scan the 'samples' directory for licenses and package manifests. Print scan -results on screen as pretty-formatted JSON: +results on screen as pretty-formatted JSON (using the special '-' FILE to print +to on screen/to stdout): - scancode --json-pp --license --package samples + scancode --json-pp - --license --package samples Note: when you run scancode, a progress bar is displayed with a counter of the number of files processed. Use --verbose to display file-by-file progress. @@ -286,39 +289,26 @@ def format_options(self, ctx, formatter): (POST_SCAN_GROUP, []), (CORE_GROUP, []), (MISC_GROUP, []), + (DOC_GROUP, []), ]) for param in self.get_params(ctx): # Get the list of option's name and help text help_record = param.get_help_record(ctx) - if help_record: - if getattr(param, 'help_group', None): - # if we have a group, organize options by group - help_groups[param.help_group].append(help_record) - else: - # use the misc group if no group is defined - help_groups[MISC_GROUP].append(help_record) + if not help_record: + continue + # organize options by group + help_group = getattr(param, 'help_group', MISC_GROUP) + sort_order = getattr(param, 'sort_order', 100) + help_groups[help_group].append((sort_order, help_record)) with formatter.section('Options'): - for group, option in help_groups.items(): - if not option: + for group, help_records in help_groups.items(): + if not help_records: continue with formatter.section(group): - formatter.write_dl(option) - - -# TODO: Implmenet me as a proper callback with partial -def validate_exclusive(ctx, exclusive_options): - """ - Validate a list of mutually `exclusive_options` names. - Raise a UsageError on errors. - """ - ctx_params = ctx.params - options = [ctx_params[eop] for eop in exclusive_options if ctx_params[eop]] - if len(options) > 1: - msg = ' and '.join('`' + eo.replace('_', '-') + '`' for eo in exclusive_options) - msg += ' are mutually exclusion options. You can use only one of them.' - raise click.UsageError(msg) + sorted_records = [help_record for _, help_record in sorted(help_records)] + formatter.write_dl(sorted_records) # IMPORTANT: this discovers, loads and validates all available plugins @@ -361,83 +351,60 @@ def print_plugins(ctx, param, value): type=click.Path(exists=True, readable=True, path_type=PATH_TYPE)) @click.option('-i', '--info', - is_flag=True, default=False, + is_flag=True, help='Scan for file information (size, type, checksums, etc).', - help_group=OTHER_SCAN_GROUP, cls=CommandLineOption) + help_group=OTHER_SCAN_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--strip-root', - is_flag=True, default=False, + is_flag=True, + conflicts=['full_root'], help='Strip the root directory segment of all paths. The default is to ' 'always include the last directory segment of the scanned path such ' 'that all paths have a common root directory.', help_group=OUTPUT_CONTROL_GROUP, cls=CommandLineOption) @click.option('--full-root', - is_flag=True, default=False, + is_flag=True, + conflicts=['strip_root'], help='Report full, absolute paths. The default is to always ' 'include the last directory segment of the scanned path such that all ' 'paths have a common root directory.', help_group=OUTPUT_CONTROL_GROUP, cls=CommandLineOption) -@click.option('--verbose', - is_flag=True, default=False, - help='Print progress as file-by-file path instead of a progress bar. ' - 'Print a verbose scan summary.', - help_group=CORE_GROUP, cls=CommandLineOption) - -@click.option('--quiet', - is_flag=True, default=False, - help='Do not print summary or progress.', - help_group=CORE_GROUP, cls=CommandLineOption) - -@click.help_option('-h', '--help', - help_group=CORE_GROUP, cls=CommandLineOption) - @click.option('-n', '--processes', type=int, default=1, metavar='INT', help='Set the number of parallel processes to use. ' 'Disable parallel processing if 0. [default: 1]', - help_group=CORE_GROUP, cls=CommandLineOption) - -@click.option('--examples', - is_flag=True, is_eager=True, - callback=print_examples, - help=('Show command examples and exit.'), - help_group=CORE_GROUP, cls=CommandLineOption) - -@click.option('--about', - is_flag=True, is_eager=True, - callback=print_about, - help='Show information about ScanCode and licensing and exit.', - help_group=CORE_GROUP, cls=CommandLineOption) - -@click.option('--version', - is_flag=True, is_eager=True, - callback=print_version, - help='Show the version and exit.', - help_group=CORE_GROUP, cls=CommandLineOption) + help_group=CORE_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--timeout', type=float, default=DEFAULT_TIMEOUT, metavar='', help='Stop an unfinished file scan after a timeout in seconds. ' - '[default: %d]' % DEFAULT_TIMEOUT, - help_group=CORE_GROUP, cls=CommandLineOption) + '[default: %d seconds]' % DEFAULT_TIMEOUT, + help_group=CORE_GROUP, sort_order=10, cls=CommandLineOption) -@click.option('--plugins', - is_flag=True, is_eager=True, - callback=print_plugins, - help='Print the list of available ScanCode plugins.', - help_group=CORE_GROUP, cls=CommandLineOption) +@click.option('--quiet', + is_flag=True, + conflicts=['verbose'], + help='Do not print summary or progress.', + help_group=CORE_GROUP, sort_order=20, cls=CommandLineOption) + +@click.option('--verbose', + is_flag=True, + conflicts=['quiet'], + help='Print progress as file-by-file path instead of a progress bar. ' + 'Print a verbose scan summary.', + help_group=CORE_GROUP, sort_order=20, cls=CommandLineOption) @click.option('--no-cache', - is_flag=True, default=False, + is_flag=True, help='Do not use on-disk cache for intermediate results. Uses more memory.', - help_group=CORE_GROUP, cls=CommandLineOption) + help_group=CORE_GROUP, sort_order=200, cls=CommandLineOption) @click.option('--timing', - is_flag=True, default=False, + is_flag=True, help='Collect execution timing for each scan and scanned file.', help_group=CORE_GROUP, cls=CommandLineOption) @@ -445,20 +412,46 @@ def print_plugins(ctx, param, value): type=click.Path( exists=True, file_okay=False, dir_okay=True, readable=True, path_type=PATH_TYPE), - default=None, + default=None, sort_order=200, metavar='DIR', help='Set the path to the temporary directory to use for ScanCode ' 'cache and temporary files.', help_group=CORE_GROUP, cls=CommandLineOption) +@click.help_option('-h', '--help', + help_group=DOC_GROUP, sort_order= 10,cls=CommandLineOption) + +@click.option('--examples', + is_flag=True, is_eager=True, + callback=print_examples, + help=('Show command examples and exit.'), + help_group=DOC_GROUP, sort_order= 50,cls=CommandLineOption) + +@click.option('--about', + is_flag=True, is_eager=True, + callback=print_about, + help='Show information about ScanCode and licensing and exit.', + help_group=DOC_GROUP, sort_order= 20,cls=CommandLineOption) + +@click.option('--version', + is_flag=True, is_eager=True, + callback=print_version, + help='Show the version and exit.', + help_group=DOC_GROUP, sort_order= 20,cls=CommandLineOption) + +@click.option('--plugins', + is_flag=True, is_eager=True, + callback=print_plugins, + help='Show the list of available ScanCode plugins and exit.', + help_group=DOC_GROUP, cls=CommandLineOption) + @click.option('--test-mode', is_flag=True, default=False, # not yet supported in Click 6.7 # hidden = True, help='Run ScanCode in a special "test mode". Only for testing.', - help_group=MISC_GROUP, cls=CommandLineOption) - + help_group=MISC_GROUP, sort_order= 1000,cls=CommandLineOption) def scancode(ctx, input, info, # @ReservedAssignment strip_root, full_root, @@ -513,7 +506,7 @@ def scancode(ctx, input, info, # @ReservedAssignment - `strip_root` and `full_root`: boolean flags: In the outputs, strip the first path segment of a file if `strip_root` is True unless the `input` is a single file. If `full_root` is True report the path as an absolute path. - These coptions are mutually exclusive. + These options are mutually exclusive. - `processes`: int: run the scan using up to this number of processes in parallel. If 0, disable the multiprocessing machinery. @@ -544,8 +537,7 @@ def scancode(ctx, input, info, # @ReservedAssignment scan_start = time2tstamp() try: - validate_exclusive(ctx, ['strip_root', 'full_root']) - validate_exclusive(ctx, ['quiet', 'verbose']) + # validate_exclusive(ctx, ['strip_root', 'full_root']) if not processes and not quiet: echo_stderr('Disabling multi-processing.', fg='yellow') @@ -553,6 +545,7 @@ def scancode(ctx, input, info, # @ReservedAssignment ############################################################################ # 1. get command options and create all plugin instances ############################################################################ + validate_option_dependencies(ctx) command_options = sorted(get_command_options(ctx)) if TRACE_DEEP: logger_debug('scancode: command_options:') @@ -585,7 +578,6 @@ def scancode(ctx, input, info, # @ReservedAssignment msg = ('Missing output option(s): at least one output ' 'option is needed to save scan results.') raise click.UsageError(msg) - ctx.exit(1) if not scanner_plugins and not info: # Use default info scan when no scan option is requested @@ -1085,21 +1077,3 @@ def format_size(size): return '%(size).2f %(symbol)s' % locals() size = size / 1024. return '%(size).2f %(symbol)s' % locals() - - -def get_command_options(ctx): - """ - Yield CommandOption tuples for each click.Option option in the `ctx` Click - context. Ignore eager flags. - """ - param_values = ctx.params - for param in ctx.command.params: - if param.is_eager: - continue - if param.name == 'test_mode': - continue - - help_group = getattr(param, 'help_group', None) - name = param.name - value = param_values.get(name) - yield CommandOption(help_group, name, value, param) diff --git a/src/scancode/plugin_copyright.py b/src/scancode/plugin_copyright.py index 6922ebb6f44..e8c07dfca34 100644 --- a/src/scancode/plugin_copyright.py +++ b/src/scancode/plugin_copyright.py @@ -44,7 +44,8 @@ class CopyrightScanner(ScanPlugin): CommandLineOption(('-c', '--copyright',), is_flag=True, default=False, help='Scan for copyrights.', - help_group=SCAN_GROUP) + help_group=SCAN_GROUP, + sort_order= 50), ] def is_enabled(self): diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 1e2f78db10f..93a509b6dec 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -70,8 +70,7 @@ def process_codebase(self, codebase): # first walk top down the codebase and collect ignored resource ids for resource in codebase.walk(topdown=True): - # FIXME: this should absolute==False!! - if ignorable(resource.get_path(absolute=True)): + if ignorable(resource.get_path(absolute=False, posix=True)): resources_to_remove_append(resource) # then remove the collected ignored resource ids (that may remove whole diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index b8616865cdd..7493dd3fb4c 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -49,29 +49,34 @@ class LicenseScanner(ScanPlugin): options = [ CommandLineOption(('-l', '--license'), - is_flag=True, default=False, + is_flag=True, help='Scan for licenses.', - help_group=SCAN_GROUP), + help_group=SCAN_GROUP, + sort_order= 10), CommandLineOption(('--license-score',), type=int, default=0, show_default=True, + requires=['license'], help='Do not return license matches with a score lower than this score. ' 'A number between 0 and 100.', help_group=SCAN_OPTIONS_GROUP), CommandLineOption(('--license-text',), - is_flag=True, default=False, + is_flag=True, + requires=['license'], help='Include the detected licenses matched text.', help_group=SCAN_OPTIONS_GROUP), CommandLineOption(('--license-url-template',), default=DEJACODE_LICENSE_URL, show_default=True, + requires=['license'], help='Set the template URL used for the license reference URLs. ' 'Curly braces ({}) are replaced by the license key.', help_group=SCAN_OPTIONS_GROUP), CommandLineOption(('--license-diag',), - is_flag=True, default=False, + is_flag=True, + requires=['license'], help='Include diagnostic information in license scan results.', help_group=SCAN_OPTIONS_GROUP), ] @@ -109,6 +114,6 @@ class LicenseIndexer(HousekeepingPlugin): ('--reindex-licenses',), is_eager=True, is_flag=True, default=False, callback=reindex_licenses, - help='Check the license index cache and reindex if needed.', + help='Check the license index cache and reindex if needed and exit', help_group=MISC_GROUP) ] diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 8db50a17dd0..8585840c773 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -45,7 +45,7 @@ class MarkSource(PostScanPlugin): options = [ CommandLineOption(('--mark-source',), - is_flag=True,default=False, + is_flag=True, default=False, help='Set the "is_source" to true for directories that contain ' 'over 90% of source files as children and descendants. ' 'Implies running the --info scan.', diff --git a/src/scancode/plugin_package.py b/src/scancode/plugin_package.py index bf009963150..d48a8c6de6e 100644 --- a/src/scancode/plugin_package.py +++ b/src/scancode/plugin_package.py @@ -44,7 +44,8 @@ class PackageScanner(ScanPlugin): CommandLineOption(('-p', '--package',), is_flag=True, default=False, help='Scan for packages.', - help_group=SCAN_GROUP) + help_group=SCAN_GROUP, + sort_order= 20), ] def is_enabled(self): diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index be20daa4941..e486fceb276 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -5,7 +5,7 @@ "--copyright": true, "--info": true, "--license": true, - "--output-json": "", + "--json": "", "--package": true }, "files_count": 1, diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 0d35388d521..9f8b7f25e2c 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -5,7 +5,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json-lines": "" + "--json-lines": "" }, "files_count": 1 } diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index c52b0f17f2d..f95c296408d 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -5,7 +5,7 @@ "--copyright": true, "--info": true, "--license": true, - "--output-json-pp": "", + "--json-pp": "", "--package": true }, "files_count": 1, diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 4693bb787c1..5df9c60529a 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -6,7 +6,7 @@ "--info": true, "--license": true, "--package": true, - "--output-json-pp": "", + "--json-pp": "", "--strip-root": true }, "files_count": 7, diff --git a/tests/formattedcode/test_output_json.py b/tests/formattedcode/test_output_json.py index d3050b73049..f18177c35d1 100644 --- a/tests/formattedcode/test_output_json.py +++ b/tests/formattedcode/test_output_json.py @@ -44,7 +44,7 @@ def test_json_pretty_print(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - result = run_scan_click(['-clip', test_dir, '--output-json-pp', result_file]) + result = run_scan_click(['-clip', test_dir, '--json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -56,7 +56,7 @@ def test_json_compact(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - result = run_scan_click(['-clip', test_dir, '--output-json', result_file]) + result = run_scan_click(['-clip', test_dir, '--json', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -72,7 +72,7 @@ def test_scan_output_does_not_truncate_copyright_json(): result_file = test_env.get_temp_file('test.json') result = run_scan_click( - ['-clip', '--strip-root', test_dir, '--output-json-pp', result_file]) + ['-clip', '--strip-root', test_dir, '--json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -85,7 +85,7 @@ def test_scan_output_does_not_truncate_copyright_with_json_to_stdout(): result_file = test_env.get_temp_file('test.json') result = run_scan_click( - ['-clip', '--strip-root', test_dir, '--output-json-pp', result_file]) + ['-clip', '--strip-root', test_dir, '--json-pp', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output diff --git a/tests/formattedcode/test_output_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py index 98dad78b626..a01bb8071b1 100644 --- a/tests/formattedcode/test_output_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -94,7 +94,7 @@ def test_jsonlines(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('jsonline') - result = run_scan_click(['-i', test_dir, '--output-json-lines', result_file]) + result = run_scan_click(['-i', test_dir, '--json-lines', result_file]) assert result.exit_code == 0 assert 'Scanning done' in result.output diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index fa922c94bd4..36501a48536 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -4,7 +4,7 @@ "input": "", "--copyright": true, "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index 2921734880b..cf4d348dfe6 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -2,7 +2,7 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "input": "", - "--output-json": "", + "--json": "", "--package": true }, "files_count": 1, diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index a106bf717e1..f21c12de299 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--copyright": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index c8b8f1427c3..f5717f4fbd3 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -18,6 +18,8 @@ Options: -u, --url Scan for urls. scan options: + --license-diag Include diagnostic information in license scan + results. --license-score INTEGER Do not return license matches with a score lower than this score. A number between 0 and 100. [default: 0] @@ -26,29 +28,21 @@ Options: reference URLs. Curly braces ({}) are replaced by the license key. [default: https://enterprise.de jacode.com/urn/urn:dje:license:{}] - --license-diag Include diagnostic information in license scan - results. output formats: - --json-pp, --output-json-pp FILE - Write scan output formatted as pretty-printed - JSON to FILE. - --output-spdx-rdf FILE Write scan output formatted as SPDX RDF to - FILE. Implies running the --info scan. - --output-spdx-tv FILE Write scan output formatted as SPDX Tag/Value - to FILE. Implies running the --info scan. - --output-html-app FILE Write scan output formatted as a mini HTML - application FILE. - --output-json-lines FILE Write scan output formatted as JSON Lines to - FILE. - --json, --output-json FILE Write scan output formatted as compact JSON to - FILE. - --output-html FILE Write scan output formatted as HTML to FILE. - --output-custom FILE Write scan output to FILE formatted with the - custom Jinja template file. - --custom-template FILE Use this Jinja template FILE as a custom - template. - --output-csv FILE Write scan output formatted as CSV to FILE. + --json FILE Write scan output as compact JSON to FILE. + --json-pp FILE Write scan output as pretty-printed JSON to FILE. + --json-lines FILE Write scan output as JSON Lines to FILE. + --output-csv FILE Write scan output as CSV to FILE. + --output-html FILE Write scan output as HTML to FILE. + --output-custom FILE Write scan output to FILE formatted with the custom + Jinja template file. + --custom-template FILE Use this Jinja template FILE as a custom template. + --output-html-app FILE Write scan output as a mini HTML application to FILE. + --output-spdx-rdf FILE Write scan output as SPDX RDF to FILE. Implies running + the --info scan. + --output-spdx-tv FILE Write scan output as SPDX Tag/Value to FILE. Implies + running the --info scan. output filters: --only-findings Only return files or directories with findings for the @@ -56,12 +50,12 @@ Options: omitted (file information is not treated as findings). output control: - --strip-root Strip the root directory segment of all paths. The default is to - always include the last directory segment of the scanned path - such that all paths have a common root directory. --full-root Report full, absolute paths. The default is to always include the last directory segment of the scanned path such that all paths have a common root directory. + --strip-root Strip the root directory segment of all paths. The default is to + always include the last directory segment of the scanned path + such that all paths have a common root directory. pre-scan: --ignore Ignore files matching . @@ -72,40 +66,43 @@ Options: running the --info scan. core: - --verbose Print progress as file-by-file path instead of a - progress bar. Print a verbose scan summary. - --quiet Do not print summary or progress. - -h, --help Show this message and exit. + --timeout Stop an unfinished file scan after a timeout in seconds. + [default: 120 seconds] -n, --processes INT Set the number of parallel processes to use. Disable parallel processing if 0. [default: 1] - --examples Show command examples and exit. - --about Show information about ScanCode and licensing and exit. - --version Show the version and exit. - --timeout Stop an unfinished file scan after a timeout in seconds. - [default: 120] - --plugins Print the list of available ScanCode plugins. + --quiet Do not print summary or progress. + --verbose Print progress as file-by-file path instead of a + progress bar. Print a verbose scan summary. + --timing Collect execution timing for each scan and scanned file. --no-cache Do not use on-disk cache for intermediate results. Uses more memory. - --timing Collect execution timing for each scan and scanned file. --temp-dir DIR Set the path to the temporary directory to use for ScanCode cache and temporary files. miscellaneous: + --reindex-licenses Check the license index cache and reindex if needed and + exit --test-mode Run ScanCode in a special "test mode". Only for testing. - --reindex-licenses Check the license index cache and reindex if needed. + + documentation: + -h, --help Show this message and exit. + --about Show information about ScanCode and licensing and exit. + --version Show the version and exit. + --examples Show command examples and exit. + --plugins Show the list of available ScanCode plugins and exit. Examples (use --examples for more): Scan the 'samples' directory for licenses and copyrights. - Save scan results to a JSON file: + Save scan results to the 'scancode_result.json' JSON file: - scancode --license --copyright --output-json=scancode_result.json - samples + scancode --license --copyright --json=scancode_result.json samples Scan the 'samples' directory for licenses and package manifests. Print scan - results on screen as pretty-formatted JSON: + results on screen as pretty-formatted JSON (using the special '-' FILE to print + to on screen/to stdout): - scancode --json-pp --license --package samples + scancode --json-pp - --license --package samples Note: when you run scancode, a progress bar is displayed with a counter of the number of files processed. Use --verbose to display file-by-file diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 17db28a3504..720f0f5a1cc 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -5,7 +5,7 @@ "--copyright": true, "--info": true, "--license": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index ada751d2ed2..cee14d0b0c6 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -5,7 +5,7 @@ "--copyright": true, "--email": true, "--license": true, - "--output-json": "", + "--json": "", "--url": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index e06865981dd..d88eda56291 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index d97c0690e64..825ae5dd263 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "" + "--json": "" }, "files_count": 6, "files": [ diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index 92dce82e917..604f5d0610e 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -5,7 +5,7 @@ "--email": true, "--info": true, "--strip-root": true, - "--output-json": "", + "--json": "", "--url": true }, "files_count": 6, diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index f7e2d7b72aa..8d3d9669255 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -4,7 +4,7 @@ "input": "", "--license": true, "--license-text": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index adc181a8a18..02edc3a9c67 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 18, diff --git a/tests/scancode/data/non_utf8/expected-mac.json b/tests/scancode/data/non_utf8/expected-mac.json index 2ab56cfa3cb..554d938f04f 100644 --- a/tests/scancode/data/non_utf8/expected-mac.json +++ b/tests/scancode/data/non_utf8/expected-mac.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 18, diff --git a/tests/scancode/data/non_utf8/expected-win.json b/tests/scancode/data/non_utf8/expected-win.json index 295971d6268..1924b62eab8 100644 --- a/tests/scancode/data/non_utf8/expected-win.json +++ b/tests/scancode/data/non_utf8/expected-win.json @@ -3,10 +3,10 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, - "files_count": 19, + "files_count": 18, "files": [ { "path": "non_unicode", @@ -36,7 +36,8 @@ "date": "2017-07-14", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -57,7 +58,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -79,7 +81,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -101,7 +104,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -123,7 +127,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -145,7 +150,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -167,7 +173,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -189,7 +196,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -211,7 +219,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -233,7 +242,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -255,7 +265,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -277,7 +288,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -299,7 +311,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -321,7 +334,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -343,7 +357,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -365,7 +380,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -387,7 +403,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -409,7 +426,8 @@ "date": "2017-08-27", "extension": "", "file_type": "empty", - "files_count": null, + "files_count": 0, + "dirs_count": 0, "is_archive": false, "is_binary": false, "is_media": false, diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index cfe9c6e9fa2..5a47eb70388 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -4,7 +4,7 @@ "input": "", "--info": true, "--mark-source": true, - "--output-json": "" + "--json": "" }, "files_count": 12, "files": [ diff --git a/tests/scancode/data/plugin_mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json index 6c2099eb886..ecce7fc5482 100644 --- a/tests/scancode/data/plugin_mark_source/without_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/without_info.expected.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--mark-source": true, - "--output-json": "" + "--json": "" }, "files_count": 12, "files": [ diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index db1bbb4bbe0..93ddcfe9f57 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -6,7 +6,7 @@ "--info": true, "--license": true, "--only-findings": true, - "--output-json": "", + "--json": "", "--package": true }, "files_count": 3, diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index 0f3412c0a0f..99048ea6301 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -2,7 +2,7 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "input": "", - "--output-json": "", + "--json": "", "--package": true }, "files_count": 1, diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index 1a6b66f37dd..4209a272004 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -3,7 +3,7 @@ "scancode_options": { "input": "", "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index daf9814ef0b..0ef2a32d400 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -6,7 +6,7 @@ "--email": true, "--info": true, "--license": true, - "--output-json": "", + "--json": "", "--package": true, "--strip-root": true, "--url": true diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json index b1d52686b84..ab613f6f0da 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json @@ -6,7 +6,7 @@ "--email": true, "--info": true, "--license": true, - "--output-json": "", + "--json": "", "--package": true, "--strip-root": true, "--url": true diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index 4000f1303ab..df29dc49ab7 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -6,7 +6,7 @@ "--email": true, "--info": true, "--license": true, - "--output-json": "", + "--json": "", "--package": true, "--strip-root": true, "--url": true diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index e315afbb629..7dc15860da0 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -4,7 +4,7 @@ "input": "", "--copyright": true, "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 5, diff --git a/tests/scancode/data/weird_file_name/expected-mac.json b/tests/scancode/data/weird_file_name/expected-mac.json index 5603b9a0dce..25559d68408 100644 --- a/tests/scancode/data/weird_file_name/expected-mac.json +++ b/tests/scancode/data/weird_file_name/expected-mac.json @@ -4,7 +4,7 @@ "input": "", "--copyright": true, "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 5, diff --git a/tests/scancode/data/weird_file_name/expected-win.json b/tests/scancode/data/weird_file_name/expected-win.json index 9e973dea37b..2ba5a36d7d7 100644 --- a/tests/scancode/data/weird_file_name/expected-win.json +++ b/tests/scancode/data/weird_file_name/expected-win.json @@ -4,7 +4,7 @@ "input": "", "--copyright": true, "--info": true, - "--output-json": "", + "--json": "", "--strip-root": true }, "files_count": 5, diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 55b38b19211..ffd5d7f74a0 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -192,7 +192,7 @@ def test_scan_info_returns_does_not_strip_root_with_single_file(): result_file = test_env.get_temp_file('json') result = run_scan_click(['--info', '--strip-root', test_file, '--json', result_file]) assert result.exit_code == 0 - check_json_scan(test_env.get_test_loc('single/iproute.expected.json'), result_file, regen=False) + check_json_scan(test_env.get_test_loc('single/iproute.expected.json'), result_file, strip_dates=True) def test_scan_info_license_copyrights(): @@ -295,11 +295,11 @@ def test_scan_works_with_multiple_processes(): # run the same scan with one or three processes result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--output-json', result_file_1]) + result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) assert result1.exit_code == 0 result_file_3 = test_env.get_temp_file('json') - result3 = run_scan_click([ '--copyright', '--processes', '3', test_dir, '--output-json', result_file_3]) + result3 = run_scan_click([ '--copyright', '--processes', '3', test_dir, '--json', result_file_3]) assert result3.exit_code == 0 res1 = json.loads(open(result_file_1).read()) res3 = json.loads(open(result_file_3).read()) @@ -311,12 +311,12 @@ def test_scan_works_with_no_processes_in_single_threaded_mode(): # run the same scan with zero or one process result_file_0 = test_env.get_temp_file('json') - result0 = run_scan_click([ '--copyright', '--processes', '0', test_dir, '--output-json', result_file_0]) + result0 = run_scan_click([ '--copyright', '--processes', '0', test_dir, '--json', result_file_0]) assert result0.exit_code == 0 assert 'Disabling multi-processing.' in result0.output result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--output-json', result_file_1]) + result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) assert result1.exit_code == 0 res0 = json.loads(open(result_file_0).read()) res1 = json.loads(open(result_file_1).read()) @@ -395,7 +395,7 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): elif on_windows: expected = 'unicodepath/unicodepath.expected-win.json' - check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) + check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) @skipIf(on_windows, 'Python tar cannot extract these files on Windows') @@ -634,3 +634,38 @@ def test_scan_cli_help(regen=False): with open(expected_file, 'wb') as ef: ef.write(result.output) assert open(expected_file).read() == result.output + + +def test_scan_errors_out_with_unknown_option(): + test_file = test_env.get_test_loc('license_text/test.txt') + result = run_scan_click([ '--json--info', test_file]) + assert result.exit_code == 2 + assert 'Error: no such option: --json--info' in result.output + + +def test_scan_to_json_without_FILE_does_not_write_to_next_option(): + test_file = test_env.get_test_loc('license_text/test.txt') + result = run_scan_click([ '--json', '--info', test_file]) + assert result.exit_code == 2 + assert ('Error: Invalid value for "--json": Illegal file name ' + 'conflicting with an option name: --info.') in result.output + + +def test_scan_errors_out_with_conflicting_root_options(): + test_file = test_env.get_test_loc('license_text/test.txt') + result_file = test_env.get_temp_file('results.json') + result = run_scan_click(['--strip-root', '--full-root','--json', result_file, '--info', test_file]) + assert result.exit_code == 2 + assert ('Error: The option --strip-root cannot be used together with the ' + '--full-root option(s) and --full-root is used.') in result.output + + +def test_scan_errors_out_with_conflicting_verbosity_options(): + test_file = test_env.get_test_loc('license_text/test.txt') + result_file = test_env.get_temp_file('results.json') + result = run_scan_click(['--quiet', '--verbose','--json', result_file, '--info', test_file]) + assert result.exit_code == 2 + print(result.output) + assert ('Error: The option --quiet cannot be used together with the ' + '--verbose option(s) and --verbose is used. You can set only one of ' + 'these options at a time.') in result.output diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 624572ecd3b..ab5f183688b 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -29,7 +29,7 @@ from os.path import join from commoncode.testcase import FileDrivenTesting -from scancode.cli import CommandOption +from scancode import CommandOption from scancode.plugin_ignore import is_ignored from scancode.plugin_ignore import ProcessIgnore from scancode.cli_test_utils import run_scan_click @@ -166,7 +166,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should be listed @@ -176,7 +176,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should be listed @@ -189,7 +189,7 @@ def test_scancode_ignore_single_file(self): result_file = self.get_temp_file('json') result = run_scan_click( - ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--output-json', result_file]) + ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 3 == scan_result['files_count'] @@ -209,7 +209,7 @@ def test_scancode_ignore_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] @@ -220,7 +220,7 @@ def test_scancode_ignore_glob_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 1 == scan_result['files_count'] @@ -231,7 +231,7 @@ def test_scancode_ignore_glob_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] @@ -242,7 +242,7 @@ def test_scancode_multiple_ignores(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, '--output-json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 0 == scan_result['files_count'] diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py index 2fbd64f172c..80ddf16b0bd 100644 --- a/tests/scancode/test_plugin_mark_source.py +++ b/tests/scancode/test_plugin_mark_source.py @@ -56,7 +56,7 @@ def test_scan_mark_source_without_info(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/without_info.expected.json') - _result = run_scan_click(['--mark-source', test_dir, '--output-json', result_file]) + _result = run_scan_click(['--mark-source', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, regen=False) def test_scan_mark_source_with_info(self): @@ -64,5 +64,5 @@ def test_scan_mark_source_with_info(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/with_info.expected.json') - _result = run_scan_click(['--info', '--mark-source', test_dir, '--output-json', result_file]) + _result = run_scan_click(['--info', '--mark-source', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file) diff --git a/tests/scancode/test_scan_utils.py b/tests/scancode/test_scan_utils.py index b13fa8d0a89..6d9171df852 100644 --- a/tests/scancode/test_scan_utils.py +++ b/tests/scancode/test_scan_utils.py @@ -128,7 +128,7 @@ class TestHelpGroups(FileDrivenTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - def test_scan_help_without_custom_class(self): + def test_scan_help_group_and_sort_order_without_custom_class(self): @click.command(name='scan', cls=ScanCommand) @click.option('--opt', is_flag=True, help='Help text for option') def scan(opt): @@ -137,11 +137,14 @@ def scan(opt): runner = CliRunner() result = runner.invoke(scan, ['--help']) from scancode import MISC_GROUP - assert MISC_GROUP + ':\n --opt Help text for option\n' in result.output + assert MISC_GROUP in result.output + assert '--opt Help text for option' in result.output + - def test_scan_help_with_custom_class(self): + def test_scan_help_group_and_sort_order_with_custom_class(self): @click.command(name='scan', cls=ScanCommand) - @click.option('--opt', is_flag=True, help='Help text for option', cls=CommandLineOption) + @click.option('--opt', is_flag=True, sort_order=10, + help='Help text for option', cls=CommandLineOption) def scan(opt): pass From 43cd8cbfe84fc0e331b637c483e7a58bda48de78 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 19 Jan 2018 09:47:42 +0100 Subject: [PATCH 055/122] Rename Pluggy impl spec from output to output_impl #787 Signed-off-by: Philippe Ombredanne --- src/formattedcode/output_csv.py | 5 ++--- src/formattedcode/output_html.py | 8 ++++---- src/formattedcode/output_json.py | 6 +++--- src/formattedcode/output_jsonlines.py | 4 ++-- src/formattedcode/output_spdx.py | 6 +++--- src/plugincode/output.py | 2 +- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/formattedcode/output_csv.py b/src/formattedcode/output_csv.py index 5188cc2a8f1..dd977b8299b 100644 --- a/src/formattedcode/output_csv.py +++ b/src/formattedcode/output_csv.py @@ -31,15 +31,14 @@ import unicodecsv -from plugincode.output import output +from plugincode.output import output_impl from plugincode.output import OutputPlugin from scancode import CommandLineOption from scancode import FileOptionType from scancode import OUTPUT_GROUP - -@output +@output_impl class CsvOutput(OutputPlugin): options = [ diff --git a/src/formattedcode/output_html.py b/src/formattedcode/output_html.py index c37275c7bfb..5b492047976 100644 --- a/src/formattedcode/output_html.py +++ b/src/formattedcode/output_html.py @@ -50,7 +50,7 @@ from commoncode.fileutils import fsencode from commoncode.fileutils import parent_directory from commoncode.system import on_linux -from plugincode.output import output +from plugincode.output import output_impl from plugincode.output import OutputPlugin from scancode import CommandLineOption from scancode import FileOptionType @@ -64,7 +64,7 @@ """ -@output +@output_impl class HtmlOutput(OutputPlugin): options = [ @@ -85,7 +85,7 @@ def save_results(self, codebase, results, files_count, version, notice, options) write_templated(output_file, results, version, template_or_format='html') -@output +@output_impl class CustomTemplateOutput(OutputPlugin): options = [ @@ -124,7 +124,7 @@ def save_results(self, codebase, results, files_count, version, notice, options) write_templated(output_file, results, version, template_or_format=template_path) -@output +@output_impl class HtmlAppOutput(OutputPlugin): """ Write scan output as a mini HTML application. diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py index f11e9eb861e..ca95353ccab 100644 --- a/src/formattedcode/output_json.py +++ b/src/formattedcode/output_json.py @@ -29,7 +29,7 @@ import simplejson -from plugincode.output import output +from plugincode.output import output_impl from plugincode.output import OutputPlugin from scancode import CommandLineOption from scancode import FileOptionType @@ -40,7 +40,7 @@ """ -@output +@output_impl class JsonCompactOutput(OutputPlugin): options = [ @@ -61,7 +61,7 @@ def save_results(self, codebase, results, files_count, version, notice, options) write_json(results, output_file, files_count, version, notice, options, pretty=False) -@output +@output_impl class JsonPrettyOutput(OutputPlugin): options = [ diff --git a/src/formattedcode/output_jsonlines.py b/src/formattedcode/output_jsonlines.py index 32e36c47038..ea3cedee245 100644 --- a/src/formattedcode/output_jsonlines.py +++ b/src/formattedcode/output_jsonlines.py @@ -29,14 +29,14 @@ import simplejson -from plugincode.output import output +from plugincode.output import output_impl from plugincode.output import OutputPlugin from scancode import CommandLineOption from scancode import FileOptionType from scancode import OUTPUT_GROUP -@output +@output_impl class JsonLinesOutput(OutputPlugin): options = [ diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index 835bdd96297..25e3e21315d 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -46,7 +46,7 @@ from spdx.utils import SPDXNone from spdx.version import Version -from plugincode.output import output +from plugincode.output import output_impl from plugincode.output import OutputPlugin from scancode import CommandLineOption from scancode import FileOptionType @@ -87,7 +87,7 @@ def logger_debug(*args): Output plugins to write scan results in SPDX format. """ -@output +@output_impl class SpdxTvOutput(OutputPlugin): needs_info = True @@ -111,7 +111,7 @@ def save_results(self, codebase, results, files_count, version, notice, options) write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True) -@output +@output_impl class SpdxRdfOutput(OutputPlugin): options = [ diff --git a/src/plugincode/output.py b/src/plugincode/output.py index aa6f8b48148..c3cd0630b54 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -80,7 +80,7 @@ def logger_debug(*args): entrypoint = 'scancode_output' output_spec = HookspecMarker(project_name=stage) -output = HookimplMarker(project_name=stage) +output_impl = HookimplMarker(project_name=stage) @output_spec From d7fb3ed47e788f0d5c33b71f22deff5e642d648c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 19 Jan 2018 09:48:16 +0100 Subject: [PATCH 056/122] Fix spacing #787 Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_license.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index 7493dd3fb4c..ee4f8bd1d45 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -49,10 +49,10 @@ class LicenseScanner(ScanPlugin): options = [ CommandLineOption(('-l', '--license'), - is_flag=True, + is_flag=True, help='Scan for licenses.', help_group=SCAN_GROUP, - sort_order= 10), + sort_order=10), CommandLineOption(('--license-score',), type=int, default=0, show_default=True, @@ -62,7 +62,7 @@ class LicenseScanner(ScanPlugin): help_group=SCAN_OPTIONS_GROUP), CommandLineOption(('--license-text',), - is_flag=True, + is_flag=True, requires=['license'], help='Include the detected licenses matched text.', help_group=SCAN_OPTIONS_GROUP), @@ -75,7 +75,7 @@ class LicenseScanner(ScanPlugin): help_group=SCAN_OPTIONS_GROUP), CommandLineOption(('--license-diag',), - is_flag=True, + is_flag=True, requires=['license'], help='Include diagnostic information in license scan results.', help_group=SCAN_OPTIONS_GROUP), @@ -92,7 +92,6 @@ def get_scanner(self, license_score=0, license_text=False, license_url_template=license_url_template) - def reindex_licenses(ctx, param, value): if not value or ctx.resilient_parsing: return From 04159b90c385b138bd7bf3ec7977836632ac0603 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 19 Jan 2018 09:50:34 +0100 Subject: [PATCH 057/122] Catch errors in the execution of scan stages #787 * for now all stages are catching exceptions and rethrowing them with an error message(except for scan stages that already catch exceptions). This stops the executaion. A better way would be to continue trucking and disable the faulty plugins Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 66 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index c2ca5d5f8d8..4e678cc6b0c 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -594,16 +594,24 @@ def scancode(ctx, input, info, # @ReservedAssignment setup_timings = OrderedDict() plugins_setup_start = time() - # TODO: add progress indicator + if not quiet and not verbose: echo_stderr('Setup plugins...', fg='green') + + # TODO: add progress indicator for stage, stage_plugins in enabled_plugins.items(): for name, plugin in stage_plugins.items(): plugin_setup_start = time() if not quiet and verbose: echo_stderr('Setup plugin: %(stage)s:%(name)s...' % locals(), fg='green') - plugin.setup() + try: + plugin.setup() + except: + msg = 'ERROR: failed to setup plugin: %(stage)s:%(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) timing_key = 'setup_%(stage)s_%(name)s' % locals() setup_timings[timing_key] = time() - plugin_setup_start @@ -619,7 +627,14 @@ def scancode(ctx, input, info, # @ReservedAssignment # TODO: add progress indicator # note: inventory timing collection is built in Codebase initialization - codebase = Codebase(location=input, use_cache=not no_cache) + try: + codebase = Codebase(location=input, use_cache=not no_cache) + except: + msg = 'ERROR: failed to collect codebase at: %(input)r' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) + if TRACE: logger_debug('scancode: codebase.use_cache:', codebase.use_cache) codebase.strip_root = strip_root @@ -672,14 +687,20 @@ def scancode(ctx, input, info, # @ReservedAssignment echo_stderr('Run pre-scan plugins...', fg='green') # TODO: add progress indicator - # FIXME: we should always catch errors from plugins properly for name, plugin in pre_scan_plugins.items(): plugin_prescan_start = time() if verbose: echo_stderr('Run pre-scan plugin: %(name)s...' % locals(), fg='green') - plugin.process_codebase(codebase) + try: + plugin.process_codebase(codebase) + except: + msg = 'ERROR: failed to run pre-scan plugin: %(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) + codebase.update_counts() timing_key = 'prescan_%(name)s' % locals() setup_timings[timing_key] = time() - plugin_prescan_start @@ -742,14 +763,19 @@ def scancode(ctx, input, info, # @ReservedAssignment post_scan_start = time() # TODO: add progress indicator - # FIXME: we should always catch errors from plugins properly if not quiet and not verbose and post_scan_plugins: echo_stderr('Run post-scan plugins...', fg='green') for name, plugin in post_scan_plugins.items(): if not quiet and verbose: echo_stderr('Run post-scan plugin: %(name)s...' % locals(), fg='green') - plugin.process_codebase(codebase) + try: + plugin.process_codebase(codebase) + except: + msg = 'ERROR: failed to run post-scan plugin: %(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) codebase.update_counts() codebase.timings['post-scan'] = time() - post_scan_start @@ -759,7 +785,6 @@ def scancode(ctx, input, info, # @ReservedAssignment ############################################################################ output_filter_start = time() # TODO: add progress indicator - # FIXME: we should always catch errors from plugins properly if not quiet and not verbose and output_filter_plugins: echo_stderr('Run output filter plugins...', fg='green') @@ -767,10 +792,16 @@ def scancode(ctx, input, info, # @ReservedAssignment if filters: # This is a set of resource ids to filter out from the final outputs filtered_rids_add = codebase.filtered_rids.add - for rid, resource in codebase.get_resources_with_rid(): - if all(to_keep(resource) for to_keep in filters): - continue - filtered_rids_add(rid) + try: + for rid, resource in codebase.get_resources_with_rid(): + if all(to_keep(resource) for to_keep in filters): + continue + filtered_rids_add(rid) + finally: + msg = 'ERROR: failed to run output filter plugins' + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) codebase.timings['output-filter'] = time() - post_scan_start @@ -779,8 +810,6 @@ def scancode(ctx, input, info, # @ReservedAssignment ############################################################################ output_start = time() # TODO: add progress indicator - # FIXME: we should always catch errors from plugins properly - if not quiet and not verbose: echo_stderr('Save results...' , fg='green') @@ -788,7 +817,14 @@ def scancode(ctx, input, info, # @ReservedAssignment if not quiet and verbose: echo_stderr('Save results as: %(name)s...' % locals(), fg='green') - plugin.process_codebase(codebase) + try: + plugin.process_codebase(codebase) + except: + msg = 'ERROR: failed to save output with plugin: %(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) + codebase.update_counts() codebase.timings['output'] = time() - output_start From a1c7053871d4de986baba6d2c34b24016d2fcb66 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 19 Jan 2018 11:45:19 +0100 Subject: [PATCH 058/122] Refine comment on temp file usage Signed-off-by: Philippe Ombredanne --- tests/extractcode/test_archive.py | 6 +++--- tests/extractcode/test_extract.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index 0736463c05f..4e33e176724 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -184,7 +184,7 @@ def test_no_handler_is_selected_for_a_non_archive3(self): def test_7zip_extract_can_extract_to_relative_paths(self): # The setup is a tad complex because we want to have a relative dir # to the base dir where we run tests from, ie the scancode-toolkit/ dir - # To use relative paths, we use our tmp dir at the root of the code + # To use relative paths, we use our tmp dir at the root of the code tree from os.path import dirname, join, abspath import tempfile import shutil @@ -207,7 +207,7 @@ def test_7zip_extract_can_extract_to_relative_paths(self): def test_libarchive_extract_can_extract_to_relative_paths(self): # The setup is a tad complex because we want to have a relative dir # to the base dir where we run tests from, ie the scancode-toolkit/ dir - # To use relative paths, we use our tmp dir at the root of the code + # To use relative paths, we use our tmp dir at the root of the code tree from os.path import dirname, join, abspath import tempfile import shutil @@ -1511,7 +1511,7 @@ def test_extract_twice_with_rpm_with_xz_compressed_cpio(self): def test_extract_twice_can_extract_to_relative_paths(self): # The setup is a tad complex because we want to have a relative dir # to the base dir where we run tests from, ie the scancode-toolkit/ dir - # To use relative paths, we use our tmp dir at the root of the code + # To use relative paths, we use our tmp dir at the root of the code tree from os.path import dirname, join, abspath, exists import shutil import tempfile diff --git a/tests/extractcode/test_extract.py b/tests/extractcode/test_extract.py index d5d9f11e96f..5c3a051d472 100644 --- a/tests/extractcode/test_extract.py +++ b/tests/extractcode/test_extract.py @@ -873,7 +873,7 @@ def test_walk_can_be_extended_while_walking(self): def test_extract_can_extract_to_relative_paths(self): # The setup is a tad complex because we want to have a relative dir # to the base dir where we run tests from, ie the scancode-toolkit/ dir - # To use relative paths, we use our tmp dir at the root of the code + # To use relative paths, we use our tmp dir at the root of the code tree from os.path import dirname, join, abspath scancode_root = dirname(dirname(dirname(__file__))) scancode_tmp = join(scancode_root, 'tmp') From ab4a3a09e4c60a19f6565086e0c72d34ffee9097 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 19 Jan 2018 19:57:34 +0100 Subject: [PATCH 059/122] Remove housekeeping stage which is not needed #787 * the plugin for license reindexing is updated in next commit Signed-off-by: Philippe Ombredanne --- setup.py | 13 ------- src/plugincode/housekeeping.py | 64 ---------------------------------- src/scancode/plugin_license.py | 20 ----------- 3 files changed, 97 deletions(-) delete mode 100644 src/plugincode/housekeeping.py diff --git a/setup.py b/setup.py index 04d9d16bec0..3a97ae6e01a 100644 --- a/setup.py +++ b/setup.py @@ -275,18 +275,5 @@ def read(*names, **kwargs): 'jsonlines = formattedcode.output_jsonlines:JsonLinesOutput', 'template = formattedcode.output_html:CustomTemplateOutput', ], - - # scancode_housekeeping is the entry point for miscellaneous eager - # housekeeping plugins that only run their own Click callback instead of - # running the scans. - # - # Each entry hast this form: - # plugin-name = fully.qualified.module:PluginClass - # where plugin-name must be a unique name for this entrypoint. - # - # See also plugincode.housekeeping module for details and doc. - 'scancode_housekeeping': [ - 'ignore = scancode.plugin_license:LicenseIndexer', - ], }, ) diff --git a/src/plugincode/housekeeping.py b/src/plugincode/housekeeping.py deleted file mode 100644 index f9a475c6223..00000000000 --- a/src/plugincode/housekeeping.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright (c) 2018 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import -from __future__ import unicode_literals - -from plugincode import BasePlugin -from plugincode import PluginManager -from plugincode import HookimplMarker -from plugincode import HookspecMarker - - -stage = 'housekeeping' -entrypoint = 'scancode_housekeeping' - -housekeeping_spec = HookspecMarker(project_name=stage) -housekeeping_impl = HookimplMarker(project_name=stage) - - -@housekeeping_spec -class HousekeepingPlugin(BasePlugin): - """ - Base plugin class for miscellaneous housekeeping plugins that are executed - eagerly and exclusively of all other options. - They must define only eager option flags that run with a Click callback - options. They scan nothing. - """ - pass - - def is_enabled(self): - """ - By design and because they are executed eagerly through a callback, an - HousekeepingPlugin is never "enabled" during scan processing. - """ - return False - - -housekeeping_plugins = PluginManager( - stage=stage, - module_qname=__name__, - entrypoint=entrypoint, - plugin_base_class=HousekeepingPlugin -) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index ee4f8bd1d45..065960a13b2 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -92,27 +92,7 @@ def get_scanner(self, license_score=0, license_text=False, license_url_template=license_url_template) -def reindex_licenses(ctx, param, value): - if not value or ctx.resilient_parsing: - return - - # TODO: check for temp file configuration and use that for the cache!!! - from licensedcode.cache import reindex - import click - click.echo('Checking and rebuilding the license index...') - reindex() - click.echo('Done.') - ctx.exit() - @housekeeping_impl class LicenseIndexer(HousekeepingPlugin): - options = [ - CommandLineOption( - ('--reindex-licenses',), - is_eager=True, is_flag=True, default=False, - callback=reindex_licenses, - help='Check the license index cache and reindex if needed and exit', - help_group=MISC_GROUP) - ] From 66047acc88f661778d2c99a7893631d9ebf8cde6 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 23 Jan 2018 18:43:33 +0100 Subject: [PATCH 060/122] Implement new cache and temp_dir #685 #357 This is based on the design in https://github.com/nexB/scancode-toolkit/issues/685#issuecomment-358929114 * add new scancode_config.py with centralized global defaults for cache and temp_dir, SCANCODE_DEV_MODE, and scancode version. * add --cache-dir and --temp-dir as new CLI options * ensure that plugins can receive all CLI args when they are called * ensure that all accesses to temp-dirs and all accesses cache files are properly using the top level cache and temp args * refactor code that creates temp directories codebase-wide to always accept an argument which is the base dir under which this is created * refactor licensedcode cache to use the the cache_dir as an option * refactor scancode.cli to use the the temp_dir for the per-scan cache * Fixed bug when an output option is followed by another option and not a file name (@JonoYang reported this). This will raise an error. * Fixed bug on dates that were not properly filtered in the test results comparison * refactor output filter plugins to be regular codebase plugins that process a whole codebase. They now set an is_filtered Resource attribute. * move output filter processing entirely inside the Codebase/Resource processing * Modified resource.Codebase/resource walking code accrodingly, removed the sort option from walk(): walk() and children() are always returning sorted resources now: default sort order of the resource tree is by file, then directories, then case-insentive name * fix bug on incorrect file_counts * wrap call to plugins in try/except to catch plugins errors on plugins runs and exit cleanly with a message. This is now done in a function for all plugins except scanners * add concrete kwargs for options to plugin methods. Plugins now receive all the CLI options as kwargs and there is no Command Option ugly tuple anymore. * cleanup output to use only a process_codebase and not a save_results * Since all errors stack trace is now fully reported, ensure that only the last and first line of an error message is used for test results comparison. * add siblings(), has_(children, parent, siblings) methods to resource.Resource * add size_count for descendants size to a Resource. Also available in JSON outputs. The size attribute of a dir is now always 0. * removed plugincode.output._TEST_MODE flag. * renamed SCANCODE_DEBUG* flags. * other minor refactorings and formatting Signed-off-by: Philippe Ombredanne --- etc/scripts/synclic.py | 38 +- etc/scripts/testdata/livescan/expected.csv | 40 +- src/cluecode/copyrights.py | 4 +- src/commoncode/command.py | 4 +- src/commoncode/fetch.py | 4 +- src/commoncode/fileutils.py | 53 +- src/commoncode/system.py | 26 +- src/commoncode/testcase.py | 7 +- src/extractcode/archive.py | 10 +- src/extractcode/extract.py | 4 +- src/extractcode/uncompress.py | 4 +- src/formattedcode/output_csv.py | 13 +- src/formattedcode/output_html.py | 48 +- src/formattedcode/output_json.py | 53 +- src/formattedcode/output_jsonlines.py | 31 +- src/formattedcode/output_spdx.py | 37 +- src/licensedcode/__init__.py | 26 +- src/licensedcode/cache.py | 188 +++--- src/licensedcode/index.py | 18 +- src/licensedcode/match.py | 1 - src/licensedcode/models.py | 21 +- src/plugincode/__init__.py | 43 +- src/plugincode/output.py | 153 +---- src/plugincode/output_filter.py | 17 +- src/plugincode/scan.py | 1 + src/scancode/__init__.py | 41 +- src/scancode/api.py | 9 +- src/scancode/cli.py | 606 +++++++++++------- src/scancode/cli_test_utils.py | 70 +- src/scancode/extract_cli.py | 8 +- src/scancode/plugin_copyright.py | 6 +- src/scancode/plugin_email.py | 4 +- src/scancode/plugin_ignore.py | 13 +- src/scancode/plugin_license.py | 40 +- src/scancode/plugin_mark_source.py | 9 +- src/scancode/plugin_only_findings.py | 16 +- src/scancode/plugin_package.py | 6 +- src/scancode/plugin_url.py | 4 +- src/scancode/resource.py | 405 ++++++------ src/scancode/utils.py | 2 +- src/scancode_config.py | 123 ++++ src/textcode/markup.py | 4 +- src/textcode/pdf.py | 1 - .../data/csv/livescan/expected.csv | 38 +- .../formattedcode/data/csv/tree/expected.csv | 18 +- .../data/json/simple-expected.json | 6 +- .../data/json/simple-expected.jsonlines | 6 +- .../data/json/simple-expected.jsonpp | 6 +- .../data/json/tree/expected.json | 12 +- tests/formattedcode/test_output_csv.py | 3 - tests/formattedcode/test_output_json.py | 2 - tests/formattedcode/test_output_jsonlines.py | 2 - tests/formattedcode/test_output_templated.py | 5 +- tests/licensedcode/test_cache.py | 224 +++---- .../data/altpath/copyright.expected.json | 1 + .../data/failing/patchelf.expected.json | 2 +- tests/scancode/data/help/help.txt | 31 +- tests/scancode/data/info/all.expected.json | 23 +- .../data/info/all.rooted.expected.json | 2 +- tests/scancode/data/info/basic.expected.json | 21 +- .../data/info/basic.rooted.expected.json | 24 +- .../data/info/email_url_info.expected.json | 23 +- .../scancode/data/license_text/test.expected | 2 +- .../data/non_utf8/expected-linux.json | 19 + .../scancode/data/non_utf8/expected-mac.json | 45 +- .../scancode/data/non_utf8/expected-win.json | 20 + .../plugin_license/license_url.expected.json | 67 ++ .../license_url/apache-1.0.txt | 0 .../with_info.expected.json | 28 +- .../without_info.expected.json | 29 +- .../data/plugin_only_findings/expected.json | 8 +- .../{ => resource}/cache/package/package.json | 0 tests/scancode/data/resource/codebase/abc | 0 .../scancode/data/resource/codebase/dir/that | 0 .../scancode/data/resource/codebase/dir/this | 0 .../scancode/data/resource/codebase/et131x.h | 47 ++ .../data/resource/codebase/other dir/file | 0 .../data/single/iproute.expected.json | 2 +- .../unicodepath.expected-linux.json | 8 +- .../unicodepath/unicodepath.expected-mac.json | 9 +- .../unicodepath/unicodepath.expected-win.json | 8 +- .../data/weird_file_name/expected-linux.json | 5 + .../data/weird_file_name/expected-mac.json | 7 +- .../data/weird_file_name/expected-win.json | 7 +- tests/scancode/test_cli.py | 18 +- tests/scancode/test_plugin_ignore.py | 130 ++-- tests/scancode/test_plugin_mark_source.py | 3 - tests/scancode/test_plugin_only_findings.py | 10 +- tests/scancode/test_resource.py | 232 ++++++- 89 files changed, 1997 insertions(+), 1367 deletions(-) create mode 100644 src/scancode_config.py create mode 100644 tests/scancode/data/plugin_license/license_url.expected.json rename tests/scancode/data/{ => plugin_license}/license_url/apache-1.0.txt (100%) rename tests/scancode/data/{ => resource}/cache/package/package.json (100%) create mode 100644 tests/scancode/data/resource/codebase/abc create mode 100644 tests/scancode/data/resource/codebase/dir/that create mode 100644 tests/scancode/data/resource/codebase/dir/this create mode 100644 tests/scancode/data/resource/codebase/et131x.h create mode 100644 tests/scancode/data/resource/codebase/other dir/file diff --git a/etc/scripts/synclic.py b/etc/scripts/synclic.py index 7bc7ae63a30..a7a3b3e1b96 100644 --- a/etc/scripts/synclic.py +++ b/etc/scripts/synclic.py @@ -31,18 +31,22 @@ from collections import OrderedDict import json import os +from os import mkdir +from os.path import exists +from os.path import join import zipfile import click +from os.path import realpath click.disable_unicode_literals_warning = True import requests -from commoncode import fileutils from commoncode import fetch +from commoncode import fileutils import licensedcode -from licensedcode.cache import get_licenses_db from licensedcode.cache import get_index +from licensedcode.cache import get_licenses_db from licensedcode.models import load_licenses from licensedcode.models import License @@ -80,30 +84,30 @@ def __init__(self, src_dir, match_text=False, match_approx=False): """ `src_dir` is where the License objects are dumped. """ - src_dir = os.path.realpath(src_dir) + src_dir = realpath(src_dir) self.src_dir = src_dir self.match_text = match_text self.match_approx = match_approx self.fetched = False - if os.path.exists(src_dir): + if exists(src_dir): # fetch ONLY if the directory is empty self.fetched = True else: - os.mkdir(src_dir) + mkdir(src_dir) self.update_dir = self.src_dir.rstrip('\\/') + '-update' - if not os.path.exists(self.update_dir): - os.mkdir(self.update_dir) + if not exists(self.update_dir): + mkdir(self.update_dir) self.new_dir = self.src_dir.rstrip('\\/') + '-new' - if not os.path.exists(self.new_dir): - os.mkdir(self.new_dir) + if not exists(self.new_dir): + mkdir(self.new_dir) self.del_dir = self.src_dir.rstrip('\\/') + '-del' - if not os.path.exists(self.del_dir): - os.mkdir(self.del_dir) + if not exists(self.del_dir): + mkdir(self.del_dir) self.scancodes_by_key = get_licenses_db() @@ -111,13 +115,15 @@ def __init__(self, src_dir, match_text=False, match_approx=False): for l in self.scancodes_by_key.values() if l.spdx_license_key} - composites_dir = os.path.join(licensedcode.data_dir, 'composites', 'licenses') + composites_dir = join( + licensedcode.models.data_dir, 'composites', 'licenses') self.composites_by_key = load_licenses(composites_dir, with_deprecated=True) self.composites_by_spdx_key = {l.spdx_license_key.lower(): l for l in self.composites_by_key.values() if l.spdx_license_key} - foreign_dir = os.path.join(licensedcode.data_dir, 'non-english', 'licenses') + foreign_dir = join( + licensedcode.models.data_dir, 'non-english', 'licenses') self.non_english_by_key = load_licenses(foreign_dir, with_deprecated=True) self.non_english_by_spdx_key = {l.spdx_license_key.lower(): l for l in self.non_english_by_key.values() @@ -449,8 +455,8 @@ def __init__(self, src_dir, match_text=False, match_approx=False, api_base_url=None, api_key=None): super(DejaSource, self).__init__(src_dir, match_text, match_approx) - self.api_base_url = api_base_url or os.environ.get('DEJACODE_API_URL', None) - self.api_key = api_key or os.environ.get('DEJACODE_API_KEY', None) + self.api_base_url = api_base_url or os.getenv('DEJACODE_API_URL') + self.api_key = api_key or os.getenv('DEJACODE_API_KEY') assert (self.api_key and self.api_base_url), ( 'You must set the DEJACODE_API_URL and DEJACODE_API_KEY ' + @@ -781,7 +787,7 @@ def synchronize_licenses(external_source): if not TRACE:print('.', end='') # Create a new ScanCode license - sc_license = ot_license.relocate(licensedcode.licenses_data_dir, o_key) + sc_license = ot_license.relocate(licensedcode.models.data_dir, o_key) scancodes_added.add(sc_license.key) scancodes_by_key[sc_license.key] = sc_license if TRACE: print('Other license key not in ScanCode:', ot_license.key, 'created in ScanCode.') diff --git a/etc/scripts/testdata/livescan/expected.csv b/etc/scripts/testdata/livescan/expected.csv index a3e69945d13..12a85b45888 100644 --- a/etc/scripts/testdata/livescan/expected.csv +++ b/etc/scripts/testdata/livescan/expected.csv @@ -1,20 +1,20 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1599,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, +Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,size_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1599,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, +/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index faeecb4b8a7..d16757ba54c 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -39,11 +39,11 @@ COPYRIGHT_TRACE = 0 logger = logging.getLogger(__name__) -if os.environ.get('SCANCODE_COPYRIGHT_DEBUG'): +if os.environ.get('SCANCODE_DEBUG_COPYRIGHT'): import sys logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) - COPYRIGHT_TRACE = 0 + COPYRIGHT_TRACE = 1 """ Detect and collect copyright statements. diff --git a/src/commoncode/command.py b/src/commoncode/command.py index de922b6fb0c..405b3d48f53 100644 --- a/src/commoncode/command.py +++ b/src/commoncode/command.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -110,7 +110,7 @@ def execute(cmd, args, root_dir=None, cwd=None, env=None, to_files=False): cwd = cwd or curr_dir # temp files for stderr and stdout - tmp_dir = get_temp_dir(base_dir='cmd') + tmp_dir = get_temp_dir(prefix='cmd-') sop = join(tmp_dir, 'stdout') sep = join(tmp_dir, 'stderr') diff --git a/src/commoncode/fetch.py b/src/commoncode/fetch.py index 6f4c34ae0a3..2df0dc399cb 100644 --- a/src/commoncode/fetch.py +++ b/src/commoncode/fetch.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -65,7 +65,7 @@ def download_url(url, file_name=None, verify=True, timeout=10): logger.error(msg) raise Exception(msg) - tmp_dir = fileutils.get_temp_dir(base_dir='fetch') + tmp_dir = fileutils.get_temp_dir(prefix='fetch-') output_file = os.path.join(tmp_dir, file_name) with open(output_file, 'wb') as out: out.write(response.content) diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index 2d61487b4f0..9772b1f9a95 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,8 +23,8 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import unicode_literals from __future__ import print_function +from __future__ import unicode_literals # Python 2 and 3 support try: @@ -42,7 +42,6 @@ from backports.os import fsencode from backports.os import fsdecode # @UnusedImport - import codecs import errno import os @@ -53,12 +52,17 @@ import sys import tempfile +try: + from scancode_config import scancode_temp_dir +except ImportError: + scancode_temp_dir = None + from commoncode import filetype from commoncode.filetype import is_rwx -from commoncode import system from commoncode.system import on_linux from commoncode import text + # this exception is not available on posix try: WindowsError # @UndefinedVariable @@ -137,32 +141,33 @@ def create_dir(location): raise -def system_temp_dir(): +def get_temp_dir(base_dir=scancode_temp_dir, prefix=''): """ - Return the global temp directory for the current user. + Return the path to a new existing unique temporary directory, created under + the `base_dir` base directory using the `prefix` prefix. + If `base_dir` is not provided, use the 'SCANCODE_TMP' env var or the system + temp directory. + + WARNING: do not change this code without changing scancode_config.py too """ - temp_dir = os.getenv('SCANCODE_TMP') - if not temp_dir: - sc = text.python_safe_name('scancode_' + system.username) - temp_dir = os.path.join(tempfile.gettempdir(), sc) - if on_linux: - temp_dir = fsencode(temp_dir) - create_dir(temp_dir) - return temp_dir + has_base = bool(base_dir) + if not has_base: + base_dir = os.getenv('SCANCODE_TMP') + if not base_dir: + base_dir = tempfile.gettempdir() + else: + if on_linux: + base_dir = fsencode(base_dir) + create_dir(base_dir) + + if not has_base: + prefix = 'scancode-tk-' -def get_temp_dir(base_dir, prefix=''): - """ - Return the path to a new existing unique temporary directory, created under - the system-wide `system_temp_dir` temp directory as a subdir of the base_dir - path (a path relative to the `system_temp_dir`). - """ if on_linux: - base_dir = fsencode(base_dir) prefix = fsencode(prefix) - base = os.path.join(system_temp_dir(), base_dir) - create_dir(base) - return tempfile.mkdtemp(prefix=prefix, dir=base) + + return tempfile.mkdtemp(prefix=prefix, dir=base_dir) # # FILE READING diff --git a/src/commoncode/system.py b/src/commoncode/system.py index 4cfc520e726..c0264a1ac45 100644 --- a/src/commoncode/system.py +++ b/src/commoncode/system.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -105,20 +105,16 @@ def os_arch(): # # Python versions # -py27 = (sys.version_info[0] == 2 and sys.version_info[1] == 7) -py34 = (sys.version_info[0] == 3 and sys.version_info[1] == 4) -py35 = (sys.version_info[0] == 3 and sys.version_info[1] == 5) -py35 = (sys.version_info[0] == 3 and sys.version_info[1] == 6) -# -# User related -# -if on_windows: - user_home = os.path.join(os.path.expandvars('$HOMEDRIVE'), - os.path.expandvars('$HOMEPATH')) -else: - user_home = os.path.expanduser('~') - -username = getpass.getuser() +_sys_v0 = sys.version_info[0] +py2 = _sys_v0 == 2 +py3 = _sys_v0 == 3 + +_sys_v1 = sys.version_info[1] +py27 = py2 and _sys_v1 == 7 +py34 = py3 and _sys_v1 == 4 +py35 = py3 and _sys_v1 == 5 +py36 = py3 and _sys_v1 == 6 +py37 = py3 and _sys_v1 == 7 # Do not let Windows error pop up messages with default SetErrorMode diff --git a/src/commoncode/testcase.py b/src/commoncode/testcase.py index 73907b1a327..1238a846ef0 100644 --- a/src/commoncode/testcase.py +++ b/src/commoncode/testcase.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -211,11 +211,12 @@ def get_temp_dir(self, sub_dir_path=None): # ensure that we have a new unique temp directory for each test run global test_run_temp_dir if not test_run_temp_dir: - test_run_temp_dir = fileutils.get_temp_dir(base_dir='tst', prefix=' ') + # not we add a space in the path for testing path with spaces + test_run_temp_dir = fileutils.get_temp_dir(prefix='tests -') if on_linux: test_run_temp_dir = fsencode(test_run_temp_dir) - new_temp_dir = fileutils.get_temp_dir(base_dir=test_run_temp_dir) + new_temp_dir = fileutils.get_temp_dir(base_dir=test_run_temp_dir, prefix='') if sub_dir_path: # create a sub directory hierarchy if requested diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index e0a170be59d..8344d6c1062 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -315,7 +315,7 @@ def extract_twice(location, target_dir, extractor1, extractor2): abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) # extract first the intermediate payload to a temp dir - temp_target = unicode(fileutils.get_temp_dir('extract')) + temp_target = unicode(fileutils.get_temp_dir(prefix='extract-')) warnings = extractor1(abs_location, temp_target) if TRACE: logger.debug('extract_twice: temp_target: %(temp_target)r' % locals()) @@ -348,7 +348,7 @@ def extract_with_fallback(location, target_dir, extractor1, extractor2): abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) # attempt extract first to a temp dir - temp_target1 = unicode(fileutils.get_temp_dir('extract1')) + temp_target1 = unicode(fileutils.get_temp_dir(prefix='extract1-')) try: warnings = extractor1(abs_location, temp_target1) if TRACE: @@ -356,7 +356,7 @@ def extract_with_fallback(location, target_dir, extractor1, extractor2): fileutils.copytree(temp_target1, abs_target_dir) except: try: - temp_target2 = unicode(fileutils.get_temp_dir('extract2')) + temp_target2 = unicode(fileutils.get_temp_dir(prefix='extract2-')) warnings = extractor2(abs_location, temp_target2) if TRACE: logger.debug('extract_with_fallback: temp_target2: %(temp_target2)r' % locals()) @@ -378,7 +378,7 @@ def try_to_extract(location, target_dir, extractor): """ abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) - temp_target = unicode(fileutils.get_temp_dir('extract1')) + temp_target = unicode(fileutils.get_temp_dir(prefix='extract1-')) warnings = [] try: warnings = extractor(abs_location, temp_target) diff --git a/src/extractcode/extract.py b/src/extractcode/extract.py index 2e3c8103b86..d0f938a28fc 100644 --- a/src/extractcode/extract.py +++ b/src/extractcode/extract.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -184,7 +184,7 @@ def extract_file(location, target, kinds=extractcode.default_kinds): # extract first to a temp directory. # if there is an error, the extracted files will not be moved # to target - tmp_tgt = fileutils.get_temp_dir('extract') + tmp_tgt = fileutils.get_temp_dir(prefix='extract-') abs_location = abspath(expanduser(location)) warnings.extend(extractor(abs_location, tmp_tgt)) fileutils.copytree(tmp_tgt, target) diff --git a/src/extractcode/uncompress.py b/src/extractcode/uncompress.py index d6469e6906d..83fcd4fa50b 100644 --- a/src/extractcode/uncompress.py +++ b/src/extractcode/uncompress.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -79,7 +79,7 @@ def uncompress_file(location, decompressor): warnings = [] base_name = fileutils.file_base_name(location) - target_location = os.path.join(fileutils.get_temp_dir(base_dir='extract'), base_name) + target_location = os.path.join(fileutils.get_temp_dir(prefix='extract-'), base_name) with decompressor(location, 'rb') as compressed: with open(target_location, 'wb') as uncompressed: buffer_size = 32 * 1024 * 1024 diff --git a/src/formattedcode/output_csv.py b/src/formattedcode/output_csv.py index dd977b8299b..75c1a6a6a31 100644 --- a/src/formattedcode/output_csv.py +++ b/src/formattedcode/output_csv.py @@ -47,16 +47,15 @@ class CsvOutput(OutputPlugin): metavar='FILE', help='Write scan output as CSV to FILE.', help_group=OUTPUT_GROUP, - sort_order= 30), + sort_order=30), ] - def is_enabled(self): - return self.is_command_option_enabled('output_csv') + def is_enabled(self, output_csv, **kwargs): + return output_csv - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_csv').value - self.create_parent_directory(output_file) - return write_csv(results, output_file) + def process_codebase(self, codebase, output_csv, **kwargs): + results = self.get_results(codebase, **kwargs) + write_csv(results, output_csv) def write_csv(results, output_file): diff --git a/src/formattedcode/output_html.py b/src/formattedcode/output_html.py index 5b492047976..3614bab2d1a 100644 --- a/src/formattedcode/output_html.py +++ b/src/formattedcode/output_html.py @@ -76,13 +76,13 @@ class HtmlOutput(OutputPlugin): sort_order=50), ] - def is_enabled(self): - return self.is_command_option_enabled('output_html') + def is_enabled(self, output_html, **kwargs): + return output_html - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_html').value - self.create_parent_directory(output_file) - write_templated(output_file, results, version, template_or_format='html') + def process_codebase(self, codebase, output_html, scancode_version, **kwargs): + results = self.get_results(codebase, **kwargs) + write_templated(output_html, results, scancode_version, + template_or_format='html') @output_impl @@ -109,19 +109,17 @@ class CustomTemplateOutput(OutputPlugin): sort_order=65), ] - def is_enabled(self): - return ( - self.is_command_option_enabled('output_custom') - and self.is_command_option_enabled('custom_template') - ) + def is_enabled(self, output_custom, custom_template, **kwargs): + return output_custom and custom_template - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_custom').value - self.create_parent_directory(output_file) - template_path = self.get_command_option('custom_template').value + def process_codebase(self, codebase, output_custom, custom_template, + scancode_version, **kwargs): + + results = self.get_results(codebase, **kwargs) if on_linux: - template_path = fsencode(template_path) - write_templated(output_file, results, version, template_or_format=template_path) + custom_template = fsencode(custom_template) + write_templated(output_custom, results, scancode_version, + template_or_format=custom_template) @output_impl @@ -138,15 +136,15 @@ class HtmlAppOutput(OutputPlugin): sort_order=70), ] - def is_enabled(self): - return self.is_command_option_enabled('output_html_app') + def is_enabled(self, output_html_app, **kwargs): + return output_html_app + + def process_codebase(self, codebase, input, output_html_app, + scancode_version, **kwargs): - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_html_app').value - scanned_path = codebase.location - self.create_parent_directory(output_file) - output_file.write(as_html_app(output_file, scanned_path, version)) - create_html_app_assets(results, output_file) + results = self.get_results(codebase, **kwargs) + output_html_app.write(as_html_app(output_html_app, input, scancode_version)) + create_html_app_assets(results, output_html_app) def write_templated(output_file, results, version, template_or_format): diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py index ca95353ccab..7eba8590d59 100644 --- a/src/formattedcode/output_json.py +++ b/src/formattedcode/output_json.py @@ -49,16 +49,23 @@ class JsonCompactOutput(OutputPlugin): metavar='FILE', help='Write scan output as compact JSON to FILE.', help_group=OUTPUT_GROUP, - sort_order= 10), + sort_order=10), ] - def is_enabled(self): - return self.is_command_option_enabled('output_json') + def is_enabled(self, output_json, **kwargs): + return output_json - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_json').value - self.create_parent_directory(output_file) - write_json(results, output_file, files_count, version, notice, options, pretty=False) + def process_codebase(self, codebase, output_json, files_count, + scancode_version, scancode_notice, pretty_options, + **kwargs): + + results = self.get_results(codebase, **kwargs) + write_json(results=results, output_file=output_json, + files_count=files_count, + scancode_version=scancode_version, + scancode_notice=scancode_notice, + pretty_options=pretty_options, + pretty=False) @output_impl @@ -70,23 +77,33 @@ class JsonPrettyOutput(OutputPlugin): metavar='FILE', help='Write scan output as pretty-printed JSON to FILE.', help_group=OUTPUT_GROUP, - sort_order= 10), + sort_order=10), ] - def is_enabled(self): - return self.is_command_option_enabled('output_json_pp') + def is_enabled(self, output_json_pp, **kwargs): + return output_json_pp + + def process_codebase(self, codebase, output_json_pp, files_count, + scancode_version, scancode_notice, pretty_options, + **kwargs): + + results = self.get_results(codebase, **kwargs) + write_json(results=results, output_file=output_json_pp, + files_count=files_count, + scancode_version=scancode_version, + scancode_notice=scancode_notice, + pretty_options=pretty_options, + pretty=True) - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_json_pp').value - self.create_parent_directory(output_file) - write_json(results, output_file, files_count, version, notice, options, pretty=True) +def write_json(results, output_file, files_count, + scancode_version, scancode_notice, + pretty_options, pretty=False): -def write_json(results, output_file, files_count, version, notice, options, pretty=False): scan = OrderedDict([ - ('scancode_notice', notice), - ('scancode_version', version), - ('scancode_options', options), + ('scancode_notice', scancode_notice), + ('scancode_version', scancode_version), + ('scancode_options', pretty_options), ('files_count', files_count), ('files', results), ]) diff --git a/src/formattedcode/output_jsonlines.py b/src/formattedcode/output_jsonlines.py index ea3cedee245..38f15235fb8 100644 --- a/src/formattedcode/output_jsonlines.py +++ b/src/formattedcode/output_jsonlines.py @@ -40,33 +40,36 @@ class JsonLinesOutput(OutputPlugin): options = [ - CommandLineOption(('--json-lines','output_json_lines',), + CommandLineOption(('--json-lines', 'output_json_lines',), type=FileOptionType(mode='wb', lazy=False), metavar='FILE', help='Write scan output as JSON Lines to FILE.', help_group=OUTPUT_GROUP, - sort_order= 15), + sort_order=15), ] - def is_enabled(self): - return self.is_command_option_enabled('output_json_lines') + def is_enabled(self, output_json_lines, **kwargs): + return output_json_lines + + def process_codebase(self, codebase, output_json_lines, files_count, + scancode_version, scancode_notice, pretty_options, + **kwargs): + + results = self.get_results(codebase, **kwargs) - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_json_lines').value - self.create_parent_directory(output_file) header = dict(header=OrderedDict([ - ('scancode_notice', notice), - ('scancode_version', version), - ('scancode_options', options), + ('scancode_notice', scancode_notice), + ('scancode_version', scancode_version), + ('scancode_options', pretty_options), ('files_count', files_count) ])) kwargs = dict( iterable_as_array=True, encoding='utf-8', separators=(',', ':',)) - output_file.write(simplejson.dumps(header, **kwargs)) - output_file.write('\n') + output_json_lines.write(simplejson.dumps(header, **kwargs)) + output_json_lines.write('\n') for scanned_file in results: scanned_file_line = {'files': [scanned_file]} - output_file.write(simplejson.dumps(scanned_file_line, **kwargs)) - output_file.write('\n') + output_json_lines.write(simplejson.dumps(scanned_file_line, **kwargs)) + output_json_lines.write('\n') diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index 25e3e21315d..b3c769d9b80 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -101,14 +101,15 @@ class SpdxTvOutput(OutputPlugin): help_group=OUTPUT_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('output_spdx_tv') + def is_enabled(self, output_spdx_tv, **kwargs): + return output_spdx_tv - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_spdx_tv').value - self.create_parent_directory(output_file) - input_file = codebase.location - write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True) + def process_codebase(self, codebase, input, output_spdx_tv, + scancode_version, scancode_notice, **kwargs): + + results = self.get_results(codebase, **kwargs) + write_spdx(output_spdx_tv, results, scancode_version, scancode_notice, + input, as_tagvalue=True) @output_impl @@ -123,17 +124,19 @@ class SpdxRdfOutput(OutputPlugin): help_group=OUTPUT_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('output_spdx_rdf') + def is_enabled(self, output_spdx_rdf, **kwargs): + return output_spdx_rdf + + def process_codebase(self, codebase, input, output_spdx_rdf, + scancode_version, scancode_notice, **kwargs): - def save_results(self, codebase, results, files_count, version, notice, options): - output_file = self.get_command_option('output_spdx_rdf').value - self.create_parent_directory(output_file) - input_file = codebase.location - write_spdx(output_file, results, version, notice, input_file, as_tagvalue=False) + results = self.get_results(codebase, **kwargs) + write_spdx(output_spdx_rdf, results, scancode_version, scancode_notice, + input, as_tagvalue=False) -def write_spdx(output_file, results, version, notice, input_file, as_tagvalue=True): +def write_spdx(output_file, results, scancode_version, scancode_notice, + input_file, as_tagvalue=True): """ Write scan output as SPDX Tag/value or RDF. """ @@ -145,9 +148,9 @@ def write_spdx(output_file, results, version, notice, input_file, as_tagvalue=Tr input_path = dirname(absinput) doc = Document(Version(2, 1), License.from_identifier('CC0-1.0')) - doc.comment = notice + doc.comment = scancode_notice - doc.creation_info.add_creator(Tool('ScanCode ' + version)) + doc.creation_info.add_creator(Tool('ScanCode ' + scancode_version)) doc.creation_info.set_created_now() package = doc.package = Package( diff --git a/src/licensedcode/__init__.py b/src/licensedcode/__init__.py index 972c5bde04b..ecfc6d7ffd3 100644 --- a/src/licensedcode/__init__.py +++ b/src/licensedcode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,31 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import -from os.path import dirname -from os.path import abspath -from os.path import getsize -from os.path import getmtime -from os.path import join -from os.path import exists - -from commoncode import fileutils - - -lic_src_dir = abspath(dirname(__file__)) -src_dir = dirname(lic_src_dir) -data_dir = join(lic_src_dir, 'data') -licenses_data_dir = join(data_dir, 'licenses') -rules_data_dir = join(data_dir, 'rules') -root_dir = dirname(src_dir) -cache_dir = join(root_dir, '.cache') -license_index_cache_dir = join(cache_dir, 'license_index') - -if not exists(license_index_cache_dir): - fileutils.create_dir(license_index_cache_dir) - # minimum number of tokens a match should have to be considered as worthy keeping MIN_MATCH_LENGTH = 4 MIN_MATCH_HIGH_LENGTH = 3 @@ -55,4 +32,3 @@ # eventually this should be skipped early right during the matching too # maximum distance between two matches to merge MAX_DIST = 120 - diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index dd486de32ad..a0f9f25edc8 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -26,7 +26,6 @@ from functools import partial from hashlib import md5 -import os from os.path import exists from os.path import getmtime from os.path import getsize @@ -35,11 +34,12 @@ import yg.lockfile # @UnresolvedImport from commoncode.fileutils import resource_iter +from commoncode.fileutils import create_dir from commoncode import ignore -from licensedcode import root_dir -from licensedcode import src_dir -from licensedcode import license_index_cache_dir +from scancode_config import scancode_cache_dir +from scancode_config import scancode_src_dir +from scancode_config import SCANCODE_DEV_MODE """ @@ -48,160 +48,158 @@ cached index is safe to use across multiple processes using lock files. """ -index_lock_file = join(license_index_cache_dir, 'lockfile') -tree_checksum_file = join(license_index_cache_dir, 'tree_checksums') -index_cache_file = join(license_index_cache_dir, 'index_cache') +LICENSE_INDEX_LOCK_TIMEOUT = 60 * 3 -_ignored_from_hash = partial( - ignore.is_ignored, - ignores={'*.pyc': 'pyc files', '*~': 'temp gedit files', '*.swp': 'vi swap files'}, - unignores={} -) +# global in-memory cache of the main license index instance +_LICENSES_INDEX = None -def tree_checksum(tree_base_dir=src_dir, _ignored=_ignored_from_hash): +def get_index(cache_dir=scancode_cache_dir): """ - Return a checksum computed from a file tree using the file paths, - size and last modified time stamps. - The purpose is to detect is there has been any modification to - source code or data files and use this as a proxy to verify the - cache consistency. - - NOTE: this is not 100% fool proof but good enough in practice. + Return and eventually cache an index built from an iterable of rules. + Build the index from the built-in rules dataset. """ - hashable = (pth + str(getmtime(pth)) + str(getsize(pth)) - for pth in resource_iter(tree_base_dir, ignored=_ignored, with_dirs=False)) - return md5(''.join(sorted(hashable))).hexdigest() - - -LICENSE_INDEX_LOCK_TIMEOUT = 60 * 3 + global _LICENSES_INDEX + if not _LICENSES_INDEX: + _LICENSES_INDEX = get_cached_index(cache_dir=scancode_cache_dir) + return _LICENSES_INDEX -# If this file exists at the root, the cache is always checked for consistency -DEV_MODE = os.path.exists(os.path.join(root_dir, 'SCANCODE_DEV_MODE')) +# global in-memory cache of a mapping of key -> license instance +_LICENSES = {} -def get_or_build_index_through_cache( - check_consistency=DEV_MODE, - return_index=True, - # used for testing only - _tree_base_dir=src_dir, - _tree_checksum_file=tree_checksum_file, - _index_lock_file=index_lock_file, - _index_cache_file=index_cache_file, - _licenses_data_dir=None, - _rules_data_dir=None, - _timeout=LICENSE_INDEX_LOCK_TIMEOUT, - ): +def get_licenses_db(licenses_data_dir=None): + """ + Return a mapping of license key -> license object. """ - Check and build or rebuild the LicenseIndex cache. - If the cache does not exist, a new index is built an cached. - Return the LicenseIndex if return_index is True. + global _LICENSES + if not _LICENSES : + from licensedcode.models import load_licenses + if not licenses_data_dir: + from licensedcode.models import licenses_data_dir as ldd + licenses_data_dir = ldd + _LICENSES = load_licenses(licenses_data_dir) + return _LICENSES + - If `check_consistency` is True, the cache is checked for consistency - and rebuilt if inconsistent or stale. +def get_cached_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE, - If `check_consistency` is False, the cache is NOT checked for consistency - If the cache files exist but stale, the cache WILL NOT be rebuilt + # used for testing only + timeout=LICENSE_INDEX_LOCK_TIMEOUT, + tree_base_dir=scancode_src_dir, + licenses_data_dir=None, rules_data_dir=None,): + """ + Return a LicenseIndex: either load a cached index or build and cache the + index. + - If the cache does not exist, a new index is built an cached. + - If `check_consistency` is True, the cache is checked for consistency and + rebuilt if inconsistent or stale. + - If `check_consistency` is False, the cache is NOT checked for consistency + If the cache files exist but ARE stale, the cache WILL NOT be rebuilt """ from licensedcode.index import LicenseIndex + from licensedcode.models import licenses_data_dir as ldd + from licensedcode.models import rules_data_dir as rdd from licensedcode.models import get_rules - from licensedcode.models import licenses_data_dir - from licensedcode.models import rules_data_dir - _licenses_data_dir = _licenses_data_dir or licenses_data_dir - _rules_data_dir = _rules_data_dir or rules_data_dir - has_cache = exists(_index_cache_file) - has_tree_checksum = exists(_tree_checksum_file) + licenses_data_dir = licenses_data_dir or ldd + rules_data_dir = rules_data_dir or rdd + + lock_file, checksum_file, cache_file = get_license_cache_paths(cache_dir) + + has_cache = exists(cache_file) + has_tree_checksum = exists(checksum_file) # bypass check if no consistency check is needed if has_cache and has_tree_checksum and not check_consistency: - return return_index and _load_index(_index_cache_file) + return load_index(cache_file) # here, we have no cache or we want a validity check: lock, check # and build or rebuild as needed try: # acquire lock and wait until timeout to get a lock or die - with yg.lockfile.FileLock(_index_lock_file, timeout=_timeout): + with yg.lockfile.FileLock(lock_file, timeout=timeout): current_checksum = None # is the current cache consistent or stale? if has_cache and has_tree_checksum: # if we have a saved cached index # load saved tree_checksum and compare with current tree_checksum - with open(_tree_checksum_file, 'rb') as etcs: + with open(checksum_file, 'rb') as etcs: existing_checksum = etcs.read() - current_checksum = tree_checksum(tree_base_dir=_tree_base_dir) + current_checksum = tree_checksum(tree_base_dir=tree_base_dir) if current_checksum == existing_checksum: # The cache is consistent with the latest code and data # load and return - return return_index and _load_index(_index_cache_file) + return load_index(cache_file) # Here, the cache is not consistent with the latest code and # data: It is either stale or non-existing: we need to # rebuild the index and cache it rules = get_rules( - licenses_data_dir=_licenses_data_dir, - rules_data_dir=_rules_data_dir) + licenses_data_dir=licenses_data_dir, + rules_data_dir=rules_data_dir) + idx = LicenseIndex(rules) - with open(_index_cache_file, 'wb') as ifc: + + with open(cache_file, 'wb') as ifc: ifc.write(idx.dumps()) # save the new checksums tree - with open(_tree_checksum_file, 'wb') as ctcs: - ctcs.write(current_checksum or tree_checksum(tree_base_dir=_tree_base_dir)) + with open(checksum_file, 'wb') as ctcs: + ctcs.write(current_checksum + or tree_checksum(tree_base_dir=tree_base_dir)) - return return_index and idx + return idx except yg.lockfile.FileLockTimeout: # TODO: handle unable to lock in a nicer way raise -def _load_index(_index_cache_file=index_cache_file): +def load_index(cache_file): """ Return a LicenseIndex loaded from cache. """ from licensedcode.index import LicenseIndex - - with open(_index_cache_file, 'rb') as ifc: + with open(cache_file, 'rb') as ifc: # Note: weird but read() + loads() is much (twice++???) faster than load() idx = LicenseIndex.loads(ifc.read()) return idx -"""Check the license index and reindex if needed.""" -reindex = partial(get_or_build_index_through_cache, check_consistency=True, return_index=False) - - -# global in-memory cache of the main license index instance -_LICENSES_INDEX = None +_ignored_from_hash = partial( + ignore.is_ignored, + ignores={'*.pyc': 'pyc files', '*~': 'temp gedit files', '*.swp': 'vi swap files'}, + unignores={} +) -def get_index(_return_index=True): - """ - Return and eventually cache an index built from an iterable of rules. - Build the index from the built-in rules dataset. +def tree_checksum(tree_base_dir=scancode_src_dir, _ignored=_ignored_from_hash): """ - global _LICENSES_INDEX - if not _LICENSES_INDEX: - _LICENSES_INDEX = get_or_build_index_through_cache() - return _return_index and _LICENSES_INDEX - + Return a checksum computed from a file tree using the file paths, + size and last modified time stamps. + The purpose is to detect is there has been any modification to + source code or data files and use this as a proxy to verify the + cache consistency. -# global in-memory cache of a mapping of key -> license instance -_LICENSES = {} + NOTE: this is not 100% fool proof but good enough in practice. + """ + resources = resource_iter(tree_base_dir, ignored=_ignored, with_dirs=False) + hashable = (pth + str(getmtime(pth)) + str(getsize(pth)) for pth in resources) + return md5(''.join(sorted(hashable))).hexdigest() -def get_licenses_db(licenses_data_dir=None): +def get_license_cache_paths(cache_dir=scancode_cache_dir): """ - Return a mapping of license key -> license object. + Return a tuple of index cache files given a master `cache_dir` """ - global _LICENSES - if not _LICENSES : - from licensedcode.models import load_licenses - if not licenses_data_dir: - from licensedcode.models import licenses_data_dir as ldd - licenses_data_dir = ldd - _LICENSES = load_licenses(licenses_data_dir) - return _LICENSES + idx_cache_dir = join(cache_dir, 'license_index') + create_dir(idx_cache_dir) + + lock_file = join(idx_cache_dir, 'lockfile') + checksum_file = join(idx_cache_dir, 'tree_checksums') + cache_file = join(idx_cache_dir, 'index_cache') + + return lock_file, checksum_file, cache_file diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index 049f36fe00b..bc444ba66e4 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -38,12 +38,12 @@ import sys from time import time -from commoncode.dict_utils import sparsify +# import early +from scancode_config import scancode_cache_dir +from commoncode.dict_utils import sparsify from licensedcode import MAX_DIST -from licensedcode.cache import get_index from licensedcode.frequent_tokens import global_tokens_by_ranks - from licensedcode import match from licensedcode import match_aho from licensedcode import match_hash @@ -83,8 +83,8 @@ def logger_debug(*args): pass -if (TRACE or TRACE_INDEXING_PERF or TRACE_QUERY_RUN_SIMPLE - or os.environ.get('SCANCODE_LICENSE_DEBUG') or TRACE_NEGATIVE): +if (TRACE or TRACE_INDEXING_PERF or TRACE_QUERY_RUN_SIMPLE + or os.environ.get('SCANCODE_DEBUG_LICENSE') or TRACE_NEGATIVE): import logging logger = logging.getLogger(__name__) @@ -96,7 +96,8 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) -def get_license_matches(location=None, query_string=None, min_score=0): +def get_license_matches(location=None, query_string=None, min_score=0, + cache_dir=scancode_cache_dir): """ Yield detected license matches in the file at `location` or the `query_string` string. @@ -108,7 +109,8 @@ def get_license_matches(location=None, query_string=None, min_score=0): The minimum length for an approximate match is four tokens. Spurrious matched are always filtered. """ - return get_index().match(location=location, query_string=query_string, min_score=min_score) + from licensedcode.cache import get_index + return get_index(cache_dir).match(location=location, query_string=query_string, min_score=min_score) # Feature switch to enable or not ngram fragments detection @@ -565,7 +567,7 @@ def negative_match(self, query_run): from the query run. """ matches = match_aho.exact_match(self, query_run, self.negative_automaton) - + if TRACE_NEGATIVE and matches: logger_debug(' ##final _negative_matches:....', len(matches)) return matches diff --git a/src/licensedcode/match.py b/src/licensedcode/match.py index 440357e5ff4..9a404ecdde7 100644 --- a/src/licensedcode/match.py +++ b/src/licensedcode/match.py @@ -430,7 +430,6 @@ def merge_matches(matches, max_dist=MAX_DIST): returned as-is. For being merged two matches must also be in increasing query and index positions. """ - from licensedcode.match_seq import MATCH_SEQ # shortcut for single matches if len(matches) < 2: diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index 81ee0cc42e7..d79bd418138 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,9 +23,9 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals import codecs from collections import Counter @@ -34,9 +34,12 @@ from collections import OrderedDict from itertools import chain from operator import itemgetter +from os.path import abspath +from os.path import dirname from os.path import exists from os.path import join +from commoncode.fileutils import copyfile from commoncode.fileutils import file_base_name from commoncode.fileutils import file_name from commoncode.fileutils import resource_iter @@ -45,11 +48,15 @@ from licensedcode import MIN_MATCH_LENGTH from licensedcode import MIN_MATCH_HIGH_LENGTH -from licensedcode import licenses_data_dir -from licensedcode import rules_data_dir from licensedcode.tokenize import rule_tokenizer from licensedcode.tokenize import query_tokenizer -from commoncode import fileutils + + +# these are globals but always side-by-side with the code so not moving +data_dir = join(abspath(dirname(__file__)), 'data') +licenses_data_dir = join(data_dir, 'licenses') +rules_data_dir = join(data_dir, 'rules') + """ @@ -180,7 +187,7 @@ def relocate(self, target_dir, new_key=None): # save it all to files if self.text: - fileutils.copyfile(self.text_file, newl.text_file) + copyfile(self.text_file, newl.text_file) newl.dump() return newl diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 7fffe18068d..3cdfa01c318 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -68,17 +68,14 @@ class BasePlugin(object): # set to True for testing _test_mode = False - - def __init__(self, command_options, *args, **kwargs): + def __init__(self, *args, **kwargs): """ - Initialize a new plugin with a list of user `command_options` (e.g. - CommandOption tuples based on CLI keyword arguments). + Initialize a new plugin with a user kwargs. Plugins can override as needed (still calling super). """ self.options_by_name = {o.name: o for o in self.options} - self.command_options = command_options or [] - self.command_options_by_name = {co.name: co for co in command_options} + self.kwargs = kwargs # mapping of scan summary data and statistics. # This is populated automatically on the plugin instance. @@ -90,6 +87,7 @@ def is_enabled(self, **kwargs): """ Return True is this plugin is enabled by user-selected options. Subclasses must override. + This receives all the ScanCode call arguments as kwargs. """ raise NotImplementedError @@ -100,6 +98,7 @@ def setup(self, **kwargs): exactly one time at initialization if this plugin is enabled. Must raise an Exception on failure. Subclasses can override as needed. + This receives all the ScanCode call arguments as kwargs. """ pass @@ -118,35 +117,6 @@ def get_option(self, name): """ return self.options_by_name.get(name) - def get_command_option(self, name): - """ - Return a global CommandOption with `name` or None. - """ - return self.command_options_by_name.get(name) - - def is_command_option_enabled(self, name): - """ - Return True if the CommandOption with `name` is enabled. - """ - opt = self.get_command_option(name) - if opt: - return opt.value - - def get_own_command_options(self): - """ - Return a mapping of {name: CommandOption} that belong to this plugin. - """ - return {nco: co for nco, co in self.command_options_by_name.items() - if nco in self.options_by_name} - - def get_own_command_options_kwargs(self): - """ - Return a mapping of {name: value} for CommandOption objects that belong - to this plugin and suitable to use as kwargs for a function or method - call. - """ - return {nco: co.value for nco, co in self.get_own_command_options().items()} - def is_active(self, plugins, *args, **kwargs): """ Return True is this plugin is enabled meaning it is enabled and all its @@ -213,10 +183,11 @@ class CodebasePlugin(BasePlugin): # Subclasses should set this as needed. needs_info = False - def process_codebase(self, codebase, *args, **kwargs): + def process_codebase(self, codebase, **kwargs): """ Process a `codebase` Codebase object updating its Reousrce as needed. Subclasses should override. + This receives all the ScanCode call arguments as kwargs. """ raise NotImplementedError diff --git a/src/plugincode/output.py b/src/plugincode/output.py index c3cd0630b54..c0378f6cd29 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -27,17 +27,9 @@ from __future__ import print_function from __future__ import unicode_literals -from collections import OrderedDict from functools import partial -from os.path import abspath -from os.path import dirname -from os.path import expanduser -from sys import stderr -from sys import stdout - -from commoncode.fileutils import create_dir -from commoncode.fileutils import fsdecode -from commoncode.system import on_linux +from itertools import imap + from plugincode import CodebasePlugin from plugincode import PluginManager from plugincode import HookimplMarker @@ -66,9 +58,10 @@ def logger_debug(*args): if TRACE or TRACE_DEEP: import logging + import sys logger = logging.getLogger(__name__) - logging.basicConfig(stream=stdout) + logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) def logger_debug(*args): @@ -89,146 +82,24 @@ class OutputPlugin(CodebasePlugin): Base plugin class for scan output formatters all output plugins must extend. """ - # TODO: pass own command options name/values as concrete kwargs def process_codebase(self, codebase, **kwargs): """ - FIXME: this is a stopgap, intermediate implementation Write scan output for the `codebase`. """ - serializer = partial(Resource.to_dict, - full_root=codebase.full_root, - strip_root=codebase.strip_root, - with_info=codebase.with_info) - - filtered_rids = codebase.filtered_rids - if TRACE_DEEP: - logger_debug('OutputPlugin.process_codebase: filtered_rids:', filtered_rids) - resources = [res for res in codebase.walk( - topdown=True, sort=True, skip_root=codebase.strip_root) - # we apply any filter plugins here - if res.rid not in filtered_rids - ] - # TODO: add dirs to results - files_count, _dirs_count = codebase.resource_counts(resources) - - results = [serializer(res) - for res in codebase.walk(topdown=True, sort=True, skip_root=codebase.strip_root) - # we apply any filter plugins here - if res.rid not in filtered_rids - ] - - version = codebase.summary['scancode_version'] - notice = codebase.summary['scancode_notice'] - - # TODO: consider getting this from the codebase? - options = get_pretty_options(self.command_options, self._test_mode) - - return self.save_results(codebase, results, files_count, version, notice, options) - - def save_results(self, codebase, results, files_count, version, notice, options, *args, **kwargs): - """ - FIXME: this is a stopgap, intermediate implementation - Write scan `results` to `output_file` - """ raise NotImplementedError - def create_parent_directory(self, output_file): - """ - Create parent directory for the `output_file` file-like object if needed. - """ - # FIXME: this IS NOT RIGHT!!! - - # We use this to check if this is a real filesystem file or not. - # note: sys.stdout.name == '' so it has a name. - has_name = hasattr(output, 'name') - output_is_real_file = output not in (stdout, stderr) and has_name - if output_is_real_file: - # we are writing to a real filesystem file: create directories! - parent_dir = dirname(output_file.name) - if parent_dir: - create_dir(abspath(expanduser(parent_dir))) - - def setup_output_file(self, output_file): + @classmethod + def get_results(cls, codebase, info, full_root, strip_root, **kwargs): """ - Return `output_file` fully resolved and in the proper OS encoding. - Create intermediate directoties if needed. + Return an iterable of serialized scan results from a codebase. """ - if on_linux: - output_file = fsdecode(output_file) - output_file = abspath(expanduser(output_file)) - self.create_parent_directory(output_file) - return output_file + serializer = partial(Resource.to_dict, full_root=full_root, + strip_root=strip_root, with_info=info) + resources = codebase.walk(topdown=True, skip_root=strip_root, + skip_filtered=True) -def get_pretty_options(command_options, generic_paths=False): - """ - Return a sorted mapping of {CLI option: pretty value string} for the - `command_options` list of CommandOption as in: - {"--license": True, "input": ~some/path} - - Skip options with with None or empty seq values or a value set to its - default. Skip eager and hidden options. - - If `generic_paths` is True, click.File and click.Path parameters are made - "generic" replacing their value with a placeholder. This is used mostly for - testing. - """ - import click - - if TRACE: - logger_debug('get_pretty_options: generic_paths', generic_paths) - args = [] - options = [] - for option in command_options: - value = option.value - param = option.param - if value == param.default: - continue - - if param.is_eager: - continue - - if value is None: - continue - - # not yet in Click 6.7 or param.hidden: - if option.name == 'test_mode': - continue - - if value in (tuple(), [],): - # option with multiple values, the value is a tuple - continue - - if isinstance(param.type, click.Path) and generic_paths: - value = '' - - if isinstance(param.type, click.File): - if generic_paths: - value = '' - else: - # the value cannot be displayed as-is as this may be an opened file- - # like object - vname = getattr(value, 'name', None) - if vname: - value = vname - else: - value = '' - - # coerce to string for non-basic supported types - if not (value in (True, False, None) - or isinstance(value, (str, unicode, bytes, tuple, list, dict, OrderedDict))): - value = repr(value) - - # opts is a list of CLI options as in "--strip-root": the last opt is - # the CLI option long form by convention - cli_opt = param.opts[-1] - - if isinstance(param, click.Argument): - args.append((cli_opt, value)) - else: - options.append((cli_opt, value)) - - return OrderedDict(sorted(args) + sorted(options)) + return imap(serializer, resources) output_plugins = PluginManager( diff --git a/src/plugincode/output_filter.py b/src/plugincode/output_filter.py index 1e0e0981dd8..e42eec527db 100644 --- a/src/plugincode/output_filter.py +++ b/src/plugincode/output_filter.py @@ -27,7 +27,7 @@ from __future__ import print_function from __future__ import unicode_literals -from plugincode import BasePlugin +from plugincode import CodebasePlugin from plugincode import PluginManager from plugincode import HookimplMarker from plugincode import HookspecMarker @@ -41,20 +41,15 @@ @output_filter_spec -class OutputFilterPlugin(BasePlugin): +class OutputFilterPlugin(CodebasePlugin): """ Base plugin class for Resource output filter plugins that all output filter plugins must extend. - """ - # TODO: pass own command options name/values as concrete kwargs - def process_resource(self, resource, **kwargs): - """ - Return True is the `resource` should be kept, False if it should omitted - aka. filtered out of the Resource stream. - Subclasses must override. - """ - raise NotImplementedError + Filter plugins SHOULD NOT modify the codebase beyond setting the + Resource.is_filtered flag on resources. + """ + pass output_filter_plugins = PluginManager( diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py index 5ea12edd915..29f61c33f42 100644 --- a/src/plugincode/scan.py +++ b/src/plugincode/scan.py @@ -60,6 +60,7 @@ def get_scanner(self, **kwargs): This callable (typically a bare function) should carry as little state as possible as it may be executed through multiprocessing. Subclasses must override. + This receives all the ScanCode call arguments as kwargs. """ raise NotImplementedError diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index cba072672ca..bff9c6d289f 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -64,14 +64,6 @@ fileutils.create_dir(scans_cache_dir) -from pkg_resources import get_distribution, DistributionNotFound -try: - __version__ = get_distribution('scancode-toolkit').version -except DistributionNotFound: - # package is not installed ?? - __version__ = '2.2.1' - - # Tracing flags TRACE = False @@ -104,10 +96,6 @@ def logger_debug(*args): CORE_GROUP = 'core' -# Holds a CLI option actual name/value and its corresponding -# click.Parameter instance -CommandOption = namedtuple('CommandOption', 'help_group name value param') - # Holds a scan plugin result "key and the corresponding function. # click.Parameter instance Scanner = namedtuple('Scanner', 'key function') @@ -124,20 +112,22 @@ def __init__(self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, + type=None, help=None, # @ReservedAssignment # custom additions # # a string that set the CLI help group for this option help_group=MISC_GROUP, # a relative sort order number (integer or float) for this # option within a help group: the sort is by increasing # sort_order then by option declaration. - sort_order = 100, + sort_order=100, # a sequence of other option name strings that this option # requires to be set requires=(), # a sequence of other option name strings that this option # conflicts with if they are set conflicts=(), + # a flag set to True if this option should be hidden from the CLI help + hidden=False, **attrs): super(CommandLineOption, self).__init__(param_decls, show_default, @@ -150,6 +140,7 @@ def __init__(self, param_decls=None, show_default=False, self.sort_order = sort_order self.requires = requires self.conflicts = conflicts + self.hidden = hidden def __repr__(self, *args, **kwargs): name = self.name @@ -284,34 +275,16 @@ def _is_set(_value, _default, typ): raise click.UsageError(msg) -def get_command_options(ctx): - """ - Yield CommandOption tuples for each click.Option option in the `ctx` Click - context. Ignore eager flags. - """ - param_values = ctx.params - for param in ctx.command.params: - if param.is_eager: - continue - if param.name == 'test_mode': - continue - - help_group = getattr(param, 'help_group', None) - name = param.name - value = param_values.get(name) - yield CommandOption(help_group, name, value, param) - - class FileOptionType(click.File): """ A click.File subclass that ensures that a file name is not set to an existing option parameter to avoid mistakes. """ def convert(self, value, param, ctx): - known_opts = set(chain.from_iterable(p.opts for p in ctx.command.params + known_opts = set(chain.from_iterable(p.opts for p in ctx.command.params if isinstance(p, click.Option))) if value in known_opts: - self.fail('Illegal file name conflicting with an option name: %s. ' + self.fail('Illegal file name conflicting with an option name: %s. ' 'Use the special "-" file name to print results on screen/stdout.' % (click.types.filename_to_ui(value), ), param, ctx) diff --git a/src/scancode/api.py b/src/scancode/api.py index c8488aafdf8..25a14ca8bad 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -107,7 +107,9 @@ def get_urls(location, **kwargs): def get_licenses(location, min_score=0, include_text=False, diag=False, - license_url_template=DEJACODE_LICENSE_URL, **kwargs): + license_url_template=DEJACODE_LICENSE_URL, + cache_dir=None, + **kwargs): """ Return a list of mappings for licenses detected in the file at `location`. @@ -120,10 +122,13 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, If `diag` is True, additional license match details are returned with the matched_rule key of the returned mapping. """ + if not cache_dir: + from scancode_config import scancode_cache_dir as cache_dir + from licensedcode.cache import get_index from licensedcode.cache import get_licenses_db - idx = get_index() + idx = get_index(cache_dir) licenses = get_licenses_db() results = [] diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 4e678cc6b0c..cece0204022 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -27,7 +27,7 @@ from __future__ import print_function from __future__ import unicode_literals -# Import early because this import has monkey-patching side effects +# Import first because this import has monkey-patching side effects from scancode.pool import get_pool from collections import OrderedDict @@ -43,6 +43,10 @@ import click click.disable_unicode_literals_warning = True +# import early +from scancode_config import __version__ as scancode_version +from scancode_config import scancode_temp_dir, scancode_cache_dir + from commoncode.fileutils import PATH_TYPE from commoncode.timeutils import time2tstamp @@ -50,14 +54,12 @@ from plugincode import PluginManager # these are important to register plugin managers -from plugincode import housekeeping from plugincode import pre_scan from plugincode import scan from plugincode import post_scan from plugincode import output_filter from plugincode import output -from scancode import __version__ as version from scancode import CORE_GROUP from scancode import DOC_GROUP from scancode import MISC_GROUP @@ -69,7 +71,6 @@ from scancode import PRE_SCAN_GROUP from scancode import SCAN_GROUP from scancode import SCAN_OPTIONS_GROUP -from scancode import get_command_options from scancode import Scanner from scancode import validate_option_dependencies from scancode.api import get_file_info @@ -221,7 +222,7 @@ def print_examples(ctx, param, value): def print_version(ctx, param, value): if not value or ctx.resilient_parsing: return - click.echo('ScanCode version ' + version) + click.echo('ScanCode version ' + scancode_version) ctx.exit() @@ -319,6 +320,7 @@ def print_plugins(ctx, param, value): if not value or ctx.resilient_parsing: return for plugin_cls in sorted(plugin_classes, key=lambda pc: (pc.stage, pc.name)): + click.echo('--------------------------------------------') click.echo('Plugin: scancode_{self.stage}:{self.name}'.format(self=plugin_cls), nl=False) click.echo(' class: {self.__module__}:{self.__name__}'.format(self=plugin_cls)) requires = ', '.join(plugin_cls.requires) @@ -334,7 +336,8 @@ def print_plugins(ctx, param, value): name = option.name opts = ', '.join(option.opts) help_group = option.help_group - click.echo(' {help_group!s}, {name!s}: {opts}'.format(**locals())) + help = option.help # noqa + click.echo(' help_group: {help_group!s}, name: {name!s}: {opts}\n help: {help!s}'.format(**locals())) click.echo('') ctx.exit() @@ -380,7 +383,7 @@ def print_plugins(ctx, param, value): @click.option('--timeout', type=float, default=DEFAULT_TIMEOUT, - metavar='', + metavar='', help='Stop an unfinished file scan after a timeout in seconds. ' '[default: %d seconds]' % DEFAULT_TIMEOUT, help_group=CORE_GROUP, sort_order=10, cls=CommandLineOption) @@ -398,47 +401,72 @@ def print_plugins(ctx, param, value): 'Print a verbose scan summary.', help_group=CORE_GROUP, sort_order=20, cls=CommandLineOption) -@click.option('--no-cache', - is_flag=True, - help='Do not use on-disk cache for intermediate results. Uses more memory.', - help_group=CORE_GROUP, sort_order=200, cls=CommandLineOption) +@click.option('--cache-dir', + type=click.Path( + exists=True, file_okay=False, dir_okay=True, + readable=True, path_type=PATH_TYPE), + default=scancode_cache_dir, + metavar='DIR', + sort_order=210, -@click.option('--timing', - is_flag=True, - help='Collect execution timing for each scan and scanned file.', - help_group=CORE_GROUP, cls=CommandLineOption) + help='Set the path to an existing directory where ScanCode can cache ' + 'files available across runs.' + + 'If not set, the value of the `SCANCODE_CACHE` environment variable is ' + 'used if available. If `SCANCODE_CACHE` is not set, a default ' + 'sub-directory in the user home directory is used instead. ' + '[default: ~/.cache/scancode-tk/version]', + help_group=CORE_GROUP, + cls=CommandLineOption) @click.option('--temp-dir', type=click.Path( exists=True, file_okay=False, dir_okay=True, readable=True, path_type=PATH_TYPE), - default=None, sort_order=200, + default=scancode_temp_dir, + show_default=False, metavar='DIR', - help='Set the path to the temporary directory to use for ScanCode ' - 'cache and temporary files.', + sort_order=210, + help='Set the path to an existing directory where ScanCode can create ' + 'temporary files. ' + 'If not set, the value of the `SCANCODE_TMP` environment variable is ' + 'used if available. If `SCANCODE_TMP` is not set, a default ' + 'sub-directory in the system temp directory is used instead. ' + '[default: TMP/scancode-tk-]', help_group=CORE_GROUP, cls=CommandLineOption) -@click.help_option('-h', '--help', - help_group=DOC_GROUP, sort_order= 10,cls=CommandLineOption) +@click.option('--timing', + is_flag=True, + help='Collect scan timing for each scan/scanned file.', + help_group=CORE_GROUP, sort_order=250, cls=CommandLineOption) -@click.option('--examples', - is_flag=True, is_eager=True, - callback=print_examples, - help=('Show command examples and exit.'), - help_group=DOC_GROUP, sort_order= 50,cls=CommandLineOption) +@click.option('--on-disk-results', + is_flag=True, default=True, + show_default=True, + help='Save intermediate scan results in temporary files. Uses less memory.', + help_group=CORE_GROUP, sort_order=300, cls=CommandLineOption) + +@click.help_option('-h', '--help', + help_group=DOC_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--about', is_flag=True, is_eager=True, callback=print_about, help='Show information about ScanCode and licensing and exit.', - help_group=DOC_GROUP, sort_order= 20,cls=CommandLineOption) + help_group=DOC_GROUP, sort_order=20, cls=CommandLineOption) @click.option('--version', is_flag=True, is_eager=True, callback=print_version, help='Show the version and exit.', - help_group=DOC_GROUP, sort_order= 20,cls=CommandLineOption) + help_group=DOC_GROUP, sort_order=20, cls=CommandLineOption) + +@click.option('--examples', + is_flag=True, is_eager=True, + callback=print_examples, + help=('Show command examples and exit.'), + help_group=DOC_GROUP, sort_order=50, cls=CommandLineOption) @click.option('--plugins', is_flag=True, is_eager=True, @@ -448,60 +476,61 @@ def print_plugins(ctx, param, value): @click.option('--test-mode', is_flag=True, default=False, - # not yet supported in Click 6.7 - # hidden = True, + # not yet supported in Click 6.7 but added in CommandLineOption + hidden=True, help='Run ScanCode in a special "test mode". Only for testing.', - help_group=MISC_GROUP, sort_order= 1000,cls=CommandLineOption) + help_group=MISC_GROUP, sort_order=1000, cls=CommandLineOption) -def scancode(ctx, input, info, # @ReservedAssignment +def scancode(ctx, input, + info, strip_root, full_root, - verbose, quiet, processes, timeout, - no_cache, + quiet, verbose, + cache_dir, temp_dir, timing, - temp_dir, + on_disk_results, test_mode, *args, **kwargs): """scan the file or directory for license, origin and packages and save results to FILE(s) using one or more ouput format option. - Error and progress is printed to stderr. + Error and progress are printed to stderr. """ # notes: the above docstring of this function is used in the CLI help Here is # it's actual docstring: """ - Return a return code of 0 on success or 1 on error from running all the - scanning "stages" in the `input` file and saving results inthe `format` format - to `output_file`. + This function is the main ScanCode CLI entry point. + + Return a return code of 0 on success or a positive integer on error from + running all the scanning "stages" with the `input` file or + directory. + The scanning stages are: - - `inventory`: collect the codebase inventory resources tree for the `input`. - This is a built-in stage that does not accept plugins. + - `inventory`: collect the codebase inventory resources tree for the + `input`. This is a built-in stage that does not accept plugins. - `setup`: as part of the plugins system, each plugin is loaded and - its `setup` class method is called if it is enabled. + its `setup` method is called if it is enabled. - `pre-scan`: each enabled pre-scan plugin `process_codebase(codebase)` - method is called to update/transforme the whole codebase + method is called to update/transforme the whole codebase. - `scan`: the codebase is walked and each enabled scan plugin - `process_resource(resource.location)` method is called for each codebase - resource. + `get_scanner()(resource.location)` scanner function is called once for + each codebase resource. - `post-scan`: each enabled post-scan plugin `process_codebase(codebase)` - method is called to update/transforme the whole codebase - - # !!!!!TODO: this is not yet true!!!! - - `output`: each enabled output plugin `process_codebase(codebase)` - method is called to create an output for the codebase + method is called to update/transforme the whole codebase. - This function is the main CLI entry point. + - `output_filter`: the `process_resource` method of each enabled + output_filter plugin is called on each resource to determine if the + resource should be kept or not in the output stage. - The other arguments are: + - `output`: each enabled output plugin `process_codebase(codebase)` + method is called to create an output for the codebase filtered resources. - - `quiet` and `verbose`: boolean flags: Do not display any message if - `quiet` is True. Otherwise, display extra verbose messages if `quiet` is - False and `verbose` is True. These two options are mutually exclusive. + Beside `input`, the other arguments are: - `strip_root` and `full_root`: boolean flags: In the outputs, strip the first path segment of a file if `strip_root` is True unless the `input` is @@ -516,12 +545,19 @@ def scancode(ctx, input, info, # @ReservedAssignment if the license scan is interrupted they other scans may complete, each withing the timeout) - - `no_cache`: boolean flag: disable on-disk caching of intermediate scan - results and store these in memory instead if True + - `quiet` and `verbose`: boolean flags: Do not display any message if + `quiet` is True. Otherwise, display extra verbose messages if `quiet` is + False and `verbose` is True. These two options are mutually exclusive. + + - `cache_dir` and `temp_dir`: paths to alternative directories for caching + and temporary files. - `timing`: boolean flag: collect per-scan and per-file scan timings if True. + - `on_disk_results`: boolean flag: default to True to enable on-disk saving + of intermediate scan results. + - `temp_dir`: path to a non-default temporary directory fo caching and other temporary files. If not provided, the default is used. @@ -529,6 +565,20 @@ def scancode(ctx, input, info, # @ReservedAssignment through Click context machinery. """ + # build mappings of all kwargs to pass down to plugins + standard_kwargs = dict( + input=input, + info=info, + strip_root=strip_root, full_root=full_root, + processes=processes, timeout=timeout, + quiet=quiet, verbose=verbose, + cache_dir=cache_dir, temp_dir=temp_dir, + timing=timing, + on_disk_results=on_disk_results, + test_mode=test_mode + ) + kwargs.update(standard_kwargs) + success = True codebase = None processing_start = time() @@ -537,35 +587,37 @@ def scancode(ctx, input, info, # @ReservedAssignment scan_start = time2tstamp() try: - # validate_exclusive(ctx, ['strip_root', 'full_root']) if not processes and not quiet: echo_stderr('Disabling multi-processing.', fg='yellow') - ############################################################################ + ######################################################################## # 1. get command options and create all plugin instances - ############################################################################ + ######################################################################## validate_option_dependencies(ctx) - command_options = sorted(get_command_options(ctx)) + if TRACE_DEEP: - logger_debug('scancode: command_options:') - for co in command_options: - logger_debug(' scancode: command_option:', co) + ctx_params = sorted(ctx.params.items()) + logger_debug('scancode: ctx.params:') + for co in ctx.params: + logger_debug(' scancode: ctx.params:', co) enabled_plugins = OrderedDict() for stage, manager in PluginManager.managers.items(): - if stage == housekeeping.stage: - continue - enabled_plugins[stage] = stage_plugins = OrderedDict() for name, plugin_cls in manager.plugin_classes.items(): - # TODO: manage errors: this will error out loudly if there are errors - plugin = plugin_cls(command_options) - if plugin.is_enabled(): - # Set special test mode flag that plugins can leverage - plugin._test_mode = test_mode - stage_plugins[name] = plugin + try: + plugin = plugin_cls(**kwargs) + if plugin.is_enabled(**kwargs): + # Set special test mode flag that plugins can leverage + plugin._test_mode = test_mode + stage_plugins[name] = plugin + except: + msg = 'ERROR: failed to load plugin: %(stage)s:%(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) # these are plugin instances, not classes pre_scan_plugins = enabled_plugins[pre_scan.stage] @@ -579,18 +631,16 @@ def scancode(ctx, input, info, # @ReservedAssignment 'option is needed to save scan results.') raise click.UsageError(msg) + # Use default info scan when no other scan options are requested if not scanner_plugins and not info: - # Use default info scan when no scan option is requested - info = True - for co in command_options: - if co.name == 'info': - co._replace(value=True) + # add info scan as scan option/kwarg/locals() + info = ctx.params['info'] = kwargs['info'] = True # TODO: check for plugin dependencies and if a plugin is ACTIVE!!! - ############################################################################ + ######################################################################## # 2. setup enabled plugins - ############################################################################ + ######################################################################## setup_timings = OrderedDict() plugins_setup_start = time() @@ -602,25 +652,27 @@ def scancode(ctx, input, info, # @ReservedAssignment for stage, stage_plugins in enabled_plugins.items(): for name, plugin in stage_plugins.items(): plugin_setup_start = time() - if not quiet and verbose: - echo_stderr('Setup plugin: %(stage)s:%(name)s...' % locals(), + if verbose: + echo_stderr(' Setup plugin: %(stage)s:%(name)s...' % locals(), fg='green') try: - plugin.setup() + plugin.setup(**kwargs) except: msg = 'ERROR: failed to setup plugin: %(stage)s:%(name)s:' % locals() echo_stderr(msg, fg='red') echo_stderr(traceback.format_exc()) ctx.exit(2) - timing_key = 'setup_%(stage)s_%(name)s' % locals() + timing_key = 'setup_%(stage)s:%(name)s' % locals() setup_timings[timing_key] = time() - plugin_setup_start setup_timings['setup'] = time() - plugins_setup_start - ############################################################################ + ######################################################################## # 3. collect codebase inventory - ############################################################################ + ######################################################################## + + inventory_start = time() if not quiet: echo_stderr('Collect file inventory...', fg='green') @@ -628,29 +680,29 @@ def scancode(ctx, input, info, # @ReservedAssignment # TODO: add progress indicator # note: inventory timing collection is built in Codebase initialization try: - codebase = Codebase(location=input, use_cache=not no_cache) + codebase = Codebase( + location=input, use_cache=on_disk_results, temp_dir=temp_dir) except: msg = 'ERROR: failed to collect codebase at: %(input)r' % locals() echo_stderr(msg, fg='red') echo_stderr(traceback.format_exc()) ctx.exit(2) - if TRACE: logger_debug('scancode: codebase.use_cache:', codebase.use_cache) - - codebase.strip_root = strip_root - codebase.full_root = full_root + if TRACE: + logger_debug('scancode: codebase.use_cache:', codebase.use_cache) codebase.timings.update(setup_timings) - # TODO: thse are noy YET used in outputs!! - codebase.summary['scancode_notice'] = notice - codebase.summary['scancode_version'] = version - # TODO: this is NOT the pretty options - codebase.summary['scancode_options'] = command_options + codebase.timings['inventory'] = time() - inventory_start + + files_count, dirs_count, size_count = codebase.compute_counts() + codebase.summary['initial_files_count'] = files_count + codebase.summary['initial_dirs_count'] = dirs_count + codebase.summary['initial_size_count'] = size_count - ############################################################################ + ######################################################################## # 4. if any prescan plugins needs_info run an info scan first - ############################################################################ + ######################################################################## # do we need to collect info before prescan? pre_scan_needs_info = any(p.needs_info for p in pre_scan_plugins.values()) @@ -658,6 +710,9 @@ def scancode(ctx, input, info, # @ReservedAssignment info_is_collected = False if pre_scan_needs_info: + # add info scan as scan option/kwarg/locals() + info = ctx.params['info'] = kwargs['info'] = True + info_start = time() progress_manager = None @@ -671,61 +726,48 @@ def scancode(ctx, input, info, # @ReservedAssignment scanners = [Scanner(key='infos', function=get_file_info)] # TODO: add CLI option to bypass cache entirely info_success = scan_codebase(codebase, scanners, processes, timeout, - with_timing=timing, with_info=True, progress_manager=progress_manager) + with_timing=timing, progress_manager=progress_manager) - codebase.timings['collect-info'] = time() - info_start info_is_collected = True + codebase.timings['collect-info'] = time() - info_start success = success and info_success - ############################################################################ + ######################################################################## # 5. run prescans - ############################################################################ - - pre_scan_start = time() - if not quiet and not verbose and pre_scan_plugins: - echo_stderr('Run pre-scan plugins...', fg='green') + ######################################################################## # TODO: add progress indicator - for name, plugin in pre_scan_plugins.items(): - plugin_prescan_start = time() - if verbose: - echo_stderr('Run pre-scan plugin: %(name)s...' % locals(), - fg='green') - - try: - plugin.process_codebase(codebase) - except: - msg = 'ERROR: failed to run pre-scan plugin: %(name)s:' % locals() - echo_stderr(msg, fg='red') - echo_stderr(traceback.format_exc()) - ctx.exit(2) + run_plugins(ctx, plugins=pre_scan_plugins, stage='pre-scan', + codebase=codebase, kwargs=kwargs, + quiet=quiet, verbose=verbose, + stage_msg='Run %(stage)ss...', + plugin_msg=' Run %(stage)s: %(name)s...') - codebase.update_counts() - timing_key = 'prescan_%(name)s' % locals() - setup_timings[timing_key] = time() - plugin_prescan_start - - codebase.timings['pre-scan'] = time() - pre_scan_start - - ############################################################################ + ######################################################################## # 6. run scans. - ############################################################################ + ######################################################################## scan_start = time() scanners = [] - # add info is requested or needed but not yet collected - stages_needs_info = any(p.needs_info for p in - (post_scan_plugins.values() + output_plugins.values())) - with_info = info or stages_needs_info - codebase.with_info = with_info - if not info_is_collected and with_info: + if not info: + next_stages = (post_scan_plugins.values() + + output_filter_plugins.values() + + output_plugins.values()) + next_stages_need_info = any(p.needs_info for p in next_stages) + # add info is requested or needed but not yet collected + if next_stages_need_info: + # add info scan as scan option + info = True + ctx.params['info'] = info + + if info and not info_is_collected: scanners = [Scanner(key='infos', function=get_file_info)] scan_sorter = lambda s: (s.sort_order, s.name) for scanner in sorted(scanner_plugins.values(), key=scan_sorter): - scanner_kwargs = scanner.get_own_command_options_kwargs() - func = scanner.get_scanner(**scanner_kwargs) + func = scanner.get_scanner(**kwargs) scanners.append(Scanner(key=scanner.name, function=func)) if TRACE_DEEP: logger_debug('scancode: scanners:', scanners) @@ -745,101 +787,74 @@ def scancode(ctx, input, info, # @ReservedAssignment # TODO: add CLI option to bypass cache entirely scan_success = scan_codebase(codebase, scanners, processes, timeout, - with_timing=timing, with_info=with_info, progress_manager=progress_manager) + with_timing=timing, progress_manager=progress_manager) - scanned_count, _, scanned_size = codebase.counts( - update=True, skip_root=False) + scanned_fc, scanned_dc, scanned_sc = codebase.compute_counts() codebase.summary['scan_names'] = scan_names - codebase.summary['scanned_count'] = scanned_count - codebase.summary['scanned_size'] = scanned_size + codebase.summary['scanned_files_count'] = scanned_fc + codebase.summary['scanned_dirs_count'] = scanned_dc + codebase.summary['scanned_size_count'] = scanned_sc codebase.timings['scan'] = time() - scan_start success = success and scan_success - ############################################################################ + ######################################################################## # 7. run postscans - ############################################################################ + ######################################################################## - post_scan_start = time() # TODO: add progress indicator - if not quiet and not verbose and post_scan_plugins: - echo_stderr('Run post-scan plugins...', fg='green') - for name, plugin in post_scan_plugins.items(): - if not quiet and verbose: - echo_stderr('Run post-scan plugin: %(name)s...' % locals(), fg='green') + run_plugins(ctx, plugins=post_scan_plugins, stage='post-scan', + codebase=codebase, kwargs=kwargs, + quiet=quiet, verbose=verbose, + stage_msg='Run %(stage)ss...', + plugin_msg=' Run %(stage)s: %(name)s...') - try: - plugin.process_codebase(codebase) - except: - msg = 'ERROR: failed to run post-scan plugin: %(name)s:' % locals() - echo_stderr(msg, fg='red') - echo_stderr(traceback.format_exc()) - ctx.exit(2) - codebase.update_counts() - - codebase.timings['post-scan'] = time() - post_scan_start - - ############################################################################ + ######################################################################## # 8. apply output filters - ############################################################################ - output_filter_start = time() - # TODO: add progress indicator - if not quiet and not verbose and output_filter_plugins: - echo_stderr('Run output filter plugins...', fg='green') + ######################################################################## - filters = tuple(plugin.process_resource for plugin in output_filter_plugins.values()) - if filters: - # This is a set of resource ids to filter out from the final outputs - filtered_rids_add = codebase.filtered_rids.add - try: - for rid, resource in codebase.get_resources_with_rid(): - if all(to_keep(resource) for to_keep in filters): - continue - filtered_rids_add(rid) - finally: - msg = 'ERROR: failed to run output filter plugins' - echo_stderr(msg, fg='red') - echo_stderr(traceback.format_exc()) - ctx.exit(2) - - codebase.timings['output-filter'] = time() - post_scan_start - - ############################################################################ - # 9. run outputs - ############################################################################ - output_start = time() # TODO: add progress indicator - if not quiet and not verbose: - echo_stderr('Save results...' , fg='green') + run_plugins(ctx, plugins=output_filter_plugins, stage='output-filter', + codebase=codebase, kwargs=kwargs, + quiet=quiet, verbose=verbose, + stage_msg='Apply %(stage)ss...', + plugin_msg=' Apply %(stage)s: %(name)s...') - for name, plugin in output_plugins.items(): - if not quiet and verbose: - echo_stderr('Save results as: %(name)s...' % locals(), fg='green') + ######################################################################## + # 9. run outputs + ######################################################################## - try: - plugin.process_codebase(codebase) - except: - msg = 'ERROR: failed to save output with plugin: %(name)s:' % locals() - echo_stderr(msg, fg='red') - echo_stderr(traceback.format_exc()) - ctx.exit(2) + # TODO: cleanup kwargs vs. codebase attrs + files_count, dirs_count, size_count = codebase.compute_counts( + skip_root=strip_root, skip_filtered=True) - codebase.update_counts() + codebase.summary['final_files_count'] = files_count + codebase.summary['final_dirs_count'] = dirs_count + codebase.summary['final_size_count'] = size_count - codebase.timings['output'] = time() - output_start + kwargs['files_count'] = files_count + kwargs['pretty_options'] = get_pretty_params(ctx, info=info, generic_paths=test_mode) + kwargs['scancode_notice'] = notice + kwargs['scancode_version'] = scancode_version - ############################################################################ + # TODO: add progress indicator + run_plugins(ctx, plugins=output_plugins, stage='output', + codebase=codebase, kwargs=kwargs, + quiet=quiet, verbose=verbose, + stage_msg='Save scan results...', + plugin_msg=' Save scan results as: %(name)s...', + exit_on_fail=False) + + ######################################################################## # 9. display summary - ############################################################################ + ######################################################################## codebase.timings['total'] = time() - processing_start # TODO: compute summary for output plugins too?? if not quiet: echo_stderr('Scanning done.', fg='green' if success else 'red') - display_summary(codebase, scan_names, processes, - skip_root=strip_root, verbose=verbose) - + display_summary(codebase, scan_names, processes, verbose=verbose) finally: # cleanup including cache cleanup if codebase: @@ -849,8 +864,48 @@ def scancode(ctx, input, info, # @ReservedAssignment ctx.exit(rc) +def run_plugins(ctx, stage, plugins, codebase, kwargs, quiet, verbose, + stage_msg='', plugin_msg='', exit_on_fail=True): + """ + Run the `stage` `plugins` (a mapping of {name: plugin} on `codebase`. + Display errors. + Exit the CLI on failure if `exit_on_fail` is True. + """ + stage_start = time() + if verbose and plugins: + echo_stderr(stage_msg % locals(), fg='green') + + # TODO: add progress indicator + for name, plugin in plugins.items(): + plugin_start = time() + + if verbose: + echo_stderr(plugin_msg % locals(), fg='green') + + try: + if TRACE_DEEP: + from pprint import pformat + logger_debug('run_plugins: kwargs passed to %(stage)s:%(name)s' % locals()) + logger_debug(pformat(sorted(kwargs.item()))) + logger_debug() + + plugin.process_codebase(codebase, **kwargs) + + except: + msg = 'ERROR: failed to run %(stage)s plugin: %(name)s:' % locals() + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + if exit_on_fail: + ctx.exit(2) + + timing_key = '%(stage)s:%(name)s' % locals() + codebase.timings[timing_key] = time() - plugin_start + + codebase.timings['stage'] = time() - stage_start + + def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, - with_timing=False, with_info=False, progress_manager=None): + with_timing=False, progress_manager=None): """ Run the `scanners` Scanner object on the `codebase` Codebase. Return True on success or False otherwise. @@ -871,18 +926,14 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, # FIXME: this path computation is super inefficient # tuples of (absolute location, resource id) - # TODO: should we alk topdown or not??? + # TODO: should we walk topdown or not??? resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) runner = partial(scan_resource, scanners=scanners, timeout=timeout) - has_info_scanner = with_info - lscan = len(scanners) - has_other_scanners = lscan > 1 if has_info_scanner else lscan if TRACE: logger_debug('scan_codebase: scanners:', '\n'.join(repr(s) for s in scanners)) - logger_debug('scan_codebase: has_other_scanners:', bool(has_other_scanners)) get_resource = codebase.get_resource @@ -929,15 +980,14 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, success = False resource.errors.extend(scan_errors) - if has_info_scanner: - # always set info directly on resources - info = scan_result.pop('infos', []) - resource.set_info(info) - if TRACE: logger_debug('scan_codebase: set_info:', info) + # always set info directly on resources + infos = scan_result.pop('infos', []) + if TRACE: logger_debug('scan_codebase: infos:', infos) + if infos: + resource.set_info(infos) - if has_other_scanners and scan_result: - resource.put_scans(scan_result, update=True) - if TRACE: logger_debug('scan_codebase: pu_scans:', scan_result) + saved_scans = resource.put_scans(scan_result, update=True) + if TRACE: logger_debug('scan_codebase: saved_scans:', saved_scans) except StopIteration: break @@ -1011,23 +1061,36 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=F return location, rid, errors, scan_time, results -def display_summary(codebase, scan_names, processes, skip_root, verbose): +def display_summary(codebase, scan_names, processes, verbose): """ Display a scan summary. """ - counts = codebase.counts(update=False, skip_root=skip_root) initial_files_count = codebase.summary.get('initial_files_count', 0) initial_dirs_count = codebase.summary.get('initial_dirs_count', 0) initial_res_count = initial_files_count + initial_dirs_count + initial_size_count = codebase.summary.get('initial_size_count', 0) + if initial_size_count: + initial_size_count = format_size(initial_size_count) + initial_size_count = 'for %(initial_size_count)s' % locals() + else: + initial_size_count = '' - final_files_count, final_dirs_count, final_size = counts + final_files_count = codebase.summary.get('final_files_count', 0) + final_dirs_count = codebase.summary.get('final_dirs_count', 0) final_res_count = final_files_count + final_dirs_count + final_size_count = codebase.summary.get('final_size_count', 0) + if final_size_count: + final_size_count = format_size(final_size_count) + final_size_count = 'for %(final_size_count)s' % locals() + else: + final_size_count = '' top_errors = codebase.errors - path_errors = [(r.get_path(decode=True, posix=True), r.errors) for r in codebase.walk() if r.errors] + path_and_errors = [(r.get_path(decode=True, posix=True), r.errors) + for r in codebase.walk() if r.errors] - has_errors = top_errors or path_errors + has_errors = top_errors or path_and_errors errors_count = 0 if has_errors: @@ -1035,7 +1098,8 @@ def display_summary(codebase, scan_names, processes, skip_root, verbose): for error in top_errors: echo_stderr(error) errors_count += 1 - for errored_path, errors in path_errors: + + for errored_path, errors in path_and_errors: echo_stderr('Path: ' + errored_path, fg='red') if not verbose: continue @@ -1044,25 +1108,31 @@ def display_summary(codebase, scan_names, processes, skip_root, verbose): echo_stderr(' ' + emsg, fg='red') errors_count += 1 - scanned_size = codebase.summary.get('scanned_size', 0) scan_time = codebase.timings.get('scan', 0.) - scan_size_speed = format_size(scanned_size / scan_time) - scanned_count = codebase.summary.get('scanned_count', 0) - scan_file_speed = round(float(scanned_count) / scan_time , 2) - final_size = format_size(final_size) + + scanned_size_count = codebase.summary.get('scanned_size_count', 0) + if scanned_size_count: + scan_size_speed = format_size(scanned_size_count / scan_time) + scan_size_speed = '%(scan_size_speed)s/sec.' % locals() + else: + scan_size_speed = '' + + scanned_files_count = codebase.summary.get('scanned_files_count', 0) + scan_file_speed = round(float(scanned_files_count) / scan_time , 2) echo_stderr('Summary: %(scan_names)s with %(processes)d process(es)' % locals()) echo_stderr('Errors count: %(errors_count)d' % locals()) - echo_stderr('Scan Speed: %(scan_file_speed).2f files/sec. %(scan_size_speed)s/sec.' % locals()) + echo_stderr('Scan Speed: %(scan_file_speed).2f files/sec. %(scan_size_speed)s' % locals()) echo_stderr('Initial counts: %(initial_res_count)d resource(s): ' '%(initial_files_count)d file(s) ' - 'and %(initial_dirs_count)d directorie(s)' % locals()) + 'and %(initial_dirs_count)d directorie(s) ' + '%(initial_size_count)s' % locals()) echo_stderr('Final counts: %(final_res_count)d resource(s): ' '%(final_files_count)d file(s) ' 'and %(final_dirs_count)d directorie(s) ' - 'for %(final_size)s' % locals()) + '%(final_size_count)s' % locals()) echo_stderr('Timings:') for key, value, in codebase.timings.items(): @@ -1113,3 +1183,75 @@ def format_size(size): return '%(size).2f %(symbol)s' % locals() size = size / 1024. return '%(size).2f %(symbol)s' % locals() + + +def get_pretty_params(ctx, info=False, generic_paths=False): + """ + Return a sorted mapping of {CLI option: pretty value string} for the + `ctx` Click.context, putting arguments first then options: + + {"input": ~/some/path, "--license": True} + + Skip options that are not set or hidden. + + If `generic_paths` is True, click.File and click.Path parameters are made + "generic" replacing their value with a placeholder. This is used mostly for + testing. + """ + + if TRACE: + logger_debug('get_pretty_params: generic_paths', generic_paths) + args = [] + # hack since info option can be changed to True if default + options = [('--info', info)] if info else [] + + param_values = ctx.params + for param in ctx.command.params: + name = param.name + value = param_values.get(name) + + if param.is_eager: + continue + # This attribute is not yet in Click 6.7 but in head + if getattr(param, 'hidden', False): + continue + + if value == param.default: + continue + if value is None: + continue + if value in (tuple(), [],): + # option with multiple values, the value is a tuple + continue + + if isinstance(param.type, click.Path) and generic_paths: + value = '' + + if isinstance(param.type, click.File): + if generic_paths: + value = '' + else: + # the value cannot be displayed as-is as this may be an opened file- + # like object + vname = getattr(value, 'name', None) + if vname: + value = vname + else: + value = '' + + # coerce to string for non-basic supported types + if not (value in (True, False, None) + or isinstance(value, (str, unicode, bytes, tuple, list, dict, OrderedDict))): + value = repr(value) + + # opts is a list of CLI options as in "--strip-root": the last opt is + # the CLI option long form by convention + cli_opt = param.opts[-1] + + if isinstance(param, click.Argument): + args.append((cli_opt, value)) + else: + options.append((cli_opt, value)) + + return OrderedDict(sorted(args) + sorted(options)) + diff --git a/src/scancode/cli_test_utils.py b/src/scancode/cli_test_utils.py index 6f323734408..aa5ff08692f 100644 --- a/src/scancode/cli_test_utils.py +++ b/src/scancode/cli_test_utils.py @@ -31,6 +31,7 @@ from collections import OrderedDict import json import os + from commoncode.system import on_linux @@ -39,32 +40,68 @@ def remove_dates(scan_result): Remove date fields from scan. """ for scanned_file in scan_result['files']: - if 'date' in scanned_file: - del scanned_file['date'] + scanned_file.pop('date', None) -def check_json_scan(expected_file, result_file, regen=False, strip_dates=False): +def clean_errors(scan_results): + """ + Clean error fields from scan by keeping only the first and last line + (removing the stack traces). """ - Check the scan result_file JSON results against the expected_file expected JSON - results. Removes references to test_dir for the comparison. If regen is True the - expected_file WILL BE overwritten with the results. This is convenient for - updating tests expectations. But use with caution. + + def clean(_errors): + """Modify the __errors list in place""" + for _i, _error in enumerate(_errors[:]): + _error_split = _error.splitlines(True) + if len(_error_split) <= 1: + continue + # keep first and last line + _clean_error = ''.join([_error_split[0] + _error_split[-1]]) + _errors[_i] = _clean_error + + top_level = scan_results.get('scan_errors') + if top_level: + clean(top_level) + + for result in scan_results['files']: + file_level = result.get('scan_errors') + if file_level: + clean(file_level) + + +def check_json_scan(expected_file, result_file, regen=False, + strip_dates=False, clean_errs=True): """ - result = _load_json_result(result_file) + Check the scan result_file JSON results against the expected_file expected + JSON results. Removes references to test_dir for the comparison. If regen is + True the expected_file WILL BE overwritten with the results. This is + convenient for updating tests expectations. But use with caution. + """ + scan_results = _load_json_result(result_file) + if strip_dates: - remove_dates(result) + remove_dates(scan_results) + + if clean_errs: + clean_errors(scan_results) + if regen: with open(expected_file, 'wb') as reg: - json.dump(result, reg, indent=2, separators=(',', ': ')) + json.dump(scan_results, reg, indent=2, separators=(',', ': ')) + expected = _load_json_result(expected_file) + if strip_dates: remove_dates(expected) + if clean_errs: + clean_errors(expected) # NOTE we redump the JSON as a string for a more efficient comparison of # failures + # TODO: remove sort, this should no longer be needed expected = json.dumps(expected, indent=2, sort_keys=True, separators=(',', ': ')) - result = json.dumps(result, indent=2, sort_keys=True, separators=(',', ': ')) - assert expected == result + scan_results = json.dumps(scan_results, indent=2, sort_keys=True, separators=(',', ': ')) + assert expected == scan_results def _load_json_result(result_file): @@ -78,18 +115,19 @@ def _load_json_result(result_file): if scan_result.get('scancode_version'): del scan_result['scancode_version'] + # TODO: remove sort, this should no longer be needed scan_result['files'].sort(key=lambda x: x['path']) return scan_result -def run_scan_plain(options, cwd=None): +def run_scan_plain(options, cwd=None, test_mode=True): """ Run a scan as a plain subprocess. Return rc, stdout, stderr. """ from commoncode.command import execute import scancode - if '--test-mode' not in options: + if test_mode and '--test-mode' not in options: options.append('--test-mode') scmd = b'scancode' if on_linux else 'scancode' @@ -97,7 +135,7 @@ def run_scan_plain(options, cwd=None): return execute(scan_cmd, options, cwd=cwd) -def run_scan_click(options, monkeypatch=None): +def run_scan_click(options, monkeypatch=None, test_mode=True): """ Run a scan as a Click-controlled subprocess If monkeypatch is provided, a tty with a size (80, 43) is mocked. @@ -107,7 +145,7 @@ def run_scan_click(options, monkeypatch=None): from click.testing import CliRunner from scancode import cli - if '--test-mode' not in options: + if test_mode and '--test-mode' not in options: options.append('--test-mode') if monkeypatch: diff --git a/src/scancode/extract_cli.py b/src/scancode/extract_cli.py index cac6fc02e4d..0930205e70a 100644 --- a/src/scancode/extract_cli.py +++ b/src/scancode/extract_cli.py @@ -38,7 +38,7 @@ from scancode.api import extract_archives from scancode.cli import print_about -from scancode.cli import version +from scancode_config import __version__ from scancode import utils @@ -46,10 +46,10 @@ try: # Python 2 unicode - str = unicode + str = unicode # @ReservedAssignment except NameError: # Python 3 - unicode = str + unicode = str # @ReservedAssignment echo_stderr = partial(click.secho, err=True) @@ -58,7 +58,7 @@ def print_version(ctx, param, value): if not value or ctx.resilient_parsing: return - echo_stderr('ScanCode extractcode version ' + version) + echo_stderr('ScanCode extractcode version ' + __version__) ctx.exit() diff --git a/src/scancode/plugin_copyright.py b/src/scancode/plugin_copyright.py index e8c07dfca34..838f64dfbe0 100644 --- a/src/scancode/plugin_copyright.py +++ b/src/scancode/plugin_copyright.py @@ -45,11 +45,11 @@ class CopyrightScanner(ScanPlugin): is_flag=True, default=False, help='Scan for copyrights.', help_group=SCAN_GROUP, - sort_order= 50), + sort_order=50), ] - def is_enabled(self): - return self.is_command_option_enabled('copyright') + def is_enabled(self, copyright, **kwargs): # @ReservedAssignment + return copyright def get_scanner(self, **kwargs): from scancode.api import get_copyrights diff --git a/src/scancode/plugin_email.py b/src/scancode/plugin_email.py index fc3e95a3ff4..76000123c2f 100644 --- a/src/scancode/plugin_email.py +++ b/src/scancode/plugin_email.py @@ -47,8 +47,8 @@ class EmailScanner(ScanPlugin): help_group=OTHER_SCAN_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('email') + def is_enabled(self, email, **kwargs): + return email def get_scanner(self, **kwargs): from scancode.api import get_emails diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 93a509b6dec..280f5f002f4 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -48,20 +48,19 @@ class ProcessIgnore(PreScanPlugin): help_group=PRE_SCAN_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('ignore') + def is_enabled(self, ignore, **kwargs): + return ignore - def process_codebase(self, codebase): + def process_codebase(self, codebase, ignore=(), **kwargs): """ Remove ignored Resources from the resource tree. """ - ignore_opt = self.get_command_option('ignore') - ignores = ignore_opt and ignore_opt.value or [] - if not ignores: + + if not ignore: return ignores = { - pattern: 'User ignore: Supplied by --ignore' for pattern in ignores + pattern: 'User ignore: Supplied by --ignore' for pattern in ignore } ignorable = partial(is_ignored, ignores=ignores) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index 065960a13b2..d4c3a5e86eb 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -31,8 +31,6 @@ from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl -from plugincode.housekeeping import HousekeepingPlugin -from plugincode.housekeeping import housekeeping_impl from scancode import CommandLineOption from scancode import MISC_GROUP from scancode import SCAN_OPTIONS_GROUP @@ -40,6 +38,19 @@ from scancode.api import DEJACODE_LICENSE_URL +def reindex_licenses(ctx, param, value): + if not value or ctx.resilient_parsing: + return + + # TODO: check for temp file configuration and use that for the cache!!! + from licensedcode.cache import get_cached_index + import click + click.echo('Checking and rebuilding the license index...') + get_cached_index(cache_dir=value, check_consistency=True,) + click.echo('Done.') + ctx.exit(0) + + @scan_impl class LicenseScanner(ScanPlugin): """ @@ -79,20 +90,25 @@ class LicenseScanner(ScanPlugin): requires=['license'], help='Include diagnostic information in license scan results.', help_group=SCAN_OPTIONS_GROUP), + + CommandLineOption( + ('--reindex-licenses',), + is_eager=True, is_flag=False, default=False, + metavar='DIR', + callback=reindex_licenses, + help='Check the license index cache and reindex if needed and exit.', + help_group=MISC_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('license') + def is_enabled(self, license, **kwargs): # @ReservedAssignment + return license def get_scanner(self, license_score=0, license_text=False, - license_url_template=DEJACODE_LICENSE_URL, license_diag=False, **kwargs): + license_url_template=DEJACODE_LICENSE_URL, + license_diag=False, cache_dir=None, **kwargs): + from scancode.api import get_licenses return partial(get_licenses, min_score=license_score, include_text=license_text, diag=license_diag, - license_url_template=license_url_template) - - - -@housekeeping_impl -class LicenseIndexer(HousekeepingPlugin): - + license_url_template=license_url_template, + cache_dir=cache_dir) diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 8585840c773..f22e25f3e62 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -52,14 +52,17 @@ class MarkSource(PostScanPlugin): help_group=POST_SCAN_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('mark_source') + def is_enabled(self, mark_source, **kwargs): + return mark_source - def process_codebase(self, codebase): + def process_codebase(self, codebase, mark_source, **kwargs): """ Set the `is_source` to True in directories if they contain over 90% of source code files at full depth. """ + if not mark_source: + return + # TODO: these two nested walk() calls are not super efficient for resource in codebase.walk(topdown=False): if resource.is_file: diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index f40238448f6..ffe3e127fe8 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -45,19 +45,23 @@ class OnlyFindings(OutputFilterPlugin): help_group=OUTPUT_FILTER_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('only_findings') + def is_enabled(self, only_findings, **kwargs): + return only_findings - def process_resource(self, resource): + def process_codebase(self, codebase, **kwargs): """ - Return True if `resource` has finding e.g. if they have no scan data, no + Set Resource.is_filtered to True for resources from the codebase that do + not have findings e.g. if they have no scan data (excluding info) and no errors. """ - return has_findings(resource) + resources = codebase.walk(topdown=True, skip_filtered=True) + for resource in resources: + if not has_findings(resource): + resource.is_filtered = True def has_findings(resource): """ Return True if this resource has findings. """ - return any(resource.get_scans().values() + resource.errors) + return bool(resource.errors or resource.get_scans().values()) diff --git a/src/scancode/plugin_package.py b/src/scancode/plugin_package.py index d48a8c6de6e..d67a6df0743 100644 --- a/src/scancode/plugin_package.py +++ b/src/scancode/plugin_package.py @@ -45,11 +45,11 @@ class PackageScanner(ScanPlugin): is_flag=True, default=False, help='Scan for packages.', help_group=SCAN_GROUP, - sort_order= 20), + sort_order=20), ] - def is_enabled(self): - return self.is_command_option_enabled('package') + def is_enabled(self, package, **kwargs): + return package def get_scanner(self, **kwargs): from scancode.api import get_package_info diff --git a/src/scancode/plugin_url.py b/src/scancode/plugin_url.py index 7dad1b20456..d9e1ca2f93a 100644 --- a/src/scancode/plugin_url.py +++ b/src/scancode/plugin_url.py @@ -47,8 +47,8 @@ class UrlScanner(ScanPlugin): help_group=OTHER_SCAN_GROUP) ] - def is_enabled(self): - return self.is_command_option_enabled('url') + def is_enabled(self, url, **kwargs): + return url def get_scanner(self, **kwargs): from scancode.api import get_urls diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 72fe7182a53..fa7a58e82d3 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -38,13 +38,14 @@ from os.path import expanduser from os.path import join from os.path import normpath -from time import time import traceback import sys import attr import yg.lockfile # @UnresolvedImport +from scancode_config import scancode_temp_dir + from commoncode.filetype import is_file as filetype_is_file from commoncode.filetype import is_special @@ -54,15 +55,10 @@ from commoncode.fileutils import file_name from commoncode.fileutils import fsdecode from commoncode.fileutils import fsencode -from commoncode.fileutils import get_temp_dir from commoncode.fileutils import parent_directory -from commoncode.functional import iter_skip -from commoncode.timeutils import time2tstamp from commoncode import ignore from commoncode.system import on_linux -from scancode import cache_dir -from scancode import scans_cache_dir # Python 2 and 3 support try: @@ -90,11 +86,12 @@ # Tracing flags TRACE = False +TRACE_DEEP = False def logger_debug(*args): pass -if TRACE: +if TRACE or TRACE_DEEP: import logging logger = logging.getLogger(__name__) @@ -116,7 +113,7 @@ def logger_debug(*args): # TODO: consider using a class variable instead of a module variable? _CODEBASES = {} -_cache_lock_file = join(cache_dir, 'codebases-lockfile') +_cache_lock_file = join(scancode_temp_dir, 'codebases-lockfile') def add_codebase(codebase, cache_lock_file=_cache_lock_file): @@ -174,7 +171,7 @@ class Codebase(object): # TODO: add populate progress manager!!! - def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): + def __init__(self, location, use_cache=True, temp_dir=scancode_temp_dir): """ Initialize a new codebase rooted at the `location` existing file or directory. @@ -183,7 +180,6 @@ def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): Resource in a new unique directory under `cache_base_dir`. Otherwise, scans are kept as Resource attributes. """ - start = time() self.original_location = location if on_linux: @@ -226,41 +222,39 @@ def __init__(self, location, use_cache=True, cache_base_dir=scans_cache_dir): # setup cache self.use_cache = use_cache - self.cache_base_dir = self.cache_dir = None - self.cache_base_dir = cache_base_dir + self.temp_dir = temp_dir + self.cache_dir = None if use_cache: # this is unique to this run and valid for the lifetime of this codebase - self.cache_dir = get_cache_dir(cache_base_dir) - create_dir(self.cache_dir) + self.cache_dir = get_results_cache_dir(temp_dir=temp_dir) # this updates the global cache using a file lock self.cid = add_codebase(self) self.populate() - self.timings['inventory'] = time() - start - files_count, dirs_count = self.resource_counts() - self.summary['initial_files_count'] = files_count - self.summary['initial_dirs_count'] = dirs_count - # Flag set to True if file information was requested for results output self.with_info = False - # Flag set to True is strip root was requested for results output - self.strip_root = False - # Flag set to True is full root was requested for results output - self.full_root = False - # set of resource rid to exclude from outputs # This is populated automatically. self.filtered_rids = set() + def _get_next_rid(self): + """ + Return the next available resource id. + """ + return len(self.resources) def populate(self): """ - Populate this codebase with Resource objects for this codebase by - walking its `location` topdown, returning directories then files, each - in sorted order. + Populate this codebase with Resource objects. + + The codebase must be populated by walking its `location` topdown, + breadth-first, creating files first then directories both in in sorted + case-insensitive name order. + + Special files, links and VCS files are ignored. """ # clear things self.resources = [] @@ -283,15 +277,17 @@ def populate(self): res_by_loc = {rloc: root} - def err(error): + def err(_error): self.errors.append( - 'ERROR: cannot collect files: %(error)s\n' % dict(error=error) + 'ERROR: cannot collect files: %(error)s\n' % dict(error=_error) + traceback.format_exc() ) # we always ignore VCS and some filetypes. ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) + sorter = lambda p: (p.lower(), p) + # TODO: this is where we would plug archive walking?? for top, dirs, files in os_walk(rloc, topdown=True, onerror=err): @@ -306,60 +302,89 @@ def err(error): if TRACE: logger_debug('Codebase.collect: parent:', parent) - for name in sorted(dirs): + files.sort(key=sorter) + for name in sorted(files): loc = join(top, name) if is_special(loc) or ignored(loc): if TRACE: logger_debug( - 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', + 'Codebase.collect: walk: file ignored:', loc, 'ignored:', ignored(loc), 'is_special:', is_special(loc)) continue rid += 1 - res = parent._add_child(name, rid, is_file=False) + res = parent._add_child(name, rid, is_file=True) res_by_loc[loc] = res resources_append(res) - if TRACE: logger_debug('Codebase.collect: dir:', res) + if TRACE: logger_debug(' Codebase.collect: file:', res) - for name in sorted(files): + dirs.sort(key=sorter) + for name in dirs: loc = join(top, name) if is_special(loc) or ignored(loc): if TRACE: logger_debug( - 'Codebase.collect: walk: file ignored:', loc, 'ignored:', + 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', ignored(loc), 'is_special:', is_special(loc)) continue rid += 1 - res = parent._add_child(name, rid, is_file=True) + res = parent._add_child(name, rid, is_file=False) res_by_loc[loc] = res resources_append(res) - if TRACE: logger_debug('Codebase.collect: file:', res) - + if TRACE: logger_debug(' Codebase.collect: dir:', res) - def walk(self, topdown=True, sort=False, skip_root=False): + def walk(self, topdown=True, skip_root=False, skip_filtered=False): """ - Yield all Resources for this Codebase. - Walks the tree top-down in pre-order traversal if `topdown` is True. - Walks the tree bottom-up in post-order traversal if `topdown` is False. - If `sort` is True, each level is sorted by Resource name, directories - first then files. + Yield all resources for this Codebase walking its resource tree. + Walk the tree top-down, depth-first if `topdown` is True, otherwise walk + bottom-up. + + Each level is sorted by children sort order (e.g. without-children, then + with-children and each group by case-insensitive name) + If `skip_root` is True, the root resource is not returned. + If `skip_filtered` is True, resources with `is_filtered` set to True are + not returned. """ - # single resources without children - if not self.root.children_rids: - return [self.root] + root = self.root + + # do not skip root if has no children (e.g, single root resource) + without_root = root.is_filtered or (skip_root and root.has_children()) - return self.root.walk(topdown, sort, skip_root) + if topdown and not without_root: + yield root + + for res in root.walk(topdown): + if skip_filtered and res.is_filtered: + continue + yield res + + if not topdown and not without_root: + yield root def get_resource(self, rid): """ Return the Resource with `rid` or None if it does not exists. """ - try: - return self.resources[rid] - except IndexError: - pass + if rid is not None: + try: + res = self.resources[rid] + if res: + return res + except IndexError: + pass + + def get_resources(self, rids=None): + """ + Return a list of Resource with their rid the in the list `rids`. + if `rids` is None, return all resources + """ + if rids is None: + return self.resources[:] + + rids = set(rids) + return [res for res in self.resources if res.rid in rids] def add_resource(self, name, parent, is_file=False): """ @@ -368,12 +393,6 @@ def add_resource(self, name, parent, is_file=False): """ return parent.add_child(name, is_file) - def _get_next_rid(self): - """ - Return the next available resource id. - """ - return len([r for r in self.resources if r is not None]) - def remove_resource(self, resource): """ Remove the `resource` Resource object and all its children from the @@ -398,71 +417,51 @@ def remove_resource(self, resource): 'at location:', resource.get_path(absolute=True, decode=True)) return rids - def counts(self, update=True, skip_root=False): + def compute_counts(self, skip_root=False, skip_filtered=False): """ - Return a tuple of counters (files_count, dirs_count, size) for this - codebase. - If `update` is True, update the codebase counts before returning. - Do not include the root Resource in the counts if `skip_root` is True. + Compute and update the counts of every resource. + Return a tuple of top level counters (files_count, dirs_count, + size_count) for this codebase. + + - If `skip_root` is True, the root resource is not included in counts. + - If `skip_filtered` is True, resources with `is_filtered` set to True + are not included in counts. """ - if update: - self.update_counts() + self.update_counts(skip_filtered=skip_filtered) + root = self.root + files_count = root.files_count + dirs_count = root.dirs_count + size_count = root.size_count + + if (skip_root and not root.is_file) or (skip_filtered and root.is_filtered): + return files_count, dirs_count, size_count - if skip_root and not self.is_file: - counts = [(c.files_count, c.dirs_count, c.size) for c in root.children()] - files_count, dirs_count, size = map(sum, zip(*counts)) + if root.is_file: + files_count += 1 else: - files_count = root.files_count - dirs_count = root.dirs_count - size = root.size - if self.is_file: - files_count += 1 - else: - dirs_count += 1 - return files_count, dirs_count, size + dirs_count += 1 + size_count += root.size - def update_counts(self): - """ - Update files_count, dirs_count and size attributes of each Resource in - this codebase based on the current state. - """ - # note: we walk bottom up to update things in the proper order - for resource in self.walk(topdown=False): - resource._update_children_counts() + return files_count, dirs_count, size_count - def resource_counts(self, resources=None): - """ - Return a tuple of quick counters (files_count, dirs_count) for this - codebase or an optional list of resources. - """ - resources = resources or self.resources - - files_count = 0 - dirs_count = 0 - for res in resources: - if res is None: - continue - if res.is_file: - files_count += 1 - else: - dirs_count += 1 - return files_count, dirs_count - def get_resources_with_rid(self): + def update_counts(self, skip_filtered=False): """ - Return an iterable of (rid, resource) for all the resources. - The order is topdown. + Update files_count, dirs_count and size_count attributes of each + Resource in this codebase based on the current state. + + If `skip_filtered` is True, resources with `is_filtered` set to True are + not included in counts. """ - for rid, res in enumerate(self.resources): - if res is None: - continue - yield rid, res + # note: we walk bottom up to update things in the proper order + for resource in self.walk(topdown=False): + resource._compute_children_counts(skip_filtered) def clear(self): """ Purge the codebase cache(s) by deleting the corresponding cached data - files and in-memodyr structures. + files and in-memory data. """ delete(self.cache_dir) del_codebase(self.cid) @@ -489,16 +488,21 @@ class Resource(object): name = attr.ib() # a integer resource id - rid = attr.ib(type=int, repr=False) + rid = attr.ib(type=int) # the root of a Resource tree has a pid==None by convention - pid = attr.ib(type=int, repr=False) + pid = attr.ib(type=int) # a integer codebase id cid = attr.ib(default=None, type=int, repr=False) + # True for file, False for directory is_file = attr.ib(default=False, type=bool) + # True if this Resource should be filtered out, e.g. skipped from the + # returned list of resources + is_filtered = attr.ib(default=False, type=bool) + # a list of rids children_rids = attr.ib(default=attr.Factory(list), repr=False) @@ -509,6 +513,8 @@ class Resource(object): # True is the cache is used. Set at creation time from the codebase settings use_cache = attr.ib(default=None, type=bool, repr=False) + + # FIXME: this may not need to be saved?? # tuple of cache keys: dir and file name cache_keys = attr.ib(default=None, repr=False) @@ -517,6 +523,7 @@ class Resource(object): base_name = attr.ib(default=None, repr=False) extension = attr.ib(default=None, repr=False) date = attr.ib(default=None, repr=False) + size = attr.ib(default=0, type=int) sha1 = attr.ib(default=None, repr=False) md5 = attr.ib(default=None, repr=False) mime_type = attr.ib(default=None, repr=False) @@ -530,16 +537,19 @@ class Resource(object): is_script = attr.ib(default=False, type=bool, repr=False) # These attributes are re/computed for directories and files with children - size = attr.ib(default=0, type=int, repr=False) + # they represent are the for the full descendants of a Resource + size_count = attr.ib(default=0, type=int, repr=False) files_count = attr.ib(default=0, type=int, repr=False) dirs_count = attr.ib(default=0, type=int, repr=False) # Duration in seconds as float to run all scans for this resource scan_time = attr.ib(default=0, repr=False) + # mapping of timings for each scan as {scan_key: duration in seconds as a float} scan_timings = attr.ib(default=None, repr=False) def __attrs_post_init__(self): + # TODO: compute rather than store # build simple cache keys for this resource based on the hex # representation of the resource id: they are guaranteed to be unique # within a codebase. @@ -553,39 +563,39 @@ def __attrs_post_init__(self): def is_root(self): return self.pid is None - def _update_children_counts(self): + def _compute_children_counts(self, skip_filtered=False): """ Compute counts and update self with these counts from direct children. - """ - files, dirs, size = self._children_counts() - if not self.is_file: - # only set the size for directories - self.size = size - self.files_count = files - self.dirs_count = dirs - - def _children_counts(self): - """ - Return a tuple of counters (files_count, dirs_count, size) for the + Return a tuple of counters (files_count, dirs_count, size_count) for the direct children of this Resource. + If `skip_filtered` is True, skip resources with the `is_filtered` flag + set to True. + Note: because certain files such as archives can have children, they may have a files and dirs counts. The size of a directory is aggregated size of its files (including the count of files inside archives). """ - files_count = dirs_count = size = 0 - if not self.children_rids: - return files_count, dirs_count, size - + files_count = dirs_count = size_count = 0 for res in self.children(): + if skip_filtered and res.is_filtered: + continue files_count += res.files_count dirs_count += res.dirs_count - if res.is_file: - files_count += 1 - else: - dirs_count += 1 - size += res.size - return files_count, dirs_count, size + size_count += res.size_count + + if not (skip_filtered and res.is_filtered): + if res.is_file: + files_count += 1 + else: + dirs_count += 1 + size_count += res.size + + self.files_count = files_count + self.dirs_count = dirs_count + self.size_count = size_count + + return files_count, dirs_count, size_count @property def codebase(self): @@ -672,44 +682,24 @@ def put_scans(self, scans, update=True): return existing - def walk(self, topdown=True, sort=False, skip_root=False): - """ - Yield Resources for this Resource tree. - Walks the tree top-down in pre-order traversal if `topdown` is True. - Walks the tree bottom-up in post-order traversal if `topdown` is False. - If `sort` is True, each level is sorted by Resource name, directories - first then files. - If `skip_root` is True, the root resource is not returned. + def walk(self, topdown=True): """ - # single root resource without children - if self.pid == None and not self.children_rids: - return [self] - - walked = self._walk(topdown, sort) - if skip_root: - skip_first = skip_last = False - if topdown: - skip_first = True - else: - skip_last = True - walked = iter_skip(walked, skip_first, skip_last) - return walked + Yield all descendant Resources of this Resource. Does not include self. - def _walk(self, topdown=True, sort=False): - if topdown: - yield self + Walk the tree top-down, depth-first if `topdown` is True, otherwise walk + bottom-up. - children = self.children() - if sort and children: - sorter = lambda r: (r.is_file, r.name) - children.sort(key=sorter) + Each level is sorted by children sort order (e.g. without-children, then + with-children and each group by case-insensitive name) + """ - for child in children: - for subchild in child._walk(topdown, sort): + for child in self.children(): + if topdown: + yield child + for subchild in child.walk(topdown): yield subchild - - if not topdown: - yield self + if not topdown: + yield child def add_child(self, name, is_file=False): """ @@ -718,7 +708,7 @@ def add_child(self, name, is_file=False): """ rid = self.codebase._get_next_rid() child = self._add_child(name, rid, is_file) - self.codebase.resources.append(rid) + self.codebase.resources.append(child) return child def _add_child(self, name, rid, is_file=False): @@ -731,25 +721,56 @@ def _add_child(self, name, rid, is_file=False): self.children_rids.append(rid) return res + def has_children(self): + """ + Return True is this Resource has children. + """ + return bool(self.children_rids) + def children(self): """ - Return a sequence of direct children Resource objects for this Resource - or None. + Return a sorted sequence of direct children Resource objects for this Resource + or an empty sequence. + Sorting is by resources without children, then resource with children + (e.g. directories or files with children), then case-insentive name. """ + _sorter = lambda r: (r.has_children(), r.name.lower(), r.name) resources = self.codebase.resources - return [resources[rid] for rid in self.children_rids] + return sorted((resources[rid] for rid in self.children_rids), key=_sorter) + + def has_parent(self): + """ + Return True is this Resource has children. + """ + return not self.is_root() def parent(self): """ Return the parent Resource object for this Resource or None. """ - if self.pid is not None: - return self.codebase.resources[self.pid] + return self.codebase.get_resource(self.pid) + + def has_siblings(self): + """ + Return True is this Resource has siblings. + """ + return self.has_parent() and self.parent().has_children() + + def siblings(self): + """ + Return a sequence of sibling Resource objects for this Resource + or an empty sequence. + """ + if self.has_parent(): + return self.parent().children() + return [] def ancestors(self): """ Return a sequence of ancestor Resource objects from root to self. """ + if self.pid is None: + return [self] resources = self.codebase.resources ancestors = deque() ancestors_append = ancestors.appendleft @@ -764,7 +785,7 @@ def ancestors(self): def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): """ Return a path to self using the preferred OS encoding (bytes on Linux, - Unicode elsewhere) or Unicode is decode=True. + Unicode elsewhere) or Unicode if `decode`=True. - If `absolute` is True, return an absolute path. Otherwise return a relative path where the first segment is the root name. @@ -802,23 +823,31 @@ def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): def set_info(self, info): """ - Set `info` file information for this Resource. - Info is a list of mappings of file information. + Set each mapping attribute from the `info` list of mappings of file + information as attributes of this Resource. """ + if TRACE: + from pprint import pformat + logger_debug() + logger_debug('Resource.set_info:', self, '\n info:', pformat(info)) + if not info: return + for inf in info: for key, value in inf.items(): setattr(self, key, value) + if TRACE: + logger_debug('Resource.set_info: to_dict():', pformat(info)) + def to_dict(self, full_root=False, strip_root=False, with_info=False): """ Return a mapping of representing this Resource and its scans. """ res = OrderedDict() - res['path'] = fsdecode( - self.get_path(absolute=full_root, strip_root=strip_root, - decode=True, posix=True)) + res['path'] = fsdecode(self.get_path( + absolute=full_root, strip_root=strip_root, decode=True, posix=True)) if with_info: res['type'] = self.type res['name'] = fsdecode(self.name) @@ -830,6 +859,7 @@ def to_dict(self, full_root=False, strip_root=False, with_info=False): res['md5'] = self.md5 res['files_count'] = self.files_count res['dirs_count'] = self.dirs_count + res['size_count'] = self.size_count res['mime_type'] = self.mime_type res['file_type'] = self.file_type res['programming_language'] = self.programming_language @@ -841,19 +871,22 @@ def to_dict(self, full_root=False, strip_root=False, with_info=False): res['is_script'] = self.is_script res['scan_errors'] = self.errors res.update(self.get_scans()) + if TRACE: + logger_debug('Resource.to_dict:', res) return res -def get_cache_dir(cache_base_dir): +def get_results_cache_dir(temp_dir=scancode_temp_dir): """ Return a new, created and unique cache storage directory path rooted at the - `cache_base_dir` in the OS- preferred representation (either bytes on Linux - and Unicode elsewhere). + `cache_dir` base temp directory in the OS- preferred representation (either + bytes on Linux and Unicode elsewhere). """ - create_dir(cache_base_dir) - # create a unique temp directory in cache_dir - prefix = time2tstamp() + u'-' - cache_dir = get_temp_dir(cache_base_dir, prefix=prefix) + from commoncode.fileutils import get_temp_dir + from commoncode.timeutils import time2tstamp + + prefix = 'scan-results-cache-' + time2tstamp() + '-' + cache_dir = get_temp_dir(base_dir=temp_dir, prefix=prefix) if on_linux: cache_dir = fsencode(cache_dir) else: diff --git a/src/scancode/utils.py b/src/scancode/utils.py index b84857353c5..c51207928f7 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -135,7 +135,7 @@ def render_finish(self): def progressmanager(iterable=None, length=None, label=None, show_eta=True, show_percent=None, show_pos=True, item_show_func=None, fill_char='#', empty_char='-', bar_template=None, - info_sep=BAR_SEP, width=BAR_WIDTH, file=None, color=None, + info_sep=BAR_SEP, width=BAR_WIDTH, file=None, color=None, # @ReservedAssignment verbose=False): """ diff --git a/src/scancode_config.py b/src/scancode_config.py new file mode 100644 index 00000000000..a89b01b988f --- /dev/null +++ b/src/scancode_config.py @@ -0,0 +1,123 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import os +from os.path import abspath +from os.path import dirname +from os.path import expanduser +from os.path import join +from os.path import exists +import tempfile + + +""" +Core configuration globals. + +Note: this module MUST import ONLY from the standard library. +""" + + +def _create_dir(location): + """ + Create all the directories are location + """ + if not exists(location): + os.makedirs(location) + + +################################################################################ +# INVARIABLE INSTALLATION-SPECIFIC, BUILT-IN LOCATIONS AND FLAGS +################################################################################ +# these are guaranteed to be there and are entirely based on and relative to the +# current installation location. This is where the source code and static data +# lives. + +from pkg_resources import get_distribution, DistributionNotFound +try: + __version__ = get_distribution('scancode-toolkit').version +except DistributionNotFound: + # package is not installed ?? + __version__ = '2.2.1' + +system_temp_dir = tempfile.gettempdir() +scancode_src_dir = dirname(__file__) +scancode_root_dir = dirname(scancode_src_dir) + + +################################################################################ +# USAGE MODE FLAGS +################################################################################ + +# tag file or env var to determined if we are in dev mode +SCANCODE_DEV_MODE = (os.getenv('SCANCODE_DEV_MODE') + or exists(join(scancode_root_dir, 'SCANCODE_DEV_MODE'))) + +################################################################################ +# USAGE MODE-, INSTALLATION- and IMPORT- and RUN-SPECIFIC DIRECTORIES +################################################################################ +# These vary based on the usage mode: dev or not: we define two locations: + +# - scancode_cache_dir: for long-lived caches which are installation-specific: +# this is for cached data which are infrequently written to and mostly readed, +# such as the license index cache. The same location is used across runs of +# a given version of ScanCode + +# - scancode_temp_dir: for short-lived temporary files which are import- or run- +# specific that may live for the duration of a function call or for the duration +# of a whole scancode run, such as any temp file and the per-run scan results +# cache. A new unique location is used for each run of ScanCode (e.g. for the +# lifetime of the Python interpreter process) + +if SCANCODE_DEV_MODE: + # in dev mode the cache and temp files are stored execlusively under the + # scancode_root_dir + scancode_cache_dir = join(scancode_root_dir, '.cache') + scancode_temp_dir = join(scancode_root_dir, 'tmp') + +else: + # in other usage modes (as a CLI or as a library, regardless of how + # installed) we use sensible defaults in the user home directory + # these are version specific + + # WARNING: do not change this code without changing + # commoncode.fileutils.get_temp_dir too + + user_home = abspath(expanduser('~')) + scancode_cache_dir = os.getenv('SCANCODE_CACHE') + if not scancode_cache_dir: + scancode_cache_dir = join(user_home, '.cache', 'scancode-tk', __version__) + + scancode_temp_dir = os.getenv('SCANCODE_TMP') + if not scancode_temp_dir: + _prefix = 'scancode-tk-' + __version__ + '-' + # NOTE: for now this is in the system_temp_dir + scancode_temp_dir = tempfile.mkdtemp(prefix=_prefix, dir=system_temp_dir) + +_create_dir(scancode_cache_dir) +_create_dir(scancode_temp_dir) diff --git a/src/textcode/markup.py b/src/textcode/markup.py index 672c74ec56d..d95a8a86616 100644 --- a/src/textcode/markup.py +++ b/src/textcode/markup.py @@ -146,7 +146,7 @@ def convert_to_utf8(location): if encoding: encoding = encoding.get('encoding', None) if encoding: - target = os.path.join(fileutils.get_temp_dir('markup'), + target = os.path.join(fileutils.get_temp_dir(prefix='markup'), fileutils.file_name(location)) with codecs.open(location, 'rb', encoding=encoding, errors='replace', buffering=16384) as inf: @@ -166,7 +166,7 @@ def convert_to_text(location, _retrying=False): if not is_markup(location): return - temp_file = os.path.join(fileutils.get_temp_dir('markup'), 'text') + temp_file = os.path.join(fileutils.get_temp_dir(prefix='markup'), 'text') from bs4 import BeautifulSoup with open(location, 'rb') as input_text: soup = BeautifulSoup(input_text.read(), 'html5lib') diff --git a/src/textcode/pdf.py b/src/textcode/pdf.py index afb677f10b8..53cac168139 100644 --- a/src/textcode/pdf.py +++ b/src/textcode/pdf.py @@ -43,7 +43,6 @@ def get_text_lines(location): `location`. May raise exceptions. """ extracted_text = BytesIO() - lines = [] laparams = LAParams() with open(location, 'rb') as pdf_file: with contextlib.closing(PDFParser(pdf_file)) as parser: diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index 6e6ffc0c478..bbf4af81230 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,19 +1,19 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1014,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, +Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,size_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1014,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, +/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,TJ Holowaychuk,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,, diff --git a/tests/formattedcode/data/csv/tree/expected.csv b/tests/formattedcode/data/csv/tree/expected.csv index 7ec9a67980f..3a646d8148f 100644 --- a/tests/formattedcode/data/csv/tree/expected.csv +++ b/tests/formattedcode/data/csv/tree/expected.csv @@ -1,5 +1,14 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder /scan,,,,, +/scan/copy1.c,,,,, +/scan/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy1.c,,,1,1,"ACME, Inc." +/scan/copy2.c,,,,, +/scan/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy2.c,,,1,1,"ACME, Inc." +/scan/copy3.c,,,,, +/scan/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, +/scan/copy3.c,,,1,1,"ACME, Inc." /scan/subdir,,,,, /scan/subdir/copy1.c,,,,, /scan/subdir/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, @@ -13,12 +22,3 @@ Resource,scan_errors,copyright,start_line,end_line,copyright_holder /scan/subdir/copy4.c,,,,, /scan/subdir/copy4.c,,"Copyright (c) 2000 ACME, Inc.",1,1, /scan/subdir/copy4.c,,,1,1,"ACME, Inc." -/scan/copy1.c,,,,, -/scan/copy1.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy1.c,,,1,1,"ACME, Inc." -/scan/copy2.c,,,,, -/scan/copy2.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy2.c,,,1,1,"ACME, Inc." -/scan/copy3.c,,,,, -/scan/copy3.c,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy3.c,,,1,1,"ACME, Inc." diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index e486fceb276..aaeae70f17e 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -4,8 +4,8 @@ "input": "", "--copyright": true, "--info": true, - "--license": true, "--json": "", + "--license": true, "--package": true }, "files_count": 1, @@ -16,11 +16,12 @@ "name": "simple", "base_name": "simple", "extension": "", - "size": 55, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -46,6 +47,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 9f8b7f25e2c..2d6420943a1 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -18,11 +18,12 @@ "name": "simple", "base_name": "simple", "extension": "", - "size": 55, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -49,6 +50,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", @@ -62,4 +64,4 @@ } ] } -] +] \ No newline at end of file diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index f95c296408d..75e606fe7e3 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -4,8 +4,8 @@ "input": "", "--copyright": true, "--info": true, - "--license": true, "--json-pp": "", + "--license": true, "--package": true }, "files_count": 1, @@ -16,11 +16,12 @@ "name": "simple", "base_name": "simple", "extension": "", - "size": 55, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -46,6 +47,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 5df9c60529a..c9a2259e987 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -4,9 +4,9 @@ "input": "", "--copyright": true, "--info": true, + "--json-pp": "", "--license": true, "--package": true, - "--json-pp": "", "--strip-root": true }, "files_count": 7, @@ -22,6 +22,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -59,6 +60,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -96,6 +98,7 @@ "md5": "e999e21c9d7de4d0f943aefbb6f21b99", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -128,11 +131,12 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "size": 361, + "size": 0, "sha1": null, "md5": null, "files_count": 4, "dirs_count": 0, + "size_count": 361, "mime_type": null, "file_type": null, "programming_language": null, @@ -158,6 +162,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -195,6 +200,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -232,6 +238,7 @@ "md5": "290627a1387288ef77ae7e07946f3ecf", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -269,6 +276,7 @@ "md5": "88e46475db9b1a68f415f6a3544eeb16", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", diff --git a/tests/formattedcode/test_output_csv.py b/tests/formattedcode/test_output_csv.py index 68a12da100c..4328fd7d32a 100644 --- a/tests/formattedcode/test_output_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -40,9 +40,6 @@ from formattedcode.output_csv import flatten_scan -from plugincode import output -output._TEST_MODE = True - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/formattedcode/test_output_json.py b/tests/formattedcode/test_output_json.py index f18177c35d1..6985a05f3c9 100644 --- a/tests/formattedcode/test_output_json.py +++ b/tests/formattedcode/test_output_json.py @@ -33,8 +33,6 @@ from scancode.cli_test_utils import check_json_scan from scancode.cli_test_utils import run_scan_click -from plugincode import output -output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/formattedcode/test_output_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py index a01bb8071b1..03709147a6e 100644 --- a/tests/formattedcode/test_output_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -35,8 +35,6 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click -from plugincode import output -output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index b044ceef1f7..f40c0a90e75 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -30,13 +30,12 @@ import os import re +from scancode_config import __version__ + from commoncode import fileutils from commoncode.testcase import FileDrivenTesting -from scancode import __version__ from scancode.cli_test_utils import run_scan_click -from plugincode import output -output._TEST_MODE = True test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/licensedcode/test_cache.py b/tests/licensedcode/test_cache.py index 6dcaf2d0b4c..3e65aea5719 100644 --- a/tests/licensedcode/test_cache.py +++ b/tests/licensedcode/test_cache.py @@ -33,6 +33,7 @@ from commoncode import fileutils from commoncode import hash from licensedcode import cache +from licensedcode.cache import get_license_cache_paths TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -113,197 +114,122 @@ def test_tree_checksum_is_different_when_file_is_removed(self): after = cache.tree_checksum(test_dir) assert before != after - def test_get_or_build_index_through_cache(self): + def test_build_index(self): # note: this is a rather complex test because caching involves some globals - license_index_cache_dir = self.get_temp_dir('index_cache') - _index_lock_file = os.path.join(license_index_cache_dir, 'lockfile') - _tree_checksum_file = os.path.join(license_index_cache_dir, 'tree_checksums') - _index_cache_file = os.path.join(license_index_cache_dir, 'index_cache') + cache_dir = self.get_temp_dir('index_cache') + lock_file, checksum_file, cache_file = get_license_cache_paths(cache_dir=cache_dir) + tree_base_dir = self.get_temp_dir('src_dir') + licenses_data_dir = self.get_test_loc('cache/data/licenses', copy=True) + rules_data_dir = self.get_test_loc('cache/data/rules', copy=True) - _tree_base_dir = self.get_temp_dir('src_dir') + timeout = 10 - _licenses_dir = self.get_test_loc('cache/data', copy=True) - _licenses_data_dir = os.path.join(_licenses_dir, 'licenses') - _rules_data_dir = os.path.join(_licenses_dir, 'rules') - - _timeout = 10 - - assert not os.path.exists(_tree_checksum_file) - assert not os.path.exists(_index_cache_file) - assert not os.path.exists(_index_lock_file) + assert not os.path.exists(checksum_file) + assert not os.path.exists(cache_file) + assert not os.path.exists(lock_file) check_consistency = True - return_index = False # when a new index is built, new index files are created - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - - assert os.path.exists(_tree_checksum_file) - assert os.path.exists(_index_cache_file) - assert not os.path.exists(_index_lock_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + + assert os.path.exists(checksum_file) + assert os.path.exists(cache_file) + assert not os.path.exists(lock_file) # when nothing changed a new index files is not created - tree_before = open(_tree_checksum_file).read() - idx_checksum_before = hash.sha1(_index_cache_file) - idx_date_before = date.get_file_mtime(_index_cache_file) - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - assert tree_before == open(_tree_checksum_file).read() - assert idx_checksum_before == hash.sha1(_index_cache_file) - assert idx_date_before == date.get_file_mtime(_index_cache_file) + tree_before = open(checksum_file).read() + idx_checksum_before = hash.sha1(cache_file) + idx_date_before = date.get_file_mtime(cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + assert tree_before == open(checksum_file).read() + assert idx_checksum_before == hash.sha1(cache_file) + assert idx_date_before == date.get_file_mtime(cache_file) # now add some file in the source tree - new_file = os.path.join(_tree_base_dir, 'some file') + new_file = os.path.join(tree_base_dir, 'some file') with open(new_file, 'wb') as nf: nf.write('somthing') # when check_consistency is False, the index is not rebuild when # new files are added check_consistency = False - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - assert tree_before == open(_tree_checksum_file).read() - assert idx_checksum_before == hash.sha1(_index_cache_file) - assert idx_date_before == date.get_file_mtime(_index_cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + assert tree_before == open(checksum_file).read() + assert idx_checksum_before == hash.sha1(cache_file) + assert idx_date_before == date.get_file_mtime(cache_file) # when check_consistency is True, the index is rebuilt when new # files are added check_consistency = True - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - assert tree_before != open(_tree_checksum_file).read() - assert idx_date_before != date.get_file_mtime(_index_cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + assert tree_before != open(checksum_file).read() + assert idx_date_before != date.get_file_mtime(cache_file) # now add some ignored file in the source tree - tree_before = open(_tree_checksum_file).read() - idx_checksum_before = hash.sha1(_index_cache_file) - idx_date_before = date.get_file_mtime(_index_cache_file) - new_file = os.path.join(_tree_base_dir, 'some file.pyc') + tree_before = open(checksum_file).read() + idx_checksum_before = hash.sha1(cache_file) + idx_date_before = date.get_file_mtime(cache_file) + new_file = os.path.join(tree_base_dir, 'some file.pyc') with open(new_file, 'wb') as nf: nf.write('somthing') check_consistency = True - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - - assert tree_before == open(_tree_checksum_file).read() - assert idx_checksum_before == hash.sha1(_index_cache_file) - assert idx_date_before == date.get_file_mtime(_index_cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + + assert tree_before == open(checksum_file).read() + assert idx_checksum_before == hash.sha1(cache_file) + assert idx_date_before == date.get_file_mtime(cache_file) # if the treechecksum file dies the index is rebuilt - fileutils.delete(_tree_checksum_file) - idx_checksum_before = hash.sha1(_index_cache_file) + fileutils.delete(checksum_file) + idx_checksum_before = hash.sha1(cache_file) check_consistency = False - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - - assert tree_before == open(_tree_checksum_file).read() - assert idx_date_before != date.get_file_mtime(_index_cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + + assert tree_before == open(checksum_file).read() + assert idx_date_before != date.get_file_mtime(cache_file) # if the index cache file dies the index is rebuilt - fileutils.delete(_index_cache_file) + fileutils.delete(cache_file) check_consistency = False - cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - - assert tree_before == open(_tree_checksum_file).read() - assert os.path.exists(_index_cache_file) + cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) - def test__load_index(self): - license_index_cache_dir = self.get_temp_dir('index_cache') - _index_lock_file = os.path.join(license_index_cache_dir, 'lockfile') - _tree_checksum_file = os.path.join(license_index_cache_dir, 'tree_checksums') - _index_cache_file = os.path.join(license_index_cache_dir, 'index_cache') + assert tree_before == open(checksum_file).read() + assert os.path.exists(cache_file) - _tree_base_dir = self.get_temp_dir('src_dir') + def test__load_index(self): + cache_dir = self.get_temp_dir('index_cache') - _licenses_dir = self.get_test_loc('cache/data', copy=True) - _licenses_data_dir = os.path.join(_licenses_dir, 'licenses') - _rules_data_dir = os.path.join(_licenses_dir, 'rules') + lock_file, checksum_file, cache_file = get_license_cache_paths(cache_dir=cache_dir) + tree_base_dir = self.get_temp_dir('src_dir') + licenses_data_dir = self.get_test_loc('cache/data/licenses', copy=True) + rules_data_dir = self.get_test_loc('cache/data/rules', copy=True) - _timeout = 10 + timeout = 10 - assert not os.path.exists(_tree_checksum_file) - assert not os.path.exists(_index_cache_file) - assert not os.path.exists(_index_lock_file) + assert not os.path.exists(checksum_file) + assert not os.path.exists(cache_file) + assert not os.path.exists(lock_file) check_consistency = True - return_index = True # Create a basic index - idx1 = cache.get_or_build_index_through_cache( - check_consistency, - return_index, - _tree_base_dir, - _tree_checksum_file, - _index_lock_file, - _index_cache_file, - _licenses_data_dir, - _rules_data_dir, - _timeout) - - assert os.path.exists(_tree_checksum_file) - assert os.path.exists(_index_cache_file) - assert not os.path.exists(_index_lock_file) - - idx2 = cache._load_index(_index_cache_file) + idx1 = cache.get_cached_index(cache_dir, check_consistency, timeout, + tree_base_dir, licenses_data_dir, rules_data_dir) + + assert os.path.exists(checksum_file) + assert os.path.exists(cache_file) + assert not os.path.exists(lock_file) + + idx2 = cache.load_index(cache_file) assert idx1.to_dict(True) == idx2.to_dict(True) diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index 36501a48536..77c1c876a4d 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -20,6 +20,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index f21c12de299..3666b1f8f92 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -11,7 +11,7 @@ { "path": "patchelf.pdf", "scan_errors": [ - "ERROR: for scanner: copyrights:\nERROR: Unknown error:\nTraceback (most recent call last):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/interrupt.py\", line 88, in interruptible\n return NO_ERROR, func(*(args or ()), **(kwargs or {}))\n File \"/home/pombreda/w421/scancode-toolkit-master/src/scancode/api.py\", line 59, in get_copyrights\n for copyrights, authors, _years, holders, start_line, end_line in detect_copyrights(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 71, in detect_copyrights\n for numbered_lines in candidate_lines(analysis.text_lines(location)):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/cluecode/copyrights.py\", line 1270, in candidate_lines\n for line_number, line in enumerate(lines):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/analysis.py\", line 125, in unicode_text_lines_from_pdf\n for line in pdf.get_text_lines(location):\n File \"/home/pombreda/w421/scancode-toolkit-master/src/textcode/pdf.py\", line 57, in get_text_lines\n interpreter.process_page(page)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 852, in process_page\n self.render_contents(page.resources, page.contents, ctm=ctm)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 862, in render_contents\n self.init_resources(resources)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 362, in init_resources\n self.fontmap[fontid] = self.rsrcmgr.get_font(objid, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 212, in get_font\n font = self.get_font(None, subspec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdfinterp.py\", line 203, in get_font\n font = PDFCIDFont(self, spec)\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 667, in __init__\n BytesIO(self.fontfile.get_data()))\n File \"/home/pombreda/w421/scancode-toolkit-master/lib/python2.7/site-packages/pdfminer/pdffont.py\", line 386, in __init__\n (ntables, _1, _2, _3) = struct.unpack('>HHHH', fp.read(8))\nerror: unpack requires a string argument of length 8\n" + "ERROR: for scanner: copyrights:\nerror: unpack requires a string argument of length 8\n" ], "copyrights": [] } diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index f5717f4fbd3..5f595d5bde8 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -3,7 +3,7 @@ Usage: scancode [OPTIONS] scan the file or directory for license, origin and packages and save results to FILE(s) using one or more ouput format option. - Error and progress is printed to stderr. + Error and progress are printed to stderr. Options: @@ -66,23 +66,34 @@ Options: running the --info scan. core: - --timeout Stop an unfinished file scan after a timeout in seconds. + --timeout Stop an unfinished file scan after a timeout in seconds. [default: 120 seconds] -n, --processes INT Set the number of parallel processes to use. Disable parallel processing if 0. [default: 1] --quiet Do not print summary or progress. --verbose Print progress as file-by-file path instead of a progress bar. Print a verbose scan summary. - --timing Collect execution timing for each scan and scanned file. - --no-cache Do not use on-disk cache for intermediate results. Uses - more memory. - --temp-dir DIR Set the path to the temporary directory to use for - ScanCode cache and temporary files. + --cache-dir DIR Set the path to an existing directory where ScanCode can + cache files available across runs.If not set, the value + of the `SCANCODE_CACHE` environment variable is used if + available. If `SCANCODE_CACHE` is not set, a default sub- + directory in the user home directory is used instead. + [default: ~/.cache/scancode-tk/version] + --temp-dir DIR Set the path to an existing directory where ScanCode can + create temporary files. If not set, the value of the + `SCANCODE_TMP` environment variable is used if available. + If `SCANCODE_TMP` is not set, a default sub-directory in + the system temp directory is used instead. [default: TMP + /scancode-tk-] + --timing Collect scan timing for each scan/scanned file. + --on-disk-results Save intermediate scan results in temporary files. Uses + less memory. [default: True] miscellaneous: - --reindex-licenses Check the license index cache and reindex if needed and - exit - --test-mode Run ScanCode in a special "test mode". Only for testing. + --reindex-licenses DIR Check the license index cache and reindex if needed + and exit. + --test-mode Run ScanCode in a special "test mode". Only for + testing. documentation: -h, --help Show this message and exit. diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 720f0f5a1cc..ab9f38c9a44 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -4,8 +4,8 @@ "input": "", "--copyright": true, "--info": true, - "--license": true, "--json": "", + "--license": true, "--strip-root": true }, "files_count": 6, @@ -17,11 +17,12 @@ "base_name": "basic", "extension": "", "date": null, - "size": 57066, + "size": 0, "sha1": null, "md5": null, "files_count": 6, "dirs_count": 4, + "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -47,6 +48,7 @@ "md5": "15240737ec72b9e88b485a663bd045f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -67,11 +69,12 @@ "base_name": "dir", "extension": "", "date": null, - "size": 18486, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -97,6 +100,7 @@ "md5": "393e789f4e4b2be93a46d0619380b445", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -117,11 +121,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 8246, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -147,6 +152,7 @@ "md5": "b2b073a64e4d568ce7b641c1857a7116", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -167,11 +173,12 @@ "base_name": "dir2", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -192,11 +199,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 0, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -222,6 +230,7 @@ "md5": "e1c66adaf6b8aa90e348668ac4869a61", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -290,6 +299,7 @@ "md5": "107dd38273ab10ce12058a3c8977e4ee", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -315,6 +325,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index cee14d0b0c6..d4ab5003188 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -4,8 +4,8 @@ "input": "", "--copyright": true, "--email": true, - "--license": true, "--json": "", + "--license": true, "--url": true }, "files_count": 6, diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index d88eda56291..a226ed9ca2d 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -15,11 +15,12 @@ "base_name": "basic", "extension": "", "date": null, - "size": 57066, + "size": 0, "sha1": null, "md5": null, "files_count": 6, "dirs_count": 4, + "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -43,6 +44,7 @@ "md5": "15240737ec72b9e88b485a663bd045f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -61,11 +63,12 @@ "base_name": "dir", "extension": "", "date": null, - "size": 18486, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -89,6 +92,7 @@ "md5": "393e789f4e4b2be93a46d0619380b445", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -107,11 +111,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 8246, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -135,6 +140,7 @@ "md5": "b2b073a64e4d568ce7b641c1857a7116", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -153,11 +159,12 @@ "base_name": "dir2", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -176,11 +183,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 0, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -204,6 +212,7 @@ "md5": "e1c66adaf6b8aa90e348668ac4869a61", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -227,6 +236,7 @@ "md5": "107dd38273ab10ce12058a3c8977e4ee", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -250,6 +260,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index 825ae5dd263..da3feca0ee1 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -14,11 +14,12 @@ "base_name": "basic.tgz", "extension": "", "date": null, - "size": 57066, + "size": 0, "sha1": null, "md5": null, "files_count": 6, "dirs_count": 5, + "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -37,11 +38,12 @@ "base_name": "basic", "extension": "", "date": null, - "size": 57066, + "size": 0, "sha1": null, "md5": null, "files_count": 6, "dirs_count": 4, + "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -65,6 +67,7 @@ "md5": "15240737ec72b9e88b485a663bd045f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -83,11 +86,12 @@ "base_name": "dir", "extension": "", "date": null, - "size": 18486, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -111,6 +115,7 @@ "md5": "393e789f4e4b2be93a46d0619380b445", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -129,11 +134,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 8246, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -157,6 +163,7 @@ "md5": "b2b073a64e4d568ce7b641c1857a7116", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -175,11 +182,12 @@ "base_name": "dir2", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -198,11 +206,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 0, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -226,6 +235,7 @@ "md5": "e1c66adaf6b8aa90e348668ac4869a61", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -249,6 +259,7 @@ "md5": "107dd38273ab10ce12058a3c8977e4ee", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -272,6 +283,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index 604f5d0610e..cf9340c1f28 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -4,8 +4,8 @@ "input": "", "--email": true, "--info": true, - "--strip-root": true, "--json": "", + "--strip-root": true, "--url": true }, "files_count": 6, @@ -17,11 +17,12 @@ "base_name": "basic", "extension": "", "date": null, - "size": 57066, + "size": 0, "sha1": null, "md5": null, "files_count": 6, "dirs_count": 4, + "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -47,6 +48,7 @@ "md5": "15240737ec72b9e88b485a663bd045f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -67,11 +69,12 @@ "base_name": "dir", "extension": "", "date": null, - "size": 18486, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -97,6 +100,7 @@ "md5": "393e789f4e4b2be93a46d0619380b445", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -117,11 +121,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 8246, + "size": 0, "sha1": null, "md5": null, "files_count": 1, "dirs_count": 0, + "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -147,6 +152,7 @@ "md5": "b2b073a64e4d568ce7b641c1857a7116", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -167,11 +173,12 @@ "base_name": "dir2", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 1, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -192,11 +199,12 @@ "base_name": "subdir", "extension": "", "date": null, - "size": 36457, + "size": 0, "sha1": null, "md5": null, "files_count": 2, "dirs_count": 0, + "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -222,6 +230,7 @@ "md5": "e1c66adaf6b8aa90e348668ac4869a61", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -259,6 +268,7 @@ "md5": "107dd38273ab10ce12058a3c8977e4ee", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -290,6 +300,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index 8d3d9669255..b1411758535 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -2,9 +2,9 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "input": "", + "--json": "", "--license": true, "--license-text": true, - "--json": "", "--strip-root": true }, "files_count": 1, diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index 02edc3a9c67..505c1e8cb9c 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -20,6 +20,7 @@ "md5": null, "files_count": 18, "dirs_count": 0, + "size_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -43,6 +44,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -66,6 +68,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -89,6 +92,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -112,6 +116,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -135,6 +140,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -158,6 +164,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -181,6 +188,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -204,6 +212,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -227,6 +236,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -250,6 +260,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -273,6 +284,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -296,6 +308,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -319,6 +332,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -342,6 +356,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -365,6 +380,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -388,6 +404,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -411,6 +428,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -434,6 +452,7 @@ "md5": null, "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, diff --git a/tests/scancode/data/non_utf8/expected-mac.json b/tests/scancode/data/non_utf8/expected-mac.json index 554d938f04f..6dbfabdabeb 100644 --- a/tests/scancode/data/non_utf8/expected-mac.json +++ b/tests/scancode/data/non_utf8/expected-mac.json @@ -10,26 +10,27 @@ "files": [ { "path": "non_unicode", + "type": "directory", + "name": "non_unicode", "base_name": "non_unicode", - "date": null, "extension": "", - "file_type": null, + "date": null, + "size": 0, + "sha1": null, + "md5": null, "files_count": 18, "dirs_count": 0, - "is_archive": false, + "size_count": 0, + "mime_type": null, + "file_type": null, + "programming_language": null, "is_binary": false, + "is_text": false, + "is_archive": false, "is_media": false, - "is_script": false, "is_source": false, - "is_text": false, - "md5": null, - "mime_type": null, - "name": "non_unicode", - "programming_language": null, - "scan_errors": [], - "sha1": null, - "size": 0, - "type": "directory" + "is_script": false, + "scan_errors": [] }, { "path": "non_unicode/foo%B1bar", @@ -39,6 +40,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -61,6 +63,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -84,6 +87,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -107,6 +111,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -130,6 +135,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -153,6 +159,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -176,6 +183,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -199,6 +207,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -222,6 +231,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -245,6 +255,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -268,6 +279,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -291,6 +303,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -314,6 +327,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -337,6 +351,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -360,6 +375,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -383,6 +399,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -406,6 +423,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -429,6 +447,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, diff --git a/tests/scancode/data/non_utf8/expected-win.json b/tests/scancode/data/non_utf8/expected-win.json index 1924b62eab8..7b58f6536d0 100644 --- a/tests/scancode/data/non_utf8/expected-win.json +++ b/tests/scancode/data/non_utf8/expected-win.json @@ -15,6 +15,8 @@ "extension": "", "file_type": null, "files_count": 18, + "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -38,6 +40,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -60,6 +63,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -83,6 +87,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -106,6 +111,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -129,6 +135,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -152,6 +159,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -175,6 +183,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -198,6 +207,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -221,6 +231,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -244,6 +255,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -267,6 +279,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -290,6 +303,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -313,6 +327,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -336,6 +351,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -359,6 +375,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -382,6 +399,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -405,6 +423,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, @@ -428,6 +447,7 @@ "file_type": "empty", "files_count": 0, "dirs_count": 0, + "size_count": 0, "is_archive": false, "is_binary": false, "is_media": false, diff --git a/tests/scancode/data/plugin_license/license_url.expected.json b/tests/scancode/data/plugin_license/license_url.expected.json new file mode 100644 index 00000000000..b61b7e94328 --- /dev/null +++ b/tests/scancode/data/plugin_license/license_url.expected.json @@ -0,0 +1,67 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--json-pp": "", + "--license": true, + "--license-url-template": "https://example.com/urn:{}" + }, + "files_count": 1, + "files": [ + { + "path": "license_url", + "scan_errors": [], + "licenses": [] + }, + { + "path": "license_url/apache-1.0.txt", + "scan_errors": [], + "licenses": [ + { + "key": "apache-1.0", + "score": 100.0, + "short_name": "Apache 1.0", + "category": "Permissive", + "owner": "Apache Software Foundation", + "homepage_url": "http://www.apache.org/licenses/", + "text_url": "http://www.apache.org/licenses/LICENSE-1.0", + "reference_url": "https://example.com/urn:apache-1.0", + "spdx_license_key": "Apache-1.0", + "spdx_url": "https://spdx.org/licenses/Apache-1.0", + "start_line": 2, + "end_line": 54, + "matched_rule": { + "identifier": "apache-1.0_group_template2.RULE", + "license_choice": false, + "licenses": [ + "apache-1.0", + "public-domain" + ] + } + }, + { + "key": "public-domain", + "score": 100.0, + "short_name": "Public Domain", + "category": "Public Domain", + "owner": "Unspecified", + "homepage_url": "http://www.linfo.org/publicdomain.html", + "text_url": "", + "reference_url": "https://example.com/urn:public-domain", + "spdx_license_key": "", + "spdx_url": "", + "start_line": 2, + "end_line": 54, + "matched_rule": { + "identifier": "apache-1.0_group_template2.RULE", + "license_choice": false, + "licenses": [ + "apache-1.0", + "public-domain" + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/license_url/apache-1.0.txt b/tests/scancode/data/plugin_license/license_url/apache-1.0.txt similarity index 100% rename from tests/scancode/data/license_url/apache-1.0.txt rename to tests/scancode/data/plugin_license/license_url/apache-1.0.txt diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index 5a47eb70388..a3a002ba4d3 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -3,8 +3,8 @@ "scancode_options": { "input": "", "--info": true, - "--mark-source": true, - "--json": "" + "--json": "", + "--mark-source": true }, "files_count": 12, "files": [ @@ -15,11 +15,12 @@ "base_name": "JGroups.tgz", "extension": "", "date": null, - "size": 206642, + "size": 0, "sha1": null, "md5": null, "files_count": 12, "dirs_count": 3, + "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -38,11 +39,12 @@ "base_name": "JGroups", "extension": "", "date": null, - "size": 206642, + "size": 0, "sha1": null, "md5": null, "files_count": 12, "dirs_count": 2, + "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -61,11 +63,12 @@ "base_name": "licenses", "extension": "", "date": null, - "size": 54552, + "size": 0, "sha1": null, "md5": null, "files_count": 5, "dirs_count": 0, + "size_count": 54552, "mime_type": null, "file_type": null, "programming_language": null, @@ -89,6 +92,7 @@ "md5": "276982197c941f4cbf3d218546e17ae2", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -112,6 +116,7 @@ "md5": "d273d63619c9aeaf15cdaf76422c4f87", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -135,6 +140,7 @@ "md5": "9fffd8de865a5705969f62b128381f85", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -158,6 +164,7 @@ "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -181,6 +188,7 @@ "md5": "f14599a2f089f6ff8c97e2baa4e3d575", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -199,11 +207,12 @@ "base_name": "src", "extension": "", "date": null, - "size": 152090, + "size": 0, "sha1": null, "md5": null, "files_count": 7, "dirs_count": 0, + "size_count": 152090, "mime_type": null, "file_type": null, "programming_language": null, @@ -227,6 +236,7 @@ "md5": "aca9640ec8beee21b098bcf8ecc91442", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -250,6 +260,7 @@ "md5": "c5064400f759d3e81771005051d17dc1", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -273,6 +284,7 @@ "md5": "48ca3c72fb9a65c771a321222f118b88", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -296,6 +308,7 @@ "md5": "4626bdbc48871b55513e1a12991c61a8", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -319,6 +332,7 @@ "md5": "eecfe23494acbcd8088c93bc1e83c7f2", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -342,6 +356,7 @@ "md5": "20bee9631b7c82a45c250e095352aec7", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -365,6 +380,7 @@ "md5": "83d8324f37d0e3f120bc89865cf0bd39", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", diff --git a/tests/scancode/data/plugin_mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json index ecce7fc5482..a3a002ba4d3 100644 --- a/tests/scancode/data/plugin_mark_source/without_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/without_info.expected.json @@ -2,8 +2,9 @@ "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", "scancode_options": { "input": "", - "--mark-source": true, - "--json": "" + "--info": true, + "--json": "", + "--mark-source": true }, "files_count": 12, "files": [ @@ -14,11 +15,12 @@ "base_name": "JGroups.tgz", "extension": "", "date": null, - "size": 206642, + "size": 0, "sha1": null, "md5": null, "files_count": 12, "dirs_count": 3, + "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -37,11 +39,12 @@ "base_name": "JGroups", "extension": "", "date": null, - "size": 206642, + "size": 0, "sha1": null, "md5": null, "files_count": 12, "dirs_count": 2, + "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -60,11 +63,12 @@ "base_name": "licenses", "extension": "", "date": null, - "size": 54552, + "size": 0, "sha1": null, "md5": null, "files_count": 5, "dirs_count": 0, + "size_count": 54552, "mime_type": null, "file_type": null, "programming_language": null, @@ -88,6 +92,7 @@ "md5": "276982197c941f4cbf3d218546e17ae2", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -111,6 +116,7 @@ "md5": "d273d63619c9aeaf15cdaf76422c4f87", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -134,6 +140,7 @@ "md5": "9fffd8de865a5705969f62b128381f85", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -157,6 +164,7 @@ "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -180,6 +188,7 @@ "md5": "f14599a2f089f6ff8c97e2baa4e3d575", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -198,11 +207,12 @@ "base_name": "src", "extension": "", "date": null, - "size": 152090, + "size": 0, "sha1": null, "md5": null, "files_count": 7, "dirs_count": 0, + "size_count": 152090, "mime_type": null, "file_type": null, "programming_language": null, @@ -226,6 +236,7 @@ "md5": "aca9640ec8beee21b098bcf8ecc91442", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -249,6 +260,7 @@ "md5": "c5064400f759d3e81771005051d17dc1", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -272,6 +284,7 @@ "md5": "48ca3c72fb9a65c771a321222f118b88", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -295,6 +308,7 @@ "md5": "4626bdbc48871b55513e1a12991c61a8", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -318,6 +332,7 @@ "md5": "eecfe23494acbcd8088c93bc1e83c7f2", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -341,6 +356,7 @@ "md5": "20bee9631b7c82a45c250e095352aec7", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -364,6 +380,7 @@ "md5": "83d8324f37d0e3f120bc89865cf0bd39", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index 93ddcfe9f57..cccddcda568 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -4,9 +4,9 @@ "input": "", "--copyright": true, "--info": true, + "--json": "", "--license": true, "--only-findings": true, - "--json": "", "--package": true }, "files_count": 3, @@ -17,12 +17,12 @@ "name": "e.tar", "base_name": "e", "extension": ".tar", - "date": "2015-06-19", "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -88,12 +88,12 @@ "name": "bcopy.s", "base_name": "bcopy", "extension": ".s", - "date": "2015-06-19", "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -157,12 +157,12 @@ "name": "main.c", "base_name": "main", "extension": ".c", - "date": "2015-06-19", "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/cache/package/package.json b/tests/scancode/data/resource/cache/package/package.json similarity index 100% rename from tests/scancode/data/cache/package/package.json rename to tests/scancode/data/resource/cache/package/package.json diff --git a/tests/scancode/data/resource/codebase/abc b/tests/scancode/data/resource/codebase/abc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/codebase/dir/that b/tests/scancode/data/resource/codebase/dir/that new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/codebase/dir/this b/tests/scancode/data/resource/codebase/dir/this new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/codebase/et131x.h b/tests/scancode/data/resource/codebase/et131x.h new file mode 100644 index 00000000000..4ffb839292b --- /dev/null +++ b/tests/scancode/data/resource/codebase/et131x.h @@ -0,0 +1,47 @@ +/* Copyright © 2005 Agere Systems Inc. + * All rights reserved. + * http://www.agere.com + * + * SOFTWARE LICENSE + * + * This software is provided subject to the following terms and conditions, + * which you should read carefully before using the software. Using this + * software indicates your acceptance of these terms and conditions. If you do + * not agree with these terms and conditions, do not use the software. + * + * Copyright © 2005 Agere Systems Inc. + * All rights reserved. + * + * Redistribution and use in source or binary forms, with or without + * modifications, are permitted provided that the following conditions are met: + * + * . Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following Disclaimer as comments in the code as + * well as in the documentation and/or other materials provided with the + * distribution. + * + * . Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following Disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * . Neither the name of Agere Systems Inc. nor the names of the contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * Disclaimer + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY + * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN + * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + */ + diff --git a/tests/scancode/data/resource/codebase/other dir/file b/tests/scancode/data/resource/codebase/other dir/file new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index 4209a272004..28aaa76b8a8 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -14,12 +14,12 @@ "name": "iproute.c", "base_name": "iproute", "extension": ".c", - "date": "2017-10-03", "size": 469, "sha1": "f0f352c14a8d0b0510cbbeae056542ae7f252151", "md5": "b8e7112a6e82921687fd1e008e72058f", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "C", diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index 0ef2a32d400..ed205e707c1 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -5,8 +5,8 @@ "--copyright": true, "--email": true, "--info": true, - "--license": true, "--json": "", + "--license": true, "--package": true, "--strip-root": true, "--url": true @@ -19,11 +19,12 @@ "name": "unicodepath", "base_name": "unicodepath", "extension": "", - "size": 20, + "size": 0, "sha1": null, "md5": null, "files_count": 3, "dirs_count": 0, + "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -51,6 +52,7 @@ "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -78,6 +80,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -105,6 +108,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json index ab613f6f0da..2ce6074370d 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json @@ -5,8 +5,8 @@ "--copyright": true, "--email": true, "--info": true, - "--license": true, "--json": "", + "--license": true, "--package": true, "--strip-root": true, "--url": true @@ -19,12 +19,12 @@ "name": "unicodepath", "base_name": "unicodepath", "extension": "", - "date": null, - "size": 20, + "size": 0, "sha1": null, "md5": null, "files_count": 3, "dirs_count": 0, + "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -53,6 +53,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -81,6 +82,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -109,6 +111,7 @@ "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index df29dc49ab7..a26b6f2f782 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -5,8 +5,8 @@ "--copyright": true, "--email": true, "--info": true, - "--license": true, "--json": "", + "--license": true, "--package": true, "--strip-root": true, "--url": true @@ -19,11 +19,12 @@ "name": "unicodepath", "base_name": "unicodepath", "extension": "", - "size": 20, + "size": 0, "sha1": null, "md5": null, "files_count": 3, "dirs_count": 0, + "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -51,6 +52,7 @@ "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -78,6 +80,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -105,6 +108,7 @@ "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index 7dc15860da0..ea6cd36210d 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -21,6 +21,7 @@ "md5": "62c4cdf80d860c09f215ffff0a9ed020", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -45,6 +46,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -69,6 +71,7 @@ "md5": "41ac81497162f2ff48a0442847238ad7", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -93,6 +96,7 @@ "md5": "9153a386e70bd1713fef91121fb9cbbf", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -117,6 +121,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", diff --git a/tests/scancode/data/weird_file_name/expected-mac.json b/tests/scancode/data/weird_file_name/expected-mac.json index 25559d68408..f90c93144e5 100644 --- a/tests/scancode/data/weird_file_name/expected-mac.json +++ b/tests/scancode/data/weird_file_name/expected-mac.json @@ -21,6 +21,7 @@ "md5": "62c4cdf80d860c09f215ffff0a9ed020", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -45,6 +46,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -69,6 +71,7 @@ "md5": "41ac81497162f2ff48a0442847238ad7", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -93,6 +96,7 @@ "md5": "9153a386e70bd1713fef91121fb9cbbf", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -117,6 +121,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -130,4 +135,4 @@ "copyrights": [] } ] -} +} \ No newline at end of file diff --git a/tests/scancode/data/weird_file_name/expected-win.json b/tests/scancode/data/weird_file_name/expected-win.json index 2ba5a36d7d7..16a8764c062 100644 --- a/tests/scancode/data/weird_file_name/expected-win.json +++ b/tests/scancode/data/weird_file_name/expected-win.json @@ -20,6 +20,7 @@ "md5": "9153a386e70bd1713fef91121fb9cbbf", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -43,6 +44,7 @@ "md5": "62c4cdf80d860c09f215ffff0a9ed020", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -66,6 +68,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -89,6 +92,7 @@ "md5": "41ac81497162f2ff48a0442847238ad7", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -112,6 +116,7 @@ "md5": "e99c06d03836700154f01778ac782d50", "files_count": 0, "dirs_count": 0, + "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -125,4 +130,4 @@ "copyrights": [] } ] -} +} \ No newline at end of file diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index ffd5d7f74a0..afe0b6efdfd 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -47,9 +47,6 @@ from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain -from plugincode import output -output._TEST_MODE = True - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -200,19 +197,21 @@ def test_scan_info_license_copyrights(): result_file = test_env.get_temp_file('json') result = run_scan_click(['--info', '--license', '--copyright', '--strip-root', test_dir, '--json', result_file]) - assert result.exit_code == 0 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('info/all.expected.json'), result_file) + assert result.exit_code == 0 def test_scan_license_with_url_template(): - test_dir = test_env.get_test_loc('license_url', copy=True) + test_dir = test_env.get_test_loc('plugin_license/license_url', copy=True) + result_file = test_env.get_temp_file('json') - result = run_scan_click(['--license', '--license-url-template', 'https://example.com/urn:{}', test_dir, '--json', '-']) + result = run_scan_click( + ['--license', '--license-url-template', 'https://example.com/urn:{}', + test_dir, '--json-pp', result_file]) + + check_json_scan(test_env.get_test_loc('plugin_license/license_url.expected.json'), result_file) assert result.exit_code == 0 - assert 'Scanning done' in result.output - assert 'https://example.com/urn:apache-1.0' in result.output - assert 'https://example.com/urn:public-domain' in result.output def test_scan_noinfo_license_copyrights_with_root(): @@ -246,7 +245,6 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e assert 'Some files failed to scan' in result.output assert 'patchelf.pdf' in result.output - def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index ab5f183688b..6239ddd8603 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -29,16 +29,12 @@ from os.path import join from commoncode.testcase import FileDrivenTesting -from scancode import CommandOption -from scancode.plugin_ignore import is_ignored -from scancode.plugin_ignore import ProcessIgnore from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import _load_json_result +from scancode.plugin_ignore import is_ignored +from scancode.plugin_ignore import ProcessIgnore from scancode.resource import Codebase -from plugincode import output -output._TEST_MODE = True - class TestPluginIgnoreFiles(FileDrivenTesting): @@ -69,10 +65,17 @@ def test_is_ignored_glob_file(self): ignores = {'*.txt': 'test ignore'} assert is_ignored(location=location, ignores=ignores) + def check_ProcessIgnore(self, test_dir, expected, ignore): + codebase = Codebase(test_dir) + test_plugin = ProcessIgnore() + test_plugin.process_codebase(codebase, ignore=ignore) + resources = [res.get_path(strip_root=True, decode=True) + for res in codebase.walk(skip_root=True)] + assert expected == sorted(resources) + def test_ProcessIgnore_with_single_file(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', value=('sample.doc',), param=None) - test_plugin = ProcessIgnore([option]) + ignore = ('sample.doc',) expected = [ 'user', 'user/ignore.doc', @@ -81,81 +84,50 @@ def test_ProcessIgnore_with_single_file(self): 'user/src/test', 'user/src/test/sample.txt' ] - - codebase = Codebase(test_dir) - test_plugin.process_codebase(codebase) - resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] - assert expected == sorted(resources) + self.check_ProcessIgnore(test_dir, expected, ignore) def test_ProcessIgnore_with_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', value=('ignore.doc', 'sample.doc',), param=None) - test_plugin = ProcessIgnore([option]) + ignore = ('ignore.doc', 'sample.doc',) expected = [ 'user', 'user/src', 'user/src/test', 'user/src/test/sample.txt' ] - - codebase = Codebase(test_dir) - test_plugin.process_codebase(codebase) - resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] - assert expected == sorted(resources) + self.check_ProcessIgnore(test_dir, expected, ignore) def test_ProcessIgnore_with_glob_for_extension(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', value=('*.doc',), param=None) - test_plugin = ProcessIgnore([option]) - + ignore = ('*.doc',) expected = [ 'user', 'user/src', 'user/src/test', 'user/src/test/sample.txt' ] - - codebase = Codebase(test_dir) - test_plugin.process_codebase(codebase) - resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] - assert expected == sorted(resources) + self.check_ProcessIgnore(test_dir, expected, ignore) def test_ProcessIgnore_with_glob_for_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - option = CommandOption(help_group=None, name='ignore', value=('*/src/test',), param=None) - test_plugin = ProcessIgnore([option]) - + ignore = ('*/src/test',) expected = [ 'user', 'user/ignore.doc', 'user/src', 'user/src/ignore.doc' ] + self.check_ProcessIgnore(test_dir, expected, ignore) - codebase = Codebase(test_dir) - test_plugin.process_codebase(codebase) - resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] - assert expected == sorted(resources) - - def test_ProcessIgnore_with_multiple_plugins(self): + def test_ProcessIgnore_with_multiple_ignores(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') - test_plugins = [ - ProcessIgnore([CommandOption(help_group=None, name='ignore', value=('*.doc',), param=None)]), - ProcessIgnore([CommandOption(help_group=None, name='ignore', value=('*/src/test/*',), param=None)]), - ] - + ignore = ('*.doc', '*/src/test/*',) expected = [ 'user', 'user/src', 'user/src/test' ] - - codebase = Codebase(test_dir) - for plugin in test_plugins: - plugin.process_codebase(codebase) - - resources = [res.get_path(strip_root=True, decode=True) for res in codebase.walk(sort=True, skip_root=True)] - assert expected == sorted(resources) + self.check_ProcessIgnore(test_dir, expected, ignore) class TestScanPluginIgnoreFiles(FileDrivenTesting): @@ -166,20 +138,27 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', test_dir, + '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) - # a single test.tst file and its directory that is not a VCS file should be listed + # a single test.tst file and its directory that is not a VCS file should + # be listed assert 1 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] assert [u'vcs', u'vcs/test.txt'] == scan_locs + def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--processes', '0', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', + '--processes', '0', + test_dir, + '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) - # a single test.tst file and its directory that is not a VCS file should be listed + # a single test.tst file and its directory that is not a VCS file should + # be listed assert 1 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] assert [u'vcs', u'vcs/test.txt'] == scan_locs @@ -189,7 +168,8 @@ def test_scancode_ignore_single_file(self): result_file = self.get_temp_file('json') result = run_scan_click( - ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--json', result_file]) + ['--copyright', '--strip-root', '--ignore', 'sample.doc', + test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 3 == scan_result['files_count'] @@ -209,40 +189,68 @@ def test_scancode_ignore_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', + '--ignore', 'ignore.doc', test_dir, + '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.doc', u'user/src/test/sample.txt'] == scan_locs + expected = [ + u'user', + u'user/src', + u'user/src/test', + u'user/src/test/sample.doc', + u'user/src/test/sample.txt'] + assert expected == scan_locs def test_scancode_ignore_glob_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', + '--ignore', '*.doc', test_dir, + '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 1 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/src', u'user/src/test', u'user/src/test/sample.txt'] == scan_locs + expected = [ + u'user', + u'user/src', + u'user/src/test', + u'user/src/test/sample.txt' + ] + assert expected == scan_locs def test_scancode_ignore_glob_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', + '--ignore', '*/src/test/*', test_dir, + '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] - assert [u'user', u'user/ignore.doc', u'user/src', u'user/src/ignore.doc', u'user/src/test'] == scan_locs + expected = [ + u'user', + u'user/ignore.doc', + u'user/src', + u'user/src/ignore.doc', + u'user/src/test' + ] + assert expected == scan_locs def test_scancode_multiple_ignores(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, '--json', result_file]) + result = run_scan_click(['--copyright', '--strip-root', + '--ignore', '*/src/test', + '--ignore', '*.doc', + test_dir, '--json', result_file]) assert result.exit_code == 0 scan_result = _load_json_result(result_file) assert 0 == scan_result['files_count'] diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py index 80ddf16b0bd..3a33e156c68 100644 --- a/tests/scancode/test_plugin_mark_source.py +++ b/tests/scancode/test_plugin_mark_source.py @@ -33,9 +33,6 @@ from scancode.cli_test_utils import run_scan_click from scancode.plugin_mark_source import is_source_directory -from plugincode import output -output._TEST_MODE = True - class TestMarkSource(FileDrivenTesting): diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index 0d18991d617..453e530fb7b 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -34,9 +34,6 @@ from scancode.plugin_only_findings import has_findings from scancode.resource import Resource -from plugincode import output -output._TEST_MODE = True - class TestHasFindings(FileDrivenTesting): @@ -64,5 +61,8 @@ def test_scan_only_findings(self): result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_only_findings/expected.json') - _result = run_scan_click(['-clip','--only-findings', test_dir, '--json', result_file]) - check_json_scan(expected_file, result_file, regen=False) + result= run_scan_click(['-clip','--only-findings','--json', result_file, test_dir]) + print(result.output) + assert result.exit_code == 0 + + check_json_scan(expected_file, result_file, strip_dates=True) diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index 37b0d277a67..66a56093603 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -38,15 +38,239 @@ from commoncode.fileutils import parent_directory +class TestCodebase(FileBasedTesting): + test_data_dir = join(dirname(__file__), 'data') + + def test_walk_defaults(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk()) + expected = [ + ('codebase', False), + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('that', True), + ('this', True), + ('other dir', False), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_topdown(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(topdown=True)) + expected = [ + ('codebase', False), + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('that', True), + ('this', True), + ('other dir', False), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_bottomup(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(topdown=False)) + expected = [ + ('abc', True), + ('et131x.h', True), + ('that', True), + ('this', True), + ('dir', False), + ('file', True), + ('other dir', False), + ('codebase', False), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_basic(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(skip_root=True)) + expected = [ + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('that', True), + ('this', True), + ('other dir', False), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_filtered_root(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + codebase.root.is_filtered = True + results = list(codebase.walk(skip_filtered=True)) + expected = [ + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('that', True), + ('this', True), + ('other dir', False), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_filtered_all(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + res.is_filtered = True + results = list(codebase.walk(skip_filtered=True)) + expected = [] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_filtered_skip_root(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + codebase.root.is_filtered = True + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [ + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('that', True), + ('this', True), + ('other dir', False), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_filtered_all_skip_root(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + res.is_filtered = True + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_single_file(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(skip_root=True)) + expected = [ + ('et131x.h', True) + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_not_filtered_single_file(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [ + ('et131x.h', True) + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_filtered_single_file(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + codebase.root.is_filtered = True + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [ + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_single_file_with_children(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + c1 = codebase.root.add_child('some child', is_file=True) + _c2 = c1.add_child('some child2', is_file=False) + results = list(codebase.walk(skip_root=True)) + expected = [ + (u'some child', True), (u'some child2', False) + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_skip_filtered_single_file_with_children(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + + c1 = codebase.root.add_child('some child', is_file=True) + c2 = c1.add_child('some child2', is_file=False) + c2.is_filtered = True + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [(u'some child', True)] + assert expected == [(r.name, r.is_file) for r in results] + + c1.is_filtered = True + results = list(codebase.walk(skip_root=True, skip_filtered=True)) + expected = [] + assert expected == [(r.name, r.is_file) for r in results] + + def test_walk_skip_root_single_dir(self): + test_codebase = self.get_temp_dir('walk') + codebase = Codebase(test_codebase, use_cache=False) + results = list(codebase.walk(skip_root=True)) + expected = [ + ('walk', False) + ] + assert expected == [(r.name, r.is_file) for r in results] + + def test_add_child_can_add_child_to_file(self): + test_codebase = self.get_test_loc('resource/codebase/et131x.h') + codebase = Codebase(test_codebase, use_cache=False) + codebase.root.add_child('some child', is_file=True) + results = list(codebase.walk()) + expected = [('et131x.h', True), (u'some child', True)] + assert expected == [(r.name, r.is_file) for r in results] + + def test_add_child_can_add_child_to_dir(self): + test_codebase = self.get_temp_dir('resource') + codebase = Codebase(test_codebase, use_cache=False) + codebase.root.add_child('some child', is_file=False) + results = list(codebase.walk()) + expected = [('resource', False), (u'some child', False)] + assert expected == [(r.name, r.is_file) for r in results] + + def test_get_resource(self): + test_codebase = self.get_temp_dir('resource') + codebase = Codebase(test_codebase, use_cache=False) + assert codebase.root is codebase.get_resource(0) + + def test_get_resources(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + expected = [ + ('codebase', False), + ('abc', True), + ('et131x.h', True), + ('dir', False), + ('other dir', False), + ('that', True), + ('this', True), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in codebase.get_resources(None)] + + expected = [ + ('codebase', False), + ('abc', True), + ('dir', False), + ('this', True), + ] + + assert expected == [(r.name, r.is_file) for r in codebase.get_resources([0,1,3,6])] + class TestCodebaseCache(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') def test_codebase_with_use_cache(self): - test_codebase = self.get_test_loc('cache/package') + test_codebase = self.get_test_loc('resource/cache/package') codebase = Codebase(test_codebase, use_cache=True) - assert codebase.cache_base_dir + assert codebase.temp_dir assert codebase.cache_dir - + codebase.cache_dir root = codebase.root assert ('00', '00000000') == root.cache_keys @@ -94,7 +318,7 @@ def test_codebase_with_use_cache(self): assert exists (root._get_cached_path(create=False)) def test_codebase_without_use_cache(self): - test_codebase = self.get_test_loc('cache/package') + test_codebase = self.get_test_loc('resource/cache/package') codebase = Codebase(test_codebase, use_cache=False) assert not codebase.cache_dir From 2d4aa6bf9d0b1da1f1af4f144b8d0057b4183b9c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 23 Jan 2018 23:57:56 +0100 Subject: [PATCH 061/122] Cosmetic Signed-off-by: Philippe Ombredanne --- src/licensedcode/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index a0f9f25edc8..a50be2b98e3 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -84,8 +84,8 @@ def get_licenses_db(licenses_data_dir=None): return _LICENSES -def get_cached_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE, - +def get_cached_index(cache_dir=scancode_cache_dir, + check_consistency=SCANCODE_DEV_MODE, # used for testing only timeout=LICENSE_INDEX_LOCK_TIMEOUT, tree_base_dir=scancode_src_dir, From 73cea2a23a4ceb67e43316e5decb2174d619e477 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 23 Jan 2018 23:58:59 +0100 Subject: [PATCH 062/122] Make license reindex use default cache for now #685 #357 *also do not use metavar in help Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_license.py | 5 ++--- tests/scancode/data/help/help.txt | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index d4c3a5e86eb..44184f7d8c9 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -46,7 +46,7 @@ def reindex_licenses(ctx, param, value): from licensedcode.cache import get_cached_index import click click.echo('Checking and rebuilding the license index...') - get_cached_index(cache_dir=value, check_consistency=True,) + get_cached_index(check_consistency=True,) click.echo('Done.') ctx.exit(0) @@ -93,8 +93,7 @@ class LicenseScanner(ScanPlugin): CommandLineOption( ('--reindex-licenses',), - is_eager=True, is_flag=False, default=False, - metavar='DIR', + is_flag=True, is_eager=True, callback=reindex_licenses, help='Check the license index cache and reindex if needed and exit.', help_group=MISC_GROUP) diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index 5f595d5bde8..2c007bfb209 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -90,10 +90,9 @@ Options: less memory. [default: True] miscellaneous: - --reindex-licenses DIR Check the license index cache and reindex if needed - and exit. - --test-mode Run ScanCode in a special "test mode". Only for - testing. + --reindex-licenses Check the license index cache and reindex if needed and + exit. + --test-mode Run ScanCode in a special "test mode". Only for testing. documentation: -h, --help Show this message and exit. From 6285f0e979eab6ab027c6663619e950cba4fe06f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:00:55 +0100 Subject: [PATCH 063/122] Add test for compute_counts Signed-off-by: Philippe Ombredanne --- tests/scancode/test_resource.py | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index 66a56093603..f12c004ec16 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -129,6 +129,86 @@ def test_walk_skip_filtered_all(self): expected = [] assert expected == [(r.name, r.is_file) for r in results] + def test_compute_counts_filtered_None(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + results = codebase.compute_counts(skip_filtered=True) + expected = (5, 3, 0) + assert expected == results + + def test_compute_counts_filtered_None_with_size(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.walk(): + if res.is_file: + res.size = 10 + + results = codebase.compute_counts(skip_filtered=True) + expected = (5, 3, 50) + assert expected == results + + def test_compute_counts_filtered_None_with_cache(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=True) + results = codebase.compute_counts(skip_filtered=True) + expected = (5, 3, 0) + assert expected == results + + def test_compute_counts_filtered_all(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + res.is_filtered = True + results = codebase.compute_counts(skip_filtered=True) + expected = (0,0,0) + assert expected == results + + def test_compute_counts_filtered_all_with_cache(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=True) + for res in codebase.get_resources(None): + res.is_filtered = True + results = codebase.compute_counts(skip_filtered=True) + expected = (0,0,0) + assert expected == results + + def test_compute_counts_filtered_files(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + if res.is_file: + res.is_filtered = True + results = codebase.compute_counts(skip_filtered=True) + expected = (0, 3, 0) + assert expected == results + + def test_compute_counts_filtered_dirs(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + if not res.is_file: + res.is_filtered = True + results = codebase.compute_counts(skip_filtered=True) + expected = (5, 0, 0) + assert expected == results + + def test_walk_filtered_dirs(self): + test_codebase = self.get_test_loc('resource/codebase') + codebase = Codebase(test_codebase, use_cache=False) + for res in codebase.get_resources(None): + if not res.is_file: + res.is_filtered = True + + results = list(codebase.walk(topdown=True, skip_filtered=True)) + expected = [ + ('abc', True), + ('et131x.h', True), + ('that', True), + ('this', True), + ('file', True), + ] + assert expected == [(r.name, r.is_file) for r in results] + def test_walk_skip_filtered_skip_root(self): test_codebase = self.get_test_loc('resource/codebase') codebase = Codebase(test_codebase, use_cache=False) From 533ff3688cee906c5e28ef0f65fbd605331f87e2 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:01:42 +0100 Subject: [PATCH 064/122] Use correct location for version file #685 #357 Signed-off-by: Philippe Ombredanne --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2ee4362a384..534457e0992 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,6 @@ [bumpversion] current_version = 2.2.1 -files = setup.py src/scancode/__init__.py +files = setup.py src/scancode_config.py commit = False tag = False From 43ba290b80e9911633ebedb07709eb875d5bb4a0 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:02:15 +0100 Subject: [PATCH 065/122] Use proper plugin name for only-findings Signed-off-by: Philippe Ombredanne --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3a97ae6e01a..8c98901422c 100644 --- a/setup.py +++ b/setup.py @@ -253,7 +253,7 @@ def read(*names, **kwargs): # # See also plugincode.post_scan module for details and doc. 'scancode_output_filter': [ - 'only-findings2 = scancode.plugin_only_findings:OnlyFindings', + 'only-findings = scancode.plugin_only_findings:OnlyFindings', ], # scancode_output is the entry point for ouput plugins that write a scan From f2fe20f78a143a73de93e6c227e73d8004b0f280 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:02:59 +0100 Subject: [PATCH 066/122] Use proper name for setup stage #787 Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index cece0204022..373dfbaf41a 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -901,7 +901,7 @@ def run_plugins(ctx, stage, plugins, codebase, kwargs, quiet, verbose, timing_key = '%(stage)s:%(name)s' % locals() codebase.timings[timing_key] = time() - plugin_start - codebase.timings['stage'] = time() - stage_start + codebase.timings['setup'] = time() - stage_start def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, From cefb0f67745d068d0ed71a6dc2095fcffe1e6f9d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:03:03 +0100 Subject: [PATCH 067/122] Use proper name for setup stage #787 Signed-off-by: Philippe Ombredanne From 92de6c688928d5c539f8647a06406c48105dcea8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:04:09 +0100 Subject: [PATCH 068/122] Simplify only-findings codebase.walk #685 #357 Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_only_findings.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index ffe3e127fe8..567eb8d725e 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -54,8 +54,7 @@ def process_codebase(self, codebase, **kwargs): not have findings e.g. if they have no scan data (excluding info) and no errors. """ - resources = codebase.walk(topdown=True, skip_filtered=True) - for resource in resources: + for resource in codebase.walk(): if not has_findings(resource): resource.is_filtered = True @@ -64,4 +63,4 @@ def has_findings(resource): """ Return True if this resource has findings. """ - return bool(resource.errors or resource.get_scans().values()) + return bool(resource.errors or any(resource.get_scans().values())) From 0b3064913bfa517e1b271e065bca28f985e1ff02 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 00:06:31 +0100 Subject: [PATCH 069/122] Correct codebase.compute_counts #685 #357 * make sure skip_filtered is used where needed and only there * ensure counts are correct in various cases Signed-off-by: Philippe Ombredanne --- src/scancode/resource.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index fa7a58e82d3..c56a8635b3a 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -350,7 +350,7 @@ def walk(self, topdown=True, skip_root=False, skip_filtered=False): root = self.root # do not skip root if has no children (e.g, single root resource) - without_root = root.is_filtered or (skip_root and root.has_children()) + without_root = (skip_filtered and root.is_filtered) or (skip_root and root.has_children()) if topdown and not without_root: yield root @@ -455,7 +455,8 @@ def update_counts(self, skip_filtered=False): not included in counts. """ # note: we walk bottom up to update things in the proper order - for resource in self.walk(topdown=False): + # and the walk MUST MNOT skip filtered, only the compute + for resource in self.walk(topdown=False, skip_filtered=False): resource._compute_children_counts(skip_filtered) def clear(self): @@ -577,24 +578,23 @@ def _compute_children_counts(self, skip_filtered=False): of its files (including the count of files inside archives). """ files_count = dirs_count = size_count = 0 - for res in self.children(): - if skip_filtered and res.is_filtered: + for child in self.children(): + files_count += child.files_count + dirs_count += child.dirs_count + size_count += child.size_count + + if skip_filtered and child.is_filtered: continue - files_count += res.files_count - dirs_count += res.dirs_count - size_count += res.size_count - if not (skip_filtered and res.is_filtered): - if res.is_file: - files_count += 1 - else: - dirs_count += 1 - size_count += res.size + if child.is_file: + files_count += 1 + else: + dirs_count += 1 + size_count += child.size self.files_count = files_count self.dirs_count = dirs_count self.size_count = size_count - return files_count, dirs_count, size_count @property From fae1e7609d87bc2bc2b68ca63804469d14197590 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 07:35:06 +0100 Subject: [PATCH 070/122] Do not reindex licenses during configure #685 #357 Signed-off-by: Philippe Ombredanne --- etc/conf/base.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/etc/conf/base.py b/etc/conf/base.py index 6f1b431d30a..f716895d59c 100644 --- a/etc/conf/base.py +++ b/etc/conf/base.py @@ -41,19 +41,3 @@ def unsupported(platform): arches = supported_combos[os] if arch not in arches: unsupported(os + arch) - - -""" -Re/build the license cache on every configure run. -""" - -def build_license_cache(): - """ - Force a rebuild of the license cache on configure. - """ - from licensedcode import cache - print('* Building license index...') - cache.reindex() - - -build_license_cache() From 01a87b6bd740e534a6df3ee069808c77c74ea85f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 11:52:06 +0100 Subject: [PATCH 071/122] Prefix all temp dirs with "scancode-" configure #685 #357 Signed-off-by: Philippe Ombredanne --- src/commoncode/command.py | 2 +- src/commoncode/fetch.py | 2 +- src/commoncode/testcase.py | 2 +- src/extractcode/archive.py | 8 ++++---- src/extractcode/extract.py | 2 +- src/extractcode/uncompress.py | 2 +- src/scancode/resource.py | 8 ++++---- src/textcode/markup.py | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/commoncode/command.py b/src/commoncode/command.py index 405b3d48f53..829ba3bc68e 100644 --- a/src/commoncode/command.py +++ b/src/commoncode/command.py @@ -110,7 +110,7 @@ def execute(cmd, args, root_dir=None, cwd=None, env=None, to_files=False): cwd = cwd or curr_dir # temp files for stderr and stdout - tmp_dir = get_temp_dir(prefix='cmd-') + tmp_dir = get_temp_dir(prefix='scancode-cmd-') sop = join(tmp_dir, 'stdout') sep = join(tmp_dir, 'stderr') diff --git a/src/commoncode/fetch.py b/src/commoncode/fetch.py index 2df0dc399cb..0e003e2d7df 100644 --- a/src/commoncode/fetch.py +++ b/src/commoncode/fetch.py @@ -65,7 +65,7 @@ def download_url(url, file_name=None, verify=True, timeout=10): logger.error(msg) raise Exception(msg) - tmp_dir = fileutils.get_temp_dir(prefix='fetch-') + tmp_dir = fileutils.get_temp_dir(prefix='scancode-fetch-') output_file = os.path.join(tmp_dir, file_name) with open(output_file, 'wb') as out: out.write(response.content) diff --git a/src/commoncode/testcase.py b/src/commoncode/testcase.py index 1238a846ef0..1f53a6898da 100644 --- a/src/commoncode/testcase.py +++ b/src/commoncode/testcase.py @@ -212,7 +212,7 @@ def get_temp_dir(self, sub_dir_path=None): global test_run_temp_dir if not test_run_temp_dir: # not we add a space in the path for testing path with spaces - test_run_temp_dir = fileutils.get_temp_dir(prefix='tests -') + test_run_temp_dir = fileutils.get_temp_dir(prefix='scancode-tests -') if on_linux: test_run_temp_dir = fsencode(test_run_temp_dir) diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index 8344d6c1062..e641d9014c1 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -315,7 +315,7 @@ def extract_twice(location, target_dir, extractor1, extractor2): abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) # extract first the intermediate payload to a temp dir - temp_target = unicode(fileutils.get_temp_dir(prefix='extract-')) + temp_target = unicode(fileutils.get_temp_dir(prefix='scancode-extract-')) warnings = extractor1(abs_location, temp_target) if TRACE: logger.debug('extract_twice: temp_target: %(temp_target)r' % locals()) @@ -348,7 +348,7 @@ def extract_with_fallback(location, target_dir, extractor1, extractor2): abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) # attempt extract first to a temp dir - temp_target1 = unicode(fileutils.get_temp_dir(prefix='extract1-')) + temp_target1 = unicode(fileutils.get_temp_dir(prefix='scancode-extract1-')) try: warnings = extractor1(abs_location, temp_target1) if TRACE: @@ -356,7 +356,7 @@ def extract_with_fallback(location, target_dir, extractor1, extractor2): fileutils.copytree(temp_target1, abs_target_dir) except: try: - temp_target2 = unicode(fileutils.get_temp_dir(prefix='extract2-')) + temp_target2 = unicode(fileutils.get_temp_dir(prefix='scancode-extract2-')) warnings = extractor2(abs_location, temp_target2) if TRACE: logger.debug('extract_with_fallback: temp_target2: %(temp_target2)r' % locals()) @@ -378,7 +378,7 @@ def try_to_extract(location, target_dir, extractor): """ abs_location = os.path.abspath(os.path.expanduser(location)) abs_target_dir = unicode(os.path.abspath(os.path.expanduser(target_dir))) - temp_target = unicode(fileutils.get_temp_dir(prefix='extract1-')) + temp_target = unicode(fileutils.get_temp_dir(prefix='scancode-extract1-')) warnings = [] try: warnings = extractor(abs_location, temp_target) diff --git a/src/extractcode/extract.py b/src/extractcode/extract.py index d0f938a28fc..08935a1ab1d 100644 --- a/src/extractcode/extract.py +++ b/src/extractcode/extract.py @@ -184,7 +184,7 @@ def extract_file(location, target, kinds=extractcode.default_kinds): # extract first to a temp directory. # if there is an error, the extracted files will not be moved # to target - tmp_tgt = fileutils.get_temp_dir(prefix='extract-') + tmp_tgt = fileutils.get_temp_dir(prefix='scancode-extract-') abs_location = abspath(expanduser(location)) warnings.extend(extractor(abs_location, tmp_tgt)) fileutils.copytree(tmp_tgt, target) diff --git a/src/extractcode/uncompress.py b/src/extractcode/uncompress.py index 83fcd4fa50b..df6dfc03d39 100644 --- a/src/extractcode/uncompress.py +++ b/src/extractcode/uncompress.py @@ -79,7 +79,7 @@ def uncompress_file(location, decompressor): warnings = [] base_name = fileutils.file_base_name(location) - target_location = os.path.join(fileutils.get_temp_dir(prefix='extract-'), base_name) + target_location = os.path.join(fileutils.get_temp_dir(prefix='scancode-extract-'), base_name) with decompressor(location, 'rb') as compressed: with open(target_location, 'wb') as uncompressed: buffer_size = 32 * 1024 * 1024 diff --git a/src/scancode/resource.py b/src/scancode/resource.py index c56a8635b3a..daa20e95a7c 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -878,14 +878,14 @@ def to_dict(self, full_root=False, strip_root=False, with_info=False): def get_results_cache_dir(temp_dir=scancode_temp_dir): """ - Return a new, created and unique cache storage directory path rooted at the - `cache_dir` base temp directory in the OS- preferred representation (either - bytes on Linux and Unicode elsewhere). + Return a new, created and unique per-run cache storage directory path rooted + at the `temp_dir` base temp directory in the OS- preferred representation + (either bytes on Linux and Unicode elsewhere). """ from commoncode.fileutils import get_temp_dir from commoncode.timeutils import time2tstamp - prefix = 'scan-results-cache-' + time2tstamp() + '-' + prefix = 'scancode-scans-' + time2tstamp() + '-' cache_dir = get_temp_dir(base_dir=temp_dir, prefix=prefix) if on_linux: cache_dir = fsencode(cache_dir) diff --git a/src/textcode/markup.py b/src/textcode/markup.py index d95a8a86616..d675e8be83c 100644 --- a/src/textcode/markup.py +++ b/src/textcode/markup.py @@ -146,7 +146,7 @@ def convert_to_utf8(location): if encoding: encoding = encoding.get('encoding', None) if encoding: - target = os.path.join(fileutils.get_temp_dir(prefix='markup'), + target = os.path.join(fileutils.get_temp_dir(prefix='scancode-markup-'), fileutils.file_name(location)) with codecs.open(location, 'rb', encoding=encoding, errors='replace', buffering=16384) as inf: @@ -166,7 +166,7 @@ def convert_to_text(location, _retrying=False): if not is_markup(location): return - temp_file = os.path.join(fileutils.get_temp_dir(prefix='markup'), 'text') + temp_file = os.path.join(fileutils.get_temp_dir(prefix='scancode-markup-'), 'text') from bs4 import BeautifulSoup with open(location, 'rb') as input_text: soup = BeautifulSoup(input_text.read(), 'html5lib') From 45a080a405bb0d470f1d9720834b75365d67be71 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 12:05:12 +0100 Subject: [PATCH 072/122] Use cache_dir and SCANCODE_DEV_MODE correctly #685 #357 Signed-off-by: Philippe Ombredanne --- src/scancode/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scancode/api.py b/src/scancode/api.py index 25a14ca8bad..7883a46e1c8 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -122,13 +122,15 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, If `diag` is True, additional license match details are returned with the matched_rule key of the returned mapping. """ + from scancode_config import SCANCODE_DEV_MODE if not cache_dir: from scancode_config import scancode_cache_dir as cache_dir from licensedcode.cache import get_index from licensedcode.cache import get_licenses_db - idx = get_index(cache_dir) + from scancode_config import SCANCODE_DEV_MODE + idx = get_index(cache_dir, SCANCODE_DEV_MODE) licenses = get_licenses_db() results = [] From 2c94a7060bd900fdfd6c7895dd39e40c2828ae58 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 12:05:41 +0100 Subject: [PATCH 073/122] Add setup() to plugin_license #685 #357 * this restore the proper cache warmup Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_license.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index 44184f7d8c9..9b5b1bde085 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -102,6 +102,12 @@ class LicenseScanner(ScanPlugin): def is_enabled(self, license, **kwargs): # @ReservedAssignment return license + def setup(self, cache_dir, **kwargs): + return + from scancode_config import SCANCODE_DEV_MODE + from licensedcode.cache import get_index + get_index(cache_dir, check_consistency=SCANCODE_DEV_MODE) + def get_scanner(self, license_score=0, license_text=False, license_url_template=DEJACODE_LICENSE_URL, license_diag=False, cache_dir=None, **kwargs): From aeef8f99b6ae73990cf121bcf5116973df60343f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 12:06:20 +0100 Subject: [PATCH 074/122] Remove SCANCODE_DEBUG_LICENSE env var. Not used Signed-off-by: Philippe Ombredanne --- src/licensedcode/index.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index bc444ba66e4..8f9b8afe15d 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -83,8 +83,7 @@ def logger_debug(*args): pass -if (TRACE or TRACE_INDEXING_PERF or TRACE_QUERY_RUN_SIMPLE - or os.environ.get('SCANCODE_DEBUG_LICENSE') or TRACE_NEGATIVE): +if TRACE or TRACE_INDEXING_PERF or TRACE_QUERY_RUN_SIMPLE or TRACE_NEGATIVE: import logging logger = logging.getLogger(__name__) From cdd4179effaa4dd51d8408fb6c10170ad9af3f49 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 12:07:35 +0100 Subject: [PATCH 075/122] Use cache_dir and SCANCODE_DEV_MODE correctly #685 #357 * in licensedcode.cached Signed-off-by: Philippe Ombredanne --- src/licensedcode/cache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index a50be2b98e3..384dcd7c6ff 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -55,14 +55,14 @@ _LICENSES_INDEX = None -def get_index(cache_dir=scancode_cache_dir): +def get_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE): """ Return and eventually cache an index built from an iterable of rules. Build the index from the built-in rules dataset. """ global _LICENSES_INDEX if not _LICENSES_INDEX: - _LICENSES_INDEX = get_cached_index(cache_dir=scancode_cache_dir) + _LICENSES_INDEX = get_cached_index(cache_dir, check_consistency) return _LICENSES_INDEX @@ -84,7 +84,7 @@ def get_licenses_db(licenses_data_dir=None): return _LICENSES -def get_cached_index(cache_dir=scancode_cache_dir, +def get_cached_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE, # used for testing only timeout=LICENSE_INDEX_LOCK_TIMEOUT, From d00b75db77753cc828e762a539880883328f7728 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 12:10:08 +0100 Subject: [PATCH 076/122] Improve license matching thresholds #889 Signed-off-by: Philippe Ombredanne --- src/licensedcode/match_set.py | 14 ++++++-- src/licensedcode/models.py | 68 +++++++++++++++++++++-------------- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/licensedcode/match_set.py b/src/licensedcode/match_set.py index b96a95fee44..4aa99e05865 100644 --- a/src/licensedcode/match_set.py +++ b/src/licensedcode/match_set.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -270,7 +270,10 @@ def compute_candidates(query_run, idx, rules_subset, top=30): logger_debug('candidate: ihigh:', [(idx.tokens_by_tid[tid], val) for tid, val in enumerate(ihigh, idx.len_junk)]) thresholds = thresholds_getter(rule) - compared = compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter) + if TRACE_DEEP: + compared = compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter, rule, idx) + else: + compared = compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter) if compared: sort_order, intersection = compared sortable_candidates.append((sort_order, rid, rule, intersection)) @@ -309,7 +312,7 @@ def compute_candidates(query_run, idx, rules_subset, top=30): return candidates -def compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter): +def compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter, _rule=None, _idx=None): """ Compare a query qhigh and qlow sets with an index rule ihigh and ilow sets. Return a tuple suitable for sorting and the computed sets intersection or None if @@ -383,4 +386,9 @@ def compare_sets(qhigh, qlow, ihigh, ilow, thresholds, intersector, counter): inter = low_inter low_inter.update(high_inter) + if TRACE_DEEP: + logger_debug('compare_sets: intersected rule:', _rule.identifier) + logger_debug(' compare_sets: thresholds:', thresholds) + logger_debug(' compare_sets: high_inter:', ' '.join(_idx.tokens_by_tid[tid] for tid in high_inter)) + return sort_order, inter diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index d79bd418138..e6eaa931d0a 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -747,30 +747,37 @@ def thresholds(self): Return a Thresholds tuple considering the occurrence of all tokens. """ if not self._thresholds: - min_high = min([self.high_length, MIN_MATCH_HIGH_LENGTH]) - min_len = MIN_MATCH_LENGTH + length = self.length + high_length = self.high_length + if length > 200: + min_high = high_length//10 + min_len = length//10 + else: + min_high = min([high_length, MIN_MATCH_HIGH_LENGTH]) + min_len = MIN_MATCH_LENGTH # note: we cascade ifs from largest to smallest lengths # FIXME: this is not efficient + if self.length < 30: - min_len = self.length // 2 + min_len = length // 2 if self.length < 10: - min_high = self.high_length - min_len = self.length + min_high = high_length + min_len = length self.minimum_coverage = 80 if self.length < 3: - min_high = self.high_length - min_len = self.length + min_high = high_length + min_len = length self.minimum_coverage = 100 if self.minimum_coverage == 100: - min_high = self.high_length - min_len = self.length + min_high = high_length + min_len = length self._thresholds = Thresholds( - self.high_length, self.low_length, self.length, + high_length, self.low_length, length, self.small(), min_high, min_len ) return self._thresholds @@ -780,31 +787,40 @@ def thresholds_unique(self): Return a Thresholds tuple considering the occurrence of only unique tokens. """ if not self._thresholds_unique: - highu = (int(self.high_unique // 2)) or self.high_unique - min_high = min([highu, MIN_MATCH_HIGH_LENGTH]) - min_len = MIN_MATCH_LENGTH + length = self.length + high_unique = self.high_unique + length_unique = self.length_unique + + if length > 200: + min_high = high_unique//10 + min_len = length//10 + else: + highu = (int(high_unique // 2)) or high_unique + min_high = min([highu, MIN_MATCH_HIGH_LENGTH]) + min_len = MIN_MATCH_LENGTH + # note: we cascade IFs from largest to smallest lengths - if self.length < 20: - min_high = self.high_unique + if length < 20: + min_high = high_unique min_len = min_high - if self.length < 10: - min_high = self.high_unique - if self.length_unique < 2: - min_len = self.length_unique + if length < 10: + min_high = high_unique + if length_unique < 2: + min_len = length_unique else: - min_len = self.length_unique - 1 + min_len = length_unique - 1 - if self.length < 5: - min_high = self.high_unique - min_len = self.length_unique + if length < 5: + min_high = high_unique + min_len = length_unique if self.minimum_coverage == 100: - min_high = self.high_unique - min_len = self.length_unique + min_high = high_unique + min_len = length_unique self._thresholds_unique = Thresholds( - self.high_unique, self.low_unique, self.length_unique, + high_unique, self.low_unique, length_unique, self.small(), min_high, min_len) return self._thresholds_unique From b34989c3fd8bc502acc981f26686f9d7a6e8735e Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 14:27:32 +0100 Subject: [PATCH 077/122] Fix scan logging #787 * reported by @haikoschol at https://github.com/nexB/scancode-toolkit/pull/885#discussion_r162937339 Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 373dfbaf41a..cb041056b33 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -965,7 +965,9 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, location, rid, scan_errors, scan_result, scan_time, scan_result, scan_timings = scans.next() else: location, rid, scan_errors, scan_time, scan_result = scans.next() - if TRACE_DEEP: logger_debug('scan_codebase: results:', scan_result) + + if TRACE_DEEP: logger_debug('scan_codebase: results:', scan_result) + resource = get_resource(rid) if not resource: # this should never happen From 622c5a0b8ccea796d0c2b051a58cd53581af47e4 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 14:57:56 +0100 Subject: [PATCH 078/122] Compute stage and scan timing correctly #787 * reported by @haikoschol Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index cb041056b33..04c4200056c 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -901,7 +901,7 @@ def run_plugins(ctx, stage, plugins, codebase, kwargs, quiet, verbose, timing_key = '%(stage)s:%(name)s' % locals() codebase.timings[timing_key] = time() - plugin_start - codebase.timings['setup'] = time() - stage_start + codebase.timings[stage] = time() - stage_start def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, @@ -1053,10 +1053,11 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=F msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + traceback.format_exc() errors.append(msg) finally: - scan_time = time() - scan_time if with_timing: timings[scanner.key] = time() - start + scan_time = time() - scan_time + if with_timing: return location, rid, errors, scan_time, results, timings else: From 69d2bc60433f3b661395bc86b64e49f919a8f5e8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 18:08:59 +0100 Subject: [PATCH 079/122] Ensure that the new --timing CLI options works #787 * reported by @haikoschol * timings are now correctly added if requested to each Resource * there is a test to ensure this works and is included in JSON and JSON lines outputs * minor refactor of cli_test_utils.py and other minor clieanups Signed-off-by: Philippe Ombredanne --- src/plugincode/output.py | 7 +- src/scancode/cli.py | 57 ++++---- src/scancode/cli_test_utils.py | 129 +++++++++---------- src/scancode/resource.py | 6 +- tests/formattedcode/test_output_jsonlines.py | 26 +++- tests/scancode/data/timing/basic.tgz | Bin 0 -> 17425 bytes tests/scancode/test_cli.py | 56 +++++++- tests/scancode/test_plugin_ignore.py | 16 +-- 8 files changed, 189 insertions(+), 108 deletions(-) create mode 100644 tests/scancode/data/timing/basic.tgz diff --git a/src/plugincode/output.py b/src/plugincode/output.py index c0378f6cd29..d861bc1c84d 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -89,12 +89,13 @@ def process_codebase(self, codebase, **kwargs): raise NotImplementedError @classmethod - def get_results(cls, codebase, info, full_root, strip_root, **kwargs): + def get_results(cls, codebase, info, full_root, strip_root, timing, **kwargs): """ Return an iterable of serialized scan results from a codebase. """ - serializer = partial(Resource.to_dict, full_root=full_root, - strip_root=strip_root, with_info=info) + serializer = partial(Resource.to_dict, + full_root=full_root,strip_root=strip_root, + with_info=info, with_timing=timing) resources = codebase.walk(topdown=True, skip_root=strip_root, skip_filtered=True) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 04c4200056c..265522ac255 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -755,6 +755,7 @@ def scancode(ctx, input, next_stages = (post_scan_plugins.values() + output_filter_plugins.values() + output_plugins.values()) + next_stages_need_info = any(p.needs_info for p in next_stages) # add info is requested or needed but not yet collected if next_stages_need_info: @@ -783,11 +784,13 @@ def scancode(ctx, input, if not quiet: item_show_func = partial(path_progress_message, verbose=verbose) progress_manager = partial(progressmanager, - item_show_func=item_show_func, verbose=verbose, file=sys.stderr) + item_show_func=item_show_func, + verbose=verbose, file=sys.stderr) - # TODO: add CLI option to bypass cache entirely - scan_success = scan_codebase(codebase, scanners, processes, timeout, - with_timing=timing, progress_manager=progress_manager) + # TODO: add CLI option to bypass cache entirely? + scan_success = scan_codebase( + codebase, scanners, processes, timeout, + with_timing=timing, progress_manager=progress_manager) scanned_fc, scanned_dc, scanned_sc = codebase.compute_counts() @@ -930,7 +933,8 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) - runner = partial(scan_resource, scanners=scanners, timeout=timeout) + runner = partial(scan_resource, scanners=scanners, + timeout=timeout, with_timing=with_timing) if TRACE: logger_debug('scan_codebase: scanners:', '\n'.join(repr(s) for s in scanners)) @@ -961,12 +965,10 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, while True: try: - if with_timing: - location, rid, scan_errors, scan_result, scan_time, scan_result, scan_timings = scans.next() - else: - location, rid, scan_errors, scan_time, scan_result = scans.next() + location, rid, scan_errors, scan_time, scan_result, scan_timings = scans.next() - if TRACE_DEEP: logger_debug('scan_codebase: results:', scan_result) + if TRACE_DEEP: logger_debug( + 'scan_codebase: location:', location, 'results:', scan_result) resource = get_resource(rid) if not resource: @@ -988,6 +990,13 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, if infos: resource.set_info(infos) + if TRACE: logger_debug('scan_codebase: scan_timings:', scan_timings) + if with_timing and scan_timings: + if resource.scan_timings: + resource.scan_timings.update(scan_timings) + else: + resource.scan_timings = scan_timings + saved_scans = resource.put_scans(scan_result, update=True) if TRACE: logger_debug('scan_codebase: saved_scans:', saved_scans) @@ -1012,23 +1021,26 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, return success -def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=False): +def scan_resource(location_rid, scanners, + timeout=DEFAULT_TIMEOUT, + with_timing=False): """ - Return a tuple of (location, rid, errors, scan_time, scan_results) + Return a tuple of (location, rid, errors, scan_time, scan_results, timings) by running the `scanners` Scanner objects for the file or directory resource with id `rid` at `location` provided as a `location_rid` tuple of (location, rid) for up to `timeout` seconds. In the returned tuple: - - `errors` is a list of error strings - - `scan_time` is the duration in seconds as float to run all scans for this resource - - `scan_results` is a mapping of scan results keyed by scanner name. - - If `with_timing` is True, the execution time of each scanner is also - collected as a float in seconds and the returned tuple contains an extra - trailing item as a mapping of {scanner.key: execution time}. + - `location` and `rid` are the orginal arguments. + - `errors` is a list of error strings. + - `scan_results` is a mapping of scan results keyed by scanner.key. + - `scan_time` is the duration in seconds to run all scans for this resource. + - `timings` is a mapping of scan {scanner.key: execution time in seconds} + tracking the execution duration each each scan individually. + `timings` is empty unless `with_timing` is True. """ scan_time = time() + timings = None if with_timing: timings = OrderedDict((scanner.key, 0) for scanner in scanners) @@ -1040,6 +1052,7 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=F for scanner, scanner_result in zip(scanners, results.values()): if with_timing: start = time() + try: error, value = interruptible( partial(scanner.function, location), timeout=timeout) @@ -1049,6 +1062,7 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=F if value: # a scanner function MUST return a sequence scanner_result.extend(value) + except Exception: msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + traceback.format_exc() errors.append(msg) @@ -1058,10 +1072,7 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=F scan_time = time() - scan_time - if with_timing: - return location, rid, errors, scan_time, results, timings - else: - return location, rid, errors, scan_time, results + return location, rid, errors, scan_time, results, timings def display_summary(codebase, scan_names, processes, verbose): diff --git a/src/scancode/cli_test_utils.py b/src/scancode/cli_test_utils.py index aa5ff08692f..d2899fd71b4 100644 --- a/src/scancode/cli_test_utils.py +++ b/src/scancode/cli_test_utils.py @@ -35,38 +35,40 @@ from commoncode.system import on_linux -def remove_dates(scan_result): +def run_scan_plain(options, cwd=None, test_mode=True): """ - Remove date fields from scan. + Run a scan as a plain subprocess. Return rc, stdout, stderr. """ - for scanned_file in scan_result['files']: - scanned_file.pop('date', None) + from commoncode.command import execute + import scancode + if test_mode and '--test-mode' not in options: + options.append('--test-mode') -def clean_errors(scan_results): + scmd = b'scancode' if on_linux else 'scancode' + scan_cmd = os.path.join(scancode.root_dir, scmd) + return execute(scan_cmd, options, cwd=cwd) + + +def run_scan_click(options, monkeypatch=None, test_mode=True): """ - Clean error fields from scan by keeping only the first and last line - (removing the stack traces). + Run a scan as a Click-controlled subprocess + If monkeypatch is provided, a tty with a size (80, 43) is mocked. + Return a click.testing.Result object. """ + import click + from click.testing import CliRunner + from scancode import cli - def clean(_errors): - """Modify the __errors list in place""" - for _i, _error in enumerate(_errors[:]): - _error_split = _error.splitlines(True) - if len(_error_split) <= 1: - continue - # keep first and last line - _clean_error = ''.join([_error_split[0] + _error_split[-1]]) - _errors[_i] = _clean_error + if test_mode and '--test-mode' not in options: + options.append('--test-mode') - top_level = scan_results.get('scan_errors') - if top_level: - clean(top_level) + if monkeypatch: + monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) + monkeypatch.setattr(click , 'get_terminal_size', lambda : (80, 43,)) + runner = CliRunner() - for result in scan_results['files']: - file_level = result.get('scan_errors') - if file_level: - clean(file_level) + return runner.invoke(cli.scancode, options, catch_exceptions=False) def check_json_scan(expected_file, result_file, regen=False, @@ -77,24 +79,13 @@ def check_json_scan(expected_file, result_file, regen=False, True the expected_file WILL BE overwritten with the results. This is convenient for updating tests expectations. But use with caution. """ - scan_results = _load_json_result(result_file) - - if strip_dates: - remove_dates(scan_results) - - if clean_errs: - clean_errors(scan_results) + scan_results = load_json_result(result_file, strip_dates, clean_errs) if regen: with open(expected_file, 'wb') as reg: json.dump(scan_results, reg, indent=2, separators=(',', ': ')) - expected = _load_json_result(expected_file) - - if strip_dates: - remove_dates(expected) - if clean_errs: - clean_errors(expected) + expected = load_json_result(expected_file, strip_dates, clean_errs) # NOTE we redump the JSON as a string for a more efficient comparison of # failures @@ -104,53 +95,57 @@ def check_json_scan(expected_file, result_file, regen=False, assert expected == scan_results -def _load_json_result(result_file): +def load_json_result(result_file, strip_dates=False, clean_errs=True): """ Load the result file as utf-8 JSON Sort the results by location. """ with codecs.open(result_file, encoding='utf-8') as res: - scan_result = json.load(res, object_pairs_hook=OrderedDict) + scan_results = json.load(res, object_pairs_hook=OrderedDict) + + if strip_dates: + remove_dates(scan_results) + + if clean_errs: + clean_errors(scan_results) - if scan_result.get('scancode_version'): - del scan_result['scancode_version'] + if scan_results.get('scancode_version'): + del scan_results['scancode_version'] # TODO: remove sort, this should no longer be needed - scan_result['files'].sort(key=lambda x: x['path']) - return scan_result + scan_results['files'].sort(key=lambda x: x['path']) + return scan_results -def run_scan_plain(options, cwd=None, test_mode=True): +def remove_dates(scan_result): """ - Run a scan as a plain subprocess. Return rc, stdout, stderr. + Remove date fields from scan. """ - from commoncode.command import execute - import scancode - - if test_mode and '--test-mode' not in options: - options.append('--test-mode') - - scmd = b'scancode' if on_linux else 'scancode' - scan_cmd = os.path.join(scancode.root_dir, scmd) - return execute(scan_cmd, options, cwd=cwd) + for scanned_file in scan_result['files']: + scanned_file.pop('date', None) -def run_scan_click(options, monkeypatch=None, test_mode=True): +def clean_errors(scan_results): """ - Run a scan as a Click-controlled subprocess - If monkeypatch is provided, a tty with a size (80, 43) is mocked. - Return a click.testing.Result object. + Clean error fields from scan by keeping only the first and last line + (removing the stack traces). """ - import click - from click.testing import CliRunner - from scancode import cli - if test_mode and '--test-mode' not in options: - options.append('--test-mode') + def clean(_errors): + """Modify the __errors list in place""" + for _i, _error in enumerate(_errors[:]): + _error_split = _error.splitlines(True) + if len(_error_split) <= 1: + continue + # keep first and last line + _clean_error = ''.join([_error_split[0] + _error_split[-1]]) + _errors[_i] = _clean_error - if monkeypatch: - monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) - monkeypatch.setattr(click , 'get_terminal_size', lambda : (80, 43,)) - runner = CliRunner() + top_level = scan_results.get('scan_errors') + if top_level: + clean(top_level) - return runner.invoke(cli.scancode, options, catch_exceptions=False) + for result in scan_results['files']: + file_level = result.get('scan_errors') + if file_level: + clean(file_level) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index daa20e95a7c..afdab6cafc1 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -841,7 +841,8 @@ def set_info(self, info): if TRACE: logger_debug('Resource.set_info: to_dict():', pformat(info)) - def to_dict(self, full_root=False, strip_root=False, with_info=False): + def to_dict(self, full_root=False, strip_root=False, + with_info=False, with_timing=False): """ Return a mapping of representing this Resource and its scans. """ @@ -869,6 +870,9 @@ def to_dict(self, full_root=False, strip_root=False, with_info=False): res['is_media'] = self.is_media res['is_source'] = self.is_source res['is_script'] = self.is_script + if with_timing: + res['scan_timings'] = self.scan_timings or {} + res['scan_errors'] = self.errors res.update(self.get_scans()) if TRACE: diff --git a/tests/formattedcode/test_output_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py index 03709147a6e..f1406bd141f 100644 --- a/tests/formattedcode/test_output_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -66,7 +66,7 @@ def check_jsonlines_scan(expected_file, result_file, regen=False): if regen: with open(expected_file, 'wb') as reg: json.dump(result, reg, indent=2, separators=(',', ': ')) - expected = _load_json_result(expected_file) + expected = _load_json_result_for_jsonlines(expected_file) remove_variable_data(expected) assert expected == result @@ -80,7 +80,7 @@ def _load_jsonlines_result(result_file): return [json.loads(line, object_pairs_hook=OrderedDict) for line in res] -def _load_json_result(result_file): +def _load_json_result_for_jsonlines(result_file): """ Load the result file as utf-8 JSON """ @@ -98,3 +98,25 @@ def test_jsonlines(): expected = test_env.get_test_loc('json/simple-expected.jsonlines') check_jsonlines_scan(test_env.get_test_loc(expected), result_file, regen=False) + + +def test_jsonlines_with_timing(): + test_dir = test_env.get_test_loc('json/simple') + result_file = test_env.get_temp_file('jsonline') + + result = run_scan_click(['-i', '--timing', test_dir, '--json-lines', result_file]) + assert result.exit_code == 0 + assert 'Scanning done' in result.output + file_results = _load_jsonlines_result(result_file) + first =True + + for res in file_results: + if first: + # skip header + first = False + continue + scan_timings = res['files'][0]['scan_timings'] + assert scan_timings + for scanner, timing in scan_timings.items(): + assert scanner in ('infos',) + assert timing diff --git a/tests/scancode/data/timing/basic.tgz b/tests/scancode/data/timing/basic.tgz new file mode 100644 index 0000000000000000000000000000000000000000..e9a24f937b4fd4fdd4fd5ef8fb13a85e182103b6 GIT binary patch literal 17425 zcmV(?K-a$?iwFP`U%FKQ1ME9#bK5wU`Kna;KVWCl6FV*2y6iZf>7JEkIo6J2dv(Og zeo-J2vKaFkg0ies*Z%f>2S`GcoTDq5s;(WSDkeeV;azwqIFZ_O_MiOFUk!dQUmoD! z`pbiw{WtqPsW%P|4qMGez210It2dgp!zbe4$D+l*xlUyw#FID*CW&(8WAAUA@3;mE`0%jxi2Pr^Y{H%g`M2t|L%0S#sUN&NXg(3O?})>rzyIg*KliFzPq&^9 zXG%;X-;Wkvcq^R9Rl?IE#Zk{!LeJwkO423Bp_71n6x}HuGZ!%B4 zC5~kHJ$tZGAF`Sju*qMt)~Dd*hB7L$W$dDhqE_$x4R2hi3Bum_QV^{_wn6M zl!Q}Y<6x;%6==~5ovo*f#bVFl2k^`@R95l9u-r$nrhz)Mr0I8LH_k2MH{kd_oR zbUmD;2@FmQRC-J|^}P~yM6W@M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AF|kn&wl6jE8%40pCg-|rkA7beA7ct4n2}a*z1T5I^AuBp#SH+q`ILLc%a{gN7*j zK6(=(86dw=W}AnHfY`#X z?*YaKVEv4n@uZ+)2LjqcM#mC@zUK+td*aS8oN0xl1yj&)@2P|<3FZ*H=4ps`@zp$b ztl4gUW~l##o9*Mq`KSw5etoXAubOyILp~On>fd(}Flf$OZc;NoeGr|J(-{;Xrjxt^{K7y{PCgTyi%UZzjh$)jt=#HV|(}s>eJwkU3jO)JX59yonkiMA@ z>6`UnU)V4n{?cj-v_K2AKnt`$3$#EBv_K2AKnt`$3$#EBv_K2AKnt`$3$#EBv_K2A UKnt`$`>SgI52prP!vGio0L{N1WB>pF literal 0 HcmV?d00001 diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index afe0b6efdfd..3b76fa294bc 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -38,12 +38,12 @@ from commoncode import fileutils from commoncode.fileutils import fsencode from commoncode.testcase import FileDrivenTesting -# from commoncode.testcase import FileBasedTesting from commoncode.system import on_linux from commoncode.system import on_mac from commoncode.system import on_windows from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import load_json_result from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain @@ -207,7 +207,7 @@ def test_scan_license_with_url_template(): result_file = test_env.get_temp_file('json') result = run_scan_click( - ['--license', '--license-url-template', 'https://example.com/urn:{}', + ['--license', '--license-url-template', 'https://example.com/urn:{}', test_dir, '--json-pp', result_file]) check_json_scan(test_env.get_test_loc('plugin_license/license_url.expected.json'), result_file) @@ -652,7 +652,7 @@ def test_scan_to_json_without_FILE_does_not_write_to_next_option(): def test_scan_errors_out_with_conflicting_root_options(): test_file = test_env.get_test_loc('license_text/test.txt') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--strip-root', '--full-root','--json', result_file, '--info', test_file]) + result = run_scan_click(['--strip-root', '--full-root', '--json', result_file, '--info', test_file]) assert result.exit_code == 2 assert ('Error: The option --strip-root cannot be used together with the ' '--full-root option(s) and --full-root is used.') in result.output @@ -661,9 +661,57 @@ def test_scan_errors_out_with_conflicting_root_options(): def test_scan_errors_out_with_conflicting_verbosity_options(): test_file = test_env.get_test_loc('license_text/test.txt') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--quiet', '--verbose','--json', result_file, '--info', test_file]) + result = run_scan_click(['--quiet', '--verbose', '--json', result_file, '--info', test_file]) assert result.exit_code == 2 print(result.output) assert ('Error: The option --quiet cannot be used together with the ' '--verbose option(s) and --verbose is used. You can set only one of ' 'these options at a time.') in result.output + + +def test_scan_with_timing_json(): + test_dir = test_env.extract_test_tar('timing/basic.tgz') + result_file = test_env.get_temp_file('json') + + result = run_scan_click( + ['--email', '--url', '--license', '--copyright', '--info', '--package', + '--timing', '--json', result_file, test_dir, ]) + + assert result.exit_code == 0 + assert 'Scanning done' in result.output + + file_results = load_json_result(result_file)['files'] + + expected_scanners = set( + ['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) + + for res in file_results: + scan_timings = res['scan_timings'] + assert scan_timings + for scanner, timing in scan_timings.items(): + assert scanner in expected_scanners + assert timing + + +def test_scan_with_timing_jsonpp(): + test_dir = test_env.extract_test_tar('timing/basic.tgz') + result_file = test_env.get_temp_file('json') + + result = run_scan_click( + ['--email', '--url', '--license', '--copyright', '--info', '--package', + '--timing', '--json-pp', result_file, test_dir, ]) + + assert result.exit_code == 0 + assert 'Scanning done' in result.output + + file_results = load_json_result(result_file)['files'] + + expected_scanners = set( + ['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) + + for res in file_results: + scan_timings = res['scan_timings'] + assert scan_timings + for scanner, timing in scan_timings.items(): + assert scanner in expected_scanners + assert timing diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 6239ddd8603..ee364356e1a 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -30,7 +30,7 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click -from scancode.cli_test_utils import _load_json_result +from scancode.cli_test_utils import load_json_result from scancode.plugin_ignore import is_ignored from scancode.plugin_ignore import ProcessIgnore from scancode.resource import Codebase @@ -141,7 +141,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): result = run_scan_click(['--copyright', '--strip-root', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should # be listed assert 1 == scan_result['files_count'] @@ -156,7 +156,7 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should # be listed assert 1 == scan_result['files_count'] @@ -171,7 +171,7 @@ def test_scancode_ignore_single_file(self): ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) assert 3 == scan_result['files_count'] # FIXME: add assert 3 == scan_result['dirs_count'] scan_locs = [x['path'] for x in scan_result['files']] @@ -193,7 +193,7 @@ def test_scancode_ignore_multiple_files(self): '--ignore', 'ignore.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] expected = [ @@ -212,7 +212,7 @@ def test_scancode_ignore_glob_files(self): '--ignore', '*.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) assert 1 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] expected = [ @@ -231,7 +231,7 @@ def test_scancode_ignore_glob_path(self): '--ignore', '*/src/test/*', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] expected = [ @@ -252,7 +252,7 @@ def test_scancode_multiple_ignores(self): '--ignore', '*.doc', test_dir, '--json', result_file]) assert result.exit_code == 0 - scan_result = _load_json_result(result_file) + scan_result = load_json_result(result_file) assert 0 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] assert [u'user', u'user/src'] == scan_locs From ac28e69c0f09574048fe3ecd374f297e7e505cfc Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 18:12:38 +0100 Subject: [PATCH 080/122] Use posix paths for tests on all OSes #787 * tests were failing on Windows otehrwise Signed-off-by: Philippe Ombredanne --- tests/scancode/test_plugin_ignore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index ee364356e1a..474a9a62fcd 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -69,7 +69,7 @@ def check_ProcessIgnore(self, test_dir, expected, ignore): codebase = Codebase(test_dir) test_plugin = ProcessIgnore() test_plugin.process_codebase(codebase, ignore=ignore) - resources = [res.get_path(strip_root=True, decode=True) + resources = [res.get_path(strip_root=True, decode=True, posix=True) for res in codebase.walk(skip_root=True)] assert expected == sorted(resources) From 9230d818c29ebd6f814d02c11a771a4f3127f209 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 18:22:34 +0100 Subject: [PATCH 081/122] Make scancode_config._create_dir work on Win #685 #357 * this is now essentailly a copy of commoncode.fileutils.create_dir() Signed-off-by: Philippe Ombredanne --- src/scancode_config.py | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/scancode_config.py b/src/scancode_config.py index a89b01b988f..f2a206de96a 100644 --- a/src/scancode_config.py +++ b/src/scancode_config.py @@ -27,6 +27,7 @@ from __future__ import print_function from __future__ import unicode_literals +import errno import os from os.path import abspath from os.path import dirname @@ -43,13 +44,47 @@ """ +# this exception is not available on posix +try: + WindowsError # @UndefinedVariable +except NameError: + WindowsError = None # @ReservedAssignment + def _create_dir(location): """ - Create all the directories are location + Create directory and all sub-directories recursively at `location`. + Raise Exceptions if it fails to create the directory. + NOTE: this is essentailly a copy of commoncode.fileutils.create_dir() """ - if not exists(location): + + if exists(location): + if not os.path.isdir(location): + err = ('Cannot create directory: existing file ' + 'in the way ''%(location)s.') + raise OSError(err % locals()) + return + + # may fail on win if the path is too long + # FIXME: consider using UNC ?\\ paths + try: os.makedirs(location) + # avoid multi-process TOCTOU conditions when creating dirs + # the directory may have been created since the exist check + except WindowsError, e: + # [Error 183] Cannot create a file when that file already exists + if e and e.winerror == 183: + if not os.path.isdir(location): + raise + else: + raise + except (IOError, OSError), o: + if o.errno == errno.EEXIST: + if not os.path.isdir(location): + raise + else: + raise + ################################################################################ # INVARIABLE INSTALLATION-SPECIFIC, BUILT-IN LOCATIONS AND FLAGS From 017bc818f79333eb551248b04901a5f389a048c6 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 22:17:21 +0100 Subject: [PATCH 082/122] Add extra timeout for failing windows tests #685 #357 Signed-off-by: Philippe Ombredanne --- tests/scancode/test_cli.py | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 3b76fa294bc..17a15626524 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -111,7 +111,10 @@ def test_license_option_detects_licenses(): test_dir = test_env.get_test_loc('license', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--license', test_dir, '--json', result_file]) + args = ['--license', test_dir, '--json', result_file] + if on_windows: + args += ['--timeout', 400] + result = run_scan_click(args) assert result.exit_code == 0 assert 'Scanning done' in result.output assert os.path.exists(result_file) @@ -238,7 +241,10 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', '--strip-root', test_file, '--json', result_file]) + args = ['--copyright', '--strip-root', test_file, '--json', result_file] + if on_windows: + args += ['--timeout', 400] + result = run_scan_click(args) assert result.exit_code == 1 assert 'Scanning done' in result.output check_json_scan(test_env.get_test_loc('failing/patchelf.expected.json'), result_file) @@ -249,7 +255,10 @@ def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - result = run_scan_click([ '--copyright', test_file, '--json', result_file]) + args = ['--copyright', test_file, '--json', result_file] + if on_windows: + args += ['--timeout', 400] + result = run_scan_click(args) assert result.exit_code == 1 assert 'Scanning done' in result.output assert 'Some files failed to scan' in result.output @@ -540,7 +549,10 @@ def test_scan_can_run_from_other_directory(): def test_scan_logs_errors_messages_not_verbosely_on_stderr(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '-n', '0', test_file, '--json', '-']) + args = ['-pi', '-n', '0', test_file, '--json', '-'] + if on_windows: + args += ['--timeout', 400] + rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -549,7 +561,10 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr(): def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '-n', '2', test_file, '--json', '-']) + args = ['-pi', '-n', '2', test_file, '--json', '-'] + if on_windows: + args += ['--timeout', 400] + rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -558,7 +573,10 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing( def test_scan_logs_errors_messages_verbosely_with_verbose(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '0', test_file, '--json', '-']) + args = ['-pi', '--verbose', '-n', '0', test_file, '--json', '-'] + if on_windows: + args += ['--timeout', 400] + rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout @@ -568,7 +586,10 @@ def test_scan_logs_errors_messages_verbosely_with_verbose(): def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) - rc, stdout, stderr = run_scan_plain(['-pi', '--verbose', '-n', '2', test_file, '--json', '-']) + args = ['-pi', '--verbose', '-n', '2', test_file, '--json', '-'] + if on_windows: + args += ['--timeout', 400] + rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout From 0efe66c7f3878a1d67de0e397bf45517b1ddd13d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 22:17:21 +0100 Subject: [PATCH 083/122] Add extra timeout for failing windows tests #685 #357 Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_templated.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index f40c0a90e75..a3b5febaf4b 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -33,6 +33,7 @@ from scancode_config import __version__ from commoncode import fileutils +from commoncode.system import on_windows from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click @@ -77,7 +78,7 @@ def test_scanned_path_is_present_in_html_app_output(): assert 'Scanning done' in result.output results = open(result_file).read() - + assert 'ScanCode scan results for: %(test_dir)s' % locals() in results assert '
' % locals() in results assert 'scan results for:' % locals() in results @@ -89,9 +90,12 @@ def test_scan_html_output_does_not_truncate_copyright_html(): test_dir = test_env.get_test_loc('templated/tree/scan/') result_file = test_env.get_temp_file('test.html') - result = run_scan_click( - ['-clip', '--strip-root', '-n', '3', test_dir, - '--output-html', result_file]) + args = ['-clip', '--strip-root', '-n', '3', test_dir, + '--output-html', result_file] + if on_windows: + args += ['--timeout', 400] + + result = run_scan_click(args) assert result.exit_code == 0 assert 'Scanning done' in result.output From 911e8cb10ee43238b73c935c5643b5d50a8af81c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Jan 2018 23:55:32 +0100 Subject: [PATCH 084/122] Add extra debug infor for failing windows tests #685 #357 Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_templated.py | 8 ++++++-- tests/scancode/test_cli.py | 14 +++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index a3b5febaf4b..63eb341e69b 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -93,10 +93,12 @@ def test_scan_html_output_does_not_truncate_copyright_html(): args = ['-clip', '--strip-root', '-n', '3', test_dir, '--output-html', result_file] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] result = run_scan_click(args) - assert result.exit_code == 0 + print('------------------------------------------------') + print(result.output) + print('------------------------------------------------') assert 'Scanning done' in result.output results = open(result_file).read() @@ -130,6 +132,8 @@ def test_scan_html_output_does_not_truncate_copyright_html(): check = re.findall(exp, results, re.MULTILINE) assert check + assert result.exit_code == 0 + def test_custom_format_with_custom_filename_fails_for_directory(): test_dir = test_env.get_temp_dir('html') diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 17a15626524..bbeb6db0371 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -113,7 +113,7 @@ def test_license_option_detects_licenses(): args = ['--license', test_dir, '--json', result_file] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] result = run_scan_click(args) assert result.exit_code == 0 assert 'Scanning done' in result.output @@ -243,7 +243,7 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e args = ['--copyright', '--strip-root', test_file, '--json', result_file] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] result = run_scan_click(args) assert result.exit_code == 1 assert 'Scanning done' in result.output @@ -257,7 +257,7 @@ def test_scan_with_errors_always_includes_full_traceback(): args = ['--copyright', test_file, '--json', result_file] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] result = run_scan_click(args) assert result.exit_code == 1 assert 'Scanning done' in result.output @@ -551,7 +551,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '-n', '0', test_file, '--json', '-'] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'Path: errors/package.json' in stderr @@ -563,7 +563,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing( test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '-n', '2', test_file, '--json', '-'] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'Path: errors/package.json' in stderr @@ -575,7 +575,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '--verbose', '-n', '0', test_file, '--json', '-'] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'package.json' in stderr @@ -588,7 +588,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '--verbose', '-n', '2', test_file, '--json', '-'] if on_windows: - args += ['--timeout', 400] + args += ['--timeout', '400'] rc, stdout, stderr = run_scan_plain(args) assert rc == 1 assert 'package.json' in stderr From 2efcd99a88318906e568ef54b6e075365241cecd Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 25 Jan 2018 12:07:55 +0100 Subject: [PATCH 085/122] Ensure that to_dict works with not-set values #787 * this can happen if info scan failed somehow Signed-off-by: Philippe Ombredanne --- src/scancode/resource.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index afdab6cafc1..298e09d4098 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -851,9 +851,9 @@ def to_dict(self, full_root=False, strip_root=False, absolute=full_root, strip_root=strip_root, decode=True, posix=True)) if with_info: res['type'] = self.type - res['name'] = fsdecode(self.name) - res['base_name'] = fsdecode(self.base_name) - res['extension'] = self.extension and fsdecode(self.extension) + res['name'] = self.name and fsdecode(self.name) or '' + res['base_name'] = self.base_name and fsdecode(self.base_name) or '' + res['extension'] = self.extension and fsdecode(self.extension) or '' res['date'] = self.date res['size'] = self.size res['sha1'] = self.sha1 From ca2621f863ecc35a9d8100a04e4f26f90057d3bc Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 25 Jan 2018 14:29:51 +0100 Subject: [PATCH 086/122] Use less deep path on Windows Signed-off-by: Philippe Ombredanne --- ...variant.0 variant => copyright_wxWindows Library .0 variant} | 0 tests/cluecode/test_copyrights.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/cluecode/data/copyrights/{copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant-LGPL wxWindows Library Licence v_ variant.0 variant => copyright_wxWindows Library .0 variant} (100%) diff --git a/tests/cluecode/data/copyrights/copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant-LGPL wxWindows Library Licence v_ variant.0 variant b/tests/cluecode/data/copyrights/copyright_wxWindows Library .0 variant similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant-LGPL wxWindows Library Licence v_ variant.0 variant rename to tests/cluecode/data/copyrights/copyright_wxWindows Library .0 variant diff --git a/tests/cluecode/test_copyrights.py b/tests/cluecode/test_copyrights.py index 26a0dbc9bc5..a1fb550ae1d 100644 --- a/tests/cluecode/test_copyrights.py +++ b/tests/cluecode/test_copyrights.py @@ -2271,7 +2271,7 @@ def test_copyright_license_text_lgpl_v3(self): check_detection(expected, test_file) def test_copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant-LGPL wxWindows Library Licence v_ variant.0 variant') + test_file = self.get_test_loc('copyrights/copyright_wxWindows Library .0 variant') expected = [ 'Copyright (c) 1998 Julian Smart, Robert Roebling', ] From 8d77d0ad2d213b9889fd2f2b74f2a7e08e8bd468 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 00:47:14 +0100 Subject: [PATCH 087/122] Shorten cpoyright test file names for Windows #787 * otherwise some test fail in somce layouts Signed-off-by: Philippe Ombredanne --- tests/cluecode/cluecode_assert_utils.py | 29 +- .../03e16f6c_0-e_f_c.0} | 0 .../3a3b02ce_0-a_b_ce.0} | 0 .../ABC_cpp-Case_cpp.cpp} | 0 .../ABC_file_cpp-File_cpp.cpp} | 0 .../copyright_abc => copyright_lines/abc} | 0 .../abc_loss_of_holder_c-c.c} | 0 .../abiword_common.copyright} | 0 .../acme_c-c.c} | 0 ...ldattribute_cs-ActiveFieldAttribute_cs.cs} | 0 .../addr_c-addr_c.c} | 0 .../adler_inflate_c-inflate_c.c} | 0 .../aleal-c.c} | 0 .../andre_darcy-c.c} | 0 .../android_c-c.c} | 0 .../apache_notice-NOTICE} | 0 .../aptitude-aptitude.label} | 0 .../atheros_spanning_lines-py.py} | 0 .../att_in_c-9_c.c} | 0 .../audio_c-c.c} | 0 .../babkin_txt.txt} | 0 .../blender_debian-blender.copyright} | 0 .../company_name_in_java-9_java.java | 20 + .../essential_smoke-ibm_c.c} | 0 .../heunrich_c-c.c} | 0 .../isc-c.c} | 0 .../sample_py-py.py} | 0 .../data/copyright_lines/vector50.hpp | 174 ++ .../data/copyrights/03e16f6c_0-e_f_c.0 | 78 + .../data/copyrights/3a3b02ce_0-a_b_ce.0 | 84 + .../data/copyrights/ABC_cpp-Case_cpp.cpp | 14 + .../data/copyrights/ABC_file_cpp-File_cpp.cpp | 14 + ...NG_gpl.gpl => COPYING_gpl-COPYING_gpl.gpl} | 0 ...PYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi} | 0 ...pyright_in_README-README => README-README} | 0 ...opyright_Yocto-SPDX.pdf => Yocto-SPDX.pdf} | Bin tests/cluecode/data/copyrights/abc | 2 + .../data/copyrights/abc_loss_of_holder_c-c.c | 2 + .../data/copyrights/abiword_common.copyright | 152 ++ tests/cluecode/data/copyrights/acme_c-c.c | 1 + ...eldattribute_cs-ActiveFieldAttribute_cs.cs | 40 + ...daptive v.0 => adaptive_v1_0-Adaptive v.0} | 0 .../cluecode/data/copyrights/addr_c-addr_c.c | 23 + .../copyrights/adler_inflate_c-inflate_c.c | 952 +++++++++ ...t_license_text_adobe-Adobe => adobe-Adobe} | 0 ...adobe_flashplugin-adobe_flashplugin.label} | 0 ...beflex_sdk => adobeflex2sdk-Adobeflex_sdk} | 0 ...plv1-AfferoGPLv => afferogplv1-AfferoGPLv} | 0 ...plv2-AfferoGPLv => afferogplv2-AfferoGPLv} | 0 ...plv3-AfferoGPLv => afferogplv3-AfferoGPLv} | 0 ...text_afl_v3_0-AFL_v.0 => afl_v3_0-AFL_v.0} | 0 ...ublic_license-Aladdin Free Public License} | 0 tests/cluecode/data/copyrights/aleal-c.c | 3 + ...mazondsb-AmazonDSb => amazondsb-AmazonDSb} | 0 ...xt_ampasbsd-AMPASBSD => ampasbsd-AMPASBSD} | 0 .../cluecode/data/copyrights/andre_darcy-c.c | 28 + ...colin_android-bsdiff_c.c => android_c-c.c} | 0 ..._debian_trailing_name_missed-apache.label} | 0 ...pache_in_html.html => apache_in_html.html} | 0 .../data/copyrights/apache_notice-NOTICE | 35 + ...chev1_0-Apachev.0 => apachev1_0-Apachev.0} | 0 ...chev1_1-Apachev.1 => apachev1_1-Apachev.1} | 0 ...-Apachev_b.0b => apachev2_0b-Apachev_b.0b} | 0 ..._0-Apple Common Documentation License v.0} | 0 ...ense_v1_0-Apple Public Source License v.0} | 0 ...ense_v1_1-Apple Public Source License v.1} | 0 ...ense_v1_2-Apple Public Source License v.2} | 0 ...text_apslv2_0-APSLv.0 => apslv2_0-APSLv.0} | 0 .../data/copyrights/aptitude-aptitude.label | 6 + ...rtistic v.0 => artistic_v1_0-Artistic v.0} | 0 ...stic_v1_0_short-Artistic v_ short.0 short} | 0 ...artistic_v2_0beta4-Artistic v_beta.0beta4} | 0 ...0-Artisticv.0 => artisticv2_0-Artisticv.0} | 0 .../copyrights/atheros_spanning_lines-py.py | 16 + tests/cluecode/data/copyrights/att_in_c-9_c.c | 18 + ...urancelicense-AttributionAssuranceLicense} | 0 tests/cluecode/data/copyrights/audio_c-c.c | 5 + tests/cluecode/data/copyrights/babkin_txt.txt | 5 + ...t_in_bash-shell_sh.sh => bash-shell_sh.sh} | 0 ...w&Holmes => bigelow_holmes-Bigelow&Holmes} | 0 ...d_lib.lib => binary_lib-php_embed_lib.lib} | Bin ...xt_bitstream-Bi_ream => bitstream-Bi_ream} | 0 .../blender_debian-blender.copyright | 57 + ..._in_name-c.c => blue_sky_dash_in_name-c.c} | 0 ...license-LICENSE => bouncy_license-LICENSE} | 0 ...notice-9_NOTICE => bouncy_notice-9_NOTICE} | 0 ...cense_text_bsdnrl-BSDNRL => bsdnrl-BSDNRL} | 0 ...plot_py.py => btt_plot1_py-btt_plot_py.py} | 0 .../copyrights/{copyright_in_c-c.c => c-c.c} | 0 ...pyright_in_c_include-h.h => c_include-h.h} | 0 ...lcase_br_diagnostics_h-br_diagnostics_h.h} | 0 ...d_psipstack_c-br_fcc_thread_psipstack_c.c} | 0 ...{copyright_ccube_txt.txt => ccube_txt.txt} | 0 ...k_java-java.java => cedrik_java-java.java} | 0 ..._java.java => cern-TestMatrix_D_java.java} | 0 ...cern_matrix2d_java-TestMatrix_D_java.java} | 0 ..._S.S => chameleon_assembly-9_9_setjmp_S.S} | 0 ...right_license_text_cnri-CNRI => cnri-CNRI} | 0 ...-copyright_java.java => co_cust-java.java} | 0 .../data/copyrights/colin_android-bsdiff_c.c | 410 ++++ ...pany_in_txt-9.txt => company_in_txt-9.txt} | 0 ...=> complex_4_line_statement_in_text-9.txt} | 0 ...ex_notice-NOTICE => complex_notice-NOTICE} | 0 ...sun_microsystems_on_multiple_lines-NOTICE} | 0 ...tra_For-Condor => condor_extra_For-Condor} | 0 ..._guess.guess => config-config_guess.guess} | 0 ...guess => config1_guess-config_guess.guess} | 0 .../copyright_license_text_gsoap-gSOAP | 158 -- ...t => coreutils_debian-coreutils.copyright} | 0 ...ht_dag_c-s_fabsl_c.c => dag_c-s_fabsl_c.c} | 0 ...notice-NOTICE => dag_elring_notice-NOTICE} | 0 ...in_name-Makefile => dash_in_name-Makefile} | 0 ...yright_label.label => dasher-dasher.label} | 0 ...hua_in_c-c.c => date_range_dahua_in_c-c.c} | 0 ...ate_range_in_c-c.c => date_range_in_c-c.c} | 0 ...range_in_c_2-c.c => date_range_in_c_2-c.c} | 0 ..._keyring-debian_archive_keyring.copyright} | 0 ...l => debian_lib_1-libmono_cairo_cil.label} | 0 ... debian_lib_2-libmono_cairo_cil.copyright} | 0 ...bian_lib_3-libmono_security_cil.copyright} | 0 ...ulti_names_on_one_line-libgdata.copyright} | 0 ...opyright_dionysos_c-c.c => dionysos_c-c.c} | 0 ...opyright_disclaimed-c.c => disclaimed-c.c} | 0 ...libre_desktop-djvulibre_desktop.copyright} | 0 ...ll-9_msvci_dll.dll => dll-9_msvci_dll.dll} | Bin ...copyright_license_text_doc-DOC => doc-DOC} | 0 ...l_doc_html-docbook_xsl_doc_html.copyright} | 0 ...rand48_c-drand_c.c => drand48_c-drand_c.c} | 0 ...Dual MPL GPL => dual_mpl_gpl-Dual MPL GPL} | 0 ...it-DualMPL_MIT => dualmpl_mit-DualMPL_MIT} | 0 ...nse_text_eclv1_0-ECLv.0 => eclv1_0-ECLv.0} | 0 ...text_ecosv2_0-eCosv.0 => ecosv2_0-eCosv.0} | 0 ...ed_copyright.copyright => ed-ed.copyright} | 0 ...e_text_entessa-Entessa => entessa-Entessa} | 0 ..._browser_data-epiphany_browser_data.label} | 0 ..._eplv1_0b-EPLv_b.0b => eplv1_0b-EPLv_b.0b} | 0 ...ight_eric_young_c-c.c => eric_young_c-c.c} | 0 ...ht_errno_atheros-c.c => errno_atheros-c.c} | 0 ..._ah_h-ah_h.h => errno_atheros_ah_h-ah_h.h} | 0 .../{copyright_errno_c-c.c => errno_c-c.c} | 0 ...java-java.java => esmertec_java-java.java} | 0 .../data/copyrights/essential_smoke-ibm_c.c | 24 + ...agrid-EUDatagrid => eudatagrid-EUDatagrid} | 0 ...2-Eurosym_v.v2 => eurosym_v2-Eurosym_v.v2} | 0 ...ht_expat_h-expat_h.h => expat_h-expat_h.h} | 0 ...ext_all_js.js => ext_all_js-ext_all_js.js} | 0 .../{copyright_extjs_c-c.c => extjs_c-c.c} | 0 ...> false_positive_in_c-false_positives_c.c} | 0 ...false_positive_in_js-editor_beta_de_js.js} | 0 ...ENSE => false_positive_in_license-LICENSE} | 0 ...rameworxv.0 => frameworxv1_0-Frameworxv.0} | 0 ...e_text_freebsd-FreeBSD => freebsd-FreeBSD} | 0 ...xt_freetype-FreeType => freetype-FreeType} | 0 ...ight_fsf_py-999_py.py => fsf_py-999_py.py} | 0 .../{copyright_gailly-c.c => gailly-c.c} | 0 ...opyright_geoff_js-js.js => geoff_js-js.js} | 0 ...text_gfdlv1_2-GFDLv.2 => gfdlv1_2-GFDLv.2} | 0 ...text_gfdlv1_3-GFDLv.3 => gfdlv1_3-GFDLv.3} | 0 ...t_license_text_glide-Glide => glide-Glide} | 0 ... => gnome_session-gnome_session.copyright} | 0 ...em_monitor-gnome_system_monitor.copyright} | 0 ...system_monitor-gnome_system_monitor.label} | 0 ...e_text_gnuplot-gnuplot => gnuplot-gnuplot} | 0 ...ht.copyright => gobjc_4_3-gobjc.copyright} | 0 ...gle_closure_templates_java_html-html.html} | 0 ...ogle_view_layout1_xml-view_layout_xml.xml} | 0 ...license_text_gpl_v1-GPL_v => gpl_v1-GPL_v} | 0 ...license_text_gpl_v2-GPL_v => gpl_v2-GPL_v} | 0 ...license_text_gpl_v3-GPL_v => gpl_v3-GPL_v} | 0 .../{copyright_group-c.c => group-c.c} | 0 .../{copyright_gsoap-gSOAP => gsoap-gSOAP} | 0 ...luendo_mp3-gstreamer_fluendo_mp.copyright} | 0 .../copyrights/{copyright_in_h-h.h => h-h.h} | 0 ..._hall-copyright.txt => hall-copyright.txt} | 0 ..._html.html => hans_jurgen_htm-9_html.html} | 0 ...yright_hansen_cs-cs.cs => hansen_cs-cs.cs} | 0 ...attach_qualcomm1_c-hciattach_qualcomm_c.c} | 0 ...t_license_text_helix-Helix => helix-Helix} | 0 tests/cluecode/data/copyrights/heunrich_c-c.c | 6 + ...ackard => hewlett_packard-Hewlett_Packard} | 0 ..._label.label => hibernate-hibernate.label} | 0 ...mm_c.c => holtmann-hciattach_qualcomm_c.c} | 0 ..._cli_c.c => hostapd_cli_c-hostapd_cli_c.c} | 0 ...ailable.c => hostapd_trailing_available.c} | 0 ...ight_hp_notice-NOTICE => hp_notice-NOTICE} | 0 ...abel.label => hpijs_ppds-hpijs_ppds.label} | 0 .../{copyright_in_html.html => html.html} | 0 ...ents-html.html => html_comments-html.html} | 0 ...html => html_incorrect-detail_9_html.html} | 0 ...{copyright_ibm_c-ibm_c.c => ibm_c-ibm_c.c} | 0 ...pl_v1_0-IBMPL_v.0 => ibmpl_v1_0-IBMPL_v.0} | 0 ...yright_label.label => icedax-icedax.label} | 0 ...right_license_text_ietf-IETF => ietf-IETF} | 0 ...c-ifrename_c.c => ifrename_c-ifrename_c.c} | 0 ...copyright_license_text_ijg-IJG => ijg-IJG} | 0 ...-9_html.html => illinois_html-9_html.html} | 0 ...cense_text_imatix-iMatix => imatix-iMatix} | 0 ...license_text_imlib2-Imlib => imlib2-Imlib} | 0 ...older_c-c.c => inria_loss_of_holder_c-c.c} | 0 ...t_license_text_intel-Intel => intel-Intel} | 0 tests/cluecode/data/copyrights/isc-c.c | 4 + ...cense_text_jabber-Jabber => jabber-Jabber} | 0 ...opyright_java-java.java => java-java.java} | 0 ...{copyright_jdoe-copyright_c.c => jdoe-c.c} | 0 ...e_text_jpython-JPython => jpython-JPython} | 0 ..._phps.phps => json_in_phps-JSON_phps.phps} | 0 ... => json_in_phps_incorrect-JSON_phps.phps} | 0 ...tml => json_phps_html-JSON_phps_html.html} | 0 ...n_phps_html_incorrect-JSON_phps_html.html} | 0 ..._all_CAPS-jsp.jsp => jsp_all_CAPS-jsp.jsp} | 0 ...ight.copyright => kaboom-kaboom.copyright} | 0 ...ight.copyright => kbuild-kbuild.copyright} | 0 ...t => kde_l10n_zhcn-kde_l_n_zhcn.copyright} | 0 ...rosen-LarryRosen => larryrosen-LarryRosen} | 0 ...ex_v1_0-LaTeX_v.0 => latex_v1_0-LaTeX_v.0} | 0 ...ex_v1_1-LaTeX_v.1 => latex_v1_1-LaTeX_v.1} | 0 ...ex_v1_2-LaTeX_v.2 => latex_v1_2-LaTeX_v.2} | 0 ...-LaTeX_v_a.3a => latex_v1_3a-LaTeX_v_a.3a} | 0 ...f => latex_v1_3a_ref-LaTeX_v_a_ref.3a_ref} | 0 ...-LaTeX_v_c.3c => latex_v1_3c-LaTeX_v_c.3c} | 0 ...opyright_leonardo_c-c.c => leonardo_c-c.c} | 0 ..._lgpl_v2_0-LGPL_v.0 => lgpl_v2_0-LGPL_v.0} | 0 ..._lgpl_v2_1-LGPL_v.1 => lgpl_v2_1-LGPL_v.1} | 0 ...nse_text_lgpl_v3-LGPL_v => lgpl_v3-LGPL_v} | 0 ...t.copyright => libadns1-libadns.copyright} | 0 ....copyright => libc6_i686-libc_i.copyright} | 0 ...ht_label.label => libcdio10-libcdio.label} | 0 ...t.copyright => libcelt0-libcelt.copyright} | 0 ..._perl-libcompress_raw_zlib_perl.copyright} | 0 ...right => libcpufreq0-libcpufreq.copyright} | 0 ...sleay_perl-libcrypt_ssleay_perl.copyright} | 0 ...ht => libepc_ui_1_0_1-libepc_ui.copyright} | 0 ....label => libepc_ui_1_0_2-libepc_ui.label} | 0 ...copyright => libfltk1_1-libfltk.copyright} | 0 ...ht_label.label => libgail18-libgail.label} | 0 ...mh0_target_x-libggiwmh_target_x.copyright} | 0 ...nome_desktop_2-libgnome_desktop.copyright} | 0 ... libgnome_media0-libgnome_media.copyright} | 0 ....label => libgoffice_0_8-libgoffice.label} | 0 ...ght => libgtkhtml2_0-libgtkhtml.copyright} | 0 ...ht.copyright => libisc44-libisc.copyright} | 0 ...yright => libisccfg30-libisccfg.copyright} | 0 ...yright => libisccfg40-libisccfg.copyright} | 0 ....copyright => libjpeg62-libjpeg.copyright} | 0 ...l.label => libkeyutils1-libkeyutils.label} | 0 ...ale_gettext_perl-liblocale_get_perl.label} | 0 ...bel.label => libopenraw1-libopenraw.label} | 0 ...libopenthreads12-libopenthreads.copyright} | 0 ...k_connector-libpam_ck_connector.copyright} | 0 ...right => libpoppler3-libpoppler.copyright} | 0 ...4_scripttools-libqt_scripttools.copyright} | 0 ...ibqtscript4_gui-libqtscript_gui.copyright} | 0 ...copyright => libsocks4-libsocks.copyright} | 0 ...libsox_fmt_alsa-libsox_fmt_alsa.copyright} | 0 ...copyright => libspeex1-libspeex.copyright} | 0 ...> libstlport4_6ldbl-libstlport_ldbl.label} | 0 ...ght.copyright => libtdb1-libtdb.copyright} | 0 ...ght.copyright => libuim6-libuim.copyright} | 0 ...t.copyright => libxext6-libxext.copyright} | 0 ...ght => libxmlrpc_c3-libxmlrpc_c.copyright} | 0 ...pyright_label.label => libxt6-libxt.label} | 0 ...L_v.0 => license_qpl_v1_0_perfect-QPL_v.0} | 0 ...> linux_source_2_6-linux_source.copyright} | 0 ...v1_0-Logica_v.0 => logica_v1_0-Logica_v.0} | 0 ...s_of_holder_c-c.c => loss_of_holder_c-c.c} | 0 ...fonts-Luxi_fonts => luxi_fonts-Luxi_fonts} | 0 ...right_license_text_maia-Maia => maia-Maia} | 0 ...c => matroska_demux1_c-matroska_demux_c.c} | 0 ....c => matroska_demux_c-matroska_demux_c.c} | 0 ...atroska_demux_muller_c-matroska_demux_c.c} | 0 ..._xml.xml => maven_pom_xstream-pom_xml.xml} | 0 ...ght_in_media-a_png.png => media-a_png.png} | Bin ...cmp_S.S => memcmp_assembly-9_9_memcmp_S.S} | 0 ...ava => mergesort_java-MergeSort_java.java} | 0 ...right_in_phps-phps.phps => michal_txt.txt} | 0 ...1_be_elf_hal_o_uu-mips_be_elf_hal_o_uu.uu} | 0 ...xt => missing_statement_file_txt-file.txt} | 0 .../copyrights/{copyright_mit.txt => mit.txt} | 0 ...obeGlyph => mit_adobeglyph-MIT_AdobeGlyph} | 0 ...e_text_mit_cmu-MIT_CMU => mit_cmu-MIT_CMU} | 0 ...it_danse-MIT_Danse => mit_danse-MIT_Danse} | 0 ...it_danse-MIT_danse => mit_danse-MIT_danse} | 0 ...xt_mit_enna-MIT_enna => mit_enna-MIT_enna} | 0 ...ax-MIT_hylafax => mit_hylafax-MIT_hylafax} | 0 ...e_text_mit_icu-MIT_ICU => mit_icu-MIT_ICU} | 0 ...ucent-MIT_Lucent => mit_lucent-MIT_Lucent} | 0 ...it_mlton-MIT_MLton => mit_mlton-MIT_MLton} | 0 ...style_disclaimer4-MIT_OldStyle_disclaimer} | 0 ...de-MIT_unicode => mit_unicode-MIT_unicode} | 0 ...et-MIT_WordNet => mit_wordnet-MIT_WordNet} | 0 ...t_license_text_mitre-MITRE => mitre-MITRE} | 0 ...ixedcaps_c.c => mixedcaps_c-mixedcaps_c.c} | 0 ...e_company_name_in_c-lowercase_company_c.c} | 0 ...ht.copyright => mkisofs-mkisofs.copyright} | 0 ...opyright_moto_broad-c.c => moto_broad-c.c} | 0 ...opyright_motorola_c-c.c => motorola_c-c.c} | 0 ...mobility_c-c.c => motorola_mobility_c-c.c} | 0 ...yer_skin_blue-mplayer_skin_blue.copyright} | 0 ...t_license_text_ms_pl-Ms_PL => ms_pl-Ms_PL} | 0 ...t_license_text_ms_rl-Ms_RL => ms_rl-Ms_RL} | 0 ...cense_text_ms_rsl-Ms_RSL => ms_rsl-Ms_RSL} | 0 ...t_license_text_msntp-MSNTP => msntp-MSNTP} | 0 .../{copyright_muller-c.c => muller-c.c} | 0 ...istorical.txt => multiline-Historical.txt} | 0 ...al.txt => multiline_george-Historical.txt} | 0 .../{copyright_mycorp_c-c.c => mycorp_c-c.c} | 0 ... => mysql_gplexception-MySQL_gplexception} | 0 ...fore_copyright_c-c.c => name_before_c-c.c} | 0 ...correct-c.c => name_sign_year_correct-c.c} | 0 ...cense_text_naumen-Naumen => naumen-Naumen} | 0 ...opyright_naumen_txt.txt => naumen_txt.txt} | 0 ...ight => ncurses_bin-ncurses_bin.copyright} | 0 .../{copyright_nederlof.txt => nederlof.txt} | 0 ...Components => netcomponents-NetComponents} | 0 ...e_text_nethack-Nethack => nethack-Nethack} | 0 ...opyright_nnp_and_co.txt => nnp_and_co.txt} | 0 ...pyright_no_copyright_in_c-c.c => no_c-c.c} | 0 ..._file_1-PersistentArrayHolder_class.class} | Bin ...ile_2-PersistentElementHolder_class.class} | Bin ...ersistentIndexedElementHolder_class.class} | Bin ...4-PersistentListElementHolder_class.class} | Bin ...ava-java.java => no_holder_java-java.java} | 0 ...t_license_text_nokia-Nokia => nokia-Nokia} | 0 ...ht_nokia_cpp-cpp.cpp => nokia_cpp-cpp.cpp} | 0 ...opyright_north_c-99_c.c => north_c-99_c.c} | 0 ...ight_notice2-9_NOTICE => notice2-9_NOTICE} | 0 ..._txt-NOTICE.txt => notice2_txt-NOTICE.txt} | 0 ...CE => notice_name_before_statement-NOTICE} | 0 ...e_txt-NOTICE.txt => notice_txt-NOTICE.txt} | 0 ...text_npl_v1_0-NPL_v.0 => npl_v1_0-NPL_v.0} | 0 ...dia_source => nvidia_source-Nvidia_source} | 0 ..._style_name.txt => o_brien_style_name.txt} | 0 ...ummer_c_code-c.c => oberhummer_c_code-c.c} | 0 ...berhummer_text.txt => oberhummer_text.txt} | 0 ...jectiveC_m.m => objectivec-objectiveC_m.m} | 0 ..._oclc_v1_0-OCLC_v.0 => oclc_v1_0-OCLC_v.0} | 0 ..._oclc_v2_0-OCLC_v.0 => oclc_v2_0-OCLC_v.0} | 0 ....label => openhackware-openhackware.label} | 0 ...xt_openldap-OpenLDAP => openldap-OpenLDAP} | 0 ...penmotif-OpenMotif => openmotif-OpenMotif} | 0 ...enoffice_org_report_builder_bin.copyright} | 0 ...noffice_org_report_builder_bin.copyright2} | 0 ...e_text_openpbs-OpenPBS => openpbs-OpenPBS} | 0 ... => openpublicationref-OpenPublicationref} | 0 ...e_text_openssl-OpenSSL => openssl-OpenSSL} | 0 .../{copyright_openssl-c.c => openssl-c.c} | 0 ...text_osl_v3_0-OSL_v.0 => osl_v3_0-OSL_v.0} | 0 ...al_detection.txt => partial_detection.txt} | 0 ...tion_mit.txt => partial_detection_mit.txt} | 0 ...opyright => perl_base-perl_base.copyright} | 0 ...ht_perl_module-pm.pm => perl_module-pm.pm} | 0 .../{copyright_peter_c-c.c => peter_c-c.c} | 0 ...cense_text_phorum-Phorum => phorum-Phorum} | 0 ...opyright_michal_txt.txt => phps-phps.phps} | 0 ...va.java => piersol-TestMatrix_D_java.java} | 0 ...right_license_text_pine-Pine => pine-Pine} | 0 ...yright_pixelstream.rgb => pixelstream.rgb} | 0 ...n_postcript-9__ps.ps => postcript-9_ps.ps} | Bin ....label => postgresql_8_3-postgresql.label} | 0 ...f_informatics.txt => prof_informatics.txt} | 0 ...ght.txt => professional_txt-copyright.txt} | 0 ...rties => properties-properties.properties} | 0 ...or_py.py => psf_in_python-BitVector_py.py} | 0 ...python_dateutil-python_dateutil.copyright} | 0 ...ht => python_psyco-python_psyco.copyright} | 0 ...l => python_reportbug-python_report.label} | 0 ...ties-python_software_properties.copyright} | 0 ...v1_6-Python_v.6 => python_v1_6-Python_v.6} | 0 ..._1-Python_v.1 => python_v1_6_1-Python_v.1} | 0 ..._python_v2-Python_v => python_v2-Python_v} | 0 ...text_qpl_v1_0-QPL_v.0 => qpl_v1_0-QPL_v.0} | 0 ...0-RealCSL_v.0 => realcsl_v2_0-RealCSL_v.0} | 0 ...0-RealPSL_v.0 => realpsl_v1_0-RealPSL_v.0} | 0 ...ref => realpsl_v1_0ref-RealPSL_v_ref.0ref} | 0 ...cal_v.5 => reciprocal_v1_5-Reciprocal_v.5} | 0 ...enoffice_org_report_builder_bin.copyright} | 0 ...teula-RedHatEULA => redhateula-RedHatEULA} | 0 ...edhatref-RedHatref => redhatref-RedHatref} | 0 ...-strtol_c.c => regents_complex-strtol_c.c} | 0 ...icense-LICENSE => regents_license-LICENSE} | 0 ...opyright_resig_js-js.js => resig_js-js.js} | 0 ...oh_v1_0-Ricoh_v.0 => ricoh_v1_0-Ricoh_v.0} | 0 .../{copyright_rusty.txt => rusty.txt} | 0 .../{copyright_rusty_c-c.c => rusty_c-c.c} | 0 ...sl_c-s_fabsl_c.c => s_fabsl_c-s_fabsl_c.c} | 0 ...e_java-java.java => sample_java-java.java} | 0 ..._sample_no_copyright-c.c => sample_no-c.c} | 0 .../cluecode/data/copyrights/sample_py-py.py | 9 + ...cense_text_scilab-Scilab => scilab-Scilab} | 0 ...ahorse_plugins-seahorse_plugins.copyright} | 0 ...0-SGI_CID_v.0 => sgi_cid_v1_0-SGI_CID_v.0} | 0 ...0-SGI_GLX_v.0 => sgi_glx_v1_0-SGI_GLX_v.0} | 0 ...pyright => simgear1_0_0-simgear.copyright} | 0 ...refa => sissl_v1_1refa-SISSL_v_refa.1refa} | 0 ...leepycat-Sleepycat => sleepycat-Sleepycat} | 0 ...yright_snippet_no_copyright => snippet_no} | 0 ...nmptrapd_c.c => snmptrapd_c-snmptrapd_c.c} | 0 ...{copyright_some_co-9_h.h => some_co-9_h.h} | 0 ..._cpp.cpp => somefile_cpp-somefile_cpp.cpp} | 0 ...or_projectinfo_java-ProjectInfo_java.java} | 0 ....cpp => stacktrace_cpp-stacktrace_cpp.cpp} | 0 ...ight_stmicro_in_h-h.h => stmicro_in_h-h.h} | 0 ..._stmicro_in_txt.txt => stmicro_in_txt.txt} | 0 ...chr_S.S => strchr_assembly-9_9_strchr_S.S} | 0 ...ight_super_tech_c-c.c => super_tech_c-c.c} | 0 ...ybaseopenwatcom_v1_0-SybaseOpenWatcom_v.0} | 0 ..._copyright.copyright => tcl-tcl.copyright} | 0 .../{copyright_tech_sys.txt => tech_sys.txt} | 0 ...fo_tex.tex => texinfo_tex-texinfo_tex.tex} | 0 ...e_lang_greek-texlive_lang_greek.copyright} | 0 ...ng_spanish-texlive_lang_spanish.copyright} | 0 ..._vietnamese-texlive_lang_vietnamese.label} | 0 .../{copyright_tfc_c-c.c => tfc_c-c.c} | 0 ...yproject_prop-ThirdPartyProject_prop.prop} | 0 ...ing_For-copyright_c.c => trailing_For-c.c} | 0 ...ing_copyleft.txt => trailing_copyleft.txt} | 0 ...yright.txt => trailing_name-copyright.txt} | 0 ....c => trailing_redistribution-bspatch_c.c} | 0 ... => transcode_doc-transcode_doc.copyright} | 0 ...=> transfig_with_parts-transfig.copyright} | 0 ...pter_java-TreeTableModelAdapter_java.java} | 0 ...ated_dmv_c-9_c.c => truncated_dmv_c-9_c.c} | 0 ...ht_truncated_doe-c.c => truncated_doe-c.c} | 0 ...runcated_inria.txt => truncated_inria.txt} | 0 ...runcated_rusty-c.c => truncated_rusty-c.c} | 0 ...=> truncated_swfobject_js-swfobject_js.js} | 0 ...yalam_fonts-ttf_malayalam_fonts.copyright} | 0 ...unnel_h-tunnel_h.h => tunnel_h-tunnel_h.h} | 0 ...digits_c.c => two_digits_years-digits_c.c} | 0 .../{copyright_in_txt.txt => txt.txt} | 0 ...ofu_rfpl-UofU_RFPL => uofu_rfpl-UofU_RFPL} | 0 ...ml.html => url_in_html-detail_9_html.html} | 0 ...ies_js.js => utilities_js-utilities_js.js} | 0 ...ar_route_c.c => var_route_c-var_route_c.c} | 0 ...l => view_layout2_xml-view_layout_xml.xml} | 0 ...D_vsd.vsd => visio_doc-Glitch_ERD_vsd.vsd} | Bin ...v1_0-Vovida_v.0 => vovida_v1_0-Vovida_v.0} | 0 ...ing_empty_text-controlpanel_anjuta.anjuta} | 0 ....dtd => web_app_dtd_b_sun-web_app_dtd.dtd} | 0 ...> web_app_dtd_sun_twice-web_app_b_dtd.dtd} | 0 .../{copyright_wide_c-c.c => wide_c-c.c} | 0 .../{copyright_wide_txt.txt => wide_txt.txt} | 0 ...{copyright_with_apos.txt => with_apos.txt} | 0 ..._with_ascii_art.txt => with_ascii_art.txt} | 0 .../{copyright_with_colon => with_colon} | 0 ...ailing_words.js => with_trailing_words.js} | 0 ...f_c.c => with_verbatim_lf-verbatim_lf_c.c} | 0 ...t_license_text_wtfpl-WTFPL => wtfpl-WTFPL} | 0 ...0 variant => wxWindows Library .0 variant} | 0 ...e_text_x_net-X_Net.Net => x_net-X_Net.Net} | 0 ...tium_sh-9_sh.sh => xconsortium_sh-9_sh.sh} | 0 ...ht => xfonts_utils-xfonts_utils.copyright} | 0 ..._label.label => xresprobe-xresprobe.label} | 0 ...opyright_label.label => xsane-xsane.label} | 0 ...right_license_text_zend-Zend => zend-Zend} | 0 ...e_text_zliback-zLibAck => zliback-zLibAck} | 0 ..._zope_v1_0-Zope_v.0 => zope_v1_0-Zope_v.0} | 0 ..._zope_v2_0-Zope_v.0 => zope_v2_0-Zope_v.0} | 0 tests/cluecode/test_copyrights.py | 1855 ++++++++--------- tests/cluecode/test_copyrights_lines.py | 54 +- 460 files changed, 3149 insertions(+), 1129 deletions(-) rename tests/cluecode/data/{copyrights/copyright_03e16f6c_0-e_f_c.0 => copyright_lines/03e16f6c_0-e_f_c.0} (100%) rename tests/cluecode/data/{copyrights/copyright_3a3b02ce_0-a_b_ce.0 => copyright_lines/3a3b02ce_0-a_b_ce.0} (100%) rename tests/cluecode/data/{copyrights/copyright_ABC_cpp-Case_cpp.cpp => copyright_lines/ABC_cpp-Case_cpp.cpp} (100%) rename tests/cluecode/data/{copyrights/copyright_ABC_file_cpp-File_cpp.cpp => copyright_lines/ABC_file_cpp-File_cpp.cpp} (100%) rename tests/cluecode/data/{copyrights/copyright_abc => copyright_lines/abc} (100%) rename tests/cluecode/data/{copyrights/copyright_abc_loss_of_holder_c-c.c => copyright_lines/abc_loss_of_holder_c-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_abiword_common_copyright-abiword_common_copyright.copyright => copyright_lines/abiword_common.copyright} (100%) rename tests/cluecode/data/{copyrights/copyright_acme_c-c.c => copyright_lines/acme_c-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_activefieldattribute_cs-ActiveFieldAttribute_cs.cs => copyright_lines/activefieldattribute_cs-ActiveFieldAttribute_cs.cs} (100%) rename tests/cluecode/data/{copyrights/copyright_addr_c-addr_c.c => copyright_lines/addr_c-addr_c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_adler_inflate_c-inflate_c.c => copyright_lines/adler_inflate_c-inflate_c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_aleal-c.c => copyright_lines/aleal-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_andre_darcy-c.c => copyright_lines/andre_darcy-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_android_c-c.c => copyright_lines/android_c-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_apache_notice-NOTICE => copyright_lines/apache_notice-NOTICE} (100%) rename tests/cluecode/data/{copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label => copyright_lines/aptitude-aptitude.label} (100%) rename tests/cluecode/data/{copyrights/copyright_atheros_spanning_lines-py.py => copyright_lines/atheros_spanning_lines-py.py} (100%) rename tests/cluecode/data/{copyrights/copyright_att_in_c-9_c.c => copyright_lines/att_in_c-9_c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_audio_c-c.c => copyright_lines/audio_c-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_babkin_txt.txt => copyright_lines/babkin_txt.txt} (100%) rename tests/cluecode/data/{copyrights/copyright_blender_debian-blender_copyright.copyright => copyright_lines/blender_debian-blender.copyright} (100%) create mode 100644 tests/cluecode/data/copyright_lines/company_name_in_java-9_java.java rename tests/cluecode/data/{copyrights/copyright_essential_smoke-ibm_c.c => copyright_lines/essential_smoke-ibm_c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_heunrich_c-c.c => copyright_lines/heunrich_c-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_isc-c.c => copyright_lines/isc-c.c} (100%) rename tests/cluecode/data/{copyrights/copyright_sample_py-py.py => copyright_lines/sample_py-py.py} (100%) create mode 100644 tests/cluecode/data/copyright_lines/vector50.hpp create mode 100644 tests/cluecode/data/copyrights/03e16f6c_0-e_f_c.0 create mode 100644 tests/cluecode/data/copyrights/3a3b02ce_0-a_b_ce.0 create mode 100644 tests/cluecode/data/copyrights/ABC_cpp-Case_cpp.cpp create mode 100644 tests/cluecode/data/copyrights/ABC_file_cpp-File_cpp.cpp rename tests/cluecode/data/copyrights/{copyright_in_COPYING_gpl-COPYING_gpl.gpl => COPYING_gpl-COPYING_gpl.gpl} (100%) rename tests/cluecode/data/copyrights/{copyright_in_COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi => COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi} (100%) rename tests/cluecode/data/copyrights/{copyright_in_README-README => README-README} (100%) rename tests/cluecode/data/copyrights/{copyright_Yocto-SPDX.pdf => Yocto-SPDX.pdf} (100%) create mode 100644 tests/cluecode/data/copyrights/abc create mode 100644 tests/cluecode/data/copyrights/abc_loss_of_holder_c-c.c create mode 100644 tests/cluecode/data/copyrights/abiword_common.copyright create mode 100644 tests/cluecode/data/copyrights/acme_c-c.c create mode 100644 tests/cluecode/data/copyrights/activefieldattribute_cs-ActiveFieldAttribute_cs.cs rename tests/cluecode/data/copyrights/{copyright_license_text_adaptive_v1_0-Adaptive v.0 => adaptive_v1_0-Adaptive v.0} (100%) create mode 100644 tests/cluecode/data/copyrights/addr_c-addr_c.c create mode 100644 tests/cluecode/data/copyrights/adler_inflate_c-inflate_c.c rename tests/cluecode/data/copyrights/{copyright_license_text_adobe-Adobe => adobe-Adobe} (100%) rename tests/cluecode/data/copyrights/{copyright_adobe_flashplugin_copyright_label-adobe_flashplugin_copyright_label.label => adobe_flashplugin-adobe_flashplugin.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_adobeflex2sdk-Adobeflex_sdk => adobeflex2sdk-Adobeflex_sdk} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_afferogplv1-AfferoGPLv => afferogplv1-AfferoGPLv} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_afferogplv2-AfferoGPLv => afferogplv2-AfferoGPLv} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_afferogplv3-AfferoGPLv => afferogplv3-AfferoGPLv} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_afl_v3_0-AFL_v.0 => afl_v3_0-AFL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_aladdin_free_public_license-Aladdin Free Public License => aladdin_free_public_license-Aladdin Free Public License} (100%) create mode 100644 tests/cluecode/data/copyrights/aleal-c.c rename tests/cluecode/data/copyrights/{copyright_license_text_amazondsb-AmazonDSb => amazondsb-AmazonDSb} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ampasbsd-AMPASBSD => ampasbsd-AMPASBSD} (100%) create mode 100644 tests/cluecode/data/copyrights/andre_darcy-c.c rename tests/cluecode/data/copyrights/{copyright_colin_android-bsdiff_c.c => android_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_apache2_debian_trailing_name_missed-apache_copyright_label.label => apache2_debian_trailing_name_missed-apache.label} (100%) rename tests/cluecode/data/copyrights/{copyright_apache_in_html.html => apache_in_html.html} (100%) create mode 100644 tests/cluecode/data/copyrights/apache_notice-NOTICE rename tests/cluecode/data/copyrights/{copyright_license_text_apachev1_0-Apachev.0 => apachev1_0-Apachev.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apachev1_1-Apachev.1 => apachev1_1-Apachev.1} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apachev2_0b-Apachev_b.0b => apachev2_0b-Apachev_b.0b} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apple_common_documentation_license_v1_0-Apple Common Documentation License v.0 => apple_common_documentation_license_v1_0-Apple Common Documentation License v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apple_public_source_license_v1_0-Apple Public Source License v.0 => apple_public_source_license_v1_0-Apple Public Source License v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apple_public_source_license_v1_1-Apple Public Source License v.1 => apple_public_source_license_v1_1-Apple Public Source License v.1} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apple_public_source_license_v1_2-Apple Public Source License v.2 => apple_public_source_license_v1_2-Apple Public Source License v.2} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_apslv2_0-APSLv.0 => apslv2_0-APSLv.0} (100%) create mode 100644 tests/cluecode/data/copyrights/aptitude-aptitude.label rename tests/cluecode/data/copyrights/{copyright_license_text_artistic_v1_0-Artistic v.0 => artistic_v1_0-Artistic v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_artistic_v1_0_short-Artistic v_ short.0 short => artistic_v1_0_short-Artistic v_ short.0 short} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_artistic_v2_0beta4-Artistic v_beta.0beta4 => artistic_v2_0beta4-Artistic v_beta.0beta4} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_artisticv2_0-Artisticv.0 => artisticv2_0-Artisticv.0} (100%) create mode 100644 tests/cluecode/data/copyrights/atheros_spanning_lines-py.py create mode 100644 tests/cluecode/data/copyrights/att_in_c-9_c.c rename tests/cluecode/data/copyrights/{copyright_license_text_attributionassurancelicense-AttributionAssuranceLicense => attributionassurancelicense-AttributionAssuranceLicense} (100%) create mode 100644 tests/cluecode/data/copyrights/audio_c-c.c create mode 100644 tests/cluecode/data/copyrights/babkin_txt.txt rename tests/cluecode/data/copyrights/{copyright_in_bash-shell_sh.sh => bash-shell_sh.sh} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_bigelow_holmes-Bigelow&Holmes => bigelow_holmes-Bigelow&Holmes} (100%) rename tests/cluecode/data/copyrights/{copyright_in_binary_lib-php_embed_lib.lib => binary_lib-php_embed_lib.lib} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_bitstream-Bi_ream => bitstream-Bi_ream} (100%) create mode 100644 tests/cluecode/data/copyrights/blender_debian-blender.copyright rename tests/cluecode/data/copyrights/{copyright_blue_sky_dash_in_name-c.c => blue_sky_dash_in_name-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_bouncy_license-LICENSE => bouncy_license-LICENSE} (100%) rename tests/cluecode/data/copyrights/{copyright_bouncy_notice-9_NOTICE => bouncy_notice-9_NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_bsdnrl-BSDNRL => bsdnrl-BSDNRL} (100%) rename tests/cluecode/data/copyrights/{copyright_btt_plot1_py-btt_plot_py.py => btt_plot1_py-btt_plot_py.py} (100%) rename tests/cluecode/data/copyrights/{copyright_in_c-c.c => c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_in_c_include-h.h => c_include-h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_copyright_camelcase_br_diagnostics_h-br_diagnostics_h.h => camelcase_br_diagnostics_h-br_diagnostics_h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c => camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_ccube_txt.txt => ccube_txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_cedrik_java-java.java => cedrik_java-java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_cern-TestMatrix_D_java.java => cern-TestMatrix_D_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_cern_matrix2d_java-TestMatrix_D_java.java => cern_matrix2d_java-TestMatrix_D_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_chameleon_assembly-9_9_setjmp_S.S => chameleon_assembly-9_9_setjmp_S.S} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_cnri-CNRI => cnri-CNRI} (100%) rename tests/cluecode/data/copyrights/{copyright_co_cust-copyright_java.java => co_cust-java.java} (100%) create mode 100644 tests/cluecode/data/copyrights/colin_android-bsdiff_c.c rename tests/cluecode/data/copyrights/{copyright_company_in_txt-9.txt => company_in_txt-9.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_complex_4_line_statement_in_text-9.txt => complex_4_line_statement_in_text-9.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_complex_notice-NOTICE => complex_notice-NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_complex_notice_sun_microsystems_on_multiple_lines-NOTICE => complex_notice_sun_microsystems_on_multiple_lines-NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_condor_extra_For-Condor => condor_extra_For-Condor} (100%) rename tests/cluecode/data/copyrights/{copyright_config-config_guess.guess => config-config_guess.guess} (100%) rename tests/cluecode/data/copyrights/{copyright_config1_guess-config_guess.guess => config1_guess-config_guess.guess} (100%) delete mode 100644 tests/cluecode/data/copyrights/copyright_license_text_gsoap-gSOAP rename tests/cluecode/data/copyrights/{copyright_coreutils_debian-coreutils_copyright.copyright => coreutils_debian-coreutils.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_dag_c-s_fabsl_c.c => dag_c-s_fabsl_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_dag_elring_notice-NOTICE => dag_elring_notice-NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_dash_in_name-Makefile => dash_in_name-Makefile} (100%) rename tests/cluecode/data/copyrights/{copyright_dasher_copyright_label-dasher_copyright_label.label => dasher-dasher.label} (100%) rename tests/cluecode/data/copyrights/{copyright_date_range_dahua_in_c-c.c => date_range_dahua_in_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_date_range_in_c-c.c => date_range_in_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_date_range_in_c_2-c.c => date_range_in_c_2-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_debian_archive_keyring_copyright-debian_archive_keyring_copyright.copyright => debian_archive_keyring-debian_archive_keyring.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_debian_lib_1-libmono_cairo_cil_copyright_label.label => debian_lib_1-libmono_cairo_cil.label} (100%) rename tests/cluecode/data/copyrights/{copyright_debian_lib_2-libmono_cairo_cil_copyright.copyright => debian_lib_2-libmono_cairo_cil.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_debian_lib_3-libmono_security_cil_copyright.copyright => debian_lib_3-libmono_security_cil.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_debian_multi_names_on_one_line-libgdata__copyright.copyright => debian_multi_names_on_one_line-libgdata.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_dionysos_c-c.c => dionysos_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_disclaimed-c.c => disclaimed-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_djvulibre_desktop_copyright-djvulibre_desktop_copyright.copyright => djvulibre_desktop-djvulibre_desktop.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_in_dll-9_msvci_dll.dll => dll-9_msvci_dll.dll} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_doc-DOC => doc-DOC} (100%) rename tests/cluecode/data/copyrights/{copyright_docbook_xsl_doc_html_copyright-docbook_xsl_doc_html_copyright.copyright => docbook_xsl_doc_html-docbook_xsl_doc_html.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_drand48_c-drand_c.c => drand48_c-drand_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_dual_mpl_gpl-Dual MPL GPL => dual_mpl_gpl-Dual MPL GPL} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_dualmpl_mit-DualMPL_MIT => dualmpl_mit-DualMPL_MIT} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_eclv1_0-ECLv.0 => eclv1_0-ECLv.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ecosv2_0-eCosv.0 => ecosv2_0-eCosv.0} (100%) rename tests/cluecode/data/copyrights/{copyright_ed_copyright-ed_copyright.copyright => ed-ed.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_entessa-Entessa => entessa-Entessa} (100%) rename tests/cluecode/data/copyrights/{copyright_epiphany_browser_data_copyright_label-epiphany_browser_data_copyright_label.label => epiphany_browser_data-epiphany_browser_data.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_eplv1_0b-EPLv_b.0b => eplv1_0b-EPLv_b.0b} (100%) rename tests/cluecode/data/copyrights/{copyright_eric_young_c-c.c => eric_young_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_errno_atheros-c.c => errno_atheros-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_errno_atheros_ah_h-ah_h.h => errno_atheros_ah_h-ah_h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_errno_c-c.c => errno_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_esmertec_java-java.java => esmertec_java-java.java} (100%) create mode 100644 tests/cluecode/data/copyrights/essential_smoke-ibm_c.c rename tests/cluecode/data/copyrights/{copyright_license_text_eudatagrid-EUDatagrid => eudatagrid-EUDatagrid} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_eurosym_v2-Eurosym_v.v2 => eurosym_v2-Eurosym_v.v2} (100%) rename tests/cluecode/data/copyrights/{copyright_expat_h-expat_h.h => expat_h-expat_h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_ext_all_js-ext_all_js.js => ext_all_js-ext_all_js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_extjs_c-c.c => extjs_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_false_positive_in_c-false_positives_c.c => false_positive_in_c-false_positives_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_false_positive_in_js-editor_beta_de_js.js => false_positive_in_js-editor_beta_de_js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_false_positive_in_license-LICENSE => false_positive_in_license-LICENSE} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_frameworxv1_0-Frameworxv.0 => frameworxv1_0-Frameworxv.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_freebsd-FreeBSD => freebsd-FreeBSD} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_freetype-FreeType => freetype-FreeType} (100%) rename tests/cluecode/data/copyrights/{copyright_fsf_py-999_py.py => fsf_py-999_py.py} (100%) rename tests/cluecode/data/copyrights/{copyright_gailly-c.c => gailly-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_geoff_js-js.js => geoff_js-js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gfdlv1_2-GFDLv.2 => gfdlv1_2-GFDLv.2} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gfdlv1_3-GFDLv.3 => gfdlv1_3-GFDLv.3} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_glide-Glide => glide-Glide} (100%) rename tests/cluecode/data/copyrights/{copyright_gnome_session_copyright-gnome_session_copyright.copyright => gnome_session-gnome_session.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_gnome_system_monitor_copyright-gnome_system_monitor_copyright.copyright => gnome_system_monitor-gnome_system_monitor.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_gnome_system_monitor_copyright_label-gnome_system_monitor_copyright_label.label => gnome_system_monitor-gnome_system_monitor.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gnuplot-gnuplot => gnuplot-gnuplot} (100%) rename tests/cluecode/data/copyrights/{copyright_gobjc_4_3_copyright-gobjc__copyright.copyright => gobjc_4_3-gobjc.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_google_closure_templates_java_html-html.html => google_closure_templates_java_html-html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_google_view_layout1_xml-view_layout_xml.xml => google_view_layout1_xml-view_layout_xml.xml} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gpl_v1-GPL_v => gpl_v1-GPL_v} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gpl_v2-GPL_v => gpl_v2-GPL_v} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_gpl_v3-GPL_v => gpl_v3-GPL_v} (100%) rename tests/cluecode/data/copyrights/{copyright_group-c.c => group-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_gsoap-gSOAP => gsoap-gSOAP} (100%) rename tests/cluecode/data/copyrights/{copyright_gstreamer0_fluendo_mp3_copyright-gstreamer__fluendo_mp_copyright.copyright => gstreamer0_fluendo_mp3-gstreamer_fluendo_mp.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_in_h-h.h => h-h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_hall-copyright.txt => hall-copyright.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_hans_jurgen_htm-9_html.html => hans_jurgen_htm-9_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_hansen_cs-cs.cs => hansen_cs-cs.cs} (100%) rename tests/cluecode/data/copyrights/{copyright_hciattach_qualcomm1_c-hciattach_qualcomm_c.c => hciattach_qualcomm1_c-hciattach_qualcomm_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_helix-Helix => helix-Helix} (100%) create mode 100644 tests/cluecode/data/copyrights/heunrich_c-c.c rename tests/cluecode/data/copyrights/{copyright_license_text_hewlett_packard-Hewlett_Packard => hewlett_packard-Hewlett_Packard} (100%) rename tests/cluecode/data/copyrights/{copyright_hibernate_copyright_label-hibernate_copyright_label.label => hibernate-hibernate.label} (100%) rename tests/cluecode/data/copyrights/{copyright_holtmann-hciattach_qualcomm_c.c => holtmann-hciattach_qualcomm_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_hostapd_cli_c-hostapd_cli_c.c => hostapd_cli_c-hostapd_cli_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_hostapd_trailing_available.c => hostapd_trailing_available.c} (100%) rename tests/cluecode/data/copyrights/{copyright_hp_notice-NOTICE => hp_notice-NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_hpijs_ppds_copyright_label-hpijs_ppds_copyright_label.label => hpijs_ppds-hpijs_ppds.label} (100%) rename tests/cluecode/data/copyrights/{copyright_in_html.html => html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_in_html_comments-html.html => html_comments-html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_in_html_incorrect-detail_9_html.html => html_incorrect-detail_9_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_ibm_c-ibm_c.c => ibm_c-ibm_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ibmpl_v1_0-IBMPL_v.0 => ibmpl_v1_0-IBMPL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_icedax_copyright_label-icedax_copyright_label.label => icedax-icedax.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ietf-IETF => ietf-IETF} (100%) rename tests/cluecode/data/copyrights/{copyright_ifrename_c-ifrename_c.c => ifrename_c-ifrename_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ijg-IJG => ijg-IJG} (100%) rename tests/cluecode/data/copyrights/{copyright_illinois_html-9_html.html => illinois_html-9_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_imatix-iMatix => imatix-iMatix} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_imlib2-Imlib => imlib2-Imlib} (100%) rename tests/cluecode/data/copyrights/{copyright_inria_loss_of_holder_c-c.c => inria_loss_of_holder_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_intel-Intel => intel-Intel} (100%) create mode 100644 tests/cluecode/data/copyrights/isc-c.c rename tests/cluecode/data/copyrights/{copyright_license_text_jabber-Jabber => jabber-Jabber} (100%) rename tests/cluecode/data/copyrights/{copyright_java-java.java => java-java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_jdoe-copyright_c.c => jdoe-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_jpython-JPython => jpython-JPython} (100%) rename tests/cluecode/data/copyrights/{copyright_json_in_phps-JSON_phps.phps => json_in_phps-JSON_phps.phps} (100%) rename tests/cluecode/data/copyrights/{copyright_json_in_phps_incorrect-JSON_phps.phps => json_in_phps_incorrect-JSON_phps.phps} (100%) rename tests/cluecode/data/copyrights/{copyright_json_phps_html-JSON_phps_html.html => json_phps_html-JSON_phps_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_json_phps_html_incorrect-JSON_phps_html.html => json_phps_html_incorrect-JSON_phps_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_jsp_all_CAPS-jsp.jsp => jsp_all_CAPS-jsp.jsp} (100%) rename tests/cluecode/data/copyrights/{copyright_kaboom_copyright-kaboom_copyright.copyright => kaboom-kaboom.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_kbuild_copyright-kbuild_copyright.copyright => kbuild-kbuild.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_kde_l10n_zhcn_copyright-kde_l_n_zhcn_copyright.copyright => kde_l10n_zhcn-kde_l_n_zhcn.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_larryrosen-LarryRosen => larryrosen-LarryRosen} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_0-LaTeX_v.0 => latex_v1_0-LaTeX_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_1-LaTeX_v.1 => latex_v1_1-LaTeX_v.1} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_2-LaTeX_v.2 => latex_v1_2-LaTeX_v.2} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_3a-LaTeX_v_a.3a => latex_v1_3a-LaTeX_v_a.3a} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_3a_ref-LaTeX_v_a_ref.3a_ref => latex_v1_3a_ref-LaTeX_v_a_ref.3a_ref} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_latex_v1_3c-LaTeX_v_c.3c => latex_v1_3c-LaTeX_v_c.3c} (100%) rename tests/cluecode/data/copyrights/{copyright_leonardo_c-c.c => leonardo_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_lgpl_v2_0-LGPL_v.0 => lgpl_v2_0-LGPL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_lgpl_v2_1-LGPL_v.1 => lgpl_v2_1-LGPL_v.1} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_lgpl_v3-LGPL_v => lgpl_v3-LGPL_v} (100%) rename tests/cluecode/data/copyrights/{copyright_libadns1_copyright-libadns_copyright.copyright => libadns1-libadns.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libc6_i686_copyright-libc_i_copyright.copyright => libc6_i686-libc_i.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libcdio10_copyright_label-libcdio_copyright_label.label => libcdio10-libcdio.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libcelt0_copyright-libcelt_copyright.copyright => libcelt0-libcelt.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libcompress_raw_zlib_perl_copyright-libcompress_raw_zlib_perl_copyright.copyright => libcompress_raw_zlib_perl-libcompress_raw_zlib_perl.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libcpufreq0_copyright-libcpufreq_copyright.copyright => libcpufreq0-libcpufreq.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libcrypt_ssleay_perl_copyright-libcrypt_ssleay_perl_copyright.copyright => libcrypt_ssleay_perl-libcrypt_ssleay_perl.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libepc_ui_1_0_1_copyright-libepc_ui__copyright.copyright => libepc_ui_1_0_1-libepc_ui.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libepc_ui_1_0_2_copyright_label-libepc_ui__copyright_label.label => libepc_ui_1_0_2-libepc_ui.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libfltk1_1_copyright-libfltk_copyright.copyright => libfltk1_1-libfltk.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libgail18_copyright_label-libgail_copyright_label.label => libgail18-libgail.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libggiwmh0_target_x_copyright-libggiwmh_target_x_copyright.copyright => libggiwmh0_target_x-libggiwmh_target_x.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libgnome_desktop_2_copyright-libgnome_desktop__copyright.copyright => libgnome_desktop_2-libgnome_desktop.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libgnome_media0_copyright-libgnome_media_copyright.copyright => libgnome_media0-libgnome_media.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libgoffice_0_8_copyright_label-libgoffice__copyright_label.label => libgoffice_0_8-libgoffice.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libgtkhtml2_0_copyright-libgtkhtml_copyright.copyright => libgtkhtml2_0-libgtkhtml.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libisc44_copyright-libisc_copyright.copyright => libisc44-libisc.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libisccfg30_copyright-libisccfg_copyright.copyright => libisccfg30-libisccfg.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libisccfg40_copyright-libisccfg_copyright.copyright => libisccfg40-libisccfg.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libjpeg62_copyright-libjpeg_copyright.copyright => libjpeg62-libjpeg.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libkeyutils1_copyright_label-libkeyutils_copyright_label.label => libkeyutils1-libkeyutils.label} (100%) rename tests/cluecode/data/copyrights/{copyright_liblocale_gettext_perl_copyright_label-liblocale_get_perl_copyright_label.label => liblocale_gettext_perl-liblocale_get_perl.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libopenraw1_copyright_label-libopenraw_copyright_label.label => libopenraw1-libopenraw.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libopenthreads12_copyright-libopenthreads_copyright.copyright => libopenthreads12-libopenthreads.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libpam_ck_connector_copyright-libpam_ck_connector_copyright.copyright => libpam_ck_connector-libpam_ck_connector.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libpoppler3_copyright-libpoppler_copyright.copyright => libpoppler3-libpoppler.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libqt4_scripttools_copyright-libqt_scripttools_copyright.copyright => libqt4_scripttools-libqt_scripttools.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libqtscript4_gui_copyright-libqtscript_gui_copyright.copyright => libqtscript4_gui-libqtscript_gui.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libsocks4_copyright-libsocks_copyright.copyright => libsocks4-libsocks.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libsox_fmt_alsa_copyright-libsox_fmt_alsa_copyright.copyright => libsox_fmt_alsa-libsox_fmt_alsa.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libspeex1_copyright-libspeex_copyright.copyright => libspeex1-libspeex.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libstlport4_6ldbl_copyright_label-libstlport_ldbl_copyright_label.label => libstlport4_6ldbl-libstlport_ldbl.label} (100%) rename tests/cluecode/data/copyrights/{copyright_libtdb1_copyright-libtdb_copyright.copyright => libtdb1-libtdb.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libuim6_copyright-libuim_copyright.copyright => libuim6-libuim.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libxext6_copyright-libxext_copyright.copyright => libxext6-libxext.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libxmlrpc_c3_copyright-libxmlrpc_c_copyright.copyright => libxmlrpc_c3-libxmlrpc_c.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_libxt6_copyright_label-libxt_copyright_label.label => libxt6-libxt.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_qpl_v1_0_perfect-QPL_v.0 => license_qpl_v1_0_perfect-QPL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_linux_source_2_6_copyright-linux_source__copyright.copyright => linux_source_2_6-linux_source.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_logica_v1_0-Logica_v.0 => logica_v1_0-Logica_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_loss_of_holder_c-c.c => loss_of_holder_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_luxi_fonts-Luxi_fonts => luxi_fonts-Luxi_fonts} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_maia-Maia => maia-Maia} (100%) rename tests/cluecode/data/copyrights/{copyright_matroska_demux1_c-matroska_demux_c.c => matroska_demux1_c-matroska_demux_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_matroska_demux_c-matroska_demux_c.c => matroska_demux_c-matroska_demux_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_matroska_demux_muller_c-matroska_demux_c.c => matroska_demux_muller_c-matroska_demux_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_in_maven_pom_xstream-pom_xml.xml => maven_pom_xstream-pom_xml.xml} (100%) rename tests/cluecode/data/copyrights/{copyright_in_media-a_png.png => media-a_png.png} (100%) rename tests/cluecode/data/copyrights/{copyright_memcmp_assembly-9_9_memcmp_S.S => memcmp_assembly-9_9_memcmp_S.S} (100%) rename tests/cluecode/data/copyrights/{copyright_mergesort_java-MergeSort_java.java => mergesort_java-MergeSort_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_in_phps-phps.phps => michal_txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_mips1_be_elf_hal_o_uu-mips_be_elf_hal_o_uu.uu => mips1_be_elf_hal_o_uu-mips_be_elf_hal_o_uu.uu} (100%) rename tests/cluecode/data/copyrights/{copyright_missing_statement_file_txt-file.txt => missing_statement_file_txt-file.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_mit.txt => mit.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_adobeglyph-MIT_AdobeGlyph => mit_adobeglyph-MIT_AdobeGlyph} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_cmu-MIT_CMU => mit_cmu-MIT_CMU} (100%) rename tests/cluecode/data/copyrights/{copyright_mit_danse-MIT_Danse => mit_danse-MIT_Danse} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_danse-MIT_danse => mit_danse-MIT_danse} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_enna-MIT_enna => mit_enna-MIT_enna} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_hylafax-MIT_hylafax => mit_hylafax-MIT_hylafax} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_icu-MIT_ICU => mit_icu-MIT_ICU} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_lucent-MIT_Lucent => mit_lucent-MIT_Lucent} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_mlton-MIT_MLton => mit_mlton-MIT_MLton} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_oldstyle_disclaimer4-MIT_OldStyle_disclaimer => mit_oldstyle_disclaimer4-MIT_OldStyle_disclaimer} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_unicode-MIT_unicode => mit_unicode-MIT_unicode} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mit_wordnet-MIT_WordNet => mit_wordnet-MIT_WordNet} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mitre-MITRE => mitre-MITRE} (100%) rename tests/cluecode/data/copyrights/{copyright_mixedcaps_c-mixedcaps_c.c => mixedcaps_c-mixedcaps_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_mixedcase_company_name_in_c-lowercase_company_c.c => mixedcase_company_name_in_c-lowercase_company_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_mkisofs_copyright-mkisofs_copyright.copyright => mkisofs-mkisofs.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_moto_broad-c.c => moto_broad-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_motorola_c-c.c => motorola_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_motorola_mobility_c-c.c => motorola_mobility_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_mplayer_skin_blue_copyright-mplayer_skin_blue_copyright.copyright => mplayer_skin_blue-mplayer_skin_blue.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ms_pl-Ms_PL => ms_pl-Ms_PL} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ms_rl-Ms_RL => ms_rl-Ms_RL} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ms_rsl-Ms_RSL => ms_rsl-Ms_RSL} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_msntp-MSNTP => msntp-MSNTP} (100%) rename tests/cluecode/data/copyrights/{copyright_muller-c.c => muller-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_multiline-Historical.txt => multiline-Historical.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_multiline_george-Historical.txt => multiline_george-Historical.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_mycorp_c-c.c => mycorp_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_mysql_gplexception-MySQL_gplexception => mysql_gplexception-MySQL_gplexception} (100%) rename tests/cluecode/data/copyrights/{copyright_name_before_copyright_c-c.c => name_before_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_name_sign_year_correct-c.c => name_sign_year_correct-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_naumen-Naumen => naumen-Naumen} (100%) rename tests/cluecode/data/copyrights/{copyright_naumen_txt.txt => naumen_txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_ncurses_bin_copyright-ncurses_bin_copyright.copyright => ncurses_bin-ncurses_bin.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_nederlof.txt => nederlof.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_netcomponents-NetComponents => netcomponents-NetComponents} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_nethack-Nethack => nethack-Nethack} (100%) rename tests/cluecode/data/copyrights/{copyright_nnp_and_co.txt => nnp_and_co.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_no_copyright_in_c-c.c => no_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_no_copyright_in_class_file_1-PersistentArrayHolder_class.class => no_class_file_1-PersistentArrayHolder_class.class} (100%) rename tests/cluecode/data/copyrights/{copyright_no_copyright_in_class_file_2-PersistentElementHolder_class.class => no_class_file_2-PersistentElementHolder_class.class} (100%) rename tests/cluecode/data/copyrights/{copyright_no_copyright_in_class_file_3-PersistentIndexedElementHolder_class.class => no_class_file_3-PersistentIndexedElementHolder_class.class} (100%) rename tests/cluecode/data/copyrights/{copyright_no_copyright_in_class_file_4-PersistentListElementHolder_class.class => no_class_file_4-PersistentListElementHolder_class.class} (100%) rename tests/cluecode/data/copyrights/{copyright_no_holder_java-java.java => no_holder_java-java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_nokia-Nokia => nokia-Nokia} (100%) rename tests/cluecode/data/copyrights/{copyright_nokia_cpp-cpp.cpp => nokia_cpp-cpp.cpp} (100%) rename tests/cluecode/data/copyrights/{copyright_north_c-99_c.c => north_c-99_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_notice2-9_NOTICE => notice2-9_NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_notice2_txt-NOTICE.txt => notice2_txt-NOTICE.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_notice_name_before_statement-NOTICE => notice_name_before_statement-NOTICE} (100%) rename tests/cluecode/data/copyrights/{copyright_notice_txt-NOTICE.txt => notice_txt-NOTICE.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_npl_v1_0-NPL_v.0 => npl_v1_0-NPL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_nvidia_source-Nvidia_source => nvidia_source-Nvidia_source} (100%) rename tests/cluecode/data/copyrights/{copyright_o_brien_style_name.txt => o_brien_style_name.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_oberhummer_c_code-c.c => oberhummer_c_code-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_oberhummer_text.txt => oberhummer_text.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_objectivec-objectiveC_m.m => objectivec-objectiveC_m.m} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_oclc_v1_0-OCLC_v.0 => oclc_v1_0-OCLC_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_oclc_v2_0-OCLC_v.0 => oclc_v2_0-OCLC_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_openhackware_copyright_label-openhackware_copyright_label.label => openhackware-openhackware.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_openldap-OpenLDAP => openldap-OpenLDAP} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_openmotif-OpenMotif => openmotif-OpenMotif} (100%) rename tests/cluecode/data/copyrights/{openoffice_org_report_builder_bin_copyright.copyright => openoffice_org_report_builder_bin.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_openoffice_org_report_builder_bin_copyright2-openoffice_org_report_builder_bin_copyright.copyright2 => openoffice_org_report_builder_bin_2-openoffice_org_report_builder_bin.copyright2} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_openpbs-OpenPBS => openpbs-OpenPBS} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_openpublicationref-OpenPublicationref => openpublicationref-OpenPublicationref} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_openssl-OpenSSL => openssl-OpenSSL} (100%) rename tests/cluecode/data/copyrights/{copyright_openssl-c.c => openssl-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_osl_v3_0-OSL_v.0 => osl_v3_0-OSL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_partial_detection.txt => partial_detection.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_partial_detection_mit.txt => partial_detection_mit.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_perl_base_copyright-perl_base_copyright.copyright => perl_base-perl_base.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_perl_module-pm.pm => perl_module-pm.pm} (100%) rename tests/cluecode/data/copyrights/{copyright_peter_c-c.c => peter_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_phorum-Phorum => phorum-Phorum} (100%) rename tests/cluecode/data/copyrights/{copyright_michal_txt.txt => phps-phps.phps} (100%) rename tests/cluecode/data/copyrights/{copyright_piersol-TestMatrix_D_java.java => piersol-TestMatrix_D_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_pine-Pine => pine-Pine} (100%) rename tests/cluecode/data/copyrights/{copyright_pixelstream.rgb => pixelstream.rgb} (100%) rename tests/cluecode/data/copyrights/{copyright_in_postcript-9__ps.ps => postcript-9_ps.ps} (100%) rename tests/cluecode/data/copyrights/{copyright_postgresql_8_3_copyright_label-postgresql__copyright_label.label => postgresql_8_3-postgresql.label} (100%) rename tests/cluecode/data/copyrights/{copyright_prof_informatics.txt => prof_informatics.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_professional_txt-copyright.txt => professional_txt-copyright.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_properties-properties.properties => properties-properties.properties} (100%) rename tests/cluecode/data/copyrights/{copyright_psf_in_python-BitVector_py.py => psf_in_python-BitVector_py.py} (100%) rename tests/cluecode/data/copyrights/{copyright_python_dateutil_copyright-python_dateutil_copyright.copyright => python_dateutil-python_dateutil.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_python_psyco_copyright-python_psyco_copyright.copyright => python_psyco-python_psyco.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_python_reportbug_copyright_label-python_report_copyright_label.label => python_reportbug-python_report.label} (100%) rename tests/cluecode/data/copyrights/{copyright_python_software_properties_copyright-python_software_properties_copyright.copyright => python_software_properties-python_software_properties.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_python_v1_6-Python_v.6 => python_v1_6-Python_v.6} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_python_v1_6_1-Python_v.1 => python_v1_6_1-Python_v.1} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_python_v2-Python_v => python_v2-Python_v} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_qpl_v1_0-QPL_v.0 => qpl_v1_0-QPL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_realcsl_v2_0-RealCSL_v.0 => realcsl_v2_0-RealCSL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_realpsl_v1_0-RealPSL_v.0 => realpsl_v1_0-RealPSL_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_realpsl_v1_0ref-RealPSL_v_ref.0ref => realpsl_v1_0ref-RealPSL_v_ref.0ref} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_reciprocal_v1_5-Reciprocal_v.5 => reciprocal_v1_5-Reciprocal_v.5} (100%) rename tests/cluecode/data/copyrights/{copyright_red_hat_openoffice_org_report_builder_bin_copyright-openoffice_org_report_builder_bin_copyright.copyright => red_hat_openoffice_org_report_builder_bin-openoffice_org_report_builder_bin.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_redhateula-RedHatEULA => redhateula-RedHatEULA} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_redhatref-RedHatref => redhatref-RedHatref} (100%) rename tests/cluecode/data/copyrights/{copyright_regents_complex-strtol_c.c => regents_complex-strtol_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_regents_license-LICENSE => regents_license-LICENSE} (100%) rename tests/cluecode/data/copyrights/{copyright_resig_js-js.js => resig_js-js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_ricoh_v1_0-Ricoh_v.0 => ricoh_v1_0-Ricoh_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_rusty.txt => rusty.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_rusty_c-c.c => rusty_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_s_fabsl_c-s_fabsl_c.c => s_fabsl_c-s_fabsl_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_sample_java-java.java => sample_java-java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_sample_no_copyright-c.c => sample_no-c.c} (100%) create mode 100644 tests/cluecode/data/copyrights/sample_py-py.py rename tests/cluecode/data/copyrights/{copyright_license_text_scilab-Scilab => scilab-Scilab} (100%) rename tests/cluecode/data/copyrights/{copyright_seahorse_plugins-seahorse_plugins_copyright.copyright => seahorse_plugins-seahorse_plugins.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_sgi_cid_v1_0-SGI_CID_v.0 => sgi_cid_v1_0-SGI_CID_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_sgi_glx_v1_0-SGI_GLX_v.0 => sgi_glx_v1_0-SGI_GLX_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_simgear1_0_0_copyright-simgear__copyright.copyright => simgear1_0_0-simgear.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_sissl_v1_1refa-SISSL_v_refa.1refa => sissl_v1_1refa-SISSL_v_refa.1refa} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_sleepycat-Sleepycat => sleepycat-Sleepycat} (100%) rename tests/cluecode/data/copyrights/{copyright_snippet_no_copyright => snippet_no} (100%) rename tests/cluecode/data/copyrights/{copyright_snmptrapd_c-snmptrapd_c.c => snmptrapd_c-snmptrapd_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_some_co-9_h.h => some_co-9_h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_somefile_cpp-somefile_cpp.cpp => somefile_cpp-somefile_cpp.cpp} (100%) rename tests/cluecode/data/copyrights/{copyright_source_auditor_projectinfo_java-ProjectInfo_java.java => source_auditor_projectinfo_java-ProjectInfo_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_stacktrace_cpp-stacktrace_cpp.cpp => stacktrace_cpp-stacktrace_cpp.cpp} (100%) rename tests/cluecode/data/copyrights/{copyright_stmicro_in_h-h.h => stmicro_in_h-h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_stmicro_in_txt.txt => stmicro_in_txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_strchr_assembly-9_9_strchr_S.S => strchr_assembly-9_9_strchr_S.S} (100%) rename tests/cluecode/data/copyrights/{copyright_super_tech_c-c.c => super_tech_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_sybaseopenwatcom_v1_0-SybaseOpenWatcom_v.0 => sybaseopenwatcom_v1_0-SybaseOpenWatcom_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_tcl_copyright-tcl_copyright.copyright => tcl-tcl.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_tech_sys.txt => tech_sys.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_texinfo_tex-texinfo_tex.tex => texinfo_tex-texinfo_tex.tex} (100%) rename tests/cluecode/data/copyrights/{copyright_texlive_lang_greek_copyright-texlive_lang_greek_copyright.copyright => texlive_lang_greek-texlive_lang_greek.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_texlive_lang_spanish_copyright-texlive_lang_spanish_copyright.copyright => texlive_lang_spanish-texlive_lang_spanish.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_texlive_lang_vietnamese_copyright_label-texlive_lang_vietnamese_copyright_label.label => texlive_lang_vietnamese-texlive_lang_vietnamese.label} (100%) rename tests/cluecode/data/copyrights/{copyright_tfc_c-c.c => tfc_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_thirdpartyproject_prop-ThirdPartyProject_prop.prop => thirdpartyproject_prop-ThirdPartyProject_prop.prop} (100%) rename tests/cluecode/data/copyrights/{copyright_trailing_For-copyright_c.c => trailing_For-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_trailing_copyleft.txt => trailing_copyleft.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_trailing_name-copyright.txt => trailing_name-copyright.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_trailing_redistribution-bspatch_c.c => trailing_redistribution-bspatch_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_transcode_doc_copyright-transcode_doc_copyright.copyright => transcode_doc-transcode_doc.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_transfig_copyright_with_parts-transfig_copyright.copyright => transfig_with_parts-transfig.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_treetablemodeladapter_java-TreeTableModelAdapter_java.java => treetablemodeladapter_java-TreeTableModelAdapter_java.java} (100%) rename tests/cluecode/data/copyrights/{copyright_truncated_dmv_c-9_c.c => truncated_dmv_c-9_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_truncated_doe-c.c => truncated_doe-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_truncated_inria.txt => truncated_inria.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_truncated_rusty-c.c => truncated_rusty-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_truncated_swfobject_js-swfobject_js.js => truncated_swfobject_js-swfobject_js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_ttf_malayalam_fonts_copyright-ttf_malayalam_fonts_copyright.copyright => ttf_malayalam_fonts-ttf_malayalam_fonts.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_tunnel_h-tunnel_h.h => tunnel_h-tunnel_h.h} (100%) rename tests/cluecode/data/copyrights/{copyright_two_digits_years-digits_c.c => two_digits_years-digits_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_in_txt.txt => txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_uofu_rfpl-UofU_RFPL => uofu_rfpl-UofU_RFPL} (100%) rename tests/cluecode/data/copyrights/{copyright_url_in_html-detail_9_html.html => url_in_html-detail_9_html.html} (100%) rename tests/cluecode/data/copyrights/{copyright_utilities_js-utilities_js.js => utilities_js-utilities_js.js} (100%) rename tests/cluecode/data/copyrights/{copyright_var_route_c-var_route_c.c => var_route_c-var_route_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_view_layout2_xml-view_layout_xml.xml => view_layout2_xml-view_layout_xml.xml} (100%) rename tests/cluecode/data/copyrights/{copyright_in_visio_doc-Glitch_ERD_vsd.vsd => visio_doc-Glitch_ERD_vsd.vsd} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_vovida_v1_0-Vovida_v.0 => vovida_v1_0-Vovida_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_warning_parsing_empty_text-controlpanel_anjuta.anjuta => warning_parsing_empty_text-controlpanel_anjuta.anjuta} (100%) rename tests/cluecode/data/copyrights/{copyright_web_app_dtd_b_sun-web_app__dtd.dtd => web_app_dtd_b_sun-web_app_dtd.dtd} (100%) rename tests/cluecode/data/copyrights/{copyright_web_app_dtd_sun_twice-web_app__b_dtd.dtd => web_app_dtd_sun_twice-web_app_b_dtd.dtd} (100%) rename tests/cluecode/data/copyrights/{copyright_wide_c-c.c => wide_c-c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_wide_txt.txt => wide_txt.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_with_apos.txt => with_apos.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_with_ascii_art.txt => with_ascii_art.txt} (100%) rename tests/cluecode/data/copyrights/{copyright_with_colon => with_colon} (100%) rename tests/cluecode/data/copyrights/{copyright_with_trailing_words.js => with_trailing_words.js} (100%) rename tests/cluecode/data/copyrights/{copyright_with_verbatim_lf-verbatim_lf_c.c => with_verbatim_lf-verbatim_lf_c.c} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_wtfpl-WTFPL => wtfpl-WTFPL} (100%) rename tests/cluecode/data/copyrights/{copyright_wxWindows Library .0 variant => wxWindows Library .0 variant} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_x_net-X_Net.Net => x_net-X_Net.Net} (100%) rename tests/cluecode/data/copyrights/{copyright_xconsortium_sh-9_sh.sh => xconsortium_sh-9_sh.sh} (100%) rename tests/cluecode/data/copyrights/{copyright_xfonts_utils_copyright-xfonts_utils_copyright.copyright => xfonts_utils-xfonts_utils.copyright} (100%) rename tests/cluecode/data/copyrights/{copyright_xresprobe_copyright_label-xresprobe_copyright_label.label => xresprobe-xresprobe.label} (100%) rename tests/cluecode/data/copyrights/{copyright_xsane_copyright_label-xsane_copyright_label.label => xsane-xsane.label} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_zend-Zend => zend-Zend} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_zliback-zLibAck => zliback-zLibAck} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_zope_v1_0-Zope_v.0 => zope_v1_0-Zope_v.0} (100%) rename tests/cluecode/data/copyrights/{copyright_license_text_zope_v2_0-Zope_v.0 => zope_v2_0-Zope_v.0} (100%) diff --git a/tests/cluecode/cluecode_assert_utils.py b/tests/cluecode/cluecode_assert_utils.py index 2030a185cf7..a85955dc3ba 100644 --- a/tests/cluecode/cluecode_assert_utils.py +++ b/tests/cluecode/cluecode_assert_utils.py @@ -22,27 +22,32 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals import cluecode.copyrights -def check_detection(expected, test_file, +def check_detection(expected, test_file_or_iterable, expected_in_results=True, results_in_expected=True, what='copyrights'): """ - Run detection of copyright on the test_file, checking the results - match the expected list of values. + Run detection of copyright on the `test_file_or_iterable`, checking the + results match the expected list of values. - If expected_in_results and results_in_expected are True (the default), - then expected and test results are tested for equality. To accommodate - for some level of approximate testing, the check can test only if an - expected result in a test result, or the opposite. If - expected_in_results and results_in_expected are both False an + `test_file_or_iterable` is either a path string or an iterable of text lines. + + If `expected_in_results` and `results_in_expected` are True (the default), + then expected and test results are tested for equality. To accommodate for + some level of approximate testing, the check can test only if an expected + result in a test result, or the opposite. + + If `expected_in_results` and `results_in_expected` are both False an exception is raised as this is not a case that make sense. """ - copyrights, authors, years, holders = cluecode.copyrights.detect(test_file) + copyrights, authors, years, holders = cluecode.copyrights.detect(test_file_or_iterable) results = { 'copyrights': copyrights, 'authors': authors, @@ -60,10 +65,10 @@ def check_detection(expected, test_file, elif expected_in_results: for i, expect in enumerate(expected): - msg = repr(expect) + ' not in ' + repr(result[i]) + ' for test file:' + test_file + msg = repr(expect) + ' not in ' + repr(result[i]) + ' for test file:' + test_file_or_iterable assert expect in result[i], msg elif results_in_expected: for i, res in enumerate(result): - msg = repr(expected[i]) + ' does not contain ' + repr(res) + ' for test file:' + test_file + msg = repr(expected[i]) + ' does not contain ' + repr(res) + ' for test file:' + test_file_or_iterable assert res in expected[i], msg diff --git a/tests/cluecode/data/copyrights/copyright_03e16f6c_0-e_f_c.0 b/tests/cluecode/data/copyright_lines/03e16f6c_0-e_f_c.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_03e16f6c_0-e_f_c.0 rename to tests/cluecode/data/copyright_lines/03e16f6c_0-e_f_c.0 diff --git a/tests/cluecode/data/copyrights/copyright_3a3b02ce_0-a_b_ce.0 b/tests/cluecode/data/copyright_lines/3a3b02ce_0-a_b_ce.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_3a3b02ce_0-a_b_ce.0 rename to tests/cluecode/data/copyright_lines/3a3b02ce_0-a_b_ce.0 diff --git a/tests/cluecode/data/copyrights/copyright_ABC_cpp-Case_cpp.cpp b/tests/cluecode/data/copyright_lines/ABC_cpp-Case_cpp.cpp similarity index 100% rename from tests/cluecode/data/copyrights/copyright_ABC_cpp-Case_cpp.cpp rename to tests/cluecode/data/copyright_lines/ABC_cpp-Case_cpp.cpp diff --git a/tests/cluecode/data/copyrights/copyright_ABC_file_cpp-File_cpp.cpp b/tests/cluecode/data/copyright_lines/ABC_file_cpp-File_cpp.cpp similarity index 100% rename from tests/cluecode/data/copyrights/copyright_ABC_file_cpp-File_cpp.cpp rename to tests/cluecode/data/copyright_lines/ABC_file_cpp-File_cpp.cpp diff --git a/tests/cluecode/data/copyrights/copyright_abc b/tests/cluecode/data/copyright_lines/abc similarity index 100% rename from tests/cluecode/data/copyrights/copyright_abc rename to tests/cluecode/data/copyright_lines/abc diff --git a/tests/cluecode/data/copyrights/copyright_abc_loss_of_holder_c-c.c b/tests/cluecode/data/copyright_lines/abc_loss_of_holder_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_abc_loss_of_holder_c-c.c rename to tests/cluecode/data/copyright_lines/abc_loss_of_holder_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_abiword_common_copyright-abiword_common_copyright.copyright b/tests/cluecode/data/copyright_lines/abiword_common.copyright similarity index 100% rename from tests/cluecode/data/copyrights/copyright_abiword_common_copyright-abiword_common_copyright.copyright rename to tests/cluecode/data/copyright_lines/abiword_common.copyright diff --git a/tests/cluecode/data/copyrights/copyright_acme_c-c.c b/tests/cluecode/data/copyright_lines/acme_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_acme_c-c.c rename to tests/cluecode/data/copyright_lines/acme_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_activefieldattribute_cs-ActiveFieldAttribute_cs.cs b/tests/cluecode/data/copyright_lines/activefieldattribute_cs-ActiveFieldAttribute_cs.cs similarity index 100% rename from tests/cluecode/data/copyrights/copyright_activefieldattribute_cs-ActiveFieldAttribute_cs.cs rename to tests/cluecode/data/copyright_lines/activefieldattribute_cs-ActiveFieldAttribute_cs.cs diff --git a/tests/cluecode/data/copyrights/copyright_addr_c-addr_c.c b/tests/cluecode/data/copyright_lines/addr_c-addr_c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_addr_c-addr_c.c rename to tests/cluecode/data/copyright_lines/addr_c-addr_c.c diff --git a/tests/cluecode/data/copyrights/copyright_adler_inflate_c-inflate_c.c b/tests/cluecode/data/copyright_lines/adler_inflate_c-inflate_c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_adler_inflate_c-inflate_c.c rename to tests/cluecode/data/copyright_lines/adler_inflate_c-inflate_c.c diff --git a/tests/cluecode/data/copyrights/copyright_aleal-c.c b/tests/cluecode/data/copyright_lines/aleal-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_aleal-c.c rename to tests/cluecode/data/copyright_lines/aleal-c.c diff --git a/tests/cluecode/data/copyrights/copyright_andre_darcy-c.c b/tests/cluecode/data/copyright_lines/andre_darcy-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_andre_darcy-c.c rename to tests/cluecode/data/copyright_lines/andre_darcy-c.c diff --git a/tests/cluecode/data/copyrights/copyright_android_c-c.c b/tests/cluecode/data/copyright_lines/android_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_android_c-c.c rename to tests/cluecode/data/copyright_lines/android_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_apache_notice-NOTICE b/tests/cluecode/data/copyright_lines/apache_notice-NOTICE similarity index 100% rename from tests/cluecode/data/copyrights/copyright_apache_notice-NOTICE rename to tests/cluecode/data/copyright_lines/apache_notice-NOTICE diff --git a/tests/cluecode/data/copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label b/tests/cluecode/data/copyright_lines/aptitude-aptitude.label similarity index 100% rename from tests/cluecode/data/copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label rename to tests/cluecode/data/copyright_lines/aptitude-aptitude.label diff --git a/tests/cluecode/data/copyrights/copyright_atheros_spanning_lines-py.py b/tests/cluecode/data/copyright_lines/atheros_spanning_lines-py.py similarity index 100% rename from tests/cluecode/data/copyrights/copyright_atheros_spanning_lines-py.py rename to tests/cluecode/data/copyright_lines/atheros_spanning_lines-py.py diff --git a/tests/cluecode/data/copyrights/copyright_att_in_c-9_c.c b/tests/cluecode/data/copyright_lines/att_in_c-9_c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_att_in_c-9_c.c rename to tests/cluecode/data/copyright_lines/att_in_c-9_c.c diff --git a/tests/cluecode/data/copyrights/copyright_audio_c-c.c b/tests/cluecode/data/copyright_lines/audio_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_audio_c-c.c rename to tests/cluecode/data/copyright_lines/audio_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_babkin_txt.txt b/tests/cluecode/data/copyright_lines/babkin_txt.txt similarity index 100% rename from tests/cluecode/data/copyrights/copyright_babkin_txt.txt rename to tests/cluecode/data/copyright_lines/babkin_txt.txt diff --git a/tests/cluecode/data/copyrights/copyright_blender_debian-blender_copyright.copyright b/tests/cluecode/data/copyright_lines/blender_debian-blender.copyright similarity index 100% rename from tests/cluecode/data/copyrights/copyright_blender_debian-blender_copyright.copyright rename to tests/cluecode/data/copyright_lines/blender_debian-blender.copyright diff --git a/tests/cluecode/data/copyright_lines/company_name_in_java-9_java.java b/tests/cluecode/data/copyright_lines/company_name_in_java-9_java.java new file mode 100644 index 00000000000..778a496994f --- /dev/null +++ b/tests/cluecode/data/copyright_lines/company_name_in_java-9_java.java @@ -0,0 +1,20 @@ +/* +Copyright (c) 2008-2011 Company Name Incorporated +All rights Reserved. +Company Name Proprietary + */ +import some.java.package; +import some.java.package2; +import some.java.package3; +import some.java.package4; +import some.java.package4; +import some.java.package5; + +import some.proprietary.pkg; +import some.proprietary.pkg2; +import some.proprietary.pkg3; +import some.proprietary.pkg4; + +public class SomeClass extends SomeOtherClass implements WhateverListener { + private static final String JB = "JB"; // John Blah? Japan Beach? : -) + \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/copyright_essential_smoke-ibm_c.c b/tests/cluecode/data/copyright_lines/essential_smoke-ibm_c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_essential_smoke-ibm_c.c rename to tests/cluecode/data/copyright_lines/essential_smoke-ibm_c.c diff --git a/tests/cluecode/data/copyrights/copyright_heunrich_c-c.c b/tests/cluecode/data/copyright_lines/heunrich_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_heunrich_c-c.c rename to tests/cluecode/data/copyright_lines/heunrich_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_isc-c.c b/tests/cluecode/data/copyright_lines/isc-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_isc-c.c rename to tests/cluecode/data/copyright_lines/isc-c.c diff --git a/tests/cluecode/data/copyrights/copyright_sample_py-py.py b/tests/cluecode/data/copyright_lines/sample_py-py.py similarity index 100% rename from tests/cluecode/data/copyrights/copyright_sample_py-py.py rename to tests/cluecode/data/copyright_lines/sample_py-py.py diff --git a/tests/cluecode/data/copyright_lines/vector50.hpp b/tests/cluecode/data/copyright_lines/vector50.hpp new file mode 100644 index 00000000000..fe53f22bf6b --- /dev/null +++ b/tests/cluecode/data/copyright_lines/vector50.hpp @@ -0,0 +1,174 @@ + +// Copyright (C) 2005 Arkadiy Vertleyb +// Copyright (C) 2005 Peder Holt +// +// Use modification and distribution are subject to the boost Software License, +// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). + +// Preprocessed code, do not edit manually ! + + +namespace boost { namespace type_of { + template struct v_iter; + template struct v_iter > { typedef typename V::item0 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item1 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item2 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item3 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item4 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item5 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item6 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item7 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item8 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item9 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item10 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item11 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item12 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item13 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item14 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item15 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item16 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item17 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item18 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item19 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item20 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item21 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item69 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item22 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item23 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item24 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item25 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item26 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item27 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item28 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item29 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item30 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item31 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item32 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item33 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item34 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item35 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item36 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item37 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item38 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item39 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item40 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item41 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item42 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item43 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item44 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item45 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item46 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item47 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item48 type; typedef v_iter > next; }; + template struct v_iter > { typedef typename V::item49 type; typedef v_iter > next; }; +}} +namespace boost { namespace type_of { + template< class T = void> struct vector0 { typedef v_iter, boost::mpl::int_<0> > begin; typedef mpl::int_<1> item0; typedef mpl::int_<1> item1; typedef mpl::int_<1> item2; typedef mpl::int_<1> item3; typedef mpl::int_<1> item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 > struct vector1 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef mpl::int_<1> item1; typedef mpl::int_<1> item2; typedef mpl::int_<1> item3; typedef mpl::int_<1> item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 > struct vector2 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef mpl::int_<1> item2; typedef mpl::int_<1> item3; typedef mpl::int_<1> item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 > struct vector3 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef mpl::int_<1> item3; typedef mpl::int_<1> item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 > struct vector4 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef mpl::int_<1> item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 > struct vector5 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef mpl::int_<1> item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 > struct vector6 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef mpl::int_<1> item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 > struct vector7 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef mpl::int_<1> item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 > struct vector8 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef mpl::int_<1> item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 > struct vector9 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef mpl::int_<1> item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 > struct vector10 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef mpl::int_<1> item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 > struct vector11 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef mpl::int_<1> item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 > struct vector12 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef mpl::int_<1> item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 > struct vector13 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef mpl::int_<1> item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 > struct vector14 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef mpl::int_<1> item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 > struct vector15 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef mpl::int_<1> item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 > struct vector16 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef mpl::int_<1> item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 > struct vector17 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef mpl::int_<1> item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 > struct vector18 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef mpl::int_<1> item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 > struct vector19 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef mpl::int_<1> item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 > struct vector20 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef mpl::int_<1> item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 > struct vector21 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef mpl::int_<1> item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 > struct vector22 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef mpl::int_<1> item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 > struct vector23 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef mpl::int_<1> item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 > struct vector24 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef mpl::int_<1> item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 > struct vector25 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef mpl::int_<1> item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 > struct vector26 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef mpl::int_<1> item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 > struct vector27 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef mpl::int_<1> item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 > struct vector28 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef mpl::int_<1> item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 > struct vector29 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef mpl::int_<1> item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 > struct vector30 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef mpl::int_<1> item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 > struct vector31 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef mpl::int_<1> item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 > struct vector32 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef mpl::int_<1> item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 > struct vector33 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef mpl::int_<1> item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 > struct vector34 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef mpl::int_<1> item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 > struct vector35 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef mpl::int_<1> item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 > struct vector36 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef mpl::int_<1> item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 > struct vector37 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef mpl::int_<1> item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 > struct vector38 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef mpl::int_<1> item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 > struct vector39 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef mpl::int_<1> item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 > struct vector40 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef mpl::int_<1> item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 > struct vector41 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef mpl::int_<1> item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 > struct vector42 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef mpl::int_<1> item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 > struct vector43 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef mpl::int_<1> item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 > struct vector44 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef mpl::int_<1> item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 > struct vector45 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef mpl::int_<1> item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 > struct vector46 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef P45 item45; typedef mpl::int_<1> item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 > struct vector47 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef P45 item45; typedef P46 item46; typedef mpl::int_<1> item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class P47 > struct vector48 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef P45 item45; typedef P46 item46; typedef P47 item47; typedef mpl::int_<1> item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class P47 , class P48 > struct vector49 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef P45 item45; typedef P46 item46; typedef P47 item47; typedef P48 item48; typedef mpl::int_<1> item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class P47 , class P48 , class P49 > struct vector50 { typedef v_iter, boost::mpl::int_<0> > begin; typedef P0 item0; typedef P1 item1; typedef P2 item2; typedef P3 item3; typedef P4 item4; typedef P5 item5; typedef P6 item6; typedef P7 item7; typedef P8 item8; typedef P9 item9; typedef P10 item10; typedef P11 item11; typedef P12 item12; typedef P13 item13; typedef P14 item14; typedef P15 item15; typedef P16 item16; typedef P17 item17; typedef P18 item18; typedef P19 item19; typedef P20 item20; typedef P21 item21; typedef P22 item22; typedef P23 item23; typedef P24 item24; typedef P25 item25; typedef P26 item26; typedef P27 item27; typedef P28 item28; typedef P29 item29; typedef P30 item30; typedef P31 item31; typedef P32 item32; typedef P33 item33; typedef P34 item34; typedef P35 item35; typedef P36 item36; typedef P37 item37; typedef P38 item38; typedef P39 item39; typedef P40 item40; typedef P41 item41; typedef P42 item42; typedef P43 item43; typedef P44 item44; typedef P45 item45; typedef P46 item46; typedef P47 item47; typedef P48 item48; typedef P49 item49; typedef mpl::int_<1> item50; typedef mpl::int_<1> item51; typedef mpl::int_<1> item52; typedef mpl::int_<1> item53; typedef mpl::int_<1> item54; typedef mpl::int_<1> item55; typedef mpl::int_<1> item56; typedef mpl::int_<1> item57; typedef mpl::int_<1> item58; typedef mpl::int_<1> item59; typedef mpl::int_<1> item60; typedef mpl::int_<1> item61; typedef mpl::int_<1> item62; typedef mpl::int_<1> item63; typedef mpl::int_<1> item64; typedef mpl::int_<1> item65; typedef mpl::int_<1> item66; typedef mpl::int_<1> item67; typedef mpl::int_<1> item68; typedef mpl::int_<1> item69; typedef mpl::int_<1> item70; typedef mpl::int_<1> item71; typedef mpl::int_<1> item72; typedef mpl::int_<1> item73; typedef mpl::int_<1> item74; typedef mpl::int_<1> item75; typedef mpl::int_<1> item76; typedef mpl::int_<1> item77; typedef mpl::int_<1> item78; typedef mpl::int_<1> item79; typedef mpl::int_<1> item80; typedef mpl::int_<1> item81; typedef mpl::int_<1> item82; typedef mpl::int_<1> item83; typedef mpl::int_<1> item84; typedef mpl::int_<1> item85; typedef mpl::int_<1> item86; typedef mpl::int_<1> item87; typedef mpl::int_<1> item88; typedef mpl::int_<1> item89; typedef mpl::int_<1> item90; typedef mpl::int_<1> item91; typedef mpl::int_<1> item92; typedef mpl::int_<1> item93; typedef mpl::int_<1> item94; typedef mpl::int_<1> item95; typedef mpl::int_<1> item96; typedef mpl::int_<1> item97; typedef mpl::int_<1> item98; typedef mpl::int_<1> item99; }; +}} +namespace boost { namespace type_of { + template struct push_back { + typedef V type; + }; + template< class T> struct push_back, T> { typedef boost::type_of::vector1< T > type; }; + template< class P0 , class T> struct push_back, T> { typedef boost::type_of::vector2< P0 , T > type; }; + template< class P0 , class P1 , class T> struct push_back, T> { typedef boost::type_of::vector3< P0 , P1 , T > type; }; + template< class P0 , class P1 , class P2 , class T> struct push_back, T> { typedef boost::type_of::vector4< P0 , P1 , P2 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class T> struct push_back, T> { typedef boost::type_of::vector5< P0 , P1 , P2 , P3 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class T> struct push_back, T> { typedef boost::type_of::vector6< P0 , P1 , P2 , P3 , P4 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class T> struct push_back, T> { typedef boost::type_of::vector7< P0 , P1 , P2 , P3 , P4 , P5 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class T> struct push_back, T> { typedef boost::type_of::vector8< P0 , P1 , P2 , P3 , P4 , P5 , P6 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class T> struct push_back, T> { typedef boost::type_of::vector9< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class T> struct push_back, T> { typedef boost::type_of::vector10< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class T> struct push_back, T> { typedef boost::type_of::vector11< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class T> struct push_back, T> { typedef boost::type_of::vector12< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class T> struct push_back, T> { typedef boost::type_of::vector13< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class T> struct push_back, T> { typedef boost::type_of::vector14< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class T> struct push_back, T> { typedef boost::type_of::vector15< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class T> struct push_back, T> { typedef boost::type_of::vector16< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class T> struct push_back, T> { typedef boost::type_of::vector17< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class T> struct push_back, T> { typedef boost::type_of::vector18< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class T> struct push_back, T> { typedef boost::type_of::vector19< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class T> struct push_back, T> { typedef boost::type_of::vector20< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class T> struct push_back, T> { typedef boost::type_of::vector21< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class T> struct push_back, T> { typedef boost::type_of::vector22< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class T> struct push_back, T> { typedef boost::type_of::vector23< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class T> struct push_back, T> { typedef boost::type_of::vector24< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class T> struct push_back, T> { typedef boost::type_of::vector25< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class T> struct push_back, T> { typedef boost::type_of::vector26< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class T> struct push_back, T> { typedef boost::type_of::vector27< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class T> struct push_back, T> { typedef boost::type_of::vector28< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class T> struct push_back, T> { typedef boost::type_of::vector29< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class T> struct push_back, T> { typedef boost::type_of::vector30< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class T> struct push_back, T> { typedef boost::type_of::vector31< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class T> struct push_back, T> { typedef boost::type_of::vector32< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class T> struct push_back, T> { typedef boost::type_of::vector33< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class T> struct push_back, T> { typedef boost::type_of::vector34< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class T> struct push_back, T> { typedef boost::type_of::vector35< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class T> struct push_back, T> { typedef boost::type_of::vector36< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class T> struct push_back, T> { typedef boost::type_of::vector37< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class T> struct push_back, T> { typedef boost::type_of::vector38< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class T> struct push_back, T> { typedef boost::type_of::vector39< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class T> struct push_back, T> { typedef boost::type_of::vector40< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class T> struct push_back, T> { typedef boost::type_of::vector41< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class T> struct push_back, T> { typedef boost::type_of::vector42< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class T> struct push_back, T> { typedef boost::type_of::vector43< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class T> struct push_back, T> { typedef boost::type_of::vector44< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class T> struct push_back, T> { typedef boost::type_of::vector45< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class T> struct push_back, T> { typedef boost::type_of::vector46< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , P44 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class T> struct push_back, T> { typedef boost::type_of::vector47< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , P44 , P45 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class T> struct push_back, T> { typedef boost::type_of::vector48< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , P44 , P45 , P46 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class P47 , class T> struct push_back, T> { typedef boost::type_of::vector49< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , P44 , P45 , P46 , P47 , T > type; }; + template< class P0 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 , class P13 , class P14 , class P15 , class P16 , class P17 , class P18 , class P19 , class P20 , class P21 , class P22 , class P23 , class P24 , class P25 , class P26 , class P27 , class P28 , class P29 , class P30 , class P31 , class P32 , class P33 , class P34 , class P35 , class P36 , class P37 , class P38 , class P39 , class P40 , class P41 , class P42 , class P43 , class P44 , class P45 , class P46 , class P47 , class P48 , class T> struct push_back, T> { typedef boost::type_of::vector50< P0 , P1 , P2 , P3 , P4 , P5 , P6 , P7 , P8 , P9 , P10 , P11 , P12 , P13 , P14 , P15 , P16 , P17 , P18 , P19 , P20 , P21 , P22 , P23 , P24 , P25 , P26 , P27 , P28 , P29 , P30 , P31 , P32 , P33 , P34 , P35 , P36 , P37 , P38 , P39 , P40 , P41 , P42 , P43 , P44 , P45 , P46 , P47 , P48 , T > type; }; + template struct v_iter > { typedef typename V::item69 type; typedef v_iter > next; }; + +}} diff --git a/tests/cluecode/data/copyrights/03e16f6c_0-e_f_c.0 b/tests/cluecode/data/copyrights/03e16f6c_0-e_f_c.0 new file mode 100644 index 00000000000..4cdf2749e0f --- /dev/null +++ b/tests/cluecode/data/copyrights/03e16f6c_0-e_f_c.0 @@ -0,0 +1,78 @@ +-----BEGIN CERTIFICATE----- +MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAx +KzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAc +BgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0 +IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFow +cDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEe +MBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3Nv +ZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR5 +7qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbB +RucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55Er +GOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgko +IQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJc +PMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw +72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBN +aWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEh +MB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs +30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4F +kYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+ +Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH +/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdS +VLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQc +BOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA= +-----END CERTIFICATE----- +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + c1:00:8b:3c:3c:88:11:d1:3e:f6:63:ec:df:40 + Signature Algorithm: md5WithRSAEncryption + Issuer: OU=Copyright (c) 1997 Microsoft Corp., OU=Microsoft Corporation, CN=Microsoft Root Authority + Validity + Not Before: Jan 10 07:00:00 1997 GMT + Not After : Dec 31 07:00:00 2020 GMT + Subject: OU=Copyright (c) 1997 Microsoft Corp., OU=Microsoft Corporation, CN=Microsoft Root Authority + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:a9:02:bd:c1:70:e6:3b:f2:4e:1b:28:9f:97:78: + 5e:30:ea:a2:a9:8d:25:5f:f8:fe:95:4c:a3:b7:fe: + 9d:a2:20:3e:7c:51:a2:9b:a2:8f:60:32:6b:d1:42: + 64:79:ee:ac:76:c9:54:da:f2:eb:9c:86:1c:8f:9f: + 84:66:b3:c5:6b:7a:62:23:d6:1d:3c:de:0f:01:92: + e8:96:c4:bf:2d:66:9a:9a:68:26:99:d0:3a:2c:bf: + 0c:b5:58:26:c1:46:e7:0a:3e:38:96:2c:a9:28:39: + a8:ec:49:83:42:e3:84:0f:bb:9a:6c:55:61:ac:82: + 7c:a1:60:2d:77:4c:e9:99:b4:64:3b:9a:50:1c:31: + 08:24:14:9f:a9:e7:91:2b:18:e6:3d:98:63:14:60: + 58:05:65:9f:1d:37:52:87:f7:a7:ef:94:02:c6:1b: + d3:bf:55:45:b3:89:80:bf:3a:ec:54:94:4e:ae:fd: + a7:7a:6d:74:4e:af:18:cc:96:09:28:21:00:57:90: + 60:69:37:bb:4b:12:07:3c:56:ff:5b:fb:a4:66:0a: + 08:a6:d2:81:56:57:ef:b6:3b:5e:16:81:77:04:da: + f6:be:ae:80:95:fe:b0:cd:7f:d6:a7:1a:72:5c:3c: + ca:bc:f0:08:a3:22:30:b3:06:85:c9:b3:20:77:13: + 85:df + Exponent: 65537 (0x10001) + X509v3 extensions: + 2.5.29.1: + 0....[.p.ir.#Q~..M....r0p1+0)..U..."Copyright (c) 1997 Microsoft Corp.1.0...U....Microsoft Corporation1!0...U....Microsoft Root Authority......<<...>.c..@ + Signature Algorithm: md5WithRSAEncryption + 95:e8:0b:c0:8d:f3:97:18:35:ed:b8:01:24:d8:77:11:f3:5c: + 60:32:9f:9e:0b:cb:3e:05:91:88:8f:c9:3a:e6:21:f2:f0:57: + 93:2c:b5:a0:47:c8:62:ef:fc:d7:cc:3b:3b:5a:a9:36:54:69: + fe:24:6d:3f:c9:cc:aa:de:05:7c:dd:31:8d:3d:9f:10:70:6a: + bb:fe:12:4f:18:69:c0:fc:d0:43:e3:11:5a:20:4f:ea:62:7b: + af:aa:19:c8:2b:37:25:2d:be:65:a1:12:8a:25:0f:63:a3:f7: + 54:1c:f9:21:c9:d6:15:f3:52:ac:6e:43:32:07:fd:82:17:f8: + e5:67:6c:0d:51:f6:bd:f1:52:c7:bd:e7:c4:30:fc:20:31:09: + 88:1d:95:29:1a:4d:d5:1d:02:a5:f1:80:e0:03:b4:5b:f4:b1: + dd:c8:57:ee:65:49:c7:52:54:b6:b4:03:28:12:ff:90:d6:f0: + 08:8f:7e:b8:97:c5:ab:37:2c:e4:7a:e4:a8:77:e3:76:a0:00: + d0:6a:3f:c1:d2:36:8a:e0:41:12:a8:35:6a:1b:6a:db:35:e1: + d4:1c:04:e4:a8:45:04:c8:5a:33:38:6e:4d:1c:0d:62:b7:0a: + a2:8c:d3:d5:54:3f:46:cd:1c:55:a6:70:db:12:3a:87:93:75: + 9f:a7:d2:a0 +SHA1 Fingerprint=A4:34:89:15:9A:52:0F:0D:93:D0:32:CC:AF:37:E7:FE:20:A8:B4:19 diff --git a/tests/cluecode/data/copyrights/3a3b02ce_0-a_b_ce.0 b/tests/cluecode/data/copyrights/3a3b02ce_0-a_b_ce.0 new file mode 100644 index 00000000000..8b744f6c64d --- /dev/null +++ b/tests/cluecode/data/copyrights/3a3b02ce_0-a_b_ce.0 @@ -0,0 +1,84 @@ +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB +ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly +aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWw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oEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ +/L7fCg0= +-----END CERTIFICATE----- +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 41:3d:72:c7:f4:6b:1f:81:43:7d:f1:d2:28:54:df:9a + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=CH, O=WISeKey, OU=Copyright (c) 2005, OU=OISTE Foundation Endorsed, CN=OISTE WISeKey Global Root GA CA + Validity + Not Before: Dec 11 16:03:44 2005 GMT + Not After : Dec 11 16:09:51 2037 GMT + Subject: C=CH, O=WISeKey, OU=Copyright (c) 2005, OU=OISTE Foundation Endorsed, CN=OISTE WISeKey Global Root GA CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:cb:4f:b3:00:9b:3d:36:dd:f9:d1:49:6a:6b:10: + 49:1f:ec:d8:2b:b2:c6:f8:32:81:29:43:95:4c:9a: + 19:23:21:15:45:de:e3:c8:1c:51:55:5b:ae:93:e8: + 37:ff:2b:6b:e9:d4:ea:be:2a:dd:a8:51:2b:d7:66: + c3:61:5c:60:02:c8:f5:ce:72:7b:3b:b8:f2:4e:65: + 08:9a:cd:a4:6a:19:c1:01:bb:73:a6:d7:f6:c3:dd: + cd:bc:a4:8b:b5:99:61:b8:01:a2:a3:d4:4d:d4:05: + 3d:91:ad:f8:b4:08:71:64:af:70:f1:1c:6b:7e:f6: + c3:77:9d:24:73:7b:e4:0c:8c:e1:d9:36:e1:99:8b: + 05:99:0b:ed:45:31:09:ca:c2:00:db:f7:72:a0:96: + aa:95:87:d0:8e:c7:b6:61:73:0d:76:66:8c:dc:1b: + b4:63:a2:9f:7f:93:13:30:f1:a1:27:db:d9:ff:2c: + 55:88:91:a0:e0:4f:07:b0:28:56:8c:18:1b:97:44: + 8e:89:dd:e0:17:6e:e7:2a:ef:8f:39:0a:31:84:82: + d8:40:14:49:2e:7a:41:e4:a7:fe:e3:64:cc:c1:59: + 71:4b:2c:21:a7:5b:7d:e0:1d:d1:2e:81:9b:c3:d8: + 68:f7:bd:96:1b:ac:70:b1:16:14:0b:db:60:b9:26: + 01:05 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + B3:03:7E:AE:36:BC:B0:79:D1:DC:94:26:B6:11:BE:21:B2:69:86:94 + 1.3.6.1.4.1.311.21.1: + ... + Signature Algorithm: sha1WithRSAEncryption + 4b:a1:ff:0b:87:6e:b3:f9:c1:43:b1:48:f3:28:c0:1d:2e:c9: + 09:41:fa:94:00:1c:a4:a4:ab:49:4f:8f:3d:1e:ef:4d:6f:bd: + bc:a4:f6:f2:26:30:c9:10:ca:1d:88:fb:74:19:1f:85:45:bd: + b0:6c:51:f9:36:7e:db:f5:4c:32:3a:41:4f:5b:47:cf:e8:0b: + 2d:b6:c4:19:9d:74:c5:47:c6:3b:6a:0f:ac:14:db:3c:f4:73: + 9c:a9:05:df:00:dc:74:78:fa:f8:35:60:59:02:13:18:7c:bc: + fb:4d:b0:20:6d:43:bb:60:30:7a:67:33:5c:c5:99:d1:f8:2d: + 39:52:73:fb:8c:aa:97:25:5c:72:d9:08:1e:ab:4e:3c:e3:81: + 31:9f:03:a6:fb:c0:fe:29:88:55:da:84:d5:50:03:b6:e2:84: + a3:a6:36:aa:11:3a:01:e1:18:4b:d6:44:68:b3:3d:f9:53:74: + 84:b3:46:91:46:96:00:b7:80:2c:b6:e1:e3:10:e2:db:a2:e7: + 28:8f:01:96:62:16:3e:00:e3:1c:a5:36:81:18:a2:4c:52:76: + c0:11:a3:6e:e6:1d:ba:e3:5a:be:36:53:c5:3e:75:8f:86:69: + 29:58:53:b5:9c:bb:6f:9f:5c:c5:18:ec:dd:2f:e1:98:c9:fc: + be:df:0a:0d +SHA1 Fingerprint=59:22:A1:E1:5A:EA:16:35:21:F8:98:39:6A:46:46:B0:44:1B:0F:A9 diff --git a/tests/cluecode/data/copyrights/ABC_cpp-Case_cpp.cpp b/tests/cluecode/data/copyrights/ABC_cpp-Case_cpp.cpp new file mode 100644 index 00000000000..ce313fa7155 --- /dev/null +++ b/tests/cluecode/data/copyrights/ABC_cpp-Case_cpp.cpp @@ -0,0 +1,14 @@ +/****************************** + ABC DEF + + ABC Company + + www.abcCompany.com + + ----------------------- + File: testCase.cpp + Project: testProject + ----------------------- + Copyright (C) ABC Company + + **********************************/ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/ABC_file_cpp-File_cpp.cpp b/tests/cluecode/data/copyrights/ABC_file_cpp-File_cpp.cpp new file mode 100644 index 00000000000..f3046f0ea99 --- /dev/null +++ b/tests/cluecode/data/copyrights/ABC_file_cpp-File_cpp.cpp @@ -0,0 +1,14 @@ +/****************************** + ABC DEF + + ABC Company + + www.abcCompany.com + + ----------------------- + File: testCase.cpp + Project: testProject + ----------------------- + Copyright (C) ABC Company + +**********************************/ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/copyright_in_COPYING_gpl-COPYING_gpl.gpl b/tests/cluecode/data/copyrights/COPYING_gpl-COPYING_gpl.gpl similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_COPYING_gpl-COPYING_gpl.gpl rename to tests/cluecode/data/copyrights/COPYING_gpl-COPYING_gpl.gpl diff --git a/tests/cluecode/data/copyrights/copyright_in_COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi b/tests/cluecode/data/copyrights/COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi rename to tests/cluecode/data/copyrights/COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi diff --git a/tests/cluecode/data/copyrights/copyright_in_README-README b/tests/cluecode/data/copyrights/README-README similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_README-README rename to tests/cluecode/data/copyrights/README-README diff --git a/tests/cluecode/data/copyrights/copyright_Yocto-SPDX.pdf b/tests/cluecode/data/copyrights/Yocto-SPDX.pdf similarity index 100% rename from tests/cluecode/data/copyrights/copyright_Yocto-SPDX.pdf rename to tests/cluecode/data/copyrights/Yocto-SPDX.pdf diff --git a/tests/cluecode/data/copyrights/abc b/tests/cluecode/data/copyrights/abc new file mode 100644 index 00000000000..e31f8194906 --- /dev/null +++ b/tests/cluecode/data/copyrights/abc @@ -0,0 +1,2 @@ +#!/bin/sh +# Copyright (C) 2006 abc.org diff --git a/tests/cluecode/data/copyrights/abc_loss_of_holder_c-c.c b/tests/cluecode/data/copyrights/abc_loss_of_holder_c-c.c new file mode 100644 index 00000000000..949051f3f20 --- /dev/null +++ b/tests/cluecode/data/copyrights/abc_loss_of_holder_c-c.c @@ -0,0 +1,2 @@ +//copyright abc 2001 +//all rights reserved diff --git a/tests/cluecode/data/copyrights/abiword_common.copyright b/tests/cluecode/data/copyrights/abiword_common.copyright new file mode 100644 index 00000000000..69c723fb618 --- /dev/null +++ b/tests/cluecode/data/copyrights/abiword_common.copyright @@ -0,0 +1,152 @@ +This package was debianized by: + + Masayuki Hatta (mhatta) on Sun, 22 Mar 2009 18:42:01 +0900 + +It was downloaded from: + + http://www.abisource.com/download/ + +Upstream Authors: + + AbiSource, Inc, along with many volunteers + + See AUTHORS for (almost) complete list of contributors. + +Copyright: + + Copyright (C) 1998- AbiSource, Inc. & Co. + +License: + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +On Debian systems, the complete text of the GNU General Public License +version 2 can be found in `/usr/share/common-licenses/GPL-2'. the +complete text of the GNU General Public License version 3 can be found +in `/usr/share/common-licenses/GPL-3'. + +The Debian packaging is: + + Copyright (C) 2009 Masayuki Hatta (mhatta) + Copyright (C) 2009 Patrik Fimml + +and is licensed under the GPL version 3, see above. + + +o About Trademark + +(See also http://www.abisource.com/information/license/tm_guide.phtml) + +Trademark Usage Guidelines + +AbiSource Trademarks + +AbiSource, AbiWord, AbiCalc, AbiFile, AbiSuite, AbiShow and other +AbiSource graphics, logos and service names are trademarks of Dom +Lachowicz. These trademarks may not be used in connection with any +product or service that is not AbiSource's, in any manner that is +likely to cause confusion among customers, or in any manner that +disparages or discredits AbiSource. + +Trademarks and the GPL + +AbiSource software products, such as AbiWord, are copyrighted works +released under the terms of the GNU General Public License +(GPL). Verbatim copies of such works may be made and distributed, by +anyone, in accordance with the terms of the GPL without violating the +AbiSource trademarks. The GPL also grants you certain rights to make +and distribute derivative works based on the source code to AbiSource +products. + +The GPL does not grant you any right to use AbiSource trademarks in +connection with these derivative works. AbiSource trademarks may not +be used in connection with any such derivative works unless that usage +is explicitly and specifically licensed, in writing, from Dom +Lachowicz. + +Personal exemption + +As a specific exception, AbiSource freely licenses the use of certain +of its trademarks solely in combination with the suffix "Personal" +when applied to derivative works based on an AbiSource GPL +product. Thus, for example, you are free to use the mark "AbiWord +Personal" in connection with derivative works that are based on +"AbiWord". To help maintain this distinction, AbiSource releases the +sources to its GPL products with Personal-based trademarks. + +We are not lawyers + +Trademark and copyright issues are, at heart, legal matters. We've +tried to keep this explanation as simple and common-sense as possible, +but if you have any questions about when and how to use AbiSource +trademarks, your best bet is to ask a lawyer. We are not lawyers. + +We are not evil + +Our goal is very simple. We want to make sure our software stays Open +Source, no matter what. That's why we chose the GPL. We also want +everyone to know which products are ours. That's why we are so picky +about our trademarks. + +o "AbiWord" vs. "AbiWord Personal" for Debian? + +Maybe this is informative for now. + +> From: Dom Lachowicz +> Date: 20 July 2004 22:08:34 BST +> To: Andy Korvemaker, abiword-dev@abisource.com +> Subject: Re: Abiword being removed from Debian/unstable? +> +> +> I'm not sure if this is the reason or not, but please +> see: +> +> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=258918 +> +> For the record, I've recently acquired the AbiWord +> trademarks and whatnot. I haven't had a chance to +> update the TM information on the website. +> +> To be expressly clear here for any Debian guys that +> read this message: +> +> Within reason, I don't care if you use "AbiWord" vs. +> "AbiWord Personal." In fact, I'd prefer it if you used +> "AbiWord." +> +> Within reason, I don't care if you use the "official" +> artwork or the "personal" artwork. In fact, I'd prefer +> it if you used the "official" artwork. +> +> I do begin to care if you use my trademarks to promote +> other products, or in ways that disparage my +> trademarks or products. If you "forked" AbiWord, you +> couldn't use the trademarks. But you're clearly not +> going to do that. The USPTO has more info and case law +> on this sort of thing. +> +> Debian and the other distros are clearly distributing +> AbiWord, and providing a beneficial service to the +> community. Even though Debian's version might have a +> few patches against our "mainline" branch, I don't +> believe it constitutes a "fork." As such, I think that +> it is fine (if not preferable) for you guys to use the +> official name and artwork in your distribution. +> +> So, you have my blessing to call your AbiWord + +> patches "AbiWord". You can use the official artwork +> too. +> +> Dom +> diff --git a/tests/cluecode/data/copyrights/acme_c-c.c b/tests/cluecode/data/copyrights/acme_c-c.c new file mode 100644 index 00000000000..23dbd722d5d --- /dev/null +++ b/tests/cluecode/data/copyrights/acme_c-c.c @@ -0,0 +1 @@ +/* Copyright © 2000 ACME, Inc., All Rights Reserved */ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/activefieldattribute_cs-ActiveFieldAttribute_cs.cs b/tests/cluecode/data/copyrights/activefieldattribute_cs-ActiveFieldAttribute_cs.cs new file mode 100644 index 00000000000..bcad9a64c59 --- /dev/null +++ b/tests/cluecode/data/copyrights/activefieldattribute_cs-ActiveFieldAttribute_cs.cs @@ -0,0 +1,40 @@ +/* + * Ra-Brix - A Modular-based Framework for building + * Web Applications Copyright 2009 - Thomas Hansen + * thomas@ra-ajax.org. Unless permission is + * explicitly given this code is licensed under the + * GNU Affero GPL version 3 which can be found in the + * license.txt file on disc. + * + */ + +using System; + +namespace Ra.Brix.Data +{ + /** + * Used to mark entity objects as serializable. If a property is + * marked with this attribute then it will be possible to serialise + * that property. Notice that you still need to mark you classes with the + * ActiveRecordAttribute. Also only properties, and not fields and such + * can be marked as serializable with this attribute. + */ + [AttributeUsage(AttributeTargets.Property, AllowMultiple=false)] + public class ActiveFieldAttribute : Attribute + { + /** + * If true then this is a one-to-x relationship which + * means that the type owns this instance and will also delete + * the instance if the object itself is deleted. If it is false + * then this indicate a many-to-x relationship + * and means that the object does NOT own this property and the + * property will NOT be deleted when the object is deleted. + * If it is false then the property will also NOT be saved whenever + * the not owning object is being saved. + * Default value is true - which means that the object will + * be saved when parent object is saved, and also deleted when + * the parent object is being deleted. + */ + public bool IsOwner = true; + } +} diff --git a/tests/cluecode/data/copyrights/copyright_license_text_adaptive_v1_0-Adaptive v.0 b/tests/cluecode/data/copyrights/adaptive_v1_0-Adaptive v.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_adaptive_v1_0-Adaptive v.0 rename to tests/cluecode/data/copyrights/adaptive_v1_0-Adaptive v.0 diff --git a/tests/cluecode/data/copyrights/addr_c-addr_c.c b/tests/cluecode/data/copyrights/addr_c-addr_c.c new file mode 100644 index 00000000000..d3bb4b93fb9 --- /dev/null +++ b/tests/cluecode/data/copyrights/addr_c-addr_c.c @@ -0,0 +1,23 @@ +/**************************************************************/ +/* ADDR.C */ +/* Author: John Doe, 7/2000 */ +/* Copyright 1999 Cornell University. All rights reserved. */ +/* Copyright 2000 Jon Doe. All rights reserved. */ +/* See license.txt for further information. */ +/**************************************************************/ + +#include "string.h" +#include "sys.h" + +tst_id tst_put(tst_id *id) { + tst_id id ; + memcpy(&id, *tst_id,sizeof(id)); + return id ; +} + +tst_id tst_get() { + tst_id id ; + memset(&id, 0, sizeof(id)) ; + return id ; +} + diff --git a/tests/cluecode/data/copyrights/adler_inflate_c-inflate_c.c b/tests/cluecode/data/copyrights/adler_inflate_c-inflate_c.c new file mode 100644 index 00000000000..a12a78b33e0 --- /dev/null +++ b/tests/cluecode/data/copyrights/adler_inflate_c-inflate_c.c @@ -0,0 +1,952 @@ +/* inflate.c -- Not copyrighted 1992 by Mark Adler + version c10p1, 10 January 1993 */ + +/* You can do whatever you like with this source file, though I would + prefer that if you modify it and redistribute it that you include + comments to that effect with your name and the date. Thank you. + [The history has been moved to the file ChangeLog.] + */ + +/* + Inflate deflated (PKZIP's method 8 compressed) data. The compression + method searches for as much of the current string of bytes (up to a + length of 258) in the previous 32K bytes. If it doesn't find any + matches (of at least length 3), it codes the next byte. Otherwise, it + codes the length of the matched string and its distance backwards from + the current position. There is a single Huffman code that codes both + single bytes (called "literals") and match lengths. A second Huffman + code codes the distance information, which follows a length code. Each + length or distance code actually represents a base value and a number + of "extra" (sometimes zero) bits to get to add to the base value. At + the end of each deflated block is a special end-of-block (EOB) literal/ + length code. The decoding process is basically: get a literal/length + code; if EOB then done; if a literal, emit the decoded byte; if a + length then get the distance and emit the referred-to bytes from the + sliding window of previously emitted data. + + There are (currently) three kinds of inflate blocks: stored, fixed, and + dynamic. The compressor deals with some chunk of data at a time, and + decides which method to use on a chunk-by-chunk basis. A chunk might + typically be 32K or 64K. If the chunk is uncompressible, then the + "stored" method is used. In this case, the bytes are simply stored as + is, eight bits per byte, with none of the above coding. The bytes are + preceded by a count, since there is no longer an EOB code. + + If the data is compressible, then either the fixed or dynamic methods + are used. In the dynamic method, the compressed data is preceded by + an encoding of the literal/length and distance Huffman codes that are + to be used to decode this block. The representation is itself Huffman + coded, and so is preceded by a description of that code. These code + descriptions take up a little space, and so for small blocks, there is + a predefined set of codes, called the fixed codes. The fixed method is + used if the block codes up smaller that way (usually for quite small + chunks), otherwise the dynamic method is used. In the latter case, the + codes are customized to the probabilities in the current block, and so + can code it much better than the pre-determined fixed codes. + + The Huffman codes themselves are decoded using a mutli-level table + lookup, in order to maximize the speed of decoding plus the speed of + building the decoding tables. See the comments below that precede the + lbits and dbits tuning parameters. + */ + + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + +#ifndef lint +static char rcsid[] = "$Id: inflate.c,v 0.10 1993/02/04 13:21:06 jloup Exp $"; +#endif + +#include "tailor.h" +#include "gzip.h" +#define slide window + +#include + +#if defined(STDC_HEADERS) || defined(HAVE_STDLIB_H) +# include +# include +#endif + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). + Valid extra bits are 0..13. e == 15 is EOB (end of block), e == 16 + means that v is a literal, 16 < e < 32 means that v is a pointer to + the next table, which codes e - 16 bits, and lastly e == 99 indicates + an unused code. If a code with e == 99 is looked up, this implies an + error in the data. */ +struct huft { + uch e; /* number of extra bits or operation */ + uch b; /* number of bits in this code or subcode */ + union { + ush n; /* literal, length base, or distance base */ + struct huft *t; /* pointer to next level of table */ + } v; +}; + + +/* Function prototypes */ +int huft_build OF((unsigned *, unsigned, unsigned, ush *, ush *, + struct huft **, int *)); +int huft_free OF((struct huft *)); +int inflate_codes OF((struct huft *, struct huft *, int, int)); +int inflate_stored OF((void)); +int inflate_fixed OF((void)); +int inflate_dynamic OF((void)); +int inflate_block OF((int *)); +int inflate OF((void)); + + +/* The inflate algorithm uses a sliding 32K byte window on the uncompressed + stream to find repeated byte strings. This is implemented here as a + circular buffer. The index is updated simply by incrementing and then + and'ing with 0x7fff (32K-1). */ +/* It is left to other modules to supply the 32K area. It is assumed + to be usable as if it were declared "uch slide[32768];" or as just + "uch *slide;" and then malloc'ed in the latter case. The definition + must be in unzip.h, included above. */ +/* unsigned wp; current position in slide */ +#define wp outcnt +#define flush_output(w) (wp=(w),flush_window()) + +/* Tables for deflate from PKZIP's appnote.txt. */ +static unsigned border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +static ush cplens[] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* note: see note #13 above about the 258 in this list. */ +static ush cplext[] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ +static ush cpdist[] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +static ush cpdext[] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + + +/* Macros for inflate() bit peeking and grabbing. + The usage is: + + NEEDBITS(j) + x = b & mask_bits[j]; + DUMPBITS(j) + + where NEEDBITS makes sure that b has at least j bits in it, and + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed, and are initialized at the begining of a + routine that uses these macros from a global bit buffer and count. + + If we assume that EOB will be the longest code, then we will never + ask for bits with NEEDBITS that are beyond the end of the stream. + So, NEEDBITS should not read any more bytes than are needed to + meet the request. Then no bytes need to be "returned" to the buffer + at the end of the last block. + + However, this assumption is not true for fixed blocks--the EOB code + is 7 bits, but the other literal/length codes can be 8 or 9 bits. + (The EOB code is shorter than other codes becuase fixed blocks are + generally short. So, while a block always has an EOB, many other + literal/length codes have a significantly lower probability of + showing up at all.) However, by making the first table have a + lookup of seven bits, the EOB code will be found in that first + lookup, and so will not require that too many bits be pulled from + the stream. + */ + +ulg bb; /* bit buffer */ +unsigned bk; /* bits in bit buffer */ + +ush mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +#ifdef CRYPT + uch cc; +# define NEXTBYTE() \ + (decrypt ? (cc = get_byte(), zdecode(cc), cc) : get_byte()) +#else +# define NEXTBYTE() (uch)get_byte() +#endif +#define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE())<>=(n);k-=(n);} + + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +int lbits = 9; /* bits in base literal/length lookup table */ +int dbits = 6; /* bits in base distance lookup table */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ +#define BMAX 16 /* maximum bit length of any code (16 for explode) */ +#define N_MAX 288 /* maximum number of codes in any set */ + + +unsigned hufts; /* track memory usage */ + + +int huft_build(b, n, s, d, e, t, m) +unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ +unsigned n; /* number of codes (assumed <= N_MAX) */ +unsigned s; /* number of simple-valued codes (0..s-1) */ +ush *d; /* list of base values for non-simple codes */ +ush *e; /* list of extra bits for non-simple codes */ +struct huft **t; /* result: starting table */ +int *m; /* maximum lookup bits, returns actual */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return zero on success, one if + the given code set is incomplete (the tables are still built in this + case), two if the input is invalid (all zero length codes or an + oversubscribed set of lengths), and three if not enough memory. */ +{ + unsigned a; /* counter for codes of length k */ + unsigned c[BMAX+1]; /* bit length count table */ + unsigned f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register unsigned i; /* counter, current code */ + register unsigned j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + register unsigned *p; /* pointer into c[], b[], or v[] */ + register struct huft *q; /* points to current table */ + struct huft r; /* table entry for structure assignment */ + struct huft *u[BMAX]; /* table stack */ + unsigned v[N_MAX]; /* values in order of bit length */ + register int w; /* bits before this table == (l * h) */ + unsigned x[BMAX+1]; /* bit offsets, then code stack */ + unsigned *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + unsigned z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + memzero(c, sizeof(c)); + p = b; i = n; + do { + Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"), + n-i, *p)); + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (struct huft *)NULL; + *m = 0; + return 0; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((unsigned)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((unsigned)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return 2; /* bad input: more codes than bits */ + if ((y -= c[i]) < 0) + return 2; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (struct huft *)NULL; /* just to keep compilers happy */ + q = (struct huft *)NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = (z = g - w) > (unsigned)l ? l : z; /* upper limit on table size */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate and link in new table */ + if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == + (struct huft *)NULL) + { + if (h) + huft_free(u[0]); + return 3; /* not enough memory */ + } + hufts += z + 1; /* track memory usage */ + *t = q + 1; /* link to list for huft_free() */ + *(t = &(q->v.t)) = (struct huft *)NULL; + u[h] = ++q; /* table starts after link */ + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.b = (uch)l; /* bits to dump before this table */ + r.e = (uch)(16 + j); /* bits in this table */ + r.v.t = q; /* pointer to this table */ + j = i >> (w - l); /* (get around Turbo C bug) */ + u[h-1][j] = r; /* connect to last table */ + } + } + + /* set up table entry in r */ + r.b = (uch)(k - w); + if (p >= v + n) + r.e = 99; /* out of values--invalid code */ + else if (*p < s) + { + r.e = (uch)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ + r.v.n = *p++; /* simple code is just the value */ + } + else + { + r.e = (uch)e[*p - s]; /* non-simple--look up in lists */ + r.v.n = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + while ((i & ((1 << w) - 1)) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + } + } + } + + + /* Return true (1) if we were given an incomplete table */ + return y != 0 && g != 1; +} + + + +int huft_free(t) +struct huft *t; /* table to free */ +/* Free the malloc'ed tables built by huft_build(), which makes a linked + list of the tables it made, with the links in a dummy first entry of + each table. */ +{ + register struct huft *p, *q; + + + /* Go through linked list, freeing from the malloced (t[-1]) address. */ + p = t; + while (p != (struct huft *)NULL) + { + q = (--p)->v.t; + free(p); + p = q; + } + return 0; +} + + +int inflate_codes(tl, td, bl, bd) +struct huft *tl, *td; /* literal/length and distance decoder tables */ +int bl, bd; /* number of bits decoded by tl[] and td[] */ +/* inflate (decompress) the codes in a deflated (compressed) block. + Return an error code or zero if it all goes ok. */ +{ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned n, d; /* length and index for copy */ + unsigned w; /* current window position */ + struct huft *t; /* pointer to table entry */ + unsigned ml, md; /* masks for bl and bd bits */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local copies of globals */ + b = bb; /* initialize bit buffer */ + k = bk; + w = wp; /* initialize window position */ + + /* inflate the coded data */ + ml = mask_bits[bl]; /* precompute masks for speed */ + md = mask_bits[bd]; + for (;;) /* do until end of block */ + { + NEEDBITS((unsigned)bl) + if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) + do { + if (e == 99) + return 1; + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); + DUMPBITS(t->b) + if (e == 16) /* then it's a literal */ + { + slide[w++] = (uch)t->v.n; + Tracevv((stderr, "%c", slide[w-1])); + if (w == WSIZE) + { + flush_output(w); + w = 0; + } + } + else /* it's an EOB or a length */ + { + /* exit if end of block */ + if (e == 15) + break; + + /* get length of block to copy */ + NEEDBITS(e) + n = t->v.n + ((unsigned)b & mask_bits[e]); + DUMPBITS(e); + + /* decode distance of block to copy */ + NEEDBITS((unsigned)bd) + if ((e = (t = td + ((unsigned)b & md))->e) > 16) + do { + if (e == 99) + return 1; + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); + DUMPBITS(t->b) + NEEDBITS(e) + d = w - t->v.n - ((unsigned)b & mask_bits[e]); + DUMPBITS(e) + Tracevv((stderr,"\\[%d,%d]", w-d, n)); + + /* do the copy */ + do { + n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); +#if !defined(NOMEMCPY) && !defined(DEBUG) + if (w - d >= e) /* (this test assumes unsigned comparison) */ + { + memcpy(slide + w, slide + d, e); + w += e; + d += e; + } + else /* do it slow to avoid memcpy() overlap */ +#endif /* !NOMEMCPY */ + do { + slide[w++] = slide[d++]; + Tracevv((stderr, "%c", slide[w-1])); + } while (--e); + if (w == WSIZE) + { + flush_output(w); + w = 0; + } + } while (n); + } + } + + + /* restore the globals from the locals */ + wp = w; /* restore global window pointer */ + bb = b; /* restore global bit buffer */ + bk = k; + + /* done */ + return 0; +} + + + +int inflate_stored() +/* "decompress" an inflated type 0 (stored) block. */ +{ + unsigned n; /* number of bytes in block */ + unsigned w; /* current window position */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local copies of globals */ + b = bb; /* initialize bit buffer */ + k = bk; + w = wp; /* initialize window position */ + + + /* go to byte boundary */ + n = k & 7; + DUMPBITS(n); + + + /* get the length and its complement */ + NEEDBITS(16) + n = ((unsigned)b & 0xffff); + DUMPBITS(16) + NEEDBITS(16) + if (n != (unsigned)((~b) & 0xffff)) + return 1; /* error in compressed data */ + DUMPBITS(16) + + + /* read and output the compressed data */ + while (n--) + { + NEEDBITS(8) + slide[w++] = (uch)b; + if (w == WSIZE) + { + flush_output(w); + w = 0; + } + DUMPBITS(8) + } + + + /* restore the globals from the locals */ + wp = w; /* restore global window pointer */ + bb = b; /* restore global bit buffer */ + bk = k; + return 0; +} + + + +int inflate_fixed() +/* decompress an inflated type 1 (fixed Huffman codes) block. We should + either replace this with a custom decoder, or at least precompute the + Huffman tables. */ +{ + int i; /* temporary variable */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned l[288]; /* length list for huft_build */ + + + /* set up literal table */ + for (i = 0; i < 144; i++) + l[i] = 8; + for (; i < 256; i++) + l[i] = 9; + for (; i < 280; i++) + l[i] = 7; + for (; i < 288; i++) /* make a complete, but wrong code set */ + l[i] = 8; + bl = 7; + if ((i = huft_build(l, 288, 257, cplens, cplext, &tl, &bl)) != 0) + return i; + + + /* set up distance table */ + for (i = 0; i < 30; i++) /* make an incomplete code set */ + l[i] = 5; + bd = 5; + if ((i = huft_build(l, 30, 0, cpdist, cpdext, &td, &bd)) > 1) + { + huft_free(tl); + return i; + } + + + /* decompress until an end-of-block code */ + if (inflate_codes(tl, td, bl, bd)) + return 1; + + + /* free the decoding tables, return */ + huft_free(tl); + huft_free(td); + return 0; +} + + + +int inflate_dynamic() +/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +{ + int i; /* temporary variables */ + unsigned j; + unsigned l; /* last length */ + unsigned m; /* mask for bit lengths table */ + unsigned n; /* number of lengths to get */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned nb; /* number of bit length codes */ + unsigned nl; /* number of literal/length codes */ + unsigned nd; /* number of distance codes */ +#ifdef PKZIP_BUG_WORKAROUND + unsigned ll[288+32]; /* literal/length and distance code lengths */ +#else + unsigned ll[286+30]; /* literal/length and distance code lengths */ +#endif + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local bit buffer */ + b = bb; + k = bk; + + + /* read in table lengths */ + NEEDBITS(5) + nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ + DUMPBITS(5) + NEEDBITS(5) + nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ + DUMPBITS(5) + NEEDBITS(4) + nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ + DUMPBITS(4) +#ifdef PKZIP_BUG_WORKAROUND + if (nl > 288 || nd > 32) +#else + if (nl > 286 || nd > 30) +#endif + return 1; /* bad lengths */ + + + /* read in bit-length-code lengths */ + for (j = 0; j < nb; j++) + { + NEEDBITS(3) + ll[border[j]] = (unsigned)b & 7; + DUMPBITS(3) + } + for (; j < 19; j++) + ll[border[j]] = 0; + + + /* build decoding table for trees--single level, 7 bit lookup */ + bl = 7; + if ((i = huft_build(ll, 19, 19, NULL, NULL, &tl, &bl)) != 0) + { + if (i == 1) + huft_free(tl); + return i; /* incomplete code set */ + } + + + /* read in literal and distance code lengths */ + n = nl + nd; + m = mask_bits[bl]; + i = l = 0; + while ((unsigned)i < n) + { + NEEDBITS((unsigned)bl) + j = (td = tl + ((unsigned)b & m))->b; + DUMPBITS(j) + j = td->v.n; + if (j < 16) /* length of code in bits (0..15) */ + ll[i++] = l = j; /* save last length in l */ + else if (j == 16) /* repeat last length 3 to 6 times */ + { + NEEDBITS(2) + j = 3 + ((unsigned)b & 3); + DUMPBITS(2) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = l; + } + else if (j == 17) /* 3 to 10 zero length codes */ + { + NEEDBITS(3) + j = 3 + ((unsigned)b & 7); + DUMPBITS(3) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = 0; + l = 0; + } + else /* j == 18: 11 to 138 zero length codes */ + { + NEEDBITS(7) + j = 11 + ((unsigned)b & 0x7f); + DUMPBITS(7) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = 0; + l = 0; + } + } + + + /* free decoding table for trees */ + huft_free(tl); + + + /* restore the global bit buffer */ + bb = b; + bk = k; + + + /* build the decoding tables for literal/length and distance codes */ + bl = lbits; + if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) + { + if (i == 1) { + fprintf(stderr, " incomplete literal tree\n"); + huft_free(tl); + } + return i; /* incomplete code set */ + } + bd = dbits; + if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) + { + if (i == 1) { + fprintf(stderr, " incomplete distance tree\n"); +#ifdef PKZIP_BUG_WORKAROUND + i = 0; + } +#else + huft_free(td); + } + huft_free(tl); + return i; /* incomplete code set */ +#endif + } + + + /* decompress until an end-of-block code */ + if (inflate_codes(tl, td, bl, bd)) + return 1; + + + /* free the decoding tables, return */ + huft_free(tl); + huft_free(td); + return 0; +} + + + +int inflate_block(e) +int *e; /* last block flag */ +/* decompress an inflated block */ +{ + unsigned t; /* block type */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local bit buffer */ + b = bb; + k = bk; + + + /* read in last block bit */ + NEEDBITS(1) + *e = (int)b & 1; + DUMPBITS(1) + + + /* read in block type */ + NEEDBITS(2) + t = (unsigned)b & 3; + DUMPBITS(2) + + + /* restore the global bit buffer */ + bb = b; + bk = k; + + + /* inflate that block type */ + if (t == 2) + return inflate_dynamic(); + if (t == 0) + return inflate_stored(); + if (t == 1) + return inflate_fixed(); + + + /* bad block type */ + return 2; +} + + + +int inflate() +/* decompress an inflated entry */ +{ + int e; /* last block flag */ + int r; /* result code */ + unsigned h; /* maximum struct huft's malloc'ed */ + + + /* initialize window, bit buffer */ + wp = 0; + bk = 0; + bb = 0; + + + /* decompress until the last block */ + h = 0; + do { + hufts = 0; + if ((r = inflate_block(&e)) != 0) + return r; + if (hufts > h) + h = hufts; + } while (!e); + + /* Undo too much lookahead. The next read will be byte aligned so we + * can discard unused bits in the last meaningful byte. + */ + while (bk >= 8) { + bk -= 8; + inptr--; + } + + /* flush out slide */ + flush_output(wp); + + + /* return success */ +#ifdef DEBUG + fprintf(stderr, "<%u> ", h); +#endif /* DEBUG */ + return 0; +} diff --git a/tests/cluecode/data/copyrights/copyright_license_text_adobe-Adobe b/tests/cluecode/data/copyrights/adobe-Adobe similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_adobe-Adobe rename to tests/cluecode/data/copyrights/adobe-Adobe diff --git a/tests/cluecode/data/copyrights/copyright_adobe_flashplugin_copyright_label-adobe_flashplugin_copyright_label.label b/tests/cluecode/data/copyrights/adobe_flashplugin-adobe_flashplugin.label similarity index 100% rename from tests/cluecode/data/copyrights/copyright_adobe_flashplugin_copyright_label-adobe_flashplugin_copyright_label.label rename to tests/cluecode/data/copyrights/adobe_flashplugin-adobe_flashplugin.label diff --git a/tests/cluecode/data/copyrights/copyright_license_text_adobeflex2sdk-Adobeflex_sdk b/tests/cluecode/data/copyrights/adobeflex2sdk-Adobeflex_sdk similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_adobeflex2sdk-Adobeflex_sdk rename to tests/cluecode/data/copyrights/adobeflex2sdk-Adobeflex_sdk diff --git a/tests/cluecode/data/copyrights/copyright_license_text_afferogplv1-AfferoGPLv b/tests/cluecode/data/copyrights/afferogplv1-AfferoGPLv similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_afferogplv1-AfferoGPLv rename to tests/cluecode/data/copyrights/afferogplv1-AfferoGPLv diff --git a/tests/cluecode/data/copyrights/copyright_license_text_afferogplv2-AfferoGPLv b/tests/cluecode/data/copyrights/afferogplv2-AfferoGPLv similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_afferogplv2-AfferoGPLv rename to tests/cluecode/data/copyrights/afferogplv2-AfferoGPLv diff --git a/tests/cluecode/data/copyrights/copyright_license_text_afferogplv3-AfferoGPLv b/tests/cluecode/data/copyrights/afferogplv3-AfferoGPLv similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_afferogplv3-AfferoGPLv rename to tests/cluecode/data/copyrights/afferogplv3-AfferoGPLv diff --git a/tests/cluecode/data/copyrights/copyright_license_text_afl_v3_0-AFL_v.0 b/tests/cluecode/data/copyrights/afl_v3_0-AFL_v.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_afl_v3_0-AFL_v.0 rename to tests/cluecode/data/copyrights/afl_v3_0-AFL_v.0 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_aladdin_free_public_license-Aladdin Free Public License b/tests/cluecode/data/copyrights/aladdin_free_public_license-Aladdin Free Public License similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_aladdin_free_public_license-Aladdin Free Public License rename to tests/cluecode/data/copyrights/aladdin_free_public_license-Aladdin Free Public License diff --git a/tests/cluecode/data/copyrights/aleal-c.c b/tests/cluecode/data/copyrights/aleal-c.c new file mode 100644 index 00000000000..75d73228561 --- /dev/null +++ b/tests/cluecode/data/copyrights/aleal-c.c @@ -0,0 +1,3 @@ +/** +* copyright : (C) 2006 by aleal +*/ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/copyright_license_text_amazondsb-AmazonDSb b/tests/cluecode/data/copyrights/amazondsb-AmazonDSb similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_amazondsb-AmazonDSb rename to tests/cluecode/data/copyrights/amazondsb-AmazonDSb diff --git a/tests/cluecode/data/copyrights/copyright_license_text_ampasbsd-AMPASBSD b/tests/cluecode/data/copyrights/ampasbsd-AMPASBSD similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_ampasbsd-AMPASBSD rename to tests/cluecode/data/copyrights/ampasbsd-AMPASBSD diff --git a/tests/cluecode/data/copyrights/andre_darcy-c.c b/tests/cluecode/data/copyrights/andre_darcy-c.c new file mode 100644 index 00000000000..383e586c5dd --- /dev/null +++ b/tests/cluecode/data/copyrights/andre_darcy-c.c @@ -0,0 +1,28 @@ +/* + * $Id: vtmodule.c 33125 2009-07-16 20:58:26Z dbochkov $ + * PyGres, version 2.2 A Python interface for PostgreSQL database. Written by + * D'Arcy J.M. Cain, (darcy@druid.net). Based heavily on code written by + * Pascal Andre, andre@chimay.via.ecp.fr. Copyright (c) 1995, Pascal Andre + * (andre@via.ecp.fr). + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without a written + * agreement is hereby granted, provided that the above copyright notice and + * this paragraph and the following two paragraphs appear in all copies or in + * any new file that contains a substantial portion of this file. + * + * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE + * AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE + * AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, + * ENHANCEMENTS, OR MODIFICATIONS. + * + * Further modifications copyright 1997, 1998, 1999 by D'Arcy J.M. Cain + * (darcy@druid.net) subject to the same terms and conditions as above. + * + */ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/copyright_colin_android-bsdiff_c.c b/tests/cluecode/data/copyrights/android_c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_colin_android-bsdiff_c.c rename to tests/cluecode/data/copyrights/android_c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_apache2_debian_trailing_name_missed-apache_copyright_label.label b/tests/cluecode/data/copyrights/apache2_debian_trailing_name_missed-apache.label similarity index 100% rename from tests/cluecode/data/copyrights/copyright_apache2_debian_trailing_name_missed-apache_copyright_label.label rename to tests/cluecode/data/copyrights/apache2_debian_trailing_name_missed-apache.label diff --git a/tests/cluecode/data/copyrights/copyright_apache_in_html.html b/tests/cluecode/data/copyrights/apache_in_html.html similarity index 100% rename from tests/cluecode/data/copyrights/copyright_apache_in_html.html rename to tests/cluecode/data/copyrights/apache_in_html.html diff --git a/tests/cluecode/data/copyrights/apache_notice-NOTICE b/tests/cluecode/data/copyrights/apache_notice-NOTICE new file mode 100644 index 00000000000..e820f3230fe --- /dev/null +++ b/tests/cluecode/data/copyrights/apache_notice-NOTICE @@ -0,0 +1,35 @@ + ========================================================================= + == NOTICE file corresponding to section 4(d) of the Apache License, == + == Version 2.0, in this case for the Apache Xalan Java distribution. == + ========================================================================= + + Apache Xalan (Xalan serializer) + Copyright 1999-2006 The Apache Software Foundation + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + ========================================================================= + + + ========================================================================= + Apache Xerces Java + Copyright 1999-2006 The Apache Software Foundation + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + Portions of Apache Xerces Java in xercesImpl.jar and xml-apis.jar + + ========================================================================= + Apache xml-commons xml-apis (redistribution of xml-apis.jar) + + Apache XML Commons + Copyright 2001-2003,2006 The Apache Software Foundation. + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + Portions of this software were originally based on the following: + - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org + diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apachev1_0-Apachev.0 b/tests/cluecode/data/copyrights/apachev1_0-Apachev.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apachev1_0-Apachev.0 rename to tests/cluecode/data/copyrights/apachev1_0-Apachev.0 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apachev1_1-Apachev.1 b/tests/cluecode/data/copyrights/apachev1_1-Apachev.1 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apachev1_1-Apachev.1 rename to tests/cluecode/data/copyrights/apachev1_1-Apachev.1 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apachev2_0b-Apachev_b.0b b/tests/cluecode/data/copyrights/apachev2_0b-Apachev_b.0b similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apachev2_0b-Apachev_b.0b rename to tests/cluecode/data/copyrights/apachev2_0b-Apachev_b.0b diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apple_common_documentation_license_v1_0-Apple Common Documentation License v.0 b/tests/cluecode/data/copyrights/apple_common_documentation_license_v1_0-Apple Common Documentation License v.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apple_common_documentation_license_v1_0-Apple Common Documentation License v.0 rename to tests/cluecode/data/copyrights/apple_common_documentation_license_v1_0-Apple Common Documentation License v.0 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_0-Apple Public Source License v.0 b/tests/cluecode/data/copyrights/apple_public_source_license_v1_0-Apple Public Source License v.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_0-Apple Public Source License v.0 rename to tests/cluecode/data/copyrights/apple_public_source_license_v1_0-Apple Public Source License v.0 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_1-Apple Public Source License v.1 b/tests/cluecode/data/copyrights/apple_public_source_license_v1_1-Apple Public Source License v.1 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_1-Apple Public Source License v.1 rename to tests/cluecode/data/copyrights/apple_public_source_license_v1_1-Apple Public Source License v.1 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_2-Apple Public Source License v.2 b/tests/cluecode/data/copyrights/apple_public_source_license_v1_2-Apple Public Source License v.2 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apple_public_source_license_v1_2-Apple Public Source License v.2 rename to tests/cluecode/data/copyrights/apple_public_source_license_v1_2-Apple Public Source License v.2 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_apslv2_0-APSLv.0 b/tests/cluecode/data/copyrights/apslv2_0-APSLv.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_apslv2_0-APSLv.0 rename to tests/cluecode/data/copyrights/apslv2_0-APSLv.0 diff --git a/tests/cluecode/data/copyrights/aptitude-aptitude.label b/tests/cluecode/data/copyrights/aptitude-aptitude.label new file mode 100644 index 00000000000..228714bc833 --- /dev/null +++ b/tests/cluecode/data/copyrights/aptitude-aptitude.label @@ -0,0 +1,6 @@ +Copyright 1999-2005 Daniel Burrows + +The upstream web site for aptitude is +http://people.debian.org/~dburrows/aptitude . + +License: GPL (/usr/share/common-licenses/GPL) diff --git a/tests/cluecode/data/copyrights/copyright_license_text_artistic_v1_0-Artistic v.0 b/tests/cluecode/data/copyrights/artistic_v1_0-Artistic v.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_artistic_v1_0-Artistic v.0 rename to tests/cluecode/data/copyrights/artistic_v1_0-Artistic v.0 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_artistic_v1_0_short-Artistic v_ short.0 short b/tests/cluecode/data/copyrights/artistic_v1_0_short-Artistic v_ short.0 short similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_artistic_v1_0_short-Artistic v_ short.0 short rename to tests/cluecode/data/copyrights/artistic_v1_0_short-Artistic v_ short.0 short diff --git a/tests/cluecode/data/copyrights/copyright_license_text_artistic_v2_0beta4-Artistic v_beta.0beta4 b/tests/cluecode/data/copyrights/artistic_v2_0beta4-Artistic v_beta.0beta4 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_artistic_v2_0beta4-Artistic v_beta.0beta4 rename to tests/cluecode/data/copyrights/artistic_v2_0beta4-Artistic v_beta.0beta4 diff --git a/tests/cluecode/data/copyrights/copyright_license_text_artisticv2_0-Artisticv.0 b/tests/cluecode/data/copyrights/artisticv2_0-Artisticv.0 similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_artisticv2_0-Artisticv.0 rename to tests/cluecode/data/copyrights/artisticv2_0-Artisticv.0 diff --git a/tests/cluecode/data/copyrights/atheros_spanning_lines-py.py b/tests/cluecode/data/copyrights/atheros_spanning_lines-py.py new file mode 100644 index 00000000000..1298b24d32b --- /dev/null +++ b/tests/cluecode/data/copyrights/atheros_spanning_lines-py.py @@ -0,0 +1,16 @@ +# /***************************************************************************\ +# ** Copyright © 2000 Atheros Communications, Inc., All Rights Reserved ** +# ** Copyright © 2001 Atheros Communications, Inc., All Rights Reserved ** +# ** ** +# ** Atheros and the Atheros logo and design are trademarks of Atheros ** +# ** Communications, Inc. ** +# ** ** +# ** Sample Code from Microsoft Windows 2000 Driver Development Kit is ** +# ** used under license from Microsoft Corporation and was developed for ** +# ** Microsoft by Intel Corp., Hillsboro, Oregon: Copyright (c) 1994-1997 ** +# ** by Intel Corporation. ** +# ** ** +# ** $Id$ ** +# \**************************************************************************/ +# +# #ifndef _PCI_H diff --git a/tests/cluecode/data/copyrights/att_in_c-9_c.c b/tests/cluecode/data/copyrights/att_in_c-9_c.c new file mode 100644 index 00000000000..f475109bc3d --- /dev/null +++ b/tests/cluecode/data/copyrights/att_in_c-9_c.c @@ -0,0 +1,18 @@ +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ \ No newline at end of file diff --git a/tests/cluecode/data/copyrights/copyright_license_text_attributionassurancelicense-AttributionAssuranceLicense b/tests/cluecode/data/copyrights/attributionassurancelicense-AttributionAssuranceLicense similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_attributionassurancelicense-AttributionAssuranceLicense rename to tests/cluecode/data/copyrights/attributionassurancelicense-AttributionAssuranceLicense diff --git a/tests/cluecode/data/copyrights/audio_c-c.c b/tests/cluecode/data/copyrights/audio_c-c.c new file mode 100644 index 00000000000..014fbcd080d --- /dev/null +++ b/tests/cluecode/data/copyrights/audio_c-c.c @@ -0,0 +1,5 @@ +/* + ITU-T G.723 Speech Coder ANSI-C Source Code Version 5.00 + copyright (c) 1995, AudioCodes, DSP Group, France Telecom, + Universite de Sherbrooke. All rights reserved. +*/ diff --git a/tests/cluecode/data/copyrights/babkin_txt.txt b/tests/cluecode/data/copyrights/babkin_txt.txt new file mode 100644 index 00000000000..b75b9d7dcd2 --- /dev/null +++ b/tests/cluecode/data/copyrights/babkin_txt.txt @@ -0,0 +1,5 @@ +Copyright (c) North +Copyright (c) South +Copyright (c) 2134 abc +Copyright (c) 2001 by the TTF2PT1 project +Copyright (c) 2001 by Sergey Babkin diff --git a/tests/cluecode/data/copyrights/copyright_in_bash-shell_sh.sh b/tests/cluecode/data/copyrights/bash-shell_sh.sh similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_bash-shell_sh.sh rename to tests/cluecode/data/copyrights/bash-shell_sh.sh diff --git a/tests/cluecode/data/copyrights/copyright_license_text_bigelow_holmes-Bigelow&Holmes b/tests/cluecode/data/copyrights/bigelow_holmes-Bigelow&Holmes similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_bigelow_holmes-Bigelow&Holmes rename to tests/cluecode/data/copyrights/bigelow_holmes-Bigelow&Holmes diff --git a/tests/cluecode/data/copyrights/copyright_in_binary_lib-php_embed_lib.lib b/tests/cluecode/data/copyrights/binary_lib-php_embed_lib.lib similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_binary_lib-php_embed_lib.lib rename to tests/cluecode/data/copyrights/binary_lib-php_embed_lib.lib diff --git a/tests/cluecode/data/copyrights/copyright_license_text_bitstream-Bi_ream b/tests/cluecode/data/copyrights/bitstream-Bi_ream similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_bitstream-Bi_ream rename to tests/cluecode/data/copyrights/bitstream-Bi_ream diff --git a/tests/cluecode/data/copyrights/blender_debian-blender.copyright b/tests/cluecode/data/copyrights/blender_debian-blender.copyright new file mode 100644 index 00000000000..9a3f99b71df --- /dev/null +++ b/tests/cluecode/data/copyrights/blender_debian-blender.copyright @@ -0,0 +1,57 @@ +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat +Upstream-Author: Blender Foundation +Debianized-By: Masayuki Hatta (mhatta) +Debianized-Date: Mon, 3 May 2004 15:16:26 +0900 +Original-Source-Location: http://download.blender.org/source/ + + +Files: * +Copyright: © 2002-2008 Blender Foundation +License: GPL-2+ + | This program is free software; you can redistribute it and/or + | modify it under the terms of the GNU General Public License + | as published by the Free Software Foundation; either version 2 + | of the License, or (at your option) any later version. + | + | This program is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + | GNU General Public License for more details. + | + | You should have received a copy of the GNU General Public License along + | with this program; if not, write to the Free Software Foundation, Inc., + | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + | + | + | On Debian systems, the complete text of the GNU General Public License + | version 2 can be found in “/usr/share/common-licenses/GPL-2”. + + +Files: debian/* +Copyright: © 2004-2005 Masayuki Hatta + © 2005-2007 Florian Ernst + © 2007-2008 Cyril Brulebois +License: GPL-2+ + | This program is free software; you can redistribute it and/or + | modify it under the terms of the GNU General Public License + | as published by the Free Software Foundation; either version 2 + | of the License, or (at your option) any later version. + | + | This program is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + | GNU General Public License for more details. + | + | You should have received a copy of the GNU General Public License along + | with this program; if not, write to the Free Software Foundation, Inc., + | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + | + | + | On Debian systems, the complete text of the GNU General Public License + | version 2 can be found in “/usr/share/common-licenses/GPL-2”. + + + +Files: extern/{bFTGL,ffmpeg,libmp3lame,libopenjpeg,xvidcore,x264} +Removed since they are embedded code copies of software available in +main or software not acceptable in main. diff --git a/tests/cluecode/data/copyrights/copyright_blue_sky_dash_in_name-c.c b/tests/cluecode/data/copyrights/blue_sky_dash_in_name-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_blue_sky_dash_in_name-c.c rename to tests/cluecode/data/copyrights/blue_sky_dash_in_name-c.c diff --git a/tests/cluecode/data/copyrights/copyright_bouncy_license-LICENSE b/tests/cluecode/data/copyrights/bouncy_license-LICENSE similarity index 100% rename from tests/cluecode/data/copyrights/copyright_bouncy_license-LICENSE rename to tests/cluecode/data/copyrights/bouncy_license-LICENSE diff --git a/tests/cluecode/data/copyrights/copyright_bouncy_notice-9_NOTICE b/tests/cluecode/data/copyrights/bouncy_notice-9_NOTICE similarity index 100% rename from tests/cluecode/data/copyrights/copyright_bouncy_notice-9_NOTICE rename to tests/cluecode/data/copyrights/bouncy_notice-9_NOTICE diff --git a/tests/cluecode/data/copyrights/copyright_license_text_bsdnrl-BSDNRL b/tests/cluecode/data/copyrights/bsdnrl-BSDNRL similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_bsdnrl-BSDNRL rename to tests/cluecode/data/copyrights/bsdnrl-BSDNRL diff --git a/tests/cluecode/data/copyrights/copyright_btt_plot1_py-btt_plot_py.py b/tests/cluecode/data/copyrights/btt_plot1_py-btt_plot_py.py similarity index 100% rename from tests/cluecode/data/copyrights/copyright_btt_plot1_py-btt_plot_py.py rename to tests/cluecode/data/copyrights/btt_plot1_py-btt_plot_py.py diff --git a/tests/cluecode/data/copyrights/copyright_in_c-c.c b/tests/cluecode/data/copyrights/c-c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_c-c.c rename to tests/cluecode/data/copyrights/c-c.c diff --git a/tests/cluecode/data/copyrights/copyright_in_c_include-h.h b/tests/cluecode/data/copyrights/c_include-h.h similarity index 100% rename from tests/cluecode/data/copyrights/copyright_in_c_include-h.h rename to tests/cluecode/data/copyrights/c_include-h.h diff --git a/tests/cluecode/data/copyrights/copyright_copyright_camelcase_br_diagnostics_h-br_diagnostics_h.h b/tests/cluecode/data/copyrights/camelcase_br_diagnostics_h-br_diagnostics_h.h similarity index 100% rename from tests/cluecode/data/copyrights/copyright_copyright_camelcase_br_diagnostics_h-br_diagnostics_h.h rename to tests/cluecode/data/copyrights/camelcase_br_diagnostics_h-br_diagnostics_h.h diff --git a/tests/cluecode/data/copyrights/copyright_camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c b/tests/cluecode/data/copyrights/camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c similarity index 100% rename from tests/cluecode/data/copyrights/copyright_camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c rename to tests/cluecode/data/copyrights/camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c diff --git a/tests/cluecode/data/copyrights/copyright_ccube_txt.txt b/tests/cluecode/data/copyrights/ccube_txt.txt similarity index 100% rename from tests/cluecode/data/copyrights/copyright_ccube_txt.txt rename to tests/cluecode/data/copyrights/ccube_txt.txt diff --git a/tests/cluecode/data/copyrights/copyright_cedrik_java-java.java b/tests/cluecode/data/copyrights/cedrik_java-java.java similarity index 100% rename from tests/cluecode/data/copyrights/copyright_cedrik_java-java.java rename to tests/cluecode/data/copyrights/cedrik_java-java.java diff --git a/tests/cluecode/data/copyrights/copyright_cern-TestMatrix_D_java.java b/tests/cluecode/data/copyrights/cern-TestMatrix_D_java.java similarity index 100% rename from tests/cluecode/data/copyrights/copyright_cern-TestMatrix_D_java.java rename to tests/cluecode/data/copyrights/cern-TestMatrix_D_java.java diff --git a/tests/cluecode/data/copyrights/copyright_cern_matrix2d_java-TestMatrix_D_java.java b/tests/cluecode/data/copyrights/cern_matrix2d_java-TestMatrix_D_java.java similarity index 100% rename from tests/cluecode/data/copyrights/copyright_cern_matrix2d_java-TestMatrix_D_java.java rename to tests/cluecode/data/copyrights/cern_matrix2d_java-TestMatrix_D_java.java diff --git a/tests/cluecode/data/copyrights/copyright_chameleon_assembly-9_9_setjmp_S.S b/tests/cluecode/data/copyrights/chameleon_assembly-9_9_setjmp_S.S similarity index 100% rename from tests/cluecode/data/copyrights/copyright_chameleon_assembly-9_9_setjmp_S.S rename to tests/cluecode/data/copyrights/chameleon_assembly-9_9_setjmp_S.S diff --git a/tests/cluecode/data/copyrights/copyright_license_text_cnri-CNRI b/tests/cluecode/data/copyrights/cnri-CNRI similarity index 100% rename from tests/cluecode/data/copyrights/copyright_license_text_cnri-CNRI rename to tests/cluecode/data/copyrights/cnri-CNRI diff --git a/tests/cluecode/data/copyrights/copyright_co_cust-copyright_java.java b/tests/cluecode/data/copyrights/co_cust-java.java similarity index 100% rename from tests/cluecode/data/copyrights/copyright_co_cust-copyright_java.java rename to tests/cluecode/data/copyrights/co_cust-java.java diff --git a/tests/cluecode/data/copyrights/colin_android-bsdiff_c.c b/tests/cluecode/data/copyrights/colin_android-bsdiff_c.c new file mode 100644 index 00000000000..b6d342b7a8e --- /dev/null +++ b/tests/cluecode/data/copyrights/colin_android-bsdiff_c.c @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Most of this code comes from bsdiff.c from the bsdiff-4.3 + * distribution, which is: + */ + +/*- + * Copyright 2003-2005 Colin Percival + * All rights reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted providing that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define MIN(x,y) (((x)<(y)) ? (x) : (y)) + +static void split(off_t *I,off_t *V,off_t start,off_t len,off_t h) +{ + off_t i,j,k,x,tmp,jj,kk; + + if(len<16) { + for(k=start;kstart) split(I,V,start,jj-start,h); + + for(i=0;ikk) split(I,V,kk,start+len-kk,h); +} + +static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize) +{ + off_t buckets[256]; + off_t i,h,len; + + for(i=0;i<256;i++) buckets[i]=0; + for(i=0;i0;i--) buckets[i]=buckets[i-1]; + buckets[0]=0; + + for(i=0;iy) { + *pos=I[st]; + return x; + } else { + *pos=I[en]; + return y; + } + }; + + x=st+(en-st)/2; + if(memcmp(old+I[x],new,MIN(oldsize-I[x],newsize))<0) { + return search(I,old,oldsize,new,newsize,x,en,pos); + } else { + return search(I,old,oldsize,new,newsize,st,x,pos); + }; +} + +static void offtout(off_t x,u_char *buf) +{ + off_t y; + + if(x<0) y=-x; else y=x; + + buf[0]=y%256;y-=buf[0]; + y=y/256;buf[1]=y%256;y-=buf[1]; + y=y/256;buf[2]=y%256;y-=buf[2]; + y=y/256;buf[3]=y%256;y-=buf[3]; + y=y/256;buf[4]=y%256;y-=buf[4]; + y=y/256;buf[5]=y%256;y-=buf[5]; + y=y/256;buf[6]=y%256;y-=buf[6]; + y=y/256;buf[7]=y%256; + + if(x<0) buf[7]|=0x80; +} + +// This is main() from bsdiff.c, with the following changes: +// +// - old, oldsize, new, newsize are arguments; we don't load this +// data from files. old and new are owned by the caller; we +// don't free them at the end. +// +// - the "I" block of memory is owned by the caller, who passes a +// pointer to *I, which can be NULL. This way if we call +// bsdiff() multiple times with the same 'old' data, we only do +// the qsufsort() step the first time. +// +int bsdiff(u_char* old, off_t oldsize, off_t** IP, u_char* new, off_t newsize, + const char* patch_filename) +{ + int fd; + off_t *I; + off_t scan,pos,len; + off_t lastscan,lastpos,lastoffset; + off_t oldscore,scsc; + off_t s,Sf,lenf,Sb,lenb; + off_t overlap,Ss,lens; + off_t i; + off_t dblen,eblen; + u_char *db,*eb; + u_char buf[8]; + u_char header[32]; + FILE * pf; + BZFILE * pfbz2; + int bz2err; + + if (*IP == NULL) { + off_t* V; + *IP = malloc((oldsize+1) * sizeof(off_t)); + V = malloc((oldsize+1) * sizeof(off_t)); + qsufsort(*IP, V, old, oldsize); + free(V); + } + I = *IP; + + if(((db=malloc(newsize+1))==NULL) || + ((eb=malloc(newsize+1))==NULL)) err(1,NULL); + dblen=0; + eblen=0; + + /* Create the patch file */ + if ((pf = fopen(patch_filename, "w")) == NULL) + err(1, "%s", patch_filename); + + /* Header is + 0 8 "BSDIFF40" + 8 8 length of bzip2ed ctrl block + 16 8 length of bzip2ed diff block + 24 8 length of new file */ + /* File is + 0 32 Header + 32 ?? Bzip2ed ctrl block + ?? ?? Bzip2ed diff block + ?? ?? Bzip2ed extra block */ + memcpy(header,"BSDIFF40",8); + offtout(0, header + 8); + offtout(0, header + 16); + offtout(newsize, header + 24); + if (fwrite(header, 32, 1, pf) != 1) + err(1, "fwrite(%s)", patch_filename); + + /* Compute the differences, writing ctrl as we go */ + if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL) + errx(1, "BZ2_bzWriteOpen, bz2err = %d", bz2err); + scan=0;len=0; + lastscan=0;lastpos=0;lastoffset=0; + while(scanoldscore+8)) break; + + if((scan+lastoffsetSf*2-lenf) { Sf=s; lenf=i; }; + }; + + lenb=0; + if(scan=lastscan+i)&&(pos>=i);i++) { + if(old[pos-i]==new[scan-i]) s++; + if(s*2-i>Sb*2-lenb) { Sb=s; lenb=i; }; + }; + }; + + if(lastscan+lenf>scan-lenb) { + overlap=(lastscan+lenf)-(scan-lenb); + s=0;Ss=0;lens=0; + for(i=0;iSs) { Ss=s; lens=i+1; }; + }; + + lenf+=lens-overlap; + lenb-=lens; + }; + + for(i=0;i", "Copyright Marco d'Itri", ] check_detection(expected, test_file) - def test_copyright_adler_inflate_c(self): - test_file = self.get_test_loc('copyrights/copyright_adler_inflate_c-inflate_c.c') + def test_adler_inflate_c(self): + test_file = self.get_test_loc('copyrights/adler_inflate_c-inflate_c.c') expected = [ 'Not copyrighted 1992 by Mark Adler', ] check_detection(expected, test_file) - def test_copyright_adobe_flashplugin_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_adobe_flashplugin_copyright_label-adobe_flashplugin_copyright_label.label') + def test_adobe_flashplugin(self): + test_file = self.get_test_loc('copyrights/adobe_flashplugin-adobe_flashplugin.label') expected = [ 'Copyright (c) 1996 - 2008. Adobe Systems Incorporated', '(c) 2001-2009, Takuo KITAME, Bart Martens, and Canonical, LTD', @@ -315,31 +315,31 @@ def test_copyright_adobe_flashplugin_copyright_label(self): expected_in_results=False, results_in_expected=True) - def test_copyright_aleal(self): - test_file = self.get_test_loc('copyrights/copyright_aleal-c.c') + def test_aleal(self): + test_file = self.get_test_loc('copyrights/aleal-c.c') expected = [ 'copyright (c) 2006 by aleal', ] check_detection(expected, test_file) - def test_copyright_andre_darcy(self): - test_file = self.get_test_loc('copyrights/copyright_andre_darcy-c.c') + def test_andre_darcy(self): + test_file = self.get_test_loc('copyrights/andre_darcy-c.c') expected = [ 'Copyright (c) 1995, Pascal Andre (andre@via.ecp.fr).', "copyright 1997, 1998, 1999 by D'Arcy J.M. Cain (darcy@druid.net)", ] check_detection(expected, test_file) - def test_copyright_android_c(self): - test_file = self.get_test_loc('copyrights/copyright_android_c-c.c') + def test_android_c(self): + test_file = self.get_test_loc('copyrights/android_c-c.c') expected = [ 'Copyright (c) 2009 The Android Open Source Project', 'Copyright 2003-2005 Colin Percival', ] check_detection(expected, test_file) - def test_copyright_apache2_debian_trailing_name_missed(self): - test_file = self.get_test_loc('copyrights/copyright_apache2_debian_trailing_name_missed-apache_copyright_label.label') + def test_apache2_debian_trailing_name_missed(self): + test_file = self.get_test_loc('copyrights/apache2_debian_trailing_name_missed-apache.label') expected = [ 'copyright Steinar H. Gunderson and Knut Auvor Grythe ', 'Copyright (c) 1996-1997 Cisco Systems, Inc.', @@ -373,8 +373,8 @@ def test_copyright_apache2_debian_trailing_name_missed(self): ] check_detection(expected, test_file) - def test_copyright_apache_notice(self): - test_file = self.get_test_loc('copyrights/copyright_apache_notice-NOTICE') + def test_apache_notice(self): + test_file = self.get_test_loc('copyrights/apache_notice-NOTICE') expected = [ 'Copyright 1999-2006 The Apache Software Foundation', 'Copyright 1999-2006 The Apache Software Foundation', @@ -383,15 +383,15 @@ def test_copyright_apache_notice(self): ] check_detection(expected, test_file) - def test_copyright_aptitude_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label') + def test_aptitude(self): + test_file = self.get_test_loc('copyrights/aptitude-aptitude.label') expected = [ 'Copyright 1999-2005 Daniel Burrows ', ] check_detection(expected, test_file) - def test_copyright_atheros_spanning_lines(self): - test_file = self.get_test_loc('copyrights/copyright_atheros_spanning_lines-py.py') + def test_atheros_spanning_lines(self): + test_file = self.get_test_loc('copyrights/atheros_spanning_lines-py.py') expected = [ 'Copyright (c) 2000 Atheros Communications, Inc.', 'Copyright (c) 2001 Atheros Communications, Inc.', @@ -399,22 +399,22 @@ def test_copyright_atheros_spanning_lines(self): ] check_detection(expected, test_file) - def test_copyright_att_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_att_in_c-9_c.c') + def test_att_in_c(self): + test_file = self.get_test_loc('copyrights/att_in_c-9_c.c') expected = [ 'Copyright (c) 1991 by AT&T.', ] check_detection(expected, test_file) - def test_copyright_audio_c(self): - test_file = self.get_test_loc('copyrights/copyright_audio_c-c.c') + def test_audio_c(self): + test_file = self.get_test_loc('copyrights/audio_c-c.c') expected = [ 'copyright (c) 1995, AudioCodes, DSP Group, France Telecom, Universite de Sherbrooke.', ] check_detection(expected, test_file) - def test_copyright_babkin_txt(self): - test_file = self.get_test_loc('copyrights/copyright_babkin_txt.txt') + def test_babkin_txt(self): + test_file = self.get_test_loc('copyrights/babkin_txt.txt') expected = [ 'Copyright (c) North', 'Copyright (c) South', @@ -423,8 +423,8 @@ def test_copyright_babkin_txt(self): ] check_detection(expected, test_file) - def test_copyright_blender_debian(self): - test_file = self.get_test_loc('copyrights/copyright_blender_debian-blender_copyright.copyright') + def test_blender_debian(self): + test_file = self.get_test_loc('copyrights/blender_debian-blender.copyright') expected = [ 'Copyright (c) 2002-2008 Blender Foundation', 'Copyright (c) 2004-2005 Masayuki Hatta ', @@ -433,8 +433,8 @@ def test_copyright_blender_debian(self): ] check_detection(expected, test_file) - def test_copyright_blue_sky_dash_in_name(self): - test_file = self.get_test_loc('copyrights/copyright_blue_sky_dash_in_name-c.c') + def test_blue_sky_dash_in_name(self): + test_file = self.get_test_loc('copyrights/blue_sky_dash_in_name-c.c') expected = [ 'Copyright (c) 1995, 1996 - Blue Sky Software Corp. -', ] @@ -442,43 +442,43 @@ def test_copyright_blue_sky_dash_in_name(self): expected_in_results=False, results_in_expected=True) - def test_copyright_bouncy_license(self): - test_file = self.get_test_loc('copyrights/copyright_bouncy_license-LICENSE') + def test_bouncy_license(self): + test_file = self.get_test_loc('copyrights/bouncy_license-LICENSE') expected = [ 'Copyright (c) 2000-2005 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)', ] check_detection(expected, test_file) - def test_copyright_bouncy_notice(self): - test_file = self.get_test_loc('copyrights/copyright_bouncy_notice-9_NOTICE') + def test_bouncy_notice(self): + test_file = self.get_test_loc('copyrights/bouncy_notice-9_NOTICE') expected = [ 'Copyright (c) 2000-2005 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)', ] check_detection(expected, test_file) - def test_copyright_btt_plot1_py(self): - test_file = self.get_test_loc('copyrights/copyright_btt_plot1_py-btt_plot_py.py') + def test_btt_plot1_py(self): + test_file = self.get_test_loc('copyrights/btt_plot1_py-btt_plot_py.py') expected = [ '(c) Copyright 2009 Hewlett-Packard Development Company, L.P.', ] check_detection(expected, test_file) - def test_copyright_camelcase_bug_br_fcc_thread_psipstack_c(self): - test_file = self.get_test_loc('copyrights/copyright_camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c') + def test_camelcase_bug_br_fcc_thread_psipstack_c(self): + test_file = self.get_test_loc('copyrights/camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c') expected = [ 'Copyright 2010-2011 by BitRouter', ] check_detection(expected, test_file) - def test_copyright_ccube_txt(self): - test_file = self.get_test_loc('copyrights/copyright_ccube_txt.txt') + def test_ccube_txt(self): + test_file = self.get_test_loc('copyrights/ccube_txt.txt') expected = [ 'Copyright (c) 2001 C-Cube Microsystems.', ] check_detection(expected, test_file) - def test_copyright_cedrik_java(self): - test_file = self.get_test_loc('copyrights/copyright_cedrik_java-java.java') + def test_cedrik_java(self): + test_file = self.get_test_loc('copyrights/cedrik_java-java.java') expected = [ 'copyright (c) 2005-2006 Cedrik LIME', ] @@ -486,15 +486,15 @@ def test_copyright_cedrik_java(self): expected_in_results=True, results_in_expected=False) - def test_copyright_cern(self): - test_file = self.get_test_loc('copyrights/copyright_cern-TestMatrix_D_java.java') + def test_cern(self): + test_file = self.get_test_loc('copyrights/cern-TestMatrix_D_java.java') expected = [ 'Copyright 1999 CERN - European Organization for Nuclear Research.', ] check_detection(expected, test_file) - def test_copyright_cern_matrix2d_java(self): - test_file = self.get_test_loc('copyrights/copyright_cern_matrix2d_java-TestMatrix_D_java.java') + def test_cern_matrix2d_java(self): + test_file = self.get_test_loc('copyrights/cern_matrix2d_java-TestMatrix_D_java.java') expected = [ 'Copyright 1999 CERN - European Organization for Nuclear Research.', 'Copyright (c) 1998

Company PIERSOL Engineering Inc.', @@ -502,45 +502,45 @@ def test_copyright_cern_matrix2d_java(self): ] check_detection(expected, test_file) - def test_copyright_chameleon_assembly(self): - test_file = self.get_test_loc('copyrights/copyright_chameleon_assembly-9_9_setjmp_S.S') + def test_chameleon_assembly(self): + test_file = self.get_test_loc('copyrights/chameleon_assembly-9_9_setjmp_S.S') expected = [ 'Copyright Chameleon Systems, 1999', ] check_detection(expected, test_file) - def test_copyright_co_cust(self): - test_file = self.get_test_loc('copyrights/copyright_co_cust-copyright_java.java') + def test_co_cust(self): + test_file = self.get_test_loc('copyrights/co_cust-java.java') expected = [ 'Copyright (c) 2009

Company Customer Identity Hidden', ] check_detection(expected, test_file) - def test_copyright_colin_android(self): - test_file = self.get_test_loc('copyrights/copyright_colin_android-bsdiff_c.c') + def test_colin_android(self): + test_file = self.get_test_loc('copyrights/colin_android-bsdiff_c.c') expected = [ 'Copyright (c) 2009 The Android Open Source Project', 'Copyright 2003-2005 Colin Percival', ] check_detection(expected, test_file) - def test_copyright_company_in_txt(self): - test_file = self.get_test_loc('copyrights/copyright_company_in_txt-9.txt') + def test_company_in_txt(self): + test_file = self.get_test_loc('copyrights/company_in_txt-9.txt') expected = [ 'Copyright (c) 2008-2011 Company Name Incorporated', ] check_detection(expected, test_file) - def test_copyright_complex_4_line_statement_in_text(self): - test_file = self.get_test_loc('copyrights/copyright_complex_4_line_statement_in_text-9.txt') + def test_complex_4_line_statement_in_text(self): + test_file = self.get_test_loc('copyrights/complex_4_line_statement_in_text-9.txt') expected = [ 'Copyright 2002 Jonas Borgstrom 2002 Daniel Lundin 2002 CodeFactory AB', 'Copyright (c) 1994 The Regents of the University of California', ] check_detection(expected, test_file) - def test_copyright_complex_notice(self): - test_file = self.get_test_loc('copyrights/copyright_complex_notice-NOTICE') + def test_complex_notice(self): + test_file = self.get_test_loc('copyrights/complex_notice-NOTICE') expected = [ 'Copyright (c) 2003, Steven G. Kargl', 'Copyright (c) 2003 Mike Barcroft ', @@ -572,8 +572,8 @@ def test_copyright_complex_notice(self): ] check_detection(expected, test_file) - def test_copyright_complex_notice_sun_microsystems_on_multiple_lines(self): - test_file = self.get_test_loc('copyrights/copyright_complex_notice_sun_microsystems_on_multiple_lines-NOTICE') + def test_complex_notice_sun_microsystems_on_multiple_lines(self): + test_file = self.get_test_loc('copyrights/complex_notice_sun_microsystems_on_multiple_lines-NOTICE') expected = [ 'Copyright 1999-2006 The Apache Software Foundation', 'copyright (c) 1999-2002, Lotus Development Corporation., http://www.lotus.com.', @@ -586,29 +586,29 @@ def test_copyright_complex_notice_sun_microsystems_on_multiple_lines(self): ] check_detection(expected, test_file) - def test_copyright_config(self): - test_file = self.get_test_loc('copyrights/copyright_config-config_guess.guess') + def test_config(self): + test_file = self.get_test_loc('copyrights/config-config_guess.guess') expected = [ 'Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_config1_guess(self): - test_file = self.get_test_loc('copyrights/copyright_config1_guess-config_guess.guess') + def test_config1_guess(self): + test_file = self.get_test_loc('copyrights/config1_guess-config_guess.guess') expected = [ 'Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_copyright_camelcase_br_diagnostics_h(self): - test_file = self.get_test_loc('copyrights/copyright_copyright_camelcase_br_diagnostics_h-br_diagnostics_h.h') + def test_camelcase_br_diagnostics_h(self): + test_file = self.get_test_loc('copyrights/camelcase_br_diagnostics_h-br_diagnostics_h.h') expected = [ 'Copyright 2011 by BitRouter', ] check_detection(expected, test_file) - def test_copyright_coreutils_debian(self): - test_file = self.get_test_loc('copyrights/copyright_coreutils_debian-coreutils_copyright.copyright') + def test_coreutils_debian(self): + test_file = self.get_test_loc('copyrights/coreutils_debian-coreutils.copyright') expected = [ 'Copyright (c) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.', 'Copyright (c) 1990, 1993, 1994 The Regents of the University of California', @@ -632,22 +632,22 @@ def test_copyright_coreutils_debian(self): ] check_detection(expected, test_file) - def test_copyright_dag_c(self): - test_file = self.get_test_loc('copyrights/copyright_dag_c-s_fabsl_c.c') + def test_dag_c(self): + test_file = self.get_test_loc('copyrights/dag_c-s_fabsl_c.c') expected = [ 'Copyright (c) 2003 Dag-Erling Coidan Smrgrav', ] check_detection(expected, test_file) - def test_copyright_dag_elring_notice(self): - test_file = self.get_test_loc('copyrights/copyright_dag_elring_notice-NOTICE') + def test_dag_elring_notice(self): + test_file = self.get_test_loc('copyrights/dag_elring_notice-NOTICE') expected = [ 'Copyright (c) 2003 Dag-Erling Codan Smrgrav', ] check_detection(expected, test_file) - def test_copyright_dash_in_name(self): - test_file = self.get_test_loc('copyrights/copyright_dash_in_name-Makefile') + def test_dash_in_name(self): + test_file = self.get_test_loc('copyrights/dash_in_name-Makefile') expected = [ '(c) 2011 - Anycompany, LLC', ] @@ -655,43 +655,43 @@ def test_copyright_dash_in_name(self): expected_in_results=False, results_in_expected=True) - def test_copyright_dasher_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_dasher_copyright_label-dasher_copyright_label.label') + def test_dasher(self): + test_file = self.get_test_loc('copyrights/dasher-dasher.label') expected = [ 'Copyright (c) 1998-2008 The Dasher Project', ] check_detection(expected, test_file) - def test_copyright_date_range_dahua_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_date_range_dahua_in_c-c.c') + def test_date_range_dahua_in_c(self): + test_file = self.get_test_loc('copyrights/date_range_dahua_in_c-c.c') expected = [ '(c) Copyright 2006 to 2007 Dahua Digital.', ] check_detection(expected, test_file) - def test_copyright_date_range_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_date_range_in_c-c.c') + def test_date_range_in_c(self): + test_file = self.get_test_loc('copyrights/date_range_in_c-c.c') expected = [ 'Copyright (c) ImageSilicon Tech. (2006 - 2007)', ] check_detection(expected, test_file) - def test_copyright_date_range_in_c_2(self): - test_file = self.get_test_loc('copyrights/copyright_date_range_in_c_2-c.c') + def test_date_range_in_c_2(self): + test_file = self.get_test_loc('copyrights/date_range_in_c_2-c.c') expected = [ '(c) Copyright 2005 to 2007 ImageSilicon? Tech.,ltd', ] check_detection(expected, test_file) - def test_copyright_debian_archive_keyring_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_debian_archive_keyring_copyright-debian_archive_keyring_copyright.copyright') + def test_debian_archive_keyring(self): + test_file = self.get_test_loc('copyrights/debian_archive_keyring-debian_archive_keyring.copyright') expected = [ 'Copyright (c) 2006 Michael Vogt ', ] check_detection(expected, test_file) - def test_copyright_debian_lib_1(self): - test_file = self.get_test_loc('copyrights/copyright_debian_lib_1-libmono_cairo_cil_copyright_label.label') + def test_debian_lib_1(self): + test_file = self.get_test_loc('copyrights/debian_lib_1-libmono_cairo_cil.label') expected = [ 'Copyright 2004 The Apache Software Foundation', 'Copyright (c) 2001-2005 Novell', @@ -711,8 +711,8 @@ def test_copyright_debian_lib_1(self): ] check_detection(expected, test_file) - def test_copyright_debian_lib_2(self): - test_file = self.get_test_loc('copyrights/copyright_debian_lib_2-libmono_cairo_cil_copyright.copyright') + def test_debian_lib_2(self): + test_file = self.get_test_loc('copyrights/debian_lib_2-libmono_cairo_cil.copyright') expected = [ 'Copyright 2004 The Apache Software Foundation', 'Copyright (c) 2001-2005 Novell', @@ -732,8 +732,8 @@ def test_copyright_debian_lib_2(self): ] check_detection(expected, test_file) - def test_copyright_debian_lib_3(self): - test_file = self.get_test_loc('copyrights/copyright_debian_lib_3-libmono_security_cil_copyright.copyright') + def test_debian_lib_3(self): + test_file = self.get_test_loc('copyrights/debian_lib_3-libmono_security_cil.copyright') expected = [ 'Copyright 2004 The Apache Software Foundation', 'Copyright (c) 2001-2005 Novell', @@ -753,8 +753,8 @@ def test_copyright_debian_lib_3(self): ] check_detection(expected, test_file) - def test_copyright_debian_multi_names_on_one_line(self): - test_file = self.get_test_loc('copyrights/copyright_debian_multi_names_on_one_line-libgdata__copyright.copyright') + def test_debian_multi_names_on_one_line(self): + test_file = self.get_test_loc('copyrights/debian_multi_names_on_one_line-libgdata.copyright') expected = [ 'Copyright 1999-2004 Ximian, Inc. 1999-2005 Novell, Inc.', 'copyright 2000-2003 Ximian, Inc. , 2003 Gergo Erdi', @@ -780,8 +780,8 @@ def test_copyright_debian_multi_names_on_one_line(self): # expected_in_results=False, # results_in_expected=True) - def test_copyright_dionysos_c(self): - test_file = self.get_test_loc('copyrights/copyright_dionysos_c-c.c') + def test_dionysos_c(self): + test_file = self.get_test_loc('copyrights/dionysos_c-c.c') expected = [ 'COPYRIGHT (c) 2006 - 2009 DIONYSOS', 'COPYRIGHT (c) ADIONYSOS 2006 - 2009', @@ -796,15 +796,15 @@ def test_copyright_dionysos_c(self): ] check_detection(expected, test_file) - def test_copyright_disclaimed(self): - test_file = self.get_test_loc('copyrights/copyright_disclaimed-c.c') + def test_disclaimed(self): + test_file = self.get_test_loc('copyrights/disclaimed-c.c') expected = [ 'Copyright disclaimed 2003 by Andrew Clarke', ] check_detection(expected, test_file) - def test_copyright_djvulibre_desktop_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_djvulibre_desktop_copyright-djvulibre_desktop_copyright.copyright') + def test_djvulibre_desktop(self): + test_file = self.get_test_loc('copyrights/djvulibre_desktop-djvulibre_desktop.copyright') expected = [ 'Copyright (c) 2002 Leon Bottou and Yann Le Cun', 'Copyright (c) 2001 AT&T', @@ -812,8 +812,8 @@ def test_copyright_djvulibre_desktop_copyright(self): ] check_detection(expected, test_file) - def test_copyright_docbook_xsl_doc_html_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_docbook_xsl_doc_html_copyright-docbook_xsl_doc_html_copyright.copyright') + def test_docbook_xsl_doc_html(self): + test_file = self.get_test_loc('copyrights/docbook_xsl_doc_html-docbook_xsl_doc_html.copyright') expected = [ 'Copyright (c) 1999-2007 Norman Walsh', 'Copyright (c) 2003 Jiri Kosek', @@ -822,15 +822,15 @@ def test_copyright_docbook_xsl_doc_html_copyright(self): ] check_detection(expected, test_file) - def test_copyright_drand48_c(self): - test_file = self.get_test_loc('copyrights/copyright_drand48_c-drand_c.c') + def test_drand48_c(self): + test_file = self.get_test_loc('copyrights/drand48_c-drand_c.c') expected = [ 'Copyright (c) 1993 Martin Birgmeier', ] check_detection(expected, test_file) - def test_copyright_ed_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_ed_copyright-ed_copyright.copyright') + def test_ed(self): + test_file = self.get_test_loc('copyrights/ed-ed.copyright') expected = [ 'Copyright (c) 1993, 1994 Andrew Moore , Talke Studio', 'Copyright (c) 2006, 2007 Antonio Diaz Diaz', @@ -839,88 +839,88 @@ def test_copyright_ed_copyright(self): ] check_detection(expected, test_file) - def test_copyright_epiphany_browser_data_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_epiphany_browser_data_copyright_label-epiphany_browser_data_copyright_label.label') + def test_epiphany_browser_data(self): + test_file = self.get_test_loc('copyrights/epiphany_browser_data-epiphany_browser_data.label') expected = [ 'Copyright (c) 2004 the Initial Developer.', '(c) 2003-2007, the Debian GNOME team ', ] check_detection(expected, test_file) - def test_copyright_eric_young_c(self): - test_file = self.get_test_loc('copyrights/copyright_eric_young_c-c.c') + def test_eric_young_c(self): + test_file = self.get_test_loc('copyrights/eric_young_c-c.c') expected = [ 'Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au)', ] check_detection(expected, test_file) - def test_copyright_errno_atheros(self): - test_file = self.get_test_loc('copyrights/copyright_errno_atheros-c.c') + def test_errno_atheros(self): + test_file = self.get_test_loc('copyrights/errno_atheros-c.c') expected = [ 'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.', ] check_detection(expected, test_file) - def test_copyright_errno_atheros_ah_h(self): - test_file = self.get_test_loc('copyrights/copyright_errno_atheros_ah_h-ah_h.h') + def test_errno_atheros_ah_h(self): + test_file = self.get_test_loc('copyrights/errno_atheros_ah_h-ah_h.h') expected = [ 'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.', ] check_detection(expected, test_file) - def test_copyright_errno_c(self): - test_file = self.get_test_loc('copyrights/copyright_errno_c-c.c') + def test_errno_c(self): + test_file = self.get_test_loc('copyrights/errno_c-c.c') expected = [ 'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.', ] check_detection(expected, test_file) - def test_copyright_esmertec_java(self): - test_file = self.get_test_loc('copyrights/copyright_esmertec_java-java.java') + def test_esmertec_java(self): + test_file = self.get_test_loc('copyrights/esmertec_java-java.java') expected = [ 'Copyright (c) 2008 Esmertec AG', 'Copyright (c) 2008 The Android Open Source Project', ] check_detection(expected, test_file) - def test_copyright_essential_smoke(self): - test_file = self.get_test_loc('copyrights/copyright_essential_smoke-ibm_c.c') + def test_essential_smoke(self): + test_file = self.get_test_loc('copyrights/essential_smoke-ibm_c.c') expected = [ 'Copyright IBM and others (c) 2008', 'Copyright Eclipse, IBM and others (c) 2008', ] check_detection(expected, test_file) - def test_copyright_expat_h(self): - test_file = self.get_test_loc('copyrights/copyright_expat_h-expat_h.h') + def test_expat_h(self): + test_file = self.get_test_loc('copyrights/expat_h-expat_h.h') expected = [ 'Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd', ] check_detection(expected, test_file) - def test_copyright_ext_all_js(self): - test_file = self.get_test_loc('copyrights/copyright_ext_all_js-ext_all_js.js') + def test_ext_all_js(self): + test_file = self.get_test_loc('copyrights/ext_all_js-ext_all_js.js') expected = [ 'Copyright (c) 2006-2009 Ext JS, LLC', ] check_detection(expected, test_file) - def test_copyright_extjs_c(self): - test_file = self.get_test_loc('copyrights/copyright_extjs_c-c.c') + def test_extjs_c(self): + test_file = self.get_test_loc('copyrights/extjs_c-c.c') expected = [ 'Copyright (c) 2006-2007, Ext JS, LLC.', ] check_detection(expected, test_file) - def test_copyright_fsf_py(self): - test_file = self.get_test_loc('copyrights/copyright_fsf_py-999_py.py') + def test_fsf_py(self): + test_file = self.get_test_loc('copyrights/fsf_py-999_py.py') expected = [ 'Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_gailly(self): - test_file = self.get_test_loc('copyrights/copyright_gailly-c.c') + def test_gailly(self): + test_file = self.get_test_loc('copyrights/gailly-c.c') expected = [ 'Copyright (c) 1992-1993 Jean-loup Gailly.', 'Copyright (c) 1992-1993 Jean-loup Gailly', @@ -928,15 +928,15 @@ def test_copyright_gailly(self): ] check_detection(expected, test_file) - def test_copyright_geoff_js(self): - test_file = self.get_test_loc('copyrights/copyright_geoff_js-js.js') + def test_geoff_js(self): + test_file = self.get_test_loc('copyrights/geoff_js-js.js') expected = [ 'Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis', ] check_detection(expected, test_file) - def test_copyright_gnome_session_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_gnome_session_copyright-gnome_session_copyright.copyright') + def test_gnome_session(self): + test_file = self.get_test_loc('copyrights/gnome_session-gnome_session.copyright') expected = [ 'Copyright (c) 1999-2009 Red Hat, Inc.', 'Copyright (c) 1999-2007 Novell, Inc.', @@ -953,8 +953,8 @@ def test_copyright_gnome_session_copyright(self): ] check_detection(expected, test_file) - def test_copyright_gnome_system_monitor_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_gnome_system_monitor_copyright-gnome_system_monitor_copyright.copyright') + def test_gnome_system_monitor(self): + test_file = self.get_test_loc('copyrights/gnome_system_monitor-gnome_system_monitor.copyright') expected = [ 'Copyright Holders: Kevin Vandersloot Erik Johnsson ', ] @@ -962,8 +962,8 @@ def test_copyright_gnome_system_monitor_copyright(self): expected_in_results=False, results_in_expected=True) - def test_copyright_gnome_system_monitor_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_gnome_system_monitor_copyright_label-gnome_system_monitor_copyright_label.label') + def test_gnome_system_monitor_label(self): + test_file = self.get_test_loc('copyrights/gnome_system_monitor-gnome_system_monitor.label') expected = [ 'Copyright Holders: Kevin Vandersloot Erik Johnsson ', ] @@ -971,8 +971,8 @@ def test_copyright_gnome_system_monitor_copyright_label(self): expected_in_results=False, results_in_expected=True) - def test_copyright_gobjc_4_3_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_gobjc_4_3_copyright-gobjc__copyright.copyright') + def test_gobjc_4_3(self): + test_file = self.get_test_loc('copyrights/gobjc_4_3-gobjc.copyright') expected = [ 'Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.', 'copyright Free Software Foundation', @@ -981,46 +981,46 @@ def test_copyright_gobjc_4_3_copyright(self): ] check_detection(expected, test_file) - def test_copyright_google_closure_templates_java_html(self): - test_file = self.get_test_loc('copyrights/copyright_google_closure_templates_java_html-html.html') + def test_google_closure_templates_java_html(self): + test_file = self.get_test_loc('copyrights/google_closure_templates_java_html-html.html') expected = [ '(c) 2009 Google', ] check_detection(expected, test_file) - def test_copyright_google_view_layout1_xml(self): - test_file = self.get_test_loc('copyrights/copyright_google_view_layout1_xml-view_layout_xml.xml') + def test_google_view_layout1_xml(self): + test_file = self.get_test_loc('copyrights/google_view_layout1_xml-view_layout_xml.xml') expected = [ 'Copyright (c) 2008 Google Inc.', ] check_detection(expected, test_file) - def test_copyright_group(self): - test_file = self.get_test_loc('copyrights/copyright_group-c.c') + def test_group(self): + test_file = self.get_test_loc('copyrights/group-c.c') expected = [ 'Copyright (c) 2014 ARRis Group, Inc.', 'Copyright (c) 2013 ARRIS Group, Inc.', ] check_detection(expected, test_file) - def test_copyright_gsoap(self): - test_file = self.get_test_loc('copyrights/copyright_gsoap-gSOAP') + def test_gsoap(self): + test_file = self.get_test_loc('copyrights/gsoap-gSOAP') expected = [ 'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.', 'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.', ] check_detection(expected, test_file) - def test_copyright_gstreamer0_fluendo_mp3_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_gstreamer0_fluendo_mp3_copyright-gstreamer__fluendo_mp_copyright.copyright') + def test_gstreamer0_fluendo_mp3(self): + test_file = self.get_test_loc('copyrights/gstreamer0_fluendo_mp3-gstreamer_fluendo_mp.copyright') expected = [ 'Copyright (c) 2005,2006 Fluendo', 'Copyright 2005 Fluendo', ] check_detection(expected, test_file) - def test_copyright_hall(self): - test_file = self.get_test_loc('copyrights/copyright_hall-copyright.txt') + def test_hall(self): + test_file = self.get_test_loc('copyrights/hall-copyright.txt') expected = [ 'Copyright (c) 2004, Richard S. Hall', 'Copyright (c) 2004, Didier Donsez', @@ -1028,8 +1028,8 @@ def test_copyright_hall(self): ] check_detection(expected, test_file) - def test_copyright_hans_jurgen_htm(self): - test_file = self.get_test_loc('copyrights/copyright_hans_jurgen_htm-9_html.html') + def test_hans_jurgen_htm(self): + test_file = self.get_test_loc('copyrights/hans_jurgen_htm-9_html.html') expected = [ 'Copyright (c) 2006 by Hans-Jurgen Koch.', ] @@ -1037,22 +1037,22 @@ def test_copyright_hans_jurgen_htm(self): expected_in_results=True, results_in_expected=False) - def test_copyright_hansen_cs(self): - test_file = self.get_test_loc('copyrights/copyright_hansen_cs-cs.cs') + def test_hansen_cs(self): + test_file = self.get_test_loc('copyrights/hansen_cs-cs.cs') expected = [ 'Web Applications Copyright 2009 - Thomas Hansen thomas@ra-ajax.org.', ] check_detection(expected, test_file) - def test_copyright_hciattach_qualcomm1_c(self): - test_file = self.get_test_loc('copyrights/copyright_hciattach_qualcomm1_c-hciattach_qualcomm_c.c') + def test_hciattach_qualcomm1_c(self): + test_file = self.get_test_loc('copyrights/hciattach_qualcomm1_c-hciattach_qualcomm_c.c') expected = [ 'Copyright (c) 2005-2010 Marcel Holtmann ', ] check_detection(expected, test_file) - def test_copyright_hibernate_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_hibernate_copyright_label-hibernate_copyright_label.label') + def test_hibernate(self): + test_file = self.get_test_loc('copyrights/hibernate-hibernate.label') expected = [ 'Copyright (c) 2004-2006 Bernard Blackham ', 'copyright (c) 2004-2006 Cameron Patrick ', @@ -1060,24 +1060,24 @@ def test_copyright_hibernate_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_holtmann(self): - test_file = self.get_test_loc('copyrights/copyright_holtmann-hciattach_qualcomm_c.c') + def test_holtmann(self): + test_file = self.get_test_loc('copyrights/holtmann-hciattach_qualcomm_c.c') expected = [ 'Copyright (c) 2005-2010 Marcel Holtmann ', 'Copyright (c) 2010, Code Aurora Forum.', ] check_detection(expected, test_file) - def test_copyright_hostapd_cli_c(self): - test_file = self.get_test_loc('copyrights/copyright_hostapd_cli_c-hostapd_cli_c.c') + def test_hostapd_cli_c(self): + test_file = self.get_test_loc('copyrights/hostapd_cli_c-hostapd_cli_c.c') expected = [ 'Copyright (c) 2004-2005, Jouni Malinen ', 'Copyright (c) 2004-2005, Jouni Malinen ', ] check_detection(expected, test_file) - def test_copyright_hp_notice(self): - test_file = self.get_test_loc('copyrights/copyright_hp_notice-NOTICE') + def test_hp_notice(self): + test_file = self.get_test_loc('copyrights/hp_notice-NOTICE') expected = [ '(c) Copyright 2007 Hewlett-Packard Development Company, L.P.', '(c) Copyright 2008 Hewlett-Packard Development Company, L.P.', @@ -1090,8 +1090,8 @@ def test_copyright_hp_notice(self): ] check_detection(expected, test_file) - def test_copyright_hpijs_ppds_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_hpijs_ppds_copyright_label-hpijs_ppds_copyright_label.label') + def test_hpijs_ppds(self): + test_file = self.get_test_loc('copyrights/hpijs_ppds-hpijs_ppds.label') expected = [ 'Copyright (c) 2003-2004 by Torsten Landschoff ', 'Copyright (c) 2004-2006 by Henrique de Moraes Holschuh ', @@ -1100,8 +1100,8 @@ def test_copyright_hpijs_ppds_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_ibm_c(self): - test_file = self.get_test_loc('copyrights/copyright_ibm_c-ibm_c.c') + def test_ibm_c(self): + test_file = self.get_test_loc('copyrights/ibm_c-ibm_c.c') expected = [ 'Copyright (c) ibm technologies 2008', 'Copyright (c) IBM Corporation 2008', @@ -1112,8 +1112,8 @@ def test_copyright_ibm_c(self): ] check_detection(expected, test_file) - def test_copyright_icedax_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_icedax_copyright_label-icedax_copyright_label.label') + def test_icedax(self): + test_file = self.get_test_loc('copyrights/icedax-icedax.label') expected = [ 'Copyright 1998-2003 Heiko Eissfeldt', '(c) Peter Widow', @@ -1130,15 +1130,15 @@ def test_copyright_icedax_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_ifrename_c(self): - test_file = self.get_test_loc('copyrights/copyright_ifrename_c-ifrename_c.c') + def test_ifrename_c(self): + test_file = self.get_test_loc('copyrights/ifrename_c-ifrename_c.c') expected = [ 'Copyright (c) 2004 Jean Tourrilhes ', ] check_detection(expected, test_file) - def test_copyright_illinois_html(self): - test_file = self.get_test_loc('copyrights/copyright_illinois_html-9_html.html') + def test_illinois_html(self): + test_file = self.get_test_loc('copyrights/illinois_html-9_html.html') expected = [ 'Copyright 1999,2000,2001,2002,2003,2004 The Board of Trustees of the University of Illinois', ] @@ -1146,30 +1146,30 @@ def test_copyright_illinois_html(self): expected_in_results=False, results_in_expected=True) - def test_copyright_in_COPYING_gpl(self): - test_file = self.get_test_loc('copyrights/copyright_in_COPYING_gpl-COPYING_gpl.gpl') + def test_COPYING_gpl(self): + test_file = self.get_test_loc('copyrights/COPYING_gpl-COPYING_gpl.gpl') expected = [ 'Copyright (c) 1989, 1991 Free Software Foundation, Inc.', 'copyrighted by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_in_COPYRIGHT_madwifi(self): - test_file = self.get_test_loc('copyrights/copyright_in_COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi') + def test_COPYRIGHT_madwifi(self): + test_file = self.get_test_loc('copyrights/COPYRIGHT_madwifi-COPYRIGHT_madwifi.madwifi') expected = [ 'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.', ] check_detection(expected, test_file) - def test_copyright_in_README(self): - test_file = self.get_test_loc('copyrights/copyright_in_README-README') + def test_README(self): + test_file = self.get_test_loc('copyrights/README-README') expected = [ 'Copyright (c) 2002-2006, Jouni Malinen ', ] check_detection(expected, test_file) - def test_copyright_in_bash(self): - test_file = self.get_test_loc('copyrights/copyright_in_bash-shell_sh.sh') + def test_bash(self): + test_file = self.get_test_loc('copyrights/bash-shell_sh.sh') expected = [ 'Copyright (c) 2008 Hewlett-Packard Development Company, L.P.', ] @@ -1177,7 +1177,7 @@ def test_copyright_in_bash(self): expected_in_results=False, results_in_expected=True) - def test_copyright_in_binary_file_with_metadata(self): + def test_binary_file_with_metadata(self): test_file = self.get_test_loc('copyrights/mp4_with_metadata.mp4') expected = [ 'copyright (c) 2016 Philippe', @@ -1186,21 +1186,21 @@ def test_copyright_in_binary_file_with_metadata(self): check_detection(expected, test_file) @expectedFailure - def test_copyright_in_windows_binary_lib(self): - test_file = self.get_test_loc('copyrights/copyright_in_binary_lib-php_embed_lib.lib') + def test_windows_binary_lib(self): + test_file = self.get_test_loc('copyrights/binary_lib-php_embed_lib.lib') expected = [ 'Copyright nexB and others (c) 2012', ] check_detection(expected, test_file) - def test_copyright_in_windows_binary_dll_ignore_leading_junk(self): + def test_windows_binary_dll_ignore_leading_junk(self): test_file = self.get_test_loc('copyrights/windows.dll') expected = [ 'Copyright nexB and others (c) 2012' ] check_detection(expected, test_file) - def test_copyright_in_elf_binary_treats_new_lines_as_spaces(self): + def test_elf_binary_treats_new_lines_as_spaces(self): test_file = self.get_test_loc('copyrights/tor.bin') expected = [ u'Copyright (c) 2001-2004, Roger Dingledine', @@ -1209,15 +1209,15 @@ def test_copyright_in_elf_binary_treats_new_lines_as_spaces(self): ] check_detection(expected, test_file, what='copyrights') - def test_copyright_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_in_c-c.c') + def test_c(self): + test_file = self.get_test_loc('copyrights/c-c.c') expected = [ 'COPYRIGHT (c) STMicroelectronics 2005.', ] check_detection(expected, test_file) - def test_copyright_in_c_include(self): - test_file = self.get_test_loc('copyrights/copyright_in_c_include-h.h') + def test_c_include(self): + test_file = self.get_test_loc('copyrights/c_include-h.h') expected = [ 'COPYRIGHT (c) ST-Microelectronics 1998.', ] @@ -1225,143 +1225,142 @@ def test_copyright_in_c_include(self): expected_in_results=False, results_in_expected=True) - def test_copyright_in_dll_approximate(self): - test_file = self.get_test_loc('copyrights/copyright_in_dll-9_msvci_dll.dll') + def test_dll_approximate(self): + test_file = self.get_test_loc('copyrights/dll-9_msvci_dll.dll') expected = [ 'Copyright Myself and Me, Inc QjT F4P', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_in_dll_exact(self): - test_file = self.get_test_loc('copyrights/copyright_in_dll-9_msvci_dll.dll') + def test_dll_exact(self): + test_file = self.get_test_loc('copyrights/dll-9_msvci_dll.dll') expected = [ 'Copyright Myself and Me, Inc', ] check_detection(expected, test_file) - - def test_copyright_in_h(self): - test_file = self.get_test_loc('copyrights/copyright_in_h-h.h') + def test_h(self): + test_file = self.get_test_loc('copyrights/h-h.h') expected = [ 'COPYRIGHT (c) ST-Microelectronics 1998.', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_in_html_comments(self): - test_file = self.get_test_loc('copyrights/copyright_in_html_comments-html.html') + def test_html_comments(self): + test_file = self.get_test_loc('copyrights/html_comments-html.html') expected = [ 'Copyright 2008 ABCD, LLC.', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_in_html_incorrect(self): - test_file = self.get_test_loc('copyrights/copyright_in_html_incorrect-detail_9_html.html') + def test_html_incorrect(self): + test_file = self.get_test_loc('copyrights/html_incorrect-detail_9_html.html') expected = [ 'A12 Oe (c) 2004-2009', ] check_detection(expected, test_file) - def test_copyright_in_maven_pom_xstream(self): - test_file = self.get_test_loc('copyrights/copyright_in_maven_pom_xstream-pom_xml.xml') + def test_maven_pom_xstream(self): + test_file = self.get_test_loc('copyrights/maven_pom_xstream-pom_xml.xml') expected = [ 'Copyright (c) 2006 Joe Walnes.', 'Copyright (c) 2006, 2007, 2008 XStream committers.', ] check_detection(expected, test_file) - def test_copyright_in_media(self): - test_file = self.get_test_loc('copyrights/copyright_in_media-a_png.png') + def test_media(self): + test_file = self.get_test_loc('copyrights/media-a_png.png') expected = [ 'Copyright nexB and others (c) 2012', ] check_detection(expected, test_file) - def test_copyright_in_phps(self): - test_file = self.get_test_loc('copyrights/copyright_in_phps-phps.phps') + def test_phps(self): + test_file = self.get_test_loc('copyrights/phps-phps.phps') expected = [ 'copyright 2005 Michal Migurski', ] check_detection(expected, test_file) - def test_copyright_in_postcript(self): - test_file = self.get_test_loc('copyrights/copyright_in_postcript-9__ps.ps') + def test_postcript(self): + test_file = self.get_test_loc('copyrights/postcript-9_ps.ps') expected = [ 'Copyright 1999 Radical Eye Software', ] check_detection(expected, test_file) - def test_copyright_in_txt(self): - test_file = self.get_test_loc('copyrights/copyright_in_txt.txt') + def test_txt(self): + test_file = self.get_test_loc('copyrights/txt.txt') expected = [ 'Copyright ?2004-2006 Company', ] check_detection(expected, test_file) - def test_copyright_in_visio_doc(self): - test_file = self.get_test_loc('copyrights/copyright_in_visio_doc-Glitch_ERD_vsd.vsd') + def test_visio_doc(self): + test_file = self.get_test_loc('copyrights/visio_doc-Glitch_ERD_vsd.vsd') expected = [] check_detection(expected, test_file) - def test_copyright_inria_loss_of_holder_c(self): - test_file = self.get_test_loc('copyrights/copyright_inria_loss_of_holder_c-c.c') + def test_inria_loss_of_holder_c(self): + test_file = self.get_test_loc('copyrights/inria_loss_of_holder_c-c.c') expected = [ 'Copyright (c) 2000,2002,2003 INRIA, France Telecom', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_java(self): - test_file = self.get_test_loc('copyrights/copyright_java-java.java') + def test_java(self): + test_file = self.get_test_loc('copyrights/java-java.java') expected = [ 'Copyright (c) 1992-2002 by P.J. Plauger.', ] check_detection(expected, test_file) - def test_copyright_java_passing(self): - test_file = self.get_test_loc('copyrights/copyright_java-java.java') + def test_java_passing(self): + test_file = self.get_test_loc('copyrights/java-java.java') expected = [ 'Copyright (c) 1992-2002 by P.J.', ] check_detection(expected, test_file) - def test_copyright_jdoe(self): - test_file = self.get_test_loc('copyrights/copyright_jdoe-copyright_c.c') + def test_jdoe(self): + test_file = self.get_test_loc('copyrights/jdoe-c.c') expected = [ 'Copyright 2009 J-Doe.', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_json_in_phps(self): - test_file = self.get_test_loc('copyrights/copyright_json_in_phps-JSON_phps.phps') + def test_json_in_phps(self): + test_file = self.get_test_loc('copyrights/json_in_phps-JSON_phps.phps') expected = [ 'copyright 2005 Michal Migurski', ] check_detection(expected, test_file) - def test_copyright_json_in_phps_incorrect(self): - test_file = self.get_test_loc('copyrights/copyright_json_in_phps_incorrect-JSON_phps.phps') + def test_json_in_phps_incorrect(self): + test_file = self.get_test_loc('copyrights/json_in_phps_incorrect-JSON_phps.phps') expected = [] check_detection(expected, test_file) - def test_copyright_json_phps_html_incorrect(self): - test_file = self.get_test_loc('copyrights/copyright_json_phps_html_incorrect-JSON_phps_html.html') + def test_json_phps_html_incorrect(self): + test_file = self.get_test_loc('copyrights/json_phps_html_incorrect-JSON_phps_html.html') expected = [] check_detection(expected, test_file) @expectedFailure - def test_copyright_json_phps_html(self): - test_file = self.get_test_loc('copyrights/copyright_json_phps_html-JSON_phps_html.html') + def test_json_phps_html(self): + test_file = self.get_test_loc('copyrights/json_phps_html-JSON_phps_html.html') expected = [ 'copyright 2005 Michal Migurski', ] check_detection(expected, test_file) - def test_copyright_jsp_all_CAPS(self): - test_file = self.get_test_loc('copyrights/copyright_jsp_all_CAPS-jsp.jsp') + def test_jsp_all_CAPS(self): + test_file = self.get_test_loc('copyrights/jsp_all_CAPS-jsp.jsp') expected = [ 'copyright 2005-2006 Cedrik LIME', ] @@ -1369,8 +1368,8 @@ def test_copyright_jsp_all_CAPS(self): expected_in_results=False, results_in_expected=True) - def test_copyright_kaboom_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_kaboom_copyright-kaboom_copyright.copyright') + def test_kaboom(self): + test_file = self.get_test_loc('copyrights/kaboom-kaboom.copyright') expected = [ 'Copyright (c) 2009 Sune Vuorela ', 'Copyright (c) 2007-2009 George Kiagiadakis ', @@ -1379,8 +1378,8 @@ def test_copyright_kaboom_copyright(self): ] check_detection(expected, test_file) - def test_copyright_kbuild_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_kbuild_copyright-kbuild_copyright.copyright') + def test_kbuild(self): + test_file = self.get_test_loc('copyrights/kbuild-kbuild.copyright') expected = [ 'Copyright (c) 2005-2009 Knut St. Osmundsen ', 'Copyright (c) 1991-1993 The Regents of the University of California', @@ -1391,16 +1390,16 @@ def test_copyright_kbuild_copyright(self): ] check_detection(expected, test_file) - def test_copyright_kde_l10n_zhcn_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_kde_l10n_zhcn_copyright-kde_l_n_zhcn_copyright.copyright') + def test_kde_l10n_zhcn(self): + test_file = self.get_test_loc('copyrights/kde_l10n_zhcn-kde_l_n_zhcn.copyright') expected = [ 'Copyright (c) 1996-2009 The KDE Translation teams ', '(c) 2007-2009, Debian Qt/KDE Maintainers', ] check_detection(expected, test_file) - def test_copyright_leonardo_c(self): - test_file = self.get_test_loc('copyrights/copyright_leonardo_c-c.c') + def test_leonardo_c(self): + test_file = self.get_test_loc('copyrights/leonardo_c-c.c') expected = [ 'Copyright (c) 1994 by Leonardo DaVinci Societe', ] @@ -1408,8 +1407,8 @@ def test_copyright_leonardo_c(self): expected_in_results=False, results_in_expected=True) - def test_copyright_libadns1_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libadns1_copyright-libadns_copyright.copyright') + def test_libadns1(self): + test_file = self.get_test_loc('copyrights/libadns1-libadns.copyright') expected = [ 'Copyright 1997-2000 Ian Jackson', 'Copyright 1999 Tony Finch', @@ -1417,8 +1416,8 @@ def test_copyright_libadns1_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libc6_i686_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libc6_i686_copyright-libc_i_copyright.copyright') + def test_libc6_i686(self): + test_file = self.get_test_loc('copyrights/libc6_i686-libc_i.copyright') expected = [ 'Copyright (c) 1991,92,93,94,95,96,97,98,99,2000,2001,2002,2003,2004,2005, 2006,2007,2008 Free Software Foundation, Inc.', 'Copyright (c) 1991,92,93,94,95,96,97,98,99,2000,2001,2002,2003,2004,2005, 2006,2007,2008 Free Software Foundation, Inc.', @@ -1431,8 +1430,8 @@ def test_copyright_libc6_i686_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libcdio10_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libcdio10_copyright_label-libcdio_copyright_label.label') + def test_libcdio10(self): + test_file = self.get_test_loc('copyrights/libcdio10-libcdio.label') expected = [ 'Copyright (c) 1999, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Rocky Bernstein ', 'Copyright (c) 2000, 2001, 2003, 2004, 2005, 2008 Herbert Valerio Riedel', @@ -1456,16 +1455,16 @@ def test_copyright_libcdio10_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_libcelt0_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libcelt0_copyright-libcelt_copyright.copyright') + def test_libcelt0(self): + test_file = self.get_test_loc('copyrights/libcelt0-libcelt.copyright') expected = [ 'Copyright 2005-2007 Christopher Montgomery , Jean-Marc Valin , Timothy Terriberry', '(c) 2008, Ron', ] check_detection(expected, test_file) - def test_copyright_libcompress_raw_zlib_perl_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libcompress_raw_zlib_perl_copyright-libcompress_raw_zlib_perl_copyright.copyright') + def test_libcompress_raw_zlib_perl(self): + test_file = self.get_test_loc('copyrights/libcompress_raw_zlib_perl-libcompress_raw_zlib_perl.copyright') expected = [ 'Copyright 2005-2009, Paul Marquess ', 'Copyright 1995-2005, Jean-loup Gailly ', @@ -1475,15 +1474,15 @@ def test_copyright_libcompress_raw_zlib_perl_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libcpufreq0_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libcpufreq0_copyright-libcpufreq_copyright.copyright') + def test_libcpufreq0(self): + test_file = self.get_test_loc('copyrights/libcpufreq0-libcpufreq.copyright') expected = [ 'Copyright 2004-2006 Dominik Brodowski', ] check_detection(expected, test_file) - def test_copyright_libcrypt_ssleay_perl_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libcrypt_ssleay_perl_copyright-libcrypt_ssleay_perl_copyright.copyright') + def test_libcrypt_ssleay_perl(self): + test_file = self.get_test_loc('copyrights/libcrypt_ssleay_perl-libcrypt_ssleay_perl.copyright') expected = [ 'Copyright (c) 1999-2003 Joshua Chamas', 'Copyright (c) 1998 Gisle Aas', @@ -1491,34 +1490,34 @@ def test_copyright_libcrypt_ssleay_perl_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libepc_ui_1_0_1_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libepc_ui_1_0_1_copyright-libepc_ui__copyright.copyright') + def test_libepc_ui_1_0_1(self): + test_file = self.get_test_loc('copyrights/libepc_ui_1_0_1-libepc_ui.copyright') expected = [ 'Copyright (c) 2007, 2008 Openismus GmbH', ] check_detection(expected, test_file) - def test_copyright_libepc_ui_1_0_2_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libepc_ui_1_0_2_copyright_label-libepc_ui__copyright_label.label') + def test_libepc_ui_1_0_2(self): + test_file = self.get_test_loc('copyrights/libepc_ui_1_0_2-libepc_ui.label') expected = [ 'Copyright (c) 2007, 2008 Openismus GmbH', ] check_detection(expected, test_file) - def test_copyright_libfltk1_1_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libfltk1_1_copyright-libfltk_copyright.copyright') + def test_libfltk1_1(self): + test_file = self.get_test_loc('copyrights/libfltk1_1-libfltk.copyright') expected = [ 'Copyright (c) 1998-2009 Bill Spitzak spitzak@users.sourceforge.net', ] check_detection(expected, test_file) - def test_copyright_libgail18_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libgail18_copyright_label-libgail_copyright_label.label') + def test_libgail18(self): + test_file = self.get_test_loc('copyrights/libgail18-libgail.label') expected = [] check_detection(expected, test_file) - def test_copyright_libggiwmh0_target_x_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libggiwmh0_target_x_copyright-libggiwmh_target_x_copyright.copyright') + def test_libggiwmh0_target_x(self): + test_file = self.get_test_loc('copyrights/libggiwmh0_target_x-libggiwmh_target_x.copyright') expected = [ 'Copyright (c) 2005 Eric Faurot eric.faurot@gmail.com', 'Copyright (c) 2004 Peter Ekberg peda@lysator.liu.se', @@ -1529,8 +1528,8 @@ def test_copyright_libggiwmh0_target_x_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libgnome_desktop_2_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libgnome_desktop_2_copyright-libgnome_desktop__copyright.copyright') + def test_libgnome_desktop_2(self): + test_file = self.get_test_loc('copyrights/libgnome_desktop_2-libgnome_desktop.copyright') expected = [ 'Copyright (c) 1999, 2000 Red Hat Inc.', 'Copyright (c) 2001 Sid Vicious', @@ -1540,56 +1539,56 @@ def test_copyright_libgnome_desktop_2_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libgnome_media0_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libgnome_media0_copyright-libgnome_media_copyright.copyright') + def test_libgnome_media0(self): + test_file = self.get_test_loc('copyrights/libgnome_media0-libgnome_media.copyright') expected = [] check_detection(expected, test_file) - def test_copyright_libgoffice_0_8_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libgoffice_0_8_copyright_label-libgoffice__copyright_label.label') + def test_libgoffice_0_8(self): + test_file = self.get_test_loc('copyrights/libgoffice_0_8-libgoffice.label') expected = [ 'Copyright (c) 2003-2008 Jody Goldberg (jody@gnome.org) and others.', ] check_detection(expected, test_file) - def test_copyright_libgtkhtml2_0_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libgtkhtml2_0_copyright-libgtkhtml_copyright.copyright') + def test_libgtkhtml2_0(self): + test_file = self.get_test_loc('copyrights/libgtkhtml2_0-libgtkhtml.copyright') expected = [ 'Copyright 1999,2000,2001 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_libisc44_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libisc44_copyright-libisc_copyright.copyright') + def test_libisc44(self): + test_file = self.get_test_loc('copyrights/libisc44-libisc.copyright') expected = [ 'Copyright (c) 1996-2001 Internet Software Consortium.', ] check_detection(expected, test_file) - def test_copyright_libisccfg30_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libisccfg30_copyright-libisccfg_copyright.copyright') + def test_libisccfg30(self): + test_file = self.get_test_loc('copyrights/libisccfg30-libisccfg.copyright') expected = [ 'Copyright (c) 1996-2001 Internet Software Consortium', ] check_detection(expected, test_file) - def test_copyright_libisccfg40_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libisccfg40_copyright-libisccfg_copyright.copyright') + def test_libisccfg40(self): + test_file = self.get_test_loc('copyrights/libisccfg40-libisccfg.copyright') expected = [ 'Copyright (c) 1996-2001 Internet Software Consortium', ] check_detection(expected, test_file) - def test_copyright_libjpeg62_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libjpeg62_copyright-libjpeg_copyright.copyright') + def test_libjpeg62(self): + test_file = self.get_test_loc('copyrights/libjpeg62-libjpeg.copyright') expected = [ 'copyright (c) 1991-1998, Thomas G. Lane', 'copyright by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_libkeyutils1_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libkeyutils1_copyright_label-libkeyutils_copyright_label.label') + def test_libkeyutils1(self): + test_file = self.get_test_loc('copyrights/libkeyutils1-libkeyutils.label') expected = [ 'Copyright (c) 2005 Red Hat', 'Copyright (c) 2005 Red Hat', @@ -1597,15 +1596,15 @@ def test_copyright_libkeyutils1_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_liblocale_gettext_perl_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_liblocale_gettext_perl_copyright_label-liblocale_get_perl_copyright_label.label') + def test_liblocale_gettext_perl(self): + test_file = self.get_test_loc('copyrights/liblocale_gettext_perl-liblocale_get_perl.label') expected = [ 'Copyright 1996..2005 by Phillip Vandry ', ] check_detection(expected, test_file) - def test_copyright_libopenraw1_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libopenraw1_copyright_label-libopenraw_copyright_label.label') + def test_libopenraw1(self): + test_file = self.get_test_loc('copyrights/libopenraw1-libopenraw.label') expected = [ 'Copyright (c) 2007, David Paleino ', 'Copyright (c) 2005-2009, Hubert Figuiere ', @@ -1620,16 +1619,16 @@ def test_copyright_libopenraw1_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_libopenthreads12_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libopenthreads12_copyright-libopenthreads_copyright.copyright') + def test_libopenthreads12(self): + test_file = self.get_test_loc('copyrights/libopenthreads12-libopenthreads.copyright') expected = [ 'Copyright (c) 2002 Robert Osfield', 'Copyright (c) 1998 Julian Smart , Robert Roebling', ] check_detection(expected, test_file) - def test_copyright_libpam_ck_connector_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libpam_ck_connector_copyright-libpam_ck_connector_copyright.copyright') + def test_libpam_ck_connector(self): + test_file = self.get_test_loc('copyrights/libpam_ck_connector-libpam_ck_connector.copyright') expected = [ 'Copyright (c) 2006 William Jon McCann ', 'Copyright (c) 2007 David Zeuthen ', @@ -1638,23 +1637,23 @@ def test_copyright_libpam_ck_connector_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libpoppler3_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libpoppler3_copyright-libpoppler_copyright.copyright') + def test_libpoppler3(self): + test_file = self.get_test_loc('copyrights/libpoppler3-libpoppler.copyright') expected = [ 'Copyright (c) 1996-2003 Glyph & Cog, LLC', ] check_detection(expected, test_file) - def test_copyright_libqt4_scripttools_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libqt4_scripttools_copyright-libqt_scripttools_copyright.copyright') + def test_libqt4_scripttools(self): + test_file = self.get_test_loc('copyrights/libqt4_scripttools-libqt_scripttools.copyright') expected = [ '(c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies)', '(c) 1994-2008 Trolltech ASA', ] check_detection(expected, test_file) - def test_copyright_libqtscript4_gui_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libqtscript4_gui_copyright-libqtscript_gui_copyright.copyright') + def test_libqtscript4_gui(self): + test_file = self.get_test_loc('copyrights/libqtscript4_gui-libqtscript_gui.copyright') expected = [ 'Copyright (c) 2009 Modestas Vainius ', 'Copyright (c) Trolltech ASA', @@ -1663,23 +1662,23 @@ def test_copyright_libqtscript4_gui_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libsocks4_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libsocks4_copyright-libsocks_copyright.copyright') + def test_libsocks4(self): + test_file = self.get_test_loc('copyrights/libsocks4-libsocks.copyright') expected = [ 'Copyright (c) 1989 Regents of the University of California.', 'Portions Copyright (c) 1993, 1994, 1995 by NEC Systems Laboratory', ] check_detection(expected, test_file) - def test_copyright_libsox_fmt_alsa_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libsox_fmt_alsa_copyright-libsox_fmt_alsa_copyright.copyright') + def test_libsox_fmt_alsa(self): + test_file = self.get_test_loc('copyrights/libsox_fmt_alsa-libsox_fmt_alsa.copyright') expected = [ 'Copyright 1991 Lance Norskog And Sundry Contributors', ] check_detection(expected, test_file) - def test_copyright_libspeex1_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libspeex1_copyright-libspeex_copyright.copyright') + def test_libspeex1(self): + test_file = self.get_test_loc('copyrights/libspeex1-libspeex.copyright') expected = [ 'Copyright 2002-2007 Xiph.org Foundation', 'Copyright 2002-2007 Jean-Marc Valin', @@ -1691,8 +1690,8 @@ def test_copyright_libspeex1_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libstlport4_6ldbl_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libstlport4_6ldbl_copyright_label-libstlport_ldbl_copyright_label.label') + def test_libstlport4_6ldbl(self): + test_file = self.get_test_loc('copyrights/libstlport4_6ldbl-libstlport_ldbl.label') expected = [ 'Copyright (c) 1994 Hewlett-Packard Company', 'Copyright (c) 1996-1999 Silicon Graphics Computer Systems, Inc.', @@ -1701,8 +1700,8 @@ def test_copyright_libstlport4_6ldbl_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_libtdb1_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libtdb1_copyright-libtdb_copyright.copyright') + def test_libtdb1(self): + test_file = self.get_test_loc('copyrights/libtdb1-libtdb.copyright') expected = [ 'Copyright (c) Andrew Tridgell 1999-2004', 'Copyright (c) Paul Rusty Russell 2000', @@ -1710,8 +1709,8 @@ def test_copyright_libtdb1_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libuim6_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libuim6_copyright-libuim_copyright.copyright') + def test_libuim6(self): + test_file = self.get_test_loc('copyrights/libuim6-libuim.copyright') expected = [ 'Copyright (c) 2003-2007 uim Project http://uim.freedesktop.org/', 'COPYRIGHT (c) 1988-1994 BY PARADIGM ASSOCIATES INCORPORATED', @@ -1726,8 +1725,8 @@ def test_copyright_libuim6_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libxext6_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libxext6_copyright-libxext_copyright.copyright') + def test_libxext6(self): + test_file = self.get_test_loc('copyrights/libxext6-libxext.copyright') expected = [ 'Copyright 1986, 1987, 1988, 1989, 1994, 1998 The Open Group', 'Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts', @@ -1741,8 +1740,8 @@ def test_copyright_libxext6_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libxmlrpc_c3_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_libxmlrpc_c3_copyright-libxmlrpc_c_copyright.copyright') + def test_libxmlrpc_c3(self): + test_file = self.get_test_loc('copyrights/libxmlrpc_c3-libxmlrpc_c.copyright') expected = [ 'Copyright (c) 2001 by First Peer, Inc.', 'Copyright (c) 2001 by Eric Kidd.', @@ -1752,8 +1751,8 @@ def test_copyright_libxmlrpc_c3_copyright(self): ] check_detection(expected, test_file) - def test_copyright_libxt6_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_libxt6_copyright_label-libxt_copyright_label.label') + def test_libxt6(self): + test_file = self.get_test_loc('copyrights/libxt6-libxt.label') expected = [ 'Copyright 1987, 1988 by Digital Equipment Corporation , Maynard, Massachusetts', 'Copyright 1993 by Sun Microsystems, Inc. Mountain View', @@ -1763,38 +1762,38 @@ def test_copyright_libxt6_copyright_label(self): check_detection(expected, test_file) @expectedFailure - def test_copyright_license__qpl_v1_0_perfect(self): - test_file = self.get_test_loc('copyrights/copyright_license_qpl_v1_0_perfect-QPL_v.0') + def test_license_qpl_v1_0_perfect(self): + test_file = self.get_test_loc('copyrights/license_qpl_v1_0_perfect-QPL_v.0') expected = [ 'Copyright (c) 1999 Trolltech AS, Norway.', ] check_detection(expected, test_file) - def test_copyright_license_text_adaptive_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_adaptive_v1_0-Adaptive v.0') + def test_adaptive_v1_0(self): + test_file = self.get_test_loc('copyrights/adaptive_v1_0-Adaptive v.0') expected = [ '(c) Any Recipient', '(c) Each Recipient', ] check_detection(expected, test_file) - def test_copyright_license_text_adobe(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_adobe-Adobe') + def test_adobe(self): + test_file = self.get_test_loc('copyrights/adobe-Adobe') expected = [ 'Copyright (c) 2006 Adobe Systems Incorporated.', ] check_detection(expected, test_file) - def test_copyright_license_text_adobeflex2sdk(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_adobeflex2sdk-Adobeflex_sdk') + def test_adobeflex2sdk(self): + test_file = self.get_test_loc('copyrights/adobeflex2sdk-Adobeflex_sdk') expected = [ '(c) Adobe AIR', '(c) Material Improvement', ] check_detection(expected, test_file) - def test_copyright_license_text_afferogplv1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_afferogplv1-AfferoGPLv') + def test_afferogplv1(self): + test_file = self.get_test_loc('copyrights/afferogplv1-AfferoGPLv') expected = [ 'Copyright (c) 2002 Affero Inc.', 'copyright (c) 1989, 1991 Free Software Foundation, Inc.', @@ -1802,253 +1801,253 @@ def test_copyright_license_text_afferogplv1(self): ] check_detection(expected, test_file) - def test_copyright_license_text_afferogplv2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_afferogplv2-AfferoGPLv') + def test_afferogplv2(self): + test_file = self.get_test_loc('copyrights/afferogplv2-AfferoGPLv') expected = [ 'Copyright (c) 2007 Affero Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_afferogplv3(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_afferogplv3-AfferoGPLv') + def test_afferogplv3(self): + test_file = self.get_test_loc('copyrights/afferogplv3-AfferoGPLv') expected = [ 'Copyright (c) 2007 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_afl_v3_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_afl_v3_0-AFL_v.0') + def test_afl_v3_0(self): + test_file = self.get_test_loc('copyrights/afl_v3_0-AFL_v.0') expected = [ 'Copyright (c) 2005 Lawrence Rosen.', ] check_detection(expected, test_file) - def test_copyright_license_text_aladdin_free_public_license(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_aladdin_free_public_license-Aladdin Free Public License') + def test_aladdin_free_public_license(self): + test_file = self.get_test_loc('copyrights/aladdin_free_public_license-Aladdin Free Public License') expected = [ 'Copyright (c) 1994, 1995, 1997, 1998, 1999, 2000 Aladdin Enterprises, Menlo Park, California, U.S.A.', ] check_detection(expected, test_file) - def test_copyright_license_text_amazondsb(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_amazondsb-AmazonDSb') + def test_amazondsb(self): + test_file = self.get_test_loc('copyrights/amazondsb-AmazonDSb') expected = [ '(c) 2006 Amazon Digital Services, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_ampasbsd(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ampasbsd-AMPASBSD') + def test_ampasbsd(self): + test_file = self.get_test_loc('copyrights/ampasbsd-AMPASBSD') expected = [ 'Copyright (c) 2006 Academy of Motion Picture Arts and Sciences', ] check_detection(expected, test_file) - def test_copyright_license_text_apachev1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apachev1_0-Apachev.0') + def test_apachev1_0(self): + test_file = self.get_test_loc('copyrights/apachev1_0-Apachev.0') expected = [ 'Copyright (c) 1995-1999 The Apache Group.', ] check_detection(expected, test_file) - def test_copyright_license_text_apachev1_1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apachev1_1-Apachev.1') + def test_apachev1_1(self): + test_file = self.get_test_loc('copyrights/apachev1_1-Apachev.1') expected = [ 'Copyright (c) 2000 The Apache Software Foundation.', ] check_detection(expected, test_file) - def test_copyright_license_text_apachev2_0b(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apachev2_0b-Apachev_b.0b') + def test_apachev2_0b(self): + test_file = self.get_test_loc('copyrights/apachev2_0b-Apachev_b.0b') expected = [ 'Copyright 2000', ] check_detection(expected, test_file) - def test_copyright_license_text_apple_common_documentation_license_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apple_common_documentation_license_v1_0-Apple Common Documentation License v.0') + def test_apple_common_documentation_license_v1_0(self): + test_file = self.get_test_loc('copyrights/apple_common_documentation_license_v1_0-Apple Common Documentation License v.0') expected = [ 'Copyright (c) 2001 Apple Computer, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_apple_public_source_license_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apple_public_source_license_v1_0-Apple Public Source License v.0') + def test_apple_public_source_license_v1_0(self): + test_file = self.get_test_loc('copyrights/apple_public_source_license_v1_0-Apple Public Source License v.0') expected = [ 'Portions Copyright (c) 1999 Apple Computer, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_apple_public_source_license_v1_1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apple_public_source_license_v1_1-Apple Public Source License v.1') + def test_apple_public_source_license_v1_1(self): + test_file = self.get_test_loc('copyrights/apple_public_source_license_v1_1-Apple Public Source License v.1') expected = [ 'Portions Copyright (c) 1999-2000 Apple Computer, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_apple_public_source_license_v1_2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apple_public_source_license_v1_2-Apple Public Source License v.2') + def test_apple_public_source_license_v1_2(self): + test_file = self.get_test_loc('copyrights/apple_public_source_license_v1_2-Apple Public Source License v.2') expected = [ 'Portions Copyright (c) 1999-2003 Apple Computer, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_apslv2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_apslv2_0-APSLv.0') + def test_apslv2_0(self): + test_file = self.get_test_loc('copyrights/apslv2_0-APSLv.0') expected = [ 'Portions Copyright (c) 1999-2007 Apple Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_artistic_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_artistic_v1_0-Artistic v.0') + def test_artistic_v1_0(self): + test_file = self.get_test_loc('copyrights/artistic_v1_0-Artistic v.0') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_artistic_v1_0_short(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_artistic_v1_0_short-Artistic v_ short.0 short') + def test_artistic_v1_0_short(self): + test_file = self.get_test_loc('copyrights/artistic_v1_0_short-Artistic v_ short.0 short') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_artistic_v2_0beta4(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_artistic_v2_0beta4-Artistic v_beta.0beta4') + def test_artistic_v2_0beta4(self): + test_file = self.get_test_loc('copyrights/artistic_v2_0beta4-Artistic v_beta.0beta4') expected = [ 'Copyright (c) 2000, Larry Wall.', ] check_detection(expected, test_file) - def test_copyright_license_text_artisticv2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_artisticv2_0-Artisticv.0') + def test_artisticv2_0(self): + test_file = self.get_test_loc('copyrights/artisticv2_0-Artisticv.0') expected = [ 'Copyright (c) 2000-2006, The Perl Foundation.', ] check_detection(expected, test_file) - def test_copyright_license_text_attributionassurancelicense(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_attributionassurancelicense-AttributionAssuranceLicense') + def test_attributionassurancelicense(self): + test_file = self.get_test_loc('copyrights/attributionassurancelicense-AttributionAssuranceLicense') expected = [ 'Copyright (c) 2002 by AUTHOR', ] check_detection(expected, test_file) - def test_copyright_license_text_bigelow_holmes(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_bigelow_holmes-Bigelow&Holmes') + def test_bigelow_holmes(self): + test_file = self.get_test_loc('copyrights/bigelow_holmes-Bigelow&Holmes') expected = [ '(c) Copyright 1989 Sun Microsystems, Inc.', '(c) Copyright Bigelow & Holmes 1986, 1985.', ] check_detection(expected, test_file) - def test_copyright_license_text_bitstream(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_bitstream-Bi_ream') + def test_bitstream(self): + test_file = self.get_test_loc('copyrights/bitstream-Bi_ream') expected = [ 'Copyright (c) 2003 by Bitstream, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_bsdnrl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_bsdnrl-BSDNRL') + def test_bsdnrl(self): + test_file = self.get_test_loc('copyrights/bsdnrl-BSDNRL') expected = [ 'copyright by The Regents of the University of California.', ] check_detection(expected, test_file) - def test_copyright_license_text_cnri(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_cnri-CNRI') + def test_cnri(self): + test_file = self.get_test_loc('copyrights/cnri-CNRI') expected = [ 'Copyright (c) 1995-2000 Corporation for National Research Initiatives', ] check_detection(expected, test_file) - def test_copyright_license_text_condor_extra_For(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_condor_extra_For-Condor') + def test_condor_extra_For(self): + test_file = self.get_test_loc('copyrights/condor_extra_For-Condor') expected = [ 'Copyright 1990-2006 Condor Team, Computer Sciences Department, University of Wisconsin-Madison, Madison', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_license_text_doc(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_doc-DOC') + def test_doc(self): + test_file = self.get_test_loc('copyrights/doc-DOC') expected = [ 'copyrighted by Douglas C. Schmidt and his research group at Washington University, University of California, Irvine, and Vanderbilt University', 'Copyright (c) 1993-2008' ] check_detection(expected, test_file) - def test_copyright_license_text_dual_mpl_gpl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_dual_mpl_gpl-Dual MPL GPL') + def test_dual_mpl_gpl(self): + test_file = self.get_test_loc('copyrights/dual_mpl_gpl-Dual MPL GPL') expected = [ 'Copyright (c) 2002 the Initial Developer.', ] check_detection(expected, test_file) - def test_copyright_license_text_dualmpl_mit(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_dualmpl_mit-DualMPL_MIT') + def test_dualmpl_mit(self): + test_file = self.get_test_loc('copyrights/dualmpl_mit-DualMPL_MIT') expected = [ 'Copyright (c) 1998-2001, Daniel Stenberg, ', ] check_detection(expected, test_file) - def test_copyright_license_text_eclv1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_eclv1_0-ECLv.0') + def test_eclv1_0(self): + test_file = self.get_test_loc('copyrights/eclv1_0-ECLv.0') expected = [ 'Copyright (c) YeAr Name', ] check_detection(expected, test_file) - def test_copyright_license_text_ecosv2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ecosv2_0-eCosv.0') + def test_ecosv2_0(self): + test_file = self.get_test_loc('copyrights/ecosv2_0-eCosv.0') expected = [ 'Copyright (c) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_entessa(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_entessa-Entessa') + def test_entessa(self): + test_file = self.get_test_loc('copyrights/entessa-Entessa') expected = [ 'Copyright (c) 2003 Entessa, LLC.', ] check_detection(expected, test_file) - def test_copyright_license_text_eplv1_0b(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_eplv1_0b-EPLv_b.0b') + def test_eplv1_0b(self): + test_file = self.get_test_loc('copyrights/eplv1_0b-EPLv_b.0b') expected = [ 'Copyright (c) 2003, 2005 IBM Corporation and others.', ] check_detection(expected, test_file) - def test_copyright_license_text_eudatagrid(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_eudatagrid-EUDatagrid') + def test_eudatagrid(self): + test_file = self.get_test_loc('copyrights/eudatagrid-EUDatagrid') expected = [ 'Copyright (c) 2001 EU DataGrid.', ] check_detection(expected, test_file) - def test_copyright_license_text_eurosym_v2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_eurosym_v2-Eurosym_v.v2') + def test_eurosym_v2(self): + test_file = self.get_test_loc('copyrights/eurosym_v2-Eurosym_v.v2') expected = [ 'Copyright (c) 1999-2002 Henrik Theiling', ] check_detection(expected, test_file) - def test_copyright_license_text_frameworxv1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_frameworxv1_0-Frameworxv.0') + def test_frameworxv1_0(self): + test_file = self.get_test_loc('copyrights/frameworxv1_0-Frameworxv.0') expected = [ '(c) Source Code', '(c) THE FRAMEWORX COMPANY 2003', ] check_detection(expected, test_file) - def test_copyright_license_text_freebsd(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_freebsd-FreeBSD') + def test_freebsd(self): + test_file = self.get_test_loc('copyrights/freebsd-FreeBSD') expected = [ 'Copyright 1994-2006 The FreeBSD Project.', ] check_detection(expected, test_file) - def test_copyright_license_text_freetype(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_freetype-FreeType') + def test_freetype(self): + test_file = self.get_test_loc('copyrights/freetype-FreeType') expected = [ 'Copyright 1996-2002, 2006 by David Turner, Robert Wilhelm, and Werner Lemberg', 'copyright (c) The FreeType Project (www.freetype.org).', @@ -2056,22 +2055,22 @@ def test_copyright_license_text_freetype(self): ] check_detection(expected, test_file) - def test_copyright_license_text_gfdlv1_2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gfdlv1_2-GFDLv.2') + def test_gfdlv1_2(self): + test_file = self.get_test_loc('copyrights/gfdlv1_2-GFDLv.2') expected = [ 'Copyright (c) 2000,2001,2002 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_gfdlv1_3(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gfdlv1_3-GFDLv.3') + def test_gfdlv1_3(self): + test_file = self.get_test_loc('copyrights/gfdlv1_3-GFDLv.3') expected = [ 'Copyright (c) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_glide(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_glide-Glide') + def test_glide(self): + test_file = self.get_test_loc('copyrights/glide-Glide') expected = [ 'copyright notice (3dfx Interactive, Inc. 1999)', 'COPYRIGHT 3DFX INTERACTIVE, INC. 1999', @@ -2079,82 +2078,74 @@ def test_copyright_license_text_glide(self): ] check_detection(expected, test_file) - def test_copyright_license_text_gnuplot(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gnuplot-gnuplot') + def test_gnuplot(self): + test_file = self.get_test_loc('copyrights/gnuplot-gnuplot') expected = [ 'Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley', ] check_detection(expected, test_file) - def test_copyright_license_text_gpl_v1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gpl_v1-GPL_v') + def test_gpl_v1(self): + test_file = self.get_test_loc('copyrights/gpl_v1-GPL_v') expected = [ 'Copyright (c) 1989 Free Software Foundation, Inc.', 'copyrighted by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_license_text_gpl_v2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gpl_v2-GPL_v') + def test_gpl_v2(self): + test_file = self.get_test_loc('copyrights/gpl_v2-GPL_v') expected = [ 'Copyright (c) 1989, 1991 Free Software Foundation, Inc.', 'copyrighted by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_license_text_gpl_v3(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gpl_v3-GPL_v') + def test_gpl_v3(self): + test_file = self.get_test_loc('copyrights/gpl_v3-GPL_v') expected = [ 'Copyright (c) 2007 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_gsoap(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_gsoap-gSOAP') - expected = [ - 'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.', - 'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.', - ] - check_detection(expected, test_file) - - def test_copyright_license_text_helix(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_helix-Helix') + def test_helix(self): + test_file = self.get_test_loc('copyrights/helix-Helix') expected = [ 'Copyright (c) 1995-2002 RealNetworks, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_hewlett_packard(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_hewlett_packard-Hewlett_Packard') + def test_hewlett_packard(self): + test_file = self.get_test_loc('copyrights/hewlett_packard-Hewlett_Packard') expected = [ '(c) HEWLETT-PACKARD COMPANY, 2004.', ] check_detection(expected, test_file) - def test_copyright_license_text_ibmpl_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ibmpl_v1_0-IBMPL_v.0') + def test_ibmpl_v1_0(self): + test_file = self.get_test_loc('copyrights/ibmpl_v1_0-IBMPL_v.0') expected = [ 'Copyright (c) 1996, 1999 International Business Machines Corporation and others.', ] check_detection(expected, test_file) - def test_copyright_license_text_ietf(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ietf-IETF') + def test_ietf(self): + test_file = self.get_test_loc('copyrights/ietf-IETF') expected = [ 'Copyright (c) The Internet Society (2003).', ] check_detection(expected, test_file) - def test_copyright_license_text_ijg(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ijg-IJG') + def test_ijg(self): + test_file = self.get_test_loc('copyrights/ijg-IJG') expected = [ 'copyright (c) 1991-1998, Thomas G. Lane.', 'copyright by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_license_text_imatix(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_imatix-iMatix') + def test_imatix(self): + test_file = self.get_test_loc('copyrights/imatix-iMatix') expected = [ 'Copyright 1991-2000 iMatix Corporation.', 'Copyright 1991-2000 iMatix Corporation', @@ -2164,311 +2155,304 @@ def test_copyright_license_text_imatix(self): ] check_detection(expected, test_file) - def test_copyright_license_text_imlib2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_imlib2-Imlib') + def test_imlib2(self): + test_file = self.get_test_loc('copyrights/imlib2-Imlib') expected = [ 'Copyright (c) 2000 Carsten Haitzler', ] check_detection(expected, test_file) - def test_copyright_license_text_intel(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_intel-Intel') + def test_intel(self): + test_file = self.get_test_loc('copyrights/intel-Intel') expected = [ 'Copyright (c) 2006, Intel Corporation.', ] check_detection(expected, test_file) - def test_copyright_license_text_jabber(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_jabber-Jabber') + def test_jabber(self): + test_file = self.get_test_loc('copyrights/jabber-Jabber') expected = [ 'Copyright (c) 1999-2000 Jabber.com, Inc.', 'Portions Copyright (c) 1998-1999 Jeremie Miller.', ] check_detection(expected, test_file) - def test_copyright_license_text_jpython(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_jpython-JPython') + def test_jpython(self): + test_file = self.get_test_loc('copyrights/jpython-JPython') expected = [ 'Copyright 1996-1999 Corporation for National Research Initiatives', ] check_detection(expected, test_file) - def test_copyright_license_text_larryrosen(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_larryrosen-LarryRosen') + def test_larryrosen(self): + test_file = self.get_test_loc('copyrights/larryrosen-LarryRosen') expected = [ 'Copyright (c) 2002 Lawrence E. Rosen.', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_0-LaTeX_v.0') + def test_latex_v1_0(self): + test_file = self.get_test_loc('copyrights/latex_v1_0-LaTeX_v.0') expected = [ 'Copyright 1999 LaTeX3 Project', 'Copyright 2001 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_1-LaTeX_v.1') + def test_latex_v1_1(self): + test_file = self.get_test_loc('copyrights/latex_v1_1-LaTeX_v.1') expected = [ 'Copyright 1999 LaTeX3 Project', 'Copyright 2001 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_2-LaTeX_v.2') + def test_latex_v1_2(self): + test_file = self.get_test_loc('copyrights/latex_v1_2-LaTeX_v.2') expected = [ 'Copyright 1999 LaTeX3 Project', 'Copyright 2001 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_3a(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_3a-LaTeX_v_a.3a') + def test_latex_v1_3a(self): + test_file = self.get_test_loc('copyrights/latex_v1_3a-LaTeX_v_a.3a') expected = [ 'Copyright 1999 2002-04 LaTeX3 Project', 'Copyright 2003 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_3a_ref(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_3a_ref-LaTeX_v_a_ref.3a_ref') + def test_latex_v1_3a_ref(self): + test_file = self.get_test_loc('copyrights/latex_v1_3a_ref-LaTeX_v_a_ref.3a_ref') expected = [ 'Copyright 2003 Name', ] check_detection(expected, test_file) - def test_copyright_license_text_latex_v1_3c(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_latex_v1_3c-LaTeX_v_c.3c') + def test_latex_v1_3c(self): + test_file = self.get_test_loc('copyrights/latex_v1_3c-LaTeX_v_c.3c') expected = [ 'Copyright 1999 2002-2008 LaTeX3 Project', 'Copyright 2005 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_license_text_lgpl_v2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_lgpl_v2_0-LGPL_v.0') + def test_lgpl_v2_0(self): + test_file = self.get_test_loc('copyrights/lgpl_v2_0-LGPL_v.0') expected = [ 'Copyright (c) 1991 Free Software Foundation, Inc.', 'copyrighted by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_license_text_lgpl_v2_1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_lgpl_v2_1-LGPL_v.1') + def test_lgpl_v2_1(self): + test_file = self.get_test_loc('copyrights/lgpl_v2_1-LGPL_v.1') expected = [ 'Copyright (c) 1991, 1999 Free Software Foundation, Inc.', 'copyrighted by the Free Software Foundation', ] check_detection(expected, test_file) - def test_copyright_license_text_lgpl_v3(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_lgpl_v3-LGPL_v') + def test_lgpl_v3(self): + test_file = self.get_test_loc('copyrights/lgpl_v3-LGPL_v') expected = [ 'Copyright (c) 2007 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_lgpl_wxwindows_library_licence_v3_0_variant(self): - test_file = self.get_test_loc('copyrights/copyright_wxWindows Library .0 variant') + def test_lgpl_wxwindows_library_licence_v3_0_variant(self): + test_file = self.get_test_loc('copyrights/wxWindows Library .0 variant') expected = [ 'Copyright (c) 1998 Julian Smart, Robert Roebling', ] check_detection(expected, test_file) - def test_copyright_license_text_logica_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_logica_v1_0-Logica_v.0') + def test_logica_v1_0(self): + test_file = self.get_test_loc('copyrights/logica_v1_0-Logica_v.0') expected = [ 'Copyright (c) 1996-2001 Logica Mobile Networks Limited', 'Copyright (c) 1996-2001 Logica Mobile Networks Limited', ] check_detection(expected, test_file) - def test_copyright_license_text_luxi_fonts(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_luxi_fonts-Luxi_fonts') + def test_luxi_fonts(self): + test_file = self.get_test_loc('copyrights/luxi_fonts-Luxi_fonts') expected = [ 'copyright (c) 2001 by Bigelow & Holmes Inc.', 'copyright (c) 2001 by URW++ GmbH.', ] check_detection(expected, test_file) - def test_copyright_license_text_maia(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_maia-Maia') + def test_maia(self): + test_file = self.get_test_loc('copyrights/maia-Maia') expected = [ 'Copyright 2004 by Robert LeBlanc', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_adobeglyph(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_adobeglyph-MIT_AdobeGlyph') + def test_mit_adobeglyph(self): + test_file = self.get_test_loc('copyrights/mit_adobeglyph-MIT_AdobeGlyph') expected = [ 'Copyright (c) 1997,1998,2002,2007 Adobe Systems Incorporated', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_cmu(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_cmu-MIT_CMU') + def test_mit_cmu(self): + test_file = self.get_test_loc('copyrights/mit_cmu-MIT_CMU') expected = [ 'Copyright 1989, 1991, 1992 by Carnegie Mellon University', 'Copyright 1996, 1998-2000 The Regents of the University of California', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_danse(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_danse-MIT_danse') - expected = [ - 'Copyright (c) 2009 California Institute of Technology.', - ] - check_detection(expected, test_file) - - def test_copyright_license_text_mit_enna(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_enna-MIT_enna') + def test_mit_enna(self): + test_file = self.get_test_loc('copyrights/mit_enna-MIT_enna') expected = [ 'Copyright (c) 2000 Carsten Haitzler', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_hylafax(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_hylafax-MIT_hylafax') + def test_mit_hylafax(self): + test_file = self.get_test_loc('copyrights/mit_hylafax-MIT_hylafax') expected = [ 'Copyright (c) 1990-1996 Sam Leffler', 'Copyright (c) 1991-1996 Silicon Graphics, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_icu(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_icu-MIT_ICU') + def test_mit_icu(self): + test_file = self.get_test_loc('copyrights/mit_icu-MIT_ICU') expected = [ 'Copyright (c) 1995-2006 International Business Machines Corporation and others', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_lucent(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_lucent-MIT_Lucent') + def test_mit_lucent(self): + test_file = self.get_test_loc('copyrights/mit_lucent-MIT_Lucent') expected = [ 'Copyright (c) 1989-1998 by Lucent Technologies', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_mlton(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_mlton-MIT_MLton') + def test_mit_mlton(self): + test_file = self.get_test_loc('copyrights/mit_mlton-MIT_MLton') expected = [ 'Copyright (c) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh Jagannathan, and Stephen Weeks.', 'Copyright (c) 1997-2000 by the NEC Research', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_oldstyle_disclaimer4(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_oldstyle_disclaimer4-MIT_OldStyle_disclaimer') + def test_mit_oldstyle_disclaimer4(self): + test_file = self.get_test_loc('copyrights/mit_oldstyle_disclaimer4-MIT_OldStyle_disclaimer') expected = [ 'Copyright (c) 2001, 2002, 2003, 2004, 2005 by The Regents of the University of California.', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_unicode(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_unicode-MIT_unicode') + def test_mit_unicode(self): + test_file = self.get_test_loc('copyrights/mit_unicode-MIT_unicode') expected = [ 'Copyright (c) 1991-2005 Unicode, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_mit_wordnet(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mit_wordnet-MIT_WordNet') + def test_mit_wordnet(self): + test_file = self.get_test_loc('copyrights/mit_wordnet-MIT_WordNet') expected = [ 'Copyright 2006 by Princeton University.', ] check_detection(expected, test_file) - def test_copyright_license_text_mitre(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mitre-MITRE') + def test_mitre(self): + test_file = self.get_test_loc('copyrights/mitre-MITRE') expected = [ 'Copyright (c) 1994-1999. The MITRE Corporation', ] check_detection(expected, test_file) - def test_copyright_license_text_ms_pl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ms_pl-Ms_PL') + def test_ms_pl(self): + test_file = self.get_test_loc('copyrights/ms_pl-Ms_PL') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_ms_rl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ms_rl-Ms_RL') + def test_ms_rl(self): + test_file = self.get_test_loc('copyrights/ms_rl-Ms_RL') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_ms_rsl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ms_rsl-Ms_RSL') + def test_ms_rsl(self): + test_file = self.get_test_loc('copyrights/ms_rsl-Ms_RSL') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_msntp(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_msntp-MSNTP') + def test_msntp(self): + test_file = self.get_test_loc('copyrights/msntp-MSNTP') expected = [ '(c) Copyright, University of Cambridge, 1996, 1997, 2000', '(c) Copyright University of Cambridge.', ] check_detection(expected, test_file) - def test_copyright_license_text_mysql_gplexception(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_mysql_gplexception-MySQL_gplexception') + def test_mysql_gplexception(self): + test_file = self.get_test_loc('copyrights/mysql_gplexception-MySQL_gplexception') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_naumen(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_naumen-Naumen') + def test_naumen(self): + test_file = self.get_test_loc('copyrights/naumen-Naumen') expected = [ 'Copyright (c) NAUMEN (tm) and Contributors.', ] check_detection(expected, test_file) - def test_copyright_license_text_netcomponents(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_netcomponents-NetComponents') + def test_netcomponents(self): + test_file = self.get_test_loc('copyrights/netcomponents-NetComponents') expected = [ 'Copyright (c) 1996-1999 Daniel F. Savarese.', ] check_detection(expected, test_file) - def test_copyright_license_text_nethack(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_nethack-Nethack') + def test_nethack(self): + test_file = self.get_test_loc('copyrights/nethack-Nethack') expected = [ 'Copyright (c) 1989 M. Stephenson', 'copyright 1988 Richard M. Stallman', ] check_detection(expected, test_file) - def test_copyright_license_text_nokia(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_nokia-Nokia') + def test_nokia(self): + test_file = self.get_test_loc('copyrights/nokia-Nokia') expected = [ 'Copyright (c) Nokia and others.', ] check_detection(expected, test_file) - def test_copyright_license_text_npl_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_npl_v1_0-NPL_v.0') + def test_npl_v1_0(self): + test_file = self.get_test_loc('copyrights/npl_v1_0-NPL_v.0') expected = [ 'Copyright (c) 1998 Netscape Communications Corporation.', ] check_detection(expected, test_file) - def test_copyright_license_text_nvidia_source(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_nvidia_source-Nvidia_source') + def test_nvidia_source(self): + test_file = self.get_test_loc('copyrights/nvidia_source-Nvidia_source') expected = [ 'Copyright (c) 1996-1998 NVIDIA, Corp.', 'Copyright (c) 1996-1998 NVIDIA, Corp.', ] check_detection(expected, test_file) - def test_copyright_license_text_oclc_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_oclc_v1_0-OCLC_v.0') + def test_oclc_v1_0(self): + test_file = self.get_test_loc('copyrights/oclc_v1_0-OCLC_v.0') expected = [ 'Copyright (c) 2000. OCLC Research.', 'Copyright (c) 2000- (insert then current year) OCLC OCLC Research and others.', ] check_detection(expected, test_file) - def test_copyright_license_text_oclc_v2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_oclc_v2_0-OCLC_v.0') + def test_oclc_v2_0(self): + test_file = self.get_test_loc('copyrights/oclc_v2_0-OCLC_v.0') expected = [ 'Copyright (c) 2002. OCLC Research.', 'Copyright (c) 2000- (insert then current year) OCLC Online Computer Library Center, Inc. and other contributors.', @@ -2476,124 +2460,131 @@ def test_copyright_license_text_oclc_v2_0(self): ] check_detection(expected, test_file) - def test_copyright_license_text_openldap(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_openldap-OpenLDAP') + def test_openldap(self): + test_file = self.get_test_loc('copyrights/openldap-OpenLDAP') expected = [ 'Copyright 1999-2003 The OpenLDAP Foundation, Redwood City, California', ] check_detection(expected, test_file) - def test_copyright_license_text_openmotif(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_openmotif-OpenMotif') + def test_openmotif(self): + test_file = self.get_test_loc('copyrights/openmotif-OpenMotif') expected = [ 'Copyright (c) date here, The Open Group Ltd. and others.', ] check_detection(expected, test_file) - def test_copyright_license_text_openpbs(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_openpbs-OpenPBS') + def test_openpbs(self): + test_file = self.get_test_loc('copyrights/openpbs-OpenPBS') expected = [ 'Copyright (c) 1999-2000 Veridian Information Solutions, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_openpublicationref(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_openpublicationref-OpenPublicationref') + def test_openpublicationref(self): + test_file = self.get_test_loc('copyrights/openpublicationref-OpenPublicationref') expected = [ 'Copyright (c) 2000 by ThisOldHouse.', ] check_detection(expected, test_file) - def test_copyright_license_text_openssl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_openssl-OpenSSL') + def test_openssl_c(self): + test_file = self.get_test_loc('copyrights/openssl-c.c') + expected = [ + 'Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au)', + ] + check_detection(expected, test_file) + + def test_openssl(self): + test_file = self.get_test_loc('copyrights/openssl-OpenSSL') expected = [ 'Copyright (c) 1998-2000 The OpenSSL Project.', ] check_detection(expected, test_file) - def test_copyright_license_text_osl_v3_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_osl_v3_0-OSL_v.0') + def test_osl_v3_0(self): + test_file = self.get_test_loc('copyrights/osl_v3_0-OSL_v.0') expected = [ 'Copyright (c) 2005 Lawrence Rosen.', ] check_detection(expected, test_file) - def test_copyright_license_text_phorum(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_phorum-Phorum') + def test_phorum(self): + test_file = self.get_test_loc('copyrights/phorum-Phorum') expected = [ 'Copyright (c) 2001 The Phorum Development Team.', ] check_detection(expected, test_file) - def test_copyright_license_text_pine(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_pine-Pine') + def test_pine(self): + test_file = self.get_test_loc('copyrights/pine-Pine') expected = [ 'Copyright 1989-2007 by the University of Washington.', ] check_detection(expected, test_file) - def test_copyright_license_text_python_v1_6(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_python_v1_6-Python_v.6') + def test_python_v1_6(self): + test_file = self.get_test_loc('copyrights/python_v1_6-Python_v.6') expected = [ 'Copyright (c) 1995-2000 Corporation for National Research Initiatives', ] check_detection(expected, test_file) - def test_copyright_license_text_python_v1_6_1(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_python_v1_6_1-Python_v.1') + def test_python_v1_6_1(self): + test_file = self.get_test_loc('copyrights/python_v1_6_1-Python_v.1') expected = [ 'Copyright 1995-2001 Corporation for National Research Initiatives', ] check_detection(expected, test_file) - def test_copyright_license_text_python_v2(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_python_v2-Python_v') + def test_python_v2(self): + test_file = self.get_test_loc('copyrights/python_v2-Python_v') expected = [ 'Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation', 'Copyright (c) 1995-2001 Corporation for National Research Initiatives', ] check_detection(expected, test_file) - def test_copyright_license_text_qpl_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_qpl_v1_0-QPL_v.0') + def test_qpl_v1_0(self): + test_file = self.get_test_loc('copyrights/qpl_v1_0-QPL_v.0') expected = [ 'Copyright (c) 1999 Trolltech AS', ] check_detection(expected, test_file) - def test_copyright_license_text_realcsl_v2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_realcsl_v2_0-RealCSL_v.0') + def test_realcsl_v2_0(self): + test_file = self.get_test_loc('copyrights/realcsl_v2_0-RealCSL_v.0') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_realpsl_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_realpsl_v1_0-RealPSL_v.0') + def test_realpsl_v1_0(self): + test_file = self.get_test_loc('copyrights/realpsl_v1_0-RealPSL_v.0') expected = [ 'Copyright (c) 1995-2002 RealNetworks, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_realpsl_v1_0ref(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_realpsl_v1_0ref-RealPSL_v_ref.0ref') + def test_realpsl_v1_0ref(self): + test_file = self.get_test_loc('copyrights/realpsl_v1_0ref-RealPSL_v_ref.0ref') expected = [ 'Copyright (c) 1995-2004 RealNetworks, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_reciprocal_v1_5(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_reciprocal_v1_5-Reciprocal_v.5') + def test_reciprocal_v1_5(self): + test_file = self.get_test_loc('copyrights/reciprocal_v1_5-Reciprocal_v.5') expected = [ 'Copyright (c) 2001-2007 Technical Pursuit Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_redhateula(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_redhateula-RedHatEULA') + def test_redhateula(self): + test_file = self.get_test_loc('copyrights/redhateula-RedHatEULA') expected = [] check_detection(expected, test_file) - def test_copyright_license_text_redhatref(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_redhatref-RedHatref') + def test_redhatref(self): + test_file = self.get_test_loc('copyrights/redhatref-RedHatref') expected = [ 'Copyright (c) 2005 Red Hat, Inc.', 'Copyright (c) 1995-2005 Red Hat, Inc. and others.', @@ -2601,16 +2592,16 @@ def test_copyright_license_text_redhatref(self): ] check_detection(expected, test_file) - def test_copyright_license_text_ricoh_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_ricoh_v1_0-Ricoh_v.0') + def test_ricoh_v1_0(self): + test_file = self.get_test_loc('copyrights/ricoh_v1_0-Ricoh_v.0') expected = [ 'Ricoh Silicon Valley, Inc. are Copyright (c) 1995-1999.', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_license_text_scilab(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_scilab-Scilab') + def test_scilab(self): + test_file = self.get_test_loc('copyrights/scilab-Scilab') expected = [ 'Scilab (c) INRIA-ENPC.', 'Scilab (c) INRIA-ENPC.', @@ -2622,79 +2613,79 @@ def test_copyright_license_text_scilab(self): ] check_detection(expected, test_file) - def test_copyright_license_text_sgi_cid_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_sgi_cid_v1_0-SGI_CID_v.0') + def test_sgi_cid_v1_0(self): + test_file = self.get_test_loc('copyrights/sgi_cid_v1_0-SGI_CID_v.0') expected = [ 'Copyright (c) 1994-1999 Silicon Graphics, Inc.', 'Copyright (c) 1994-1999 Silicon Graphics, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_sgi_glx_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_sgi_glx_v1_0-SGI_GLX_v.0') + def test_sgi_glx_v1_0(self): + test_file = self.get_test_loc('copyrights/sgi_glx_v1_0-SGI_GLX_v.0') expected = [ '(c) 1991-9 Silicon Graphics, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_sissl_v1_1refa(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_sissl_v1_1refa-SISSL_v_refa.1refa') + def test_sissl_v1_1refa(self): + test_file = self.get_test_loc('copyrights/sissl_v1_1refa-SISSL_v_refa.1refa') expected = [ 'Copyright 2000 by Sun Microsystems, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_sleepycat(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_sleepycat-Sleepycat') + def test_sleepycat(self): + test_file = self.get_test_loc('copyrights/sleepycat-Sleepycat') expected = [ 'Copyright (c) 1990-1999 Sleepycat Software.', ] check_detection(expected, test_file) - def test_copyright_license_text_sybaseopenwatcom_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_sybaseopenwatcom_v1_0-SybaseOpenWatcom_v.0') + def test_sybaseopenwatcom_v1_0(self): + test_file = self.get_test_loc('copyrights/sybaseopenwatcom_v1_0-SybaseOpenWatcom_v.0') expected = [ 'Portions Copyright (c) 1983-2002 Sybase, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_uofu_rfpl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_uofu_rfpl-UofU_RFPL') + def test_uofu_rfpl(self): + test_file = self.get_test_loc('copyrights/uofu_rfpl-UofU_RFPL') expected = [ 'Copyright (c) 2001, 1998 University of Utah.', ] check_detection(expected, test_file) - def test_copyright_license_text_vovida_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_vovida_v1_0-Vovida_v.0') + def test_vovida_v1_0(self): + test_file = self.get_test_loc('copyrights/vovida_v1_0-Vovida_v.0') expected = [ 'Copyright (c) 2000 Vovida Networks, Inc.', ] check_detection(expected, test_file) - def test_copyright_license_text_wtfpl(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_wtfpl-WTFPL') + def test_wtfpl(self): + test_file = self.get_test_loc('copyrights/wtfpl-WTFPL') expected = [ 'Copyright (c) 2004 Sam Hocevar', ] check_detection(expected, test_file) - def test_copyright_license_text_x_net(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_x_net-X_Net.Net') + def test_x_net(self): + test_file = self.get_test_loc('copyrights/x_net-X_Net.Net') expected = [ 'Copyright (c) 2000-2001 X.Net, Inc. Lafayette, California', ] check_detection(expected, test_file) - def test_copyright_license_text_zend(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_zend-Zend') + def test_zend(self): + test_file = self.get_test_loc('copyrights/zend-Zend') expected = [ 'Copyright (c) 1999-2002 Zend Technologies Ltd.', ] check_detection(expected, test_file) - def test_copyright_license_text_zliback(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_zliback-zLibAck') + def test_zliback(self): + test_file = self.get_test_loc('copyrights/zliback-zLibAck') expected = [ 'Portions Copyright (c) 2002-2007 Charlie Poole', 'Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov', @@ -2702,110 +2693,117 @@ def test_copyright_license_text_zliback(self): ] check_detection(expected, test_file) - def test_copyright_license_text_zope_v1_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_zope_v1_0-Zope_v.0') + def test_zope_v1_0(self): + test_file = self.get_test_loc('copyrights/zope_v1_0-Zope_v.0') expected = [ 'Copyright (c) Digital Creations.', ] check_detection(expected, test_file) - def test_copyright_license_text_zope_v2_0(self): - test_file = self.get_test_loc('copyrights/copyright_license_text_zope_v2_0-Zope_v.0') + def test_zope_v2_0(self): + test_file = self.get_test_loc('copyrights/zope_v2_0-Zope_v.0') expected = [ 'Copyright (c) Zope Corporation (tm) and Contributors.', ] check_detection(expected, test_file) - def test_copyright_linux_source_2_6_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_linux_source_2_6_copyright-linux_source__copyright.copyright') + def test_linux_source_2_6(self): + test_file = self.get_test_loc('copyrights/linux_source_2_6-linux_source.copyright') expected = [ 'copyrighted by Linus Torvalds and others.', ] check_detection(expected, test_file) - def test_copyright_loss_of_holder_c(self): - test_file = self.get_test_loc('copyrights/copyright_loss_of_holder_c-c.c') + def test_loss_of_holder_c(self): + test_file = self.get_test_loc('copyrights/loss_of_holder_c-c.c') expected = [ 'COPYRIGHT (c) DIONYSOS 2006 - 2009', ] check_detection(expected, test_file) - def test_copyright_matroska_demux1_c(self): - test_file = self.get_test_loc('copyrights/copyright_matroska_demux1_c-matroska_demux_c.c') + def test_matroska_demux1_c(self): + test_file = self.get_test_loc('copyrights/matroska_demux1_c-matroska_demux_c.c') expected = [ '(c) 2003 Ronald Bultje ', '(c) 2011 Debarshi Ray ', ] check_detection(expected, test_file) - def test_copyright_matroska_demux_c(self): - test_file = self.get_test_loc('copyrights/copyright_matroska_demux_c-matroska_demux_c.c') + def test_matroska_demux_c(self): + test_file = self.get_test_loc('copyrights/matroska_demux_c-matroska_demux_c.c') expected = [ '(c) 2006 Tim-Philipp Muller', '(c) 2008 Sebastian Droge ', ] check_detection(expected, test_file) - def test_copyright_matroska_demux_muller_c(self): - test_file = self.get_test_loc('copyrights/copyright_matroska_demux_muller_c-matroska_demux_c.c') + def test_matroska_demux_muller_c(self): + test_file = self.get_test_loc('copyrights/matroska_demux_muller_c-matroska_demux_c.c') expected = [ '(c) 2006 Tim-Philipp Muller', '(c) 2008 Sebastian Droge ', ] check_detection(expected, test_file) - def test_copyright_memcmp_assembly(self): - test_file = self.get_test_loc('copyrights/copyright_memcmp_assembly-9_9_memcmp_S.S') + def test_memcmp_assembly(self): + test_file = self.get_test_loc('copyrights/memcmp_assembly-9_9_memcmp_S.S') expected = [ 'Copyright (c) 2007 ARC International (UK) LTD', ] check_detection(expected, test_file) - def test_copyright_mergesort_java(self): - test_file = self.get_test_loc('copyrights/copyright_mergesort_java-MergeSort_java.java') + def test_mergesort_java(self): + test_file = self.get_test_loc('copyrights/mergesort_java-MergeSort_java.java') expected = [ 'Copyright (c) 1998 Sun Microsystems, Inc.', ] check_detection(expected, test_file) - def test_copyright_michal_txt(self): - test_file = self.get_test_loc('copyrights/copyright_michal_txt.txt') + def test_michal_txt(self): + test_file = self.get_test_loc('copyrights/michal_txt.txt') expected = [ 'copyright 2005 Michal Migurski', ] check_detection(expected, test_file) - def test_copyright_mips1_be_elf_hal_o_uu(self): - test_file = self.get_test_loc('copyrights/copyright_mips1_be_elf_hal_o_uu-mips_be_elf_hal_o_uu.uu') + def test_mips1_be_elf_hal_o_uu(self): + test_file = self.get_test_loc('copyrights/mips1_be_elf_hal_o_uu-mips_be_elf_hal_o_uu.uu') expected = [ 'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.', ] check_detection(expected, test_file) - def test_copyright_missing_statement_file_txt(self): - test_file = self.get_test_loc('copyrights/copyright_missing_statement_file_txt-file.txt') + def test_missing_statement_file_txt(self): + test_file = self.get_test_loc('copyrights/missing_statement_file_txt-file.txt') expected = [ 'Copyright 2003-2009 The Apache Geronimo development community', 'Copyright (c) 2000-2005 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)', ] check_detection(expected, test_file) - def test_copyright_mit(self): - test_file = self.get_test_loc('copyrights/copyright_mit.txt') + def test_mit(self): + test_file = self.get_test_loc('copyrights/mit.txt') expected = [ 'Copyright 2010-2011 by MitSomething', ] check_detection(expected, test_file) - def test_copyright_mit_danse(self): - test_file = self.get_test_loc('copyrights/copyright_mit_danse-MIT_Danse') + def test_mit_danse(self): + test_file = self.get_test_loc('copyrights/mit_danse-MIT_danse') expected = [ 'Copyright (c) 2009 California Institute of Technology.', ] check_detection(expected, test_file) - def test_copyright_mixedcaps_c(self): - test_file = self.get_test_loc('copyrights/copyright_mixedcaps_c-mixedcaps_c.c') + def test_mit_danse2(self): + test_file = self.get_test_loc('copyrights/mit_danse-MIT_Danse') + expected = [ + 'Copyright (c) 2009 California Institute of Technology.', + ] + check_detection(expected, test_file) + + def test_mixedcaps_c(self): + test_file = self.get_test_loc('copyrights/mixedcaps_c-mixedcaps_c.c') expected = [ 'COPYRIGHT (c) 2006 MyCompany2 MYCOP', 'copyright (c) 2006 MyCompany2 MYCOP', @@ -2828,15 +2826,15 @@ def test_copyright_mixedcaps_c(self): expected_in_results=False, results_in_expected=True) - def test_copyright_mixedcase_company_name_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_mixedcase_company_name_in_c-lowercase_company_c.c') + def test_mixedcase_company_name_in_c(self): + test_file = self.get_test_loc('copyrights/mixedcase_company_name_in_c-lowercase_company_c.c') expected = [ 'Copyright (c) 2001 nexB', ] check_detection(expected, test_file) - def test_copyright_mkisofs_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_mkisofs_copyright-mkisofs_copyright.copyright') + def test_mkisofs(self): + test_file = self.get_test_loc('copyrights/mkisofs-mkisofs.copyright') expected = [ 'Copyright 1998-2003 Heiko Eissfeldt', '(c) Peter Widow', @@ -2853,37 +2851,37 @@ def test_copyright_mkisofs_copyright(self): ] check_detection(expected, test_file) - def test_copyright_moto_broad(self): - test_file = self.get_test_loc('copyrights/copyright_moto_broad-c.c') + def test_moto_broad(self): + test_file = self.get_test_loc('copyrights/moto_broad-c.c') expected = [ 'COPYRIGHT (c) 2005 MOTOROLA, BROADBAND COMMUNICATIONS SECTOR', ] check_detection(expected, test_file) - def test_copyright_motorola_c(self): - test_file = self.get_test_loc('copyrights/copyright_motorola_c-c.c') + def test_motorola_c(self): + test_file = self.get_test_loc('copyrights/motorola_c-c.c') expected = [ 'Copyright (c) 2003, 2010 Motorola, Inc.', ] check_detection(expected, test_file) - def test_copyright_motorola_mobility_c(self): - test_file = self.get_test_loc('copyrights/copyright_motorola_mobility_c-c.c') + def test_motorola_mobility_c(self): + test_file = self.get_test_loc('copyrights/motorola_mobility_c-c.c') expected = [ 'Copyright (c) 2009 Motorola, Inc.', 'Copyright (c) 2011 Motorola Mobility, Inc.', ] check_detection(expected, test_file) - def test_copyright_mplayer_skin_blue_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_mplayer_skin_blue_copyright-mplayer_skin_blue_copyright.copyright') + def test_mplayer_skin_blue(self): + test_file = self.get_test_loc('copyrights/mplayer_skin_blue-mplayer_skin_blue.copyright') expected = [ 'Copyright (c) 2005-06 Franciszek Wilamowski, xenomorph@irc.pl', ] check_detection(expected, test_file) - def test_copyright_muller(self): - test_file = self.get_test_loc('copyrights/copyright_muller-c.c') + def test_muller(self): + test_file = self.get_test_loc('copyrights/muller-c.c') expected = [ '(c) 2003 Ronald Bultje ', '(c) 2006 Tim-Philipp Muller', @@ -2892,8 +2890,8 @@ def test_copyright_muller(self): ] check_detection(expected, test_file) - def test_copyright_multiline(self): - test_file = self.get_test_loc('copyrights/copyright_multiline-Historical.txt') + def test_multiline(self): + test_file = self.get_test_loc('copyrights/multiline-Historical.txt') expected = [ 'COPYRIGHT (c) 1990-1994 BY GEORGE J. CARRETTE, CONCORD, MASSACHUSETTS.', ] @@ -2901,114 +2899,114 @@ def test_copyright_multiline(self): expected_in_results=False, results_in_expected=True) - def test_copyright_multiline_george(self): - test_file = self.get_test_loc('copyrights/copyright_multiline_george-Historical.txt') + def test_multiline_george(self): + test_file = self.get_test_loc('copyrights/multiline_george-Historical.txt') expected = [ 'COPYRIGHT (c) 1990-1994 BY GEORGE', ] check_detection(expected, test_file) - def test_copyright_mycorp_c(self): - test_file = self.get_test_loc('copyrights/copyright_mycorp_c-c.c') + def test_mycorp_c(self): + test_file = self.get_test_loc('copyrights/mycorp_c-c.c') expected = [ 'Copyright (c) 2012 MyCorp Inc.', ] check_detection(expected, test_file) - def test_copyright_name_before_copyright_c(self): - test_file = self.get_test_loc('copyrights/copyright_name_before_copyright_c-c.c') + def test_name_before_c(self): + test_file = self.get_test_loc('copyrights/name_before_c-c.c') expected = [ 'Russ Dill 2001-2003', 'Vladimir Oleynik (c) 2003' ] check_detection(expected, test_file) - def test_copyright_name_sign_year(self): - test_file = self.get_test_loc('copyrights/copyright_name_sign_year_correct-c.c') + def test_name_sign_year(self): + test_file = self.get_test_loc('copyrights/name_sign_year_correct-c.c') expected = [ 'Copyright (c) 2008 Daisy Ltd. http://www.daisy.com', 'Daisy (c) 1997 - 2008', ] check_detection(expected, test_file) - def test_copyright_naumen_txt(self): - test_file = self.get_test_loc('copyrights/copyright_naumen_txt.txt') + def test_naumen_txt(self): + test_file = self.get_test_loc('copyrights/naumen_txt.txt') expected = [ 'Copyright (c) NAUMEN (tm) and Contributors.', ] check_detection(expected, test_file) - def test_copyright_ncurses_bin_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_ncurses_bin_copyright-ncurses_bin_copyright.copyright') + def test_ncurses_bin(self): + test_file = self.get_test_loc('copyrights/ncurses_bin-ncurses_bin.copyright') expected = [ 'Copyright (c) 1998 Free Software Foundation, Inc.', ] check_detection(expected, test_file) - def test_copyright_nederlof(self): - test_file = self.get_test_loc('copyrights/copyright_nederlof.txt') + def test_nederlof(self): + test_file = self.get_test_loc('copyrights/nederlof.txt') expected = [ '(c) 2005 - Peter Nederlof', ] check_detection(expected, test_file) - def test_copyright_trailing_copyleft(self): - test_file = self.get_test_loc('copyrights/copyright_trailing_copyleft.txt') + def test_trailing_copyleft(self): + test_file = self.get_test_loc('copyrights/trailing_copyleft.txt') expected = [ 'Copyright (c) 1992 Ronald S. Karr', ] check_detection(expected, test_file) - def test_copyright_no_copyright_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_no_copyright_in_c-c.c') + def test_no_c(self): + test_file = self.get_test_loc('copyrights/no_c-c.c') expected = [] check_detection(expected, test_file) - def test_copyright_no_copyright_in_class_file_2(self): - test_file = self.get_test_loc('copyrights/copyright_no_copyright_in_class_file_2-PersistentElementHolder_class.class') + def test_no_class_file_2(self): + test_file = self.get_test_loc('copyrights/no_class_file_2-PersistentElementHolder_class.class') expected = [] check_detection(expected, test_file) - def test_copyright_no_copyright_in_class_file_3(self): - test_file = self.get_test_loc('copyrights/copyright_no_copyright_in_class_file_3-PersistentIndexedElementHolder_class.class') + def test_no_class_file_3(self): + test_file = self.get_test_loc('copyrights/no_class_file_3-PersistentIndexedElementHolder_class.class') expected = [] check_detection(expected, test_file) - def test_copyright_no_copyright_in_class_file_4(self): - test_file = self.get_test_loc('copyrights/copyright_no_copyright_in_class_file_4-PersistentListElementHolder_class.class') + def test_no_class_file_4(self): + test_file = self.get_test_loc('copyrights/no_class_file_4-PersistentListElementHolder_class.class') expected = [] check_detection(expected, test_file) - def test_copyright_no_holder_java(self): - test_file = self.get_test_loc('copyrights/copyright_no_holder_java-java.java') + def test_no_holder_java(self): + test_file = self.get_test_loc('copyrights/no_holder_java-java.java') expected = [ 'Copyright (c) 2005', ] check_detection(expected, test_file) - def test_copyright_nokia_cpp(self): - test_file = self.get_test_loc('copyrights/copyright_nokia_cpp-cpp.cpp') + def test_nokia_cpp(self): + test_file = self.get_test_loc('copyrights/nokia_cpp-cpp.cpp') expected = [ 'Copyright (c) 2002, Nokia Mobile Phones.', ] check_detection(expected, test_file) - def test_copyright_north_c(self): - test_file = self.get_test_loc('copyrights/copyright_north_c-99_c.c') + def test_north_c(self): + test_file = self.get_test_loc('copyrights/north_c-99_c.c') expected = [ 'Copyright (c) 2010 42North Inc.', ] check_detection(expected, test_file) - def test_copyright_notice2(self): - test_file = self.get_test_loc('copyrights/copyright_notice2-9_NOTICE') + def test_notice2(self): + test_file = self.get_test_loc('copyrights/notice2-9_NOTICE') expected = [ 'Copyright 2003-2009 The Apache Geronimo development community', ] check_detection(expected, test_file) - def test_copyright_notice2_txt(self): - test_file = self.get_test_loc('copyrights/copyright_notice2_txt-NOTICE.txt') + def test_notice2_txt(self): + test_file = self.get_test_loc('copyrights/notice2_txt-NOTICE.txt') expected = [ 'Copyright (c) 2004, Richard S. Hall', 'Copyright (c) 2002,2003, Stefan Haustein, Oberhausen', @@ -3017,15 +3015,15 @@ def test_copyright_notice2_txt(self): ] check_detection(expected, test_file) - def test_copyright_notice_name_before_statement(self): - test_file = self.get_test_loc('copyrights/copyright_notice_name_before_statement-NOTICE') + def test_notice_name_before_statement(self): + test_file = self.get_test_loc('copyrights/notice_name_before_statement-NOTICE') expected = [ 'at iClick, Inc., software copyright (c) 1999.', ] check_detection(expected, test_file) - def test_copyright_notice_txt(self): - test_file = self.get_test_loc('copyrights/copyright_notice_txt-NOTICE.txt') + def test_notice_txt(self): + test_file = self.get_test_loc('copyrights/notice_txt-NOTICE.txt') expected = [ 'Copyright 2003-2010 The Knopflerfish Project http://www.knopflerfish.org', 'Copyright (c) OSGi Alliance (2000, 2009).', @@ -3042,15 +3040,15 @@ def test_copyright_notice_txt(self): ] check_detection(expected, test_file) - def test_copyright_o_brien_style_name(self): - test_file = self.get_test_loc('copyrights/copyright_o_brien_style_name.txt') + def test_o_brien_style_name(self): + test_file = self.get_test_loc('copyrights/o_brien_style_name.txt') expected = [ "Copyright (c) 2001-2003, Patrick K. O'Brien", ] check_detection(expected, test_file) - def test_copyright_oberhummer_c_code(self): - test_file = self.get_test_loc('copyrights/copyright_oberhummer_c_code-c.c') + def test_oberhummer_c_code(self): + test_file = self.get_test_loc('copyrights/oberhummer_c_code-c.c') expected = [ 'Copyright (c) 2005 Markus Franz Xaver Johannes Oberhumer', 'Copyright (c) 2004 Markus Franz Xaver Johannes Oberhumer', @@ -3065,8 +3063,8 @@ def test_copyright_oberhummer_c_code(self): ] check_detection(expected, test_file) - def test_copyright_oberhummer_text(self): - test_file = self.get_test_loc('copyrights/copyright_oberhummer_text.txt') + def test_oberhummer_text(self): + test_file = self.get_test_loc('copyrights/oberhummer_text.txt') expected = [ 'Copyright (c) 2005 Markus Franz Xaver Johannes Oberhumer', 'Copyright (c) 2004 Markus Franz Xaver Johannes Oberhumer', @@ -3081,23 +3079,23 @@ def test_copyright_oberhummer_text(self): ] check_detection(expected, test_file) - def test_copyright_objectivec(self): - test_file = self.get_test_loc('copyrights/copyright_objectivec-objectiveC_m.m') + def test_objectivec(self): + test_file = self.get_test_loc('copyrights/objectivec-objectiveC_m.m') expected = [ 'Copyright (c) 2009 ABC', ] check_detection(expected, test_file) - def test_copyright_openhackware_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_openhackware_copyright_label-openhackware_copyright_label.label') + def test_openhackware(self): + test_file = self.get_test_loc('copyrights/openhackware-openhackware.label') expected = [ 'Copyright (c) 2004-2005 Jocelyn Mayer ', 'Copyright (c) 2004-2005 Fabrice Bellard', ] check_detection(expected, test_file) - def test_copyright_openoffice_org_report_builder_bin_copyright(self): - test_file = self.get_test_loc('copyrights/openoffice_org_report_builder_bin_copyright.copyright') + def test_openoffice_org_report_builder_bin(self): + test_file = self.get_test_loc('copyrights/openoffice_org_report_builder_bin.copyright') expected = [ 'Copyright (c) 2002-2009 Software in the Public Interest, Inc.', 'Copyright (c) 2002-2009 ooo-build/Go-OO Team', @@ -3251,23 +3249,16 @@ def test_copyright_openoffice_org_report_builder_bin_copyright(self): ] check_detection(expected, test_file) - def test_copyright_openoffice_org_report_builder_bin_copyright2(self): - test_file = self.get_test_loc('copyrights/copyright_openoffice_org_report_builder_bin_copyright2-openoffice_org_report_builder_bin_copyright.copyright2') + def test_openoffice_org_report_builder_bin_2(self): + test_file = self.get_test_loc('copyrights/openoffice_org_report_builder_bin_2-openoffice_org_report_builder_bin.copyright2') expected = [ 'Copyright (c) 1990, 1993, 1994, 1995 The Regents of the University of California', 'Copyright (c) 1995, 1996 The President and Fellows of Harvard University', ] check_detection(expected, test_file) - def test_copyright_openssl(self): - test_file = self.get_test_loc('copyrights/copyright_openssl-c.c') - expected = [ - 'Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au)', - ] - check_detection(expected, test_file) - - def test_copyright_partial_detection(self): - test_file = self.get_test_loc('copyrights/copyright_partial_detection.txt') + def test_partial_detection(self): + test_file = self.get_test_loc('copyrights/partial_detection.txt') expected = [ 'Copyright 1991 by the Massachusetts Institute of Technology', 'Copyright (c) 2001 AT&T', @@ -3287,8 +3278,8 @@ def test_copyright_partial_detection(self): ] check_detection(expected, test_file) - def test_copyright_partial_detection_mit(self): - test_file = self.get_test_loc('copyrights/copyright_partial_detection_mit.txt') + def test_partial_detection_mit(self): + test_file = self.get_test_loc('copyrights/partial_detection_mit.txt') expected = [ 'Copyright 1991 by the Massachusetts Institute of Technology', 'Copyright (c) 2001 AT&T', @@ -3308,8 +3299,8 @@ def test_copyright_partial_detection_mit(self): ] check_detection(expected, test_file) - def test_copyright_perl_base_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_perl_base_copyright-perl_base_copyright.copyright') + def test_perl_base(self): + test_file = self.get_test_loc('copyrights/perl_base-perl_base.copyright') expected = [ 'Copyright 1989-2001, Larry Wall', 'Copyright (c) 1995-2005 Jean-loup Gailly and Mark Adler', @@ -3323,39 +3314,39 @@ def test_copyright_perl_base_copyright(self): ] check_detection(expected, test_file) - def test_copyright_perl_module(self): - test_file = self.get_test_loc('copyrights/copyright_perl_module-pm.pm') + def test_perl_module(self): + test_file = self.get_test_loc('copyrights/perl_module-pm.pm') expected = [ 'Copyright (c) 1995-2000 Name Surname', ] check_detection(expected, test_file) - def test_copyright_peter_c(self): - test_file = self.get_test_loc('copyrights/copyright_peter_c-c.c') + def test_peter_c(self): + test_file = self.get_test_loc('copyrights/peter_c-c.c') expected = [ '(c) 2005 - Peter Nederlof', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_piersol(self): - test_file = self.get_test_loc('copyrights/copyright_piersol-TestMatrix_D_java.java') + def test_piersol(self): + test_file = self.get_test_loc('copyrights/piersol-TestMatrix_D_java.java') expected = [ 'Copyright (c) 1998 Company PIERSOL Engineering Inc.', 'Copyright (c) 1998 Company PIERSOL Engineering Inc.', ] check_detection(expected, test_file) - def test_copyright_piersol_ok(self): - test_file = self.get_test_loc('copyrights/copyright_piersol-TestMatrix_D_java.java') + def test_piersol_ok(self): + test_file = self.get_test_loc('copyrights/piersol-TestMatrix_D_java.java') expected = [ 'Copyright (c) 1998

Company PIERSOL Engineering Inc.', 'Copyright (c) 1998

Company PIERSOL Engineering Inc.', ] check_detection(expected, test_file) - def test_copyright_postgresql_8_3_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_postgresql_8_3_copyright_label-postgresql__copyright_label.label') + def test_postgresql_8_3(self): + test_file = self.get_test_loc('copyrights/postgresql_8_3-postgresql.label') expected = [ 'Portions Copyright (c) 1996-2003, The PostgreSQL Global Development Group', 'Portions Copyright (c) 1994, The Regents of the University of California', @@ -3364,36 +3355,36 @@ def test_copyright_postgresql_8_3_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_prof_informatics(self): - test_file = self.get_test_loc('copyrights/copyright_prof_informatics.txt') + def test_prof_informatics(self): + test_file = self.get_test_loc('copyrights/prof_informatics.txt') expected = [ 'Professional Informatics (c) 1994', ] check_detection(expected, test_file) - def test_copyright_professional_txt(self): - test_file = self.get_test_loc('copyrights/copyright_professional_txt-copyright.txt') + def test_professional_txt(self): + test_file = self.get_test_loc('copyrights/professional_txt-copyright.txt') expected = [ 'Professional Informatics (c) 1994', ] check_detection(expected, test_file) - def test_copyright_properties(self): - test_file = self.get_test_loc('copyrights/copyright_properties-properties.properties') + def test_properties(self): + test_file = self.get_test_loc('copyrights/properties-properties.properties') expected = [ '(c) 2004-2007 Restaurant.', ] check_detection(expected, test_file) - def test_copyright_psf_in_python(self): - test_file = self.get_test_loc('copyrights/copyright_psf_in_python-BitVector_py.py') + def test_psf_in_python(self): + test_file = self.get_test_loc('copyrights/psf_in_python-BitVector_py.py') expected = [ 'copyright (c) 2008 Avinash Kak. Python Software Foundation.', ] check_detection(expected, test_file) - def test_copyright_python_dateutil_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_python_dateutil_copyright-python_dateutil_copyright.copyright') + def test_python_dateutil(self): + test_file = self.get_test_loc('copyrights/python_dateutil-python_dateutil.copyright') expected = [ 'Copyright (c) 2001, 2002 Python Software Foundation', 'Copyright (c) 1995-2001 Corporation for National Research Initiatives', @@ -3401,15 +3392,15 @@ def test_copyright_python_dateutil_copyright(self): ] check_detection(expected, test_file) - def test_copyright_python_psyco_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_python_psyco_copyright-python_psyco_copyright.copyright') + def test_python_psyco(self): + test_file = self.get_test_loc('copyrights/python_psyco-python_psyco.copyright') expected = [ 'Copyright (c) 2001-2003 Armin Rigo', ] check_detection(expected, test_file) - def test_copyright_python_reportbug_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_python_reportbug_copyright_label-python_report_copyright_label.label') + def test_python_reportbug(self): + test_file = self.get_test_loc('copyrights/python_reportbug-python_report.label') expected = [ 'Copyright (c) 1999-2006 Chris Lawrence', 'Copyright (c) 2008-2009 Sandro Tosi ', @@ -3424,8 +3415,8 @@ def test_copyright_python_reportbug_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_python_software_properties_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_python_software_properties_copyright-python_software_properties_copyright.copyright') + def test_python_software_properties(self): + test_file = self.get_test_loc('copyrights/python_software_properties-python_software_properties.copyright') expected = [ 'Copyright 2004-2007 Canonical Ltd. 2004-2005 Michiel Sikkes 2006', ] @@ -3433,24 +3424,24 @@ def test_copyright_python_software_properties_copyright(self): expected_in_results=False, results_in_expected=True) - def test_copyright_red_hat_openoffice_org_report_builder_bin_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_red_hat_openoffice_org_report_builder_bin_copyright-openoffice_org_report_builder_bin_copyright.copyright') + def test_red_hat_openoffice_org_report_builder_bin(self): + test_file = self.get_test_loc('copyrights/red_hat_openoffice_org_report_builder_bin-openoffice_org_report_builder_bin.copyright') expected = [ 'Copyright (c) 2007 Red Hat, Inc', 'Copyright (c) 2007 Red Hat, Inc.', ] check_detection(expected, test_file) - def test_copyright_regents_complex(self): - test_file = self.get_test_loc('copyrights/copyright_regents_complex-strtol_c.c') + def test_regents_complex(self): + test_file = self.get_test_loc('copyrights/regents_complex-strtol_c.c') expected = [ 'Copyright (c) 1990 The Regents of the University of California.', ] check_detection(expected, test_file) # #@expectedFailure - def test_copyright_regents_license(self): - test_file = self.get_test_loc('copyrights/copyright_regents_license-LICENSE') + def test_regents_license(self): + test_file = self.get_test_loc('copyrights/regents_license-LICENSE') expected = [ 'copyrighted by The Regents of the University of California.', 'Copyright 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California.', @@ -3458,48 +3449,48 @@ def test_copyright_regents_license(self): ] check_detection(expected, test_file) - def test_copyright_resig_js(self): - test_file = self.get_test_loc('copyrights/copyright_resig_js-js.js') + def test_resig_js(self): + test_file = self.get_test_loc('copyrights/resig_js-js.js') expected = [ 'Copyright (c) 2009 John Resig', ] check_detection(expected, test_file) - def test_copyright_rusty(self): - test_file = self.get_test_loc('copyrights/copyright_rusty.txt') + def test_rusty(self): + test_file = self.get_test_loc('copyrights/rusty.txt') expected = [ '(c) Rusty Russell, IBM 2002', ] check_detection(expected, test_file) - def test_copyright_rusty_c(self): - test_file = self.get_test_loc('copyrights/copyright_rusty_c-c.c') + def test_rusty_c(self): + test_file = self.get_test_loc('copyrights/rusty_c-c.c') expected = [ '(c) Rusty Russell, IBM 2002', ] check_detection(expected, test_file) - def test_copyright_s_fabsl_c(self): - test_file = self.get_test_loc('copyrights/copyright_s_fabsl_c-s_fabsl_c.c') + def test_s_fabsl_c(self): + test_file = self.get_test_loc('copyrights/s_fabsl_c-s_fabsl_c.c') expected = [ 'Copyright (c) 2003 Dag-Erling Coidan Smrgrav', ] check_detection(expected, test_file) - def test_copyright_sample_java(self): - test_file = self.get_test_loc('copyrights/copyright_sample_java-java.java') + def test_sample_java(self): + test_file = self.get_test_loc('copyrights/sample_java-java.java') expected = [ 'Copyright (c) 2000-2007, Sample ABC Inc.', ] check_detection(expected, test_file) - def test_copyright_sample_no_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_sample_no_copyright-c.c') + def test_sample_no(self): + test_file = self.get_test_loc('copyrights/sample_no-c.c') expected = [] check_detection(expected, test_file) - def test_copyright_seahorse_plugins(self): - test_file = self.get_test_loc('copyrights/copyright_seahorse_plugins-seahorse_plugins_copyright.copyright') + def test_seahorse_plugins(self): + test_file = self.get_test_loc('copyrights/seahorse_plugins-seahorse_plugins.copyright') expected = [ 'Copyright (c) 2004-2007 Stefan Walter', 'Copyright (c) 2004-2006 Adam Schreiber', @@ -3548,35 +3539,35 @@ def test_copyright_seahorse_plugins(self): ] check_detection(expected, test_file) - def test_copyright_simgear1_0_0_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_simgear1_0_0_copyright-simgear__copyright.copyright') + def test_simgear1_0_0(self): + test_file = self.get_test_loc('copyrights/simgear1_0_0-simgear.copyright') expected = [ 'Copyright (c) 1999-2000 Curtis L. Olson ', 'Copyright (c) 2002-2004 Mark J. Harris', ] check_detection(expected, test_file) - def test_copyright_snippet_no_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_snippet_no_copyright') + def test_snippet_no(self): + test_file = self.get_test_loc('copyrights/snippet_no') expected = [] check_detection(expected, test_file) - def test_copyright_snmptrapd_c(self): - test_file = self.get_test_loc('copyrights/copyright_snmptrapd_c-snmptrapd_c.c') + def test_snmptrapd_c(self): + test_file = self.get_test_loc('copyrights/snmptrapd_c-snmptrapd_c.c') expected = [ 'Copyright 1989, 1991, 1992 by Carnegie Mellon University', ] check_detection(expected, test_file) - def test_copyright_some_co(self): - test_file = self.get_test_loc('copyrights/copyright_some_co-9_h.h') + def test_some_co(self): + test_file = self.get_test_loc('copyrights/some_co-9_h.h') expected = [ 'Copyright Some Company, inc.', ] check_detection(expected, test_file) - def test_copyright_somefile_cpp(self): - test_file = self.get_test_loc('copyrights/copyright_somefile_cpp-somefile_cpp.cpp') + def test_somefile_cpp(self): + test_file = self.get_test_loc('copyrights/somefile_cpp-somefile_cpp.cpp') expected = [ '(c) 2005', 'Copyright Private Company (PC) Property of Private Company', @@ -3584,67 +3575,67 @@ def test_copyright_somefile_cpp(self): ] check_detection(expected, test_file) - def test_copyright_source_auditor_projectinfo_java(self): - test_file = self.get_test_loc('copyrights/copyright_source_auditor_projectinfo_java-ProjectInfo_java.java') + def test_source_auditor_projectinfo_java(self): + test_file = self.get_test_loc('copyrights/source_auditor_projectinfo_java-ProjectInfo_java.java') expected = [ 'Copyright (c) 2009 Source Auditor Inc.', ] check_detection(expected, test_file) - def test_copyright_stacktrace_cpp(self): - test_file = self.get_test_loc('copyrights/copyright_stacktrace_cpp-stacktrace_cpp.cpp') + def test_stacktrace_cpp(self): + test_file = self.get_test_loc('copyrights/stacktrace_cpp-stacktrace_cpp.cpp') expected = [ 'Copyright 2003, 2004 Rickard E. Faith (faith@dict.org)', ] check_detection(expected, test_file) - def test_copyright_stmicro_in_h(self): - test_file = self.get_test_loc('copyrights/copyright_stmicro_in_h-h.h') + def test_stmicro_in_h(self): + test_file = self.get_test_loc('copyrights/stmicro_in_h-h.h') expected = [ 'COPYRIGHT (c) ST-Microelectronics 1998.', ] check_detection(expected, test_file) - def test_copyright_stmicro_in_txt(self): - test_file = self.get_test_loc('copyrights/copyright_stmicro_in_txt.txt') + def test_stmicro_in_txt(self): + test_file = self.get_test_loc('copyrights/stmicro_in_txt.txt') expected = [ 'COPYRIGHT (c) STMicroelectronics 2005.', 'COPYRIGHT (c) ST-Microelectronics 1998.', ] check_detection(expected, test_file) - def test_copyright_strchr_assembly(self): - test_file = self.get_test_loc('copyrights/copyright_strchr_assembly-9_9_strchr_S.S') + def test_strchr_assembly(self): + test_file = self.get_test_loc('copyrights/strchr_assembly-9_9_strchr_S.S') expected = [ 'Copyright (c) 2007 ARC International (UK) LTD', ] check_detection(expected, test_file) - def test_copyright_super_tech_c(self): - test_file = self.get_test_loc('copyrights/copyright_super_tech_c-c.c') + def test_super_tech_c(self): + test_file = self.get_test_loc('copyrights/super_tech_c-c.c') expected = [ 'Copyright (c) $LastChangedDate$ Super Technologies Corporation, Cedar Rapids, Iowa, U.S.A.', 'Copyright (c) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp.', ] check_detection(expected, test_file) - def test_copyright_tcl_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_tcl_copyright-tcl_copyright.copyright') + def test_tcl(self): + test_file = self.get_test_loc('copyrights/tcl-tcl.copyright') expected = [ 'copyrighted by the Regents of the University of California , Sun Microsystems, Inc. , Scriptics Corporation', # not found, rather complex 'Copyright (c) 2007 Software in the Public Interest', ] check_detection(expected, test_file) - def test_copyright_tech_sys(self): - test_file = self.get_test_loc('copyrights/copyright_tech_sys.txt') + def test_tech_sys(self): + test_file = self.get_test_loc('copyrights/tech_sys.txt') expected = [ '(c) Copyright 1985-1999 SOME TECHNOLOGY SYSTEMS', ] check_detection(expected, test_file) - def test_copyright_texinfo_tex(self): - test_file = self.get_test_loc('copyrights/copyright_texinfo_tex-texinfo_tex.tex') + def test_texinfo_tex(self): + test_file = self.get_test_loc('copyrights/texinfo_tex-texinfo_tex.tex') expected = [ 'Copyright (c) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.', ] @@ -3652,32 +3643,32 @@ def test_copyright_texinfo_tex(self): expected_in_results=False, results_in_expected=True) - def test_copyright_texlive_lang_greek_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_texlive_lang_greek_copyright-texlive_lang_greek_copyright.copyright') + def test_texlive_lang_greek(self): + test_file = self.get_test_loc('copyrights/texlive_lang_greek-texlive_lang_greek.copyright') expected = [ 'Copyright 1999 2002-2006 LaTeX3 Project', 'Copyright 2005 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_texlive_lang_spanish_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_texlive_lang_spanish_copyright-texlive_lang_spanish_copyright.copyright') + def test_texlive_lang_spanish(self): + test_file = self.get_test_loc('copyrights/texlive_lang_spanish-texlive_lang_spanish.copyright') expected = [ 'Copyright 1999 2002-2006 LaTeX3 Project', 'Copyright 2005 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_texlive_lang_vietnamese_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_texlive_lang_vietnamese_copyright_label-texlive_lang_vietnamese_copyright_label.label') + def test_texlive_lang_vietnamese(self): + test_file = self.get_test_loc('copyrights/texlive_lang_vietnamese-texlive_lang_vietnamese.label') expected = [ 'Copyright 1999 2002-2006 LaTeX3 Project', 'Copyright 2005 M. Y. Name', ] check_detection(expected, test_file) - def test_copyright_tfc_c(self): - test_file = self.get_test_loc('copyrights/copyright_tfc_c-c.c') + def test_tfc_c(self): + test_file = self.get_test_loc('copyrights/tfc_c-c.c') expected = [ 'Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Traditional Food Consortium, Inc.', 'Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Traditional Food Consortium, Inc.', @@ -3686,23 +3677,23 @@ def test_copyright_tfc_c(self): expected_in_results=False, results_in_expected=True) - def test_copyright_thirdpartyproject_prop(self): - test_file = self.get_test_loc('copyrights/copyright_thirdpartyproject_prop-ThirdPartyProject_prop.prop') + def test_thirdpartyproject_prop(self): + test_file = self.get_test_loc('copyrights/thirdpartyproject_prop-ThirdPartyProject_prop.prop') expected = [ 'Copyright 2010 Google Inc.', ] check_detection(expected, test_file) - def test_copyright_trailing_For(self): - test_file = self.get_test_loc('copyrights/copyright_trailing_For-copyright_c.c') + def test_trailing_For(self): + test_file = self.get_test_loc('copyrights/trailing_For-c.c') expected = [ 'Copyright . 2008 Mycom Pany, inc.', 'Copyright (c) 1995-2003 Jean-loup Gailly.', ] check_detection(expected, test_file) - def test_copyright_trailing_name(self): - test_file = self.get_test_loc('copyrights/copyright_trailing_name-copyright.txt') + def test_trailing_name(self): + test_file = self.get_test_loc('copyrights/trailing_name-copyright.txt') expected = [ 'Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper', ] @@ -3710,23 +3701,23 @@ def test_copyright_trailing_name(self): expected_in_results=False, results_in_expected=True) - def test_copyright_trailing_redistribution(self): - test_file = self.get_test_loc('copyrights/copyright_trailing_redistribution-bspatch_c.c') + def test_trailing_redistribution(self): + test_file = self.get_test_loc('copyrights/trailing_redistribution-bspatch_c.c') expected = [ 'Copyright (c) 2008 The Android Open Source Project', 'Copyright 2003-2005 Colin Percival', ] check_detection(expected, test_file) - def test_copyright_transcode_doc_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_transcode_doc_copyright-transcode_doc_copyright.copyright') + def test_transcode_doc(self): + test_file = self.get_test_loc('copyrights/transcode_doc-transcode_doc.copyright') expected = [ 'Copyright (c) 2001 Thomas Ostreich', ] check_detection(expected, test_file) - def test_copyright_transfig_copyright_with_parts(self): - test_file = self.get_test_loc('copyrights/copyright_transfig_copyright_with_parts-transfig_copyright.copyright') + def test_transfig_with_parts(self): + test_file = self.get_test_loc('copyrights/transfig_with_parts-transfig.copyright') expected = [ 'Copyright (c) 1985-1988 Supoj Sutantavibul', 'Copyright (c) 1991-1999 Micah Beck', @@ -3748,50 +3739,50 @@ def test_copyright_transfig_copyright_with_parts(self): ] check_detection(expected, test_file) - def test_copyright_treetablemodeladapter_java(self): - test_file = self.get_test_loc('copyrights/copyright_treetablemodeladapter_java-TreeTableModelAdapter_java.java') + def test_treetablemodeladapter_java(self): + test_file = self.get_test_loc('copyrights/treetablemodeladapter_java-TreeTableModelAdapter_java.java') expected = [ 'Copyright 1997, 1998 by Sun Microsystems, Inc.', ] check_detection(expected, test_file) - def test_copyright_truncated_dmv_c(self): - test_file = self.get_test_loc('copyrights/copyright_truncated_dmv_c-9_c.c') + def test_truncated_dmv_c(self): + test_file = self.get_test_loc('copyrights/truncated_dmv_c-9_c.c') expected = [ 'Copyright (c) 1995 DMV - DigiMedia Vision', ] check_detection(expected, test_file) - def test_copyright_truncated_doe(self): - test_file = self.get_test_loc('copyrights/copyright_truncated_doe-c.c') + def test_truncated_doe(self): + test_file = self.get_test_loc('copyrights/truncated_doe-c.c') expected = [ 'Copyright (c) 2008 by John Doe', ] check_detection(expected, test_file) - def test_copyright_truncated_inria(self): - test_file = self.get_test_loc('copyrights/copyright_truncated_inria.txt') + def test_truncated_inria(self): + test_file = self.get_test_loc('copyrights/truncated_inria.txt') expected = [ '(c) 1998-2000 (W3C) MIT, INRIA, Keio University', ] check_detection(expected, test_file) - def test_copyright_truncated_rusty(self): - test_file = self.get_test_loc('copyrights/copyright_truncated_rusty-c.c') + def test_truncated_rusty(self): + test_file = self.get_test_loc('copyrights/truncated_rusty-c.c') expected = [ '(c) 1999-2001 Paul Rusty Russell', ] check_detection(expected, test_file) - def test_copyright_truncated_swfobject_js(self): - test_file = self.get_test_loc('copyrights/copyright_truncated_swfobject_js-swfobject_js.js') + def test_truncated_swfobject_js(self): + test_file = self.get_test_loc('copyrights/truncated_swfobject_js-swfobject_js.js') expected = [ 'Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis', ] check_detection(expected, test_file) - def test_copyright_ttf_malayalam_fonts_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_ttf_malayalam_fonts_copyright-ttf_malayalam_fonts_copyright.copyright') + def test_ttf_malayalam_fonts(self): + test_file = self.get_test_loc('copyrights/ttf_malayalam_fonts-ttf_malayalam_fonts.copyright') expected = [ 'Copyright (c) Jeroen Hellingman , N.V Shaji ', 'Copyright (c) 2004 Kevin & Siji', @@ -3806,38 +3797,38 @@ def test_copyright_ttf_malayalam_fonts_copyright(self): ] check_detection(expected, test_file) - def test_copyright_tunnel_h(self): - test_file = self.get_test_loc('copyrights/copyright_tunnel_h-tunnel_h.h') + def test_tunnel_h(self): + test_file = self.get_test_loc('copyrights/tunnel_h-tunnel_h.h') expected = [ 'Copyright (c) 2000 Frank Strauss ', ] check_detection(expected, test_file) - def test_copyright_two_digits_years(self): - test_file = self.get_test_loc('copyrights/copyright_two_digits_years-digits_c.c') + def test_two_digits_years(self): + test_file = self.get_test_loc('copyrights/two_digits_years-digits_c.c') expected = [ 'Copyright (c) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.', ] check_detection(expected, test_file) @expectedFailure - def test_copyright_url_in_html(self): - test_file = self.get_test_loc('copyrights/copyright_url_in_html-detail_9_html.html') + def test_url_in_html(self): + test_file = self.get_test_loc('copyrights/url_in_html-detail_9_html.html') expected = [ '(c) 2004-2009 pudn.com', ] check_detection(expected, test_file) - def test_copyright_utilities_js(self): - test_file = self.get_test_loc('copyrights/copyright_utilities_js-utilities_js.js') + def test_utilities_js(self): + test_file = self.get_test_loc('copyrights/utilities_js-utilities_js.js') expected = [ 'Copyright (c) 2009, Yahoo! Inc.', 'Copyright 2001 Robert Penner', ] check_detection(expected, test_file) - def test_copyright_var_route_c(self): - test_file = self.get_test_loc('copyrights/copyright_var_route_c-var_route_c.c') + def test_var_route_c(self): + test_file = self.get_test_loc('copyrights/var_route_c-var_route_c.c') expected = [ 'Copyright 1988, 1989 by Carnegie Mellon University', 'Copyright 1989 TGV, Incorporated', @@ -3846,63 +3837,63 @@ def test_copyright_var_route_c(self): ] check_detection(expected, test_file) - def test_copyright_view_layout2_xml(self): - test_file = self.get_test_loc('copyrights/copyright_view_layout2_xml-view_layout_xml.xml') + def test_view_layout2_xml(self): + test_file = self.get_test_loc('copyrights/view_layout2_xml-view_layout_xml.xml') expected = [ 'Copyright (c) 2008 Esmertec AG.', ] check_detection(expected, test_file) - def test_copyright_warning_parsing_empty_text(self): - test_file = self.get_test_loc('copyrights/copyright_warning_parsing_empty_text-controlpanel_anjuta.anjuta') + def test_warning_parsing_empty_text(self): + test_file = self.get_test_loc('copyrights/warning_parsing_empty_text-controlpanel_anjuta.anjuta') expected = [] check_detection(expected, test_file) - def test_copyright_web_app_dtd__b_sun(self): - test_file = self.get_test_loc('copyrights/copyright_web_app_dtd_b_sun-web_app__dtd.dtd') + def test_web_app_dtd_b_sun(self): + test_file = self.get_test_loc('copyrights/web_app_dtd_b_sun-web_app_dtd.dtd') expected = [ 'Copyright 2000-2007 Sun Microsystems, Inc.', ] check_detection(expected, test_file) - def test_copyright_web_app_dtd_sun_twice(self): - test_file = self.get_test_loc('copyrights/copyright_web_app_dtd_sun_twice-web_app__b_dtd.dtd') + def test_web_app_dtd_sun_twice(self): + test_file = self.get_test_loc('copyrights/web_app_dtd_sun_twice-web_app_b_dtd.dtd') expected = [ 'Copyright (c) 2000 Sun Microsystems, Inc.', 'Copyright (c) 2000 Sun Microsystems, Inc.', ] check_detection(expected, test_file) - def test_copyright_wide_c(self): - test_file = self.get_test_loc('copyrights/copyright_wide_c-c.c') + def test_wide_c(self): + test_file = self.get_test_loc('copyrights/wide_c-c.c') expected = [ 'Copyright (c) 1995, 1996, 1997, and 1998 WIDE Project.', ] check_detection(expected, test_file) - def test_copyright_wide_txt(self): - test_file = self.get_test_loc('copyrights/copyright_wide_txt.txt') + def test_wide_txt(self): + test_file = self.get_test_loc('copyrights/wide_txt.txt') expected = [ 'Copyright (c) 1995, 1996, 1997, and 1998 WIDE Project.', ] check_detection(expected, test_file) - def test_copyright_with_verbatim_lf(self): - test_file = self.get_test_loc('copyrights/copyright_with_verbatim_lf-verbatim_lf_c.c') + def test_with_verbatim_lf(self): + test_file = self.get_test_loc('copyrights/with_verbatim_lf-verbatim_lf_c.c') expected = [ 'Copyright 2003-2005 Colin Percival', ] check_detection(expected, test_file) - def test_copyright_xconsortium_sh(self): - test_file = self.get_test_loc('copyrights/copyright_xconsortium_sh-9_sh.sh') + def test_xconsortium_sh(self): + test_file = self.get_test_loc('copyrights/xconsortium_sh-9_sh.sh') expected = [ 'Copyright (c) 1994 X Consortium', ] check_detection(expected, test_file) - def test_copyright_xfonts_utils_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_xfonts_utils_copyright-xfonts_utils_copyright.copyright') + def test_xfonts_utils(self): + test_file = self.get_test_loc('copyrights/xfonts_utils-xfonts_utils.copyright') expected = [ 'Copyright 1991, 1993, 1998 The Open Group', 'Copyright 2005 Red Hat, Inc.', @@ -3923,8 +3914,8 @@ def test_copyright_xfonts_utils_copyright(self): ] check_detection(expected, test_file) - def test_copyright_xresprobe_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_xresprobe_copyright_label-xresprobe_copyright_label.label') + def test_xresprobe(self): + test_file = self.get_test_loc('copyrights/xresprobe-xresprobe.label') expected = [ 'copyright (c) 2004 Canonical Software', 'Copyright (c) 2002 Terra Soft Solutions, Inc.', @@ -3935,51 +3926,51 @@ def test_copyright_xresprobe_copyright_label(self): ] check_detection(expected, test_file) - def test_copyright_xsane_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_xsane_copyright_label-xsane_copyright_label.label') + def test_xsane(self): + test_file = self.get_test_loc('copyrights/xsane-xsane.label') expected = [ 'Copyright (c) 1998-2005 Oliver Rauch', ] check_detection(expected, test_file) - def test_copyright_does_not_return_junk_in_pdf(self): + def test_does_not_return_junk_in_pdf(self): # from https://github.com/ttgurney/yocto-spdx/blob/master/doc/Yocto-SPDX_Manual_Install_Walkthrough.pdf - test_file = self.get_test_loc('copyrights/copyright_Yocto-SPDX.pdf') + test_file = self.get_test_loc('copyrights/Yocto-SPDX.pdf') expected = [ ] check_detection(expected, test_file) - def test_copyright_name_and_co(self): - test_file = self.get_test_loc('copyrights/copyright_nnp_and_co.txt') + def test_name_and_co(self): + test_file = self.get_test_loc('copyrights/nnp_and_co.txt') expected = [ 'Copyright (c) 2001, Sandra and Klaus Rennecke.', ] check_detection(expected, test_file) - def test_copyright_with_ascii_art(self): - test_file = self.get_test_loc('copyrights/copyright_with_ascii_art.txt') + def test_with_ascii_art(self): + test_file = self.get_test_loc('copyrights/with_ascii_art.txt') expected = [ 'Copyright (c) 1996. The Regents of the University of California.', ] check_detection(expected, test_file) - def test_copyright_should_not_be_detected_in_pixel_data_stream(self): - test_file = self.get_test_loc('copyrights/copyright_pixelstream.rgb') + def test_should_not_be_detected_in_pixel_data_stream(self): + test_file = self.get_test_loc('copyrights/pixelstream.rgb') expected = [] check_detection(expected, test_file) - def test_copyright_should_not_contain_leading_or_trailing_colon(self): - test_file = self.get_test_loc('copyrights/copyright_with_colon') + def test_should_not_contain_leading_or_trailing_colon(self): + test_file = self.get_test_loc('copyrights/with_colon') expected = ['copyright (c) 2013 by Armin Ronacher.'] check_detection(expected, test_file) - def test_copyright_in_markup_should_not_be_truncated(self): - test_file = self.get_test_loc('copyrights/copyright_in_html.html') + def test_markup_should_not_be_truncated(self): + test_file = self.get_test_loc('copyrights/html.html') expected = ["(c) Copyright 2010 by the WTForms Team"] check_detection(expected, test_file) - def test_copyright_should_not_have_trailing_garbage(self): - test_file = self.get_test_loc('copyrights/copyright_with_trailing_words.js') + def test_should_not_have_trailing_garbage(self): + test_file = self.get_test_loc('copyrights/with_trailing_words.js') expected = [ 'Copyright 2012-2015 The Dojo Foundation', 'Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters', @@ -3992,93 +3983,93 @@ def test_copyright_should_not_have_trailing_garbage(self): ] check_detection(expected, test_file) - def test_copyright_should_not_have_trailing_available(self): - test_file = self.get_test_loc('copyrights/copyright_hostapd_trailing_available.c') + def test_should_not_have_trailing_available(self): + test_file = self.get_test_loc('copyrights/hostapd_trailing_available.c') expected = ['Copyright (c) 2004-2005, Jouni Malinen '] check_detection(expected, test_file) - def test_copyright_with_dots_and_all_lowercase_on_multilines(self): + def test_with_dots_and_all_lowercase_on_multilines(self): test_lines = ['Copyright . 2008 company name, inc.', ' Change: Add functions', ] expected = ['Copyright . 2008 company name, inc.'] check_detection(expected, test_lines) - def test_copyright_with_dots_and_all_lowercase_on_single_line(self): + def test_with_dots_and_all_lowercase_on_single_line(self): test_lines = ['Copyright . 2008 foo name, inc.'] expected = ['Copyright . 2008 foo name, inc.'] check_detection(expected, test_lines) - def test_copyright_copy_copy_by_name3(self): + def test_copy_copy_by_name3(self): test_lines = ['Copyright (c) by 2007 Joachim Foerster '] expected = ['Copyright (c) by 2007 Joachim Foerster '] check_detection(expected, test_lines) - def test_copyright_rimini(self): + def test_rimini(self): test_file = self.get_test_loc('copyrights/rimini.c') expected = ['(c) Copyright 2000 Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it'] check_detection(expected, test_file) - def test_copyright_should_not_be_detected_in_apache_html(self): - test_file = self.get_test_loc('copyrights/copyright_apache_in_html.html') + def test_should_not_be_detected_in_apache_html(self): + test_file = self.get_test_loc('copyrights/apache_in_html.html') expected = [] check_detection(expected, test_file) - def test_copyright_bv_legal_entity(self): + def test_bv_legal_entity(self): test_file = self.get_test_loc('copyrights/bv.txt') expected = ['Copyright (c) 2016 HERE Europe B.V.', '(c) HERE 2016'] check_detection(expected, test_file) - def test_copyright_with_dash_and_dotted_name(self): + def test_with_dash_and_dotted_name(self): test_lines = ['Copyright 1999, 2000 - D.T.Shield.'] expected = ['Copyright 1999, 2000 - D.T.Shield.'] check_detection(expected, test_lines) - def test_copyright_with_sign_dash_and_dotted_name(self): + def test_with_sign_dash_and_dotted_name(self): test_lines = ['Copyright (c) 1999, 2000 - D.T.Shield.'] expected = ['Copyright (c) 1999, 2000 - D.T.Shield.'] check_detection(expected, test_lines) - def test_copyright_with_sign_year_comp_and_auth(self): + def test_with_sign_year_comp_and_auth(self): test_lines = ['Copyright (c) 2012-2016, Project contributors'] expected = ['Copyright (c) 2012-2016, Project contributors'] check_detection(expected, test_lines) - def test_copyright_with_year_comp_and_auth(self): + def test_with_year_comp_and_auth(self): test_lines = ['Copyright 2012-2016, Project contributors'] expected = ['Copyright 2012-2016, Project contributors'] check_detection(expected, test_lines) - def test_copyright_with_year_noun_junk_auth_noun_and_auth(self): + def test_with_year_noun_junk_auth_noun_and_auth(self): test_lines = ['Copyright 2007-2010 the original author or authors.'] expected = ['Copyright 2007-2010 the original author or authors.'] check_detection(expected, test_lines) - def test_copyright_with_sign_year_noun_junk_auth_noun_and_auth(self): + def test_with_sign_year_noun_junk_auth_noun_and_auth(self): test_lines = ['Copyright (c) 2007-2010 the original author or authors.'] expected = ['Copyright (c) 2007-2010 the original author or authors.'] check_detection(expected, test_lines) - def test_copyright_byten_c_exactly(self): + def test_byten_c_exactly(self): test_lines = ['... don’t fit into your fixed-size buffer.\nByten ( c )\nExactly n bytes. If the'] expected = [] check_detection(expected, test_lines) - def test_copyright_should_not_be_detected_in_junk_strings_with_year_prefix(self): + def test_should_not_be_detected_in_junk_strings_with_year_prefix(self): test_file = self.get_test_loc('copyrights/access_strings.txt') expected = [] check_detection(expected, test_file) - def test_copyright_chromium_authors(self): + def test_chromium_authors(self): test_lines = ['© 2017 The Chromium Authors'] expected = ['(c) 2017 The Chromium Authors'] check_detection(expected, test_lines) - def test_copyright_rim(self): + def test_rim(self): test_lines = ['Copyright (C) Research In Motion Limited 2010. All rights reserved.'] expected = ['Copyright (c) Research In Motion Limited 2010.'] check_detection(expected, test_lines) - def test_copyright_sinica(self): + def test_sinica(self): test_lines = ''' # Copyright (c) 1999 Computer Systems and Communication Lab, # Institute of Information Science, Academia Sinica. @@ -4089,70 +4080,70 @@ def test_copyright_sinica(self): check_detection(expected, test_lines) - def test_copyright_copr1(self): + def test_copr1(self): test_lines = ['Copyright or Copr. CNRS'] expected = ['Copyright or Copr. CNRS'] check_detection(expected, test_lines) - def test_copyright_copr2(self): + def test_copr2(self): test_lines = ['Copyright or Copr. 2006 INRIA - CIRAD - INRA'] expected = ['Copr. 2006 INRIA - CIRAD - INRA'] check_detection(expected, test_lines) @expectedFailure - def test_copyright_copr2_correct(self): + def test_copr2_correct(self): test_lines = ['Copyright or Copr. 2006 INRIA - CIRAD - INRA'] expected = ['Copyright or Copr. 2006 INRIA - CIRAD - INRA'] check_detection(expected, test_lines) - def test_copyright_copr3(self): + def test_copr3(self): test_lines = ['Copyright or © or Copr. SSD Research Team 2011'] expected = ['Copr. SSD Research Team 2011'] check_detection(expected, test_lines) @expectedFailure - def test_copyright_copr3_correct(self): + def test_copr3_correct(self): test_lines = ['Copyright or © or Copr. SSD Research Team 2011'] expected = ['Copyright or (c) or Copr. SSD Research Team 2011'] check_detection(expected, test_lines) - def test_copyright_copr4(self): + def test_copr4(self): test_lines = ["(C) Copr. 1986-92 Numerical Recipes Software i9k''3"] expected = ['(c) Copr. 1986-92 Numerical Recipes Software'] check_detection(expected, test_lines) - def test_copyright_copr5(self): + def test_copr5(self): test_lines = ['Copyright or Copr. Mines Paristech, France - Mark NOBLE, Alexandrine GESRET'] expected = ['Copr. Mines Paristech, France - Mark NOBLE'] check_detection(expected, test_lines) @expectedFailure - def test_copyright_copr5_correct(self): + def test_copr5_correct(self): test_lines = ['Copyright or Copr. Mines Paristech, France - Mark NOBLE, Alexandrine GESRET'] expected = ['Copyright or Copr. Mines Paristech, France - Mark NOBLE, Alexandrine GESRET'] check_detection(expected, test_lines) - def test_copyright_oracle(self): + def test_oracle(self): test_lines = ['Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.'] expected = ['Copyright (c) 1997-2015 Oracle and/or its affiliates.'] check_detection(expected, test_lines) - def test_copyright_windows(self): + def test_windows(self): test_lines = ['This release supports NT-based Windows releases like Windows 2000 SP4, Windows XP, and Windows 2003.'] expected = [] check_detection(expected, test_lines) - def test_copyright_in_binary_sql_server(self): + def test_binary_sql_server(self): test_lines = ['2005charchar? 7 DDLSQL Server 2005smalldatetimedatetimeLDDDDDD7'] expected = [] check_detection(expected, test_lines) - def test_copyright_with_example_com_url(self): + def test_with_example_com_url(self): test_lines = ['"domain": function(c) { assert.equal(c.domain, "example.com") },'] expected = [] check_detection(expected, test_lines) - def test_copyright_various(self): + def test_various(self): test_lines = ''' libwmf (): library for wmf conversion Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources @@ -4161,7 +4152,7 @@ def test_copyright_various(self): expected = ['Copyright (c) 2000 - various'] # ; see CREDITS, ChangeLog, and sources check_detection(expected, test_lines) - def test_copyright_natural_docs(self): + def test_natural_docs(self): test_lines = ''' // Search script generated by doxygen // Copyright (C) 2009 by Dimitri van Heesch. @@ -4176,7 +4167,7 @@ def test_copyright_natural_docs(self): ] check_detection(expected, test_lines) - def test_copyright_and_authors_mixed(self): + def test_and_authors_mixed(self): test_lines = ''' * Copyright (c) 1998 Softweyr LLC. All rights reserved. * @@ -4192,7 +4183,7 @@ def test_copyright_and_authors_mixed(self): ] check_detection(expected, test_lines) - def test_copyright_word_in_html(self): + def test_word_in_html(self): test_lines = ''' Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) '''.splitlines(False) @@ -4201,7 +4192,7 @@ def test_copyright_word_in_html(self): ] check_detection(expected, test_lines) - def test_copyright_with_date_in_angle_brackets(self): + def test_with_date_in_angle_brackets(self): test_lines = ''' * Copyright (C) <2013>, GENIVI Alliance, Inc. * Author: bj@open-rnd.pl @@ -4215,7 +4206,7 @@ def test_copyright_with_date_in_angle_brackets(self): ] check_detection(expected, test_lines, what='authors') - def test_copyright_with_zoo(self): + def test_with_zoo(self): test_lines = ''' * Download Upload Messaging Manager * @@ -4227,7 +4218,7 @@ def test_copyright_with_zoo(self): ] check_detection(expected, test_lines, what='copyrights') - def test_copyright_in_man_page(self): + def test_man_page(self): test_lines = '''COPYRIGHT Copyright \(co 2001-2017 Free Software Foundation, Inc., and others. print "Copyright \\(co ". $args{'copyright'} . ".\n"; @@ -4242,7 +4233,7 @@ def test_copyright_in_man_page(self): ] check_detection(expected, test_lines, what='holders') - def test_copyright_is_not_mixed_with_authors(self): + def test_is_not_mixed_with_authors(self): test_lines = ''' * Copyright (C) 2000-2012 Free Software Foundation, Inc. * Author: Nikos Mavrogiannopoulos @@ -4257,7 +4248,7 @@ def test_copyright_is_not_mixed_with_authors(self): ] check_detection(expected, test_lines, what='authors') - def test_ibm_copyright_and_authors_are_detected(self): + def test_ibm_and_authors_are_detected(self): test_lines = ''' * Copyright IBM, Corp. 2007 * @@ -4279,7 +4270,7 @@ def test_ibm_copyright_and_authors_are_detected(self): ] check_detection(expected, test_lines, what='holders') - def test_copyright_germany(self): + def test_germany(self): test_lines = ''' * Copyright (C) 2011 * Bardenheuer GmbH, Munich and Bundesdruckerei GmbH, Berlin @@ -4290,7 +4281,7 @@ def test_copyright_germany(self): check_detection(expected, test_lines, what='holders') @expectedFailure - def test_copyright_germany_should_detect_trailing_city(self): + def test_germany_should_detect_trailing_city(self): test_lines = ''' * Copyright (C) 2011 * Bardenheuer GmbH, Munich and Bundesdruckerei GmbH, Berlin @@ -4300,7 +4291,7 @@ def test_copyright_germany_should_detect_trailing_city(self): ] check_detection(expected, test_lines, what='holders') - def test_copyright_does_not_detect_junk_in_texinfo(self): + def test_does_not_detect_junk_in_texinfo(self): test_lines = ''' \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} @@ -4343,7 +4334,7 @@ def test_author_does_not_report_trailing_junk_and_incorrect_authors(self): ] check_detection(expected, test_lines, what='authors') - def test_copyright_in_assembly_data(self): + def test_assembly_data(self): test_lines = ''' [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] @@ -4364,7 +4355,7 @@ def test_author_does_not_report_incorrect_junk(self): ] check_detection(expected, test_lines, what='authors') - def test_copyright_does_not_truncate_last_name(self): + def test_does_not_truncate_last_name(self): test_lines = ''' /* Copyright 2014, Kenneth MacKay. Licensed under the BSD 2-clause license. */ '''.splitlines(False) @@ -4374,7 +4365,7 @@ def test_copyright_does_not_truncate_last_name(self): check_detection(expected, test_lines, what='copyrights') @expectedFailure - def test_copyright_with_leading_date_andtrailing_plus(self): + def test_with_leading_date_andtrailing_plus(self): test_lines = ''' * 2004+ Copyright (c) Evgeniy Polyakov * All rights reserved. diff --git a/tests/cluecode/test_copyrights_lines.py b/tests/cluecode/test_copyrights_lines.py index 285798f88b6..3adc8ebe3a9 100644 --- a/tests/cluecode/test_copyrights_lines.py +++ b/tests/cluecode/test_copyrights_lines.py @@ -34,7 +34,7 @@ class TestCopyrightDetector(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_copyright_detect2_basic(self): - location = self.get_test_loc('copyrights/copyright_essential_smoke-ibm_c.c') + location = self.get_test_loc('copyright_lines/essential_smoke-ibm_c.c') expected = [ ([u'Copyright IBM and others (c) 2008'], [], [u'2008'], [u'IBM and others'], 6, 6), ([u'Copyright Eclipse, IBM and others (c) 2008'], [], [u'2008'], [u'Eclipse, IBM and others'], 8, 8) @@ -76,14 +76,14 @@ class TestCopyrightLinesDetection(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_company_name_in_java(self): - test_file = self.get_test_loc('copyrights/company_name_in_java-9_java.java') + test_file = self.get_test_loc('copyright_lines/company_name_in_java-9_java.java') expected = [ ([u'Copyright (c) 2008-2011 Company Name Incorporated'], 2, 3) ] check_detection(expected, test_file) def test_copyright_03e16f6c_0(self): - test_file = self.get_test_loc('copyrights/copyright_03e16f6c_0-e_f_c.0') + test_file = self.get_test_loc('copyright_lines/03e16f6c_0-e_f_c.0') expected = [ ([u'Copyright (c) 1997 Microsoft Corp., OU Microsoft Corporation, CN Microsoft Root', u'Copyright (c) 1997 Microsoft Corp., OU Microsoft Corporation, CN Microsoft Root'], @@ -95,7 +95,7 @@ def test_copyright_03e16f6c_0(self): def test_copyright_3a3b02ce_0(self): # this is a certificate and the actual copyright holder is not clear: # could be either Wisekey or OISTE Foundation. - test_file = self.get_test_loc('copyrights/copyright_3a3b02ce_0-a_b_ce.0') + test_file = self.get_test_loc('copyright_lines/3a3b02ce_0-a_b_ce.0') expected = [([ u'Copyright (c) 2005, OU OISTE Foundation Endorsed, CN OISTE WISeKey Global Root', u'Copyright (c) 2005, OU OISTE Foundation Endorsed, CN OISTE WISeKey Global Root' @@ -105,47 +105,47 @@ def test_copyright_3a3b02ce_0(self): check_detection(expected, test_file) def test_copyright_boost_vector(self): - test_file = self.get_test_loc('copyrights/vector50.hpp') + test_file = self.get_test_loc('copyright_lines/vector50.hpp') expected = [([u'Copyright (c) 2005 Arkadiy Vertleyb', u'Copyright (c) 2005 Peder Holt'], 2, 3)] check_detection(expected, test_file) def test_copyright_ABC_cpp(self): - test_file = self.get_test_loc('copyrights/copyright_ABC_cpp-Case_cpp.cpp') + test_file = self.get_test_loc('copyright_lines/ABC_cpp-Case_cpp.cpp') expected = [([u'Copyright (c) ABC Company'], 12, 12)] check_detection(expected, test_file) def test_copyright_ABC_file_cpp(self): - test_file = self.get_test_loc('copyrights/copyright_ABC_file_cpp-File_cpp.cpp') + test_file = self.get_test_loc('copyright_lines/ABC_file_cpp-File_cpp.cpp') expected = [([u'Copyright (c) ABC Company'], 12, 12)] check_detection(expected, test_file) def test_copyright_heunrich_c(self): - test_file = self.get_test_loc('copyrights/copyright_heunrich_c-c.c') + test_file = self.get_test_loc('copyright_lines/heunrich_c-c.c') expected = [([u'Copyright (c) 2000 HEUNRICH HERTZ INSTITUTE'], 5, 5)] check_detection(expected, test_file) def test_copyright_isc(self): - test_file = self.get_test_loc('copyrights/copyright_isc-c.c') + test_file = self.get_test_loc('copyright_lines/isc-c.c') expected = [([u'Copyright (c) 1998-2000 The Internet Software Consortium.'], 1, 3)] check_detection(expected, test_file) def test_copyright_sample_py(self): - test_file = self.get_test_loc('copyrights/copyright_sample_py-py.py') + test_file = self.get_test_loc('copyright_lines/sample_py-py.py') expected = [([u'COPYRIGHT 2006 ABC ABC'], 6, 7)] check_detection(expected, test_file) def test_copyright_abc(self): - test_file = self.get_test_loc('copyrights/copyright_abc') + test_file = self.get_test_loc('copyright_lines/abc') expected = [([u'Copyright (c) 2006 abc.org'], 1, 2)] check_detection(expected, test_file) def test_copyright_abc_loss_of_holder_c(self): - test_file = self.get_test_loc('copyrights/copyright_abc_loss_of_holder_c-c.c') + test_file = self.get_test_loc('copyright_lines/abc_loss_of_holder_c-c.c') expected = [([u'copyright abc 2001'], 1, 2)] check_detection(expected, test_file) def test_copyright_abiword_common_copyright(self): - test_file = self.get_test_loc('copyrights/copyright_abiword_common_copyright-abiword_common_copyright.copyright') + test_file = self.get_test_loc('copyright_lines/abiword_common.copyright') expected = [ ([u'Copyright (c) 1998- AbiSource, Inc. & Co.'], 17, 17), ([u'Copyright (c) 2009 Masayuki Hatta', @@ -155,17 +155,17 @@ def test_copyright_abiword_common_copyright(self): check_detection(expected, test_file) def test_copyright_acme_c(self): - test_file = self.get_test_loc('copyrights/copyright_acme_c-c.c') + test_file = self.get_test_loc('copyright_lines/acme_c-c.c') expected = [([u'Copyright (c) 2000 ACME, Inc.'], 1, 1)] check_detection(expected, test_file) def test_copyright_activefieldattribute_cs(self): - test_file = self.get_test_loc('copyrights/copyright_activefieldattribute_cs-ActiveFieldAttribute_cs.cs') + test_file = self.get_test_loc('copyright_lines/activefieldattribute_cs-ActiveFieldAttribute_cs.cs') expected = [([u'Web Applications Copyright 2009 - Thomas Hansen thomas@ra-ajax.org.'], 2, 5)] check_detection(expected, test_file) def test_copyright_addr_c(self): - test_file = self.get_test_loc('copyrights/copyright_addr_c-addr_c.c') + test_file = self.get_test_loc('copyright_lines/addr_c-addr_c.c') expected = [ ([u'Copyright 1999 Cornell University.'], 2, 4), ([u'Copyright 2000 Jon Doe.'], 5, 5) @@ -173,17 +173,17 @@ def test_copyright_addr_c(self): check_detection(expected, test_file) def test_copyright_adler_inflate_c(self): - test_file = self.get_test_loc('copyrights/copyright_adler_inflate_c-inflate_c.c') + test_file = self.get_test_loc('copyright_lines/adler_inflate_c-inflate_c.c') expected = [([u'Not copyrighted 1992 by Mark Adler'], 1, 2)] check_detection(expected, test_file) def test_copyright_aleal(self): - test_file = self.get_test_loc('copyrights/copyright_aleal-c.c') + test_file = self.get_test_loc('copyright_lines/aleal-c.c') expected = [([u'copyright (c) 2006 by aleal'], 2, 2)] check_detection(expected, test_file) def test_copyright_andre_darcy(self): - test_file = self.get_test_loc('copyrights/copyright_andre_darcy-c.c') + test_file = self.get_test_loc('copyright_lines/andre_darcy-c.c') expected = [ ([u'Copyright (c) 1995, Pascal Andre (andre@via.ecp.fr).'], 2, 6), ([u"copyright 1997, 1998, 1999 by D'Arcy J.M. Cain (darcy@druid.net)"], 25, 26) @@ -191,7 +191,7 @@ def test_copyright_andre_darcy(self): check_detection(expected, test_file) def test_copyright_android_c(self): - test_file = self.get_test_loc('copyrights/copyright_android_c-c.c') + test_file = self.get_test_loc('copyright_lines/android_c-c.c') expected = [ ([u'Copyright (c) 2009 The Android Open Source Project'], 2, 2), ([u'Copyright 2003-2005 Colin Percival'], 23, 24) @@ -199,7 +199,7 @@ def test_copyright_android_c(self): check_detection(expected, test_file) def test_copyright_apache_notice(self): - test_file = self.get_test_loc('copyrights/copyright_apache_notice-NOTICE') + test_file = self.get_test_loc('copyright_lines/apache_notice-NOTICE') expected = [ ([u'Copyright 1999-2006 The Apache Software Foundation'], 6, 7), ([u'Copyright 1999-2006 The Apache Software Foundation'], 16, 17), @@ -209,12 +209,12 @@ def test_copyright_apache_notice(self): check_detection(expected, test_file) def test_copyright_aptitude_copyright_label(self): - test_file = self.get_test_loc('copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label') + test_file = self.get_test_loc('copyright_lines/aptitude-aptitude.label') expected = [([u'Copyright 1999-2005 Daniel Burrows '], 1, 1)] check_detection(expected, test_file) def test_copyright_atheros_spanning_lines(self): - test_file = self.get_test_loc('copyrights/copyright_atheros_spanning_lines-py.py') + test_file = self.get_test_loc('copyright_lines/atheros_spanning_lines-py.py') expected = [ ([u'Copyright (c) 2000 Atheros Communications, Inc.'], 2, 2), ([u'Copyright (c) 2001 Atheros Communications, Inc.'], 3, 3), @@ -223,18 +223,18 @@ def test_copyright_atheros_spanning_lines(self): check_detection(expected, test_file) def test_copyright_att_in_c(self): - test_file = self.get_test_loc('copyrights/copyright_att_in_c-9_c.c') + test_file = self.get_test_loc('copyright_lines/att_in_c-9_c.c') expected = [([u'Copyright (c) 1991 by AT&T.'], 5, 5)] check_detection(expected, test_file) def test_copyright_audio_c(self): - test_file = self.get_test_loc('copyrights/copyright_audio_c-c.c') + test_file = self.get_test_loc('copyright_lines/audio_c-c.c') expected = [([u'copyright (c) 1995, AudioCodes, DSP Group, France Telecom, Universite de Sherbrooke.'], 2, 4)] check_detection(expected, test_file) def test_copyright_babkin_txt(self): - test_file = self.get_test_loc('copyrights/copyright_babkin_txt.txt') + test_file = self.get_test_loc('copyright_lines/babkin_txt.txt') expected = [ ([u'Copyright (c) North', u'Copyright (c) South', @@ -245,7 +245,7 @@ def test_copyright_babkin_txt(self): check_detection(expected, test_file) def test_copyright_blender_debian(self): - test_file = self.get_test_loc('copyrights/copyright_blender_debian-blender_copyright.copyright') + test_file = self.get_test_loc('copyright_lines/blender_debian-blender.copyright') expected = [ ([u'Copyright (c) 2002-2008 Blender Foundation'], 8, 11), ([u'Copyright (c) 2004-2005 Masayuki Hatta ', From 3639ac95c375d36673025a4c7a5a1b5bc82eb19a Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 01:18:52 +0100 Subject: [PATCH 088/122] Correct test failures #787 #685 #357 Signed-off-by: Philippe Ombredanne --- tests/scancode/test_cli.py | 42 +++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index bbeb6db0371..5e25376a36a 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -313,14 +313,14 @@ def test_scan_works_with_multiple_processes(): assert sorted(res1['files']) == sorted(res3['files']) -def test_scan_works_with_no_processes_in_single_threaded_mode(): +def test_scan_works_with_no_processes_in_threaded_mode(): test_dir = test_env.get_test_loc('multiprocessing', copy=True) # run the same scan with zero or one process result_file_0 = test_env.get_temp_file('json') result0 = run_scan_click([ '--copyright', '--processes', '0', test_dir, '--json', result_file_0]) assert result0.exit_code == 0 - assert 'Disabling multi-processing.' in result0.output + assert 'Disabling multi-processing' in result0.output result_file_1 = test_env.get_temp_file('json') result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) @@ -330,6 +330,22 @@ def test_scan_works_with_no_processes_in_single_threaded_mode(): assert sorted(res0['files']) == sorted(res1['files']) +def test_scan_works_with_no_processes_non_threaded_mode(): + test_dir = test_env.get_test_loc('multiprocessing', copy=True) + + # run the same scan with zero or one process + result_file_0 = test_env.get_temp_file('json') + result0 = run_scan_click([ '--copyright', '--processes', '-1', test_dir, '--json', result_file_0]) + assert result0.exit_code == 0 + assert 'Disabling multi-processing and multi-threading' in result0.output + + result_file_1 = test_env.get_temp_file('json') + result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) + assert result1.exit_code == 0 + res0 = json.loads(open(result_file_0).read()) + res1 = json.loads(open(result_file_1).read()) + assert sorted(res0['files']) == sorted(res1['files']) + def test_scan_works_with_multiple_processes_and_timeouts(): # this contains test files with a lot of copyrights that should # take more thant timeout to scan @@ -596,7 +612,6 @@ def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): assert 'delimiter: line 5 column 12' in stderr assert 'ValueError: Expecting' in stdout - def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') @@ -618,13 +633,20 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): result_file = test_env.get_temp_file('json') result = run_scan_click(['--copyright', test_dir, '--json', result_file], monkeypatch) assert result.exit_code == 0 - expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' - expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' - expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' - assert expected1 in result.output - assert expected2 in result.output - assert expected3 not in result.output - + if on_windows: + expected1 = 'Scanned: 0123456789012345678901234567890123456789.c' + expected2 = 'Scanned: abcdefghijklmnopqrt...0123456789012345678' + expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' + assert expected1 in result.output + assert expected2 in result.output + assert expected3 not in result.output + else: + expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' + expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' + expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' + assert expected1 in result.output + assert expected2 in result.output + assert expected3 not in result.output def test_scan_does_scan_php_composer(): test_file = test_env.get_test_loc('composer/composer.json') From 1d8a43d241032d99c2363a7399b40d4bac70d2c8 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 01:20:02 +0100 Subject: [PATCH 089/122] Make multiprocessing working on Windows #787 #685 #357 Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 52 ++++++++++++++++---------- src/scancode/interrupt.py | 78 +++++++++++++++++++++++++++------------ 2 files changed, 88 insertions(+), 42 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 265522ac255..1c77e85606a 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -75,6 +75,7 @@ from scancode import validate_option_dependencies from scancode.api import get_file_info from scancode.interrupt import DEFAULT_TIMEOUT +from scancode.interrupt import fake_interruptible from scancode.interrupt import interruptible from scancode.resource import Codebase from scancode.utils import BaseCommand @@ -86,11 +87,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA # Tracing flags @@ -257,7 +258,7 @@ class ScanCommand(BaseCommand): Try 'scancode --help' for help on options and arguments.''' def __init__(self, name, context_settings=None, callback=None, params=None, - help=None, # @ReservedAssignment + help=None, # NOQA epilog=None, short_help=None, options_metavar='[OPTIONS]', add_help_option=True, plugin_options=()): @@ -336,8 +337,8 @@ def print_plugins(ctx, param, value): name = option.name opts = ', '.join(option.opts) help_group = option.help_group - help = option.help # noqa - click.echo(' help_group: {help_group!s}, name: {name!s}: {opts}\n help: {help!s}'.format(**locals())) + help_txt = option.help # noqa + click.echo(' help_group: {help_group!s}, name: {name!s}: {opts}\n help: {help_txt!s}'.format(**locals())) click.echo('') ctx.exit() @@ -378,7 +379,7 @@ def print_plugins(ctx, param, value): type=int, default=1, metavar='INT', help='Set the number of parallel processes to use. ' - 'Disable parallel processing if 0. [default: 1]', + 'Disable parallel processing if 0. Disable also threading if -1 [default: 1]', help_group=CORE_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--timeout', @@ -481,7 +482,7 @@ def print_plugins(ctx, param, value): help='Run ScanCode in a special "test mode". Only for testing.', help_group=MISC_GROUP, sort_order=1000, cls=CommandLineOption) -def scancode(ctx, input, +def scancode(ctx, input, #NOQA info, strip_root, full_root, processes, timeout, @@ -538,7 +539,8 @@ def scancode(ctx, input, These options are mutually exclusive. - `processes`: int: run the scan using up to this number of processes in - parallel. If 0, disable the multiprocessing machinery. + parallel. If 0, disable the multiprocessing machinery. if -1 also + disable the multithreading machinery. - `timeout`: float: intterup the scan of a file if it does not finish within `timeout` seconds. This applied to each file and scan individually (e.g. @@ -589,7 +591,9 @@ def scancode(ctx, input, try: if not processes and not quiet: - echo_stderr('Disabling multi-processing.', fg='yellow') + echo_stderr('Disabling multi-processing for debugging.', fg='yellow') + if processes == -1 and not quiet: + echo_stderr('Disabling multi-processing and multi-threading for debugging.', fg='yellow') ######################################################################## # 1. get command options and create all plugin instances @@ -934,7 +938,8 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) runner = partial(scan_resource, scanners=scanners, - timeout=timeout, with_timing=with_timing) + timeout=timeout, with_timing=with_timing, + with_threading=processes >= 0) if TRACE: logger_debug('scan_codebase: scanners:', '\n'.join(repr(s) for s in scanners)) @@ -945,7 +950,7 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, pool = None scans = None try: - if processes: + if processes >= 1: # maxtasksperchild helps with recycling processes in case of leaks pool = get_pool(processes=processes, maxtasksperchild=1000) # Using chunksize is documented as much more efficient in the Python doc. @@ -954,7 +959,7 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, scans = pool.imap_unordered(runner, resources, chunksize=1) pool.close() else: - # no multiprocessing with processes=0 + # no multiprocessing with processes=0 or -1 scans = imap(runner, resources) if progress_manager: @@ -1021,15 +1026,16 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, return success -def scan_resource(location_rid, scanners, - timeout=DEFAULT_TIMEOUT, - with_timing=False): +def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, + with_timing=False, with_threading=True): """ Return a tuple of (location, rid, errors, scan_time, scan_results, timings) by running the `scanners` Scanner objects for the file or directory resource with id `rid` at `location` provided as a `location_rid` tuple of (location, rid) for up to `timeout` seconds. - In the returned tuple: + If `with_threading` is False, threading is disabled. + + The returned tuple has these values (: - `location` and `rid` are the orginal arguments. - `errors` is a list of error strings. - `scan_results` is a mapping of scan results keyed by scanner.key. @@ -1037,6 +1043,9 @@ def scan_resource(location_rid, scanners, - `timings` is a mapping of scan {scanner.key: execution time in seconds} tracking the execution duration each each scan individually. `timings` is empty unless `with_timing` is True. + + All these values MUST be serializable/pickable because of the way multi- + processing/threading works. """ scan_time = time() @@ -1044,6 +1053,11 @@ def scan_resource(location_rid, scanners, if with_timing: timings = OrderedDict((scanner.key, 0) for scanner in scanners) + if not with_threading: + interruptor= fake_interruptible + else: + interruptor = interruptible + location, rid = location_rid errors = [] results = OrderedDict((scanner.key, []) for scanner in scanners) @@ -1054,8 +1068,8 @@ def scan_resource(location_rid, scanners, start = time() try: - error, value = interruptible( - partial(scanner.function, location), timeout=timeout) + runner = partial(scanner.function, location) + error, value = interruptor(runner, timeout=timeout) if error: msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + error errors.append(msg) diff --git a/src/scancode/interrupt.py b/src/scancode/interrupt.py index 286ae438ccf..25ff6d2bc2e 100644 --- a/src/scancode/interrupt.py +++ b/src/scancode/interrupt.py @@ -11,10 +11,12 @@ # specific language governing permissions and limitations under the License. # -from __future__ import print_function from __future__ import absolute_import +from __future__ import print_function from __future__ import unicode_literals +from traceback import format_exc as traceback_format_exc + from commoncode.system import on_windows @@ -72,7 +74,11 @@ class TimeoutError(Exception): permissions and limitations under the License. """ - import signal + from signal import ITIMER_REAL + from signal import SIGALRM + from signal import setitimer + from signal import signal as create_signal + def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): """ @@ -83,19 +89,18 @@ def handler(signum, frame): raise TimeoutError try: - signal.signal(signal.SIGALRM, handler) - signal.setitimer(signal.ITIMER_REAL, timeout) + create_signal(SIGALRM, handler) + setitimer(ITIMER_REAL, timeout) return NO_ERROR, func(*(args or ()), **(kwargs or {})) except TimeoutError: return TIMEOUT_MSG % locals(), NO_VALUE except Exception: - import traceback - return ERROR_MSG + traceback.format_exc(), NO_VALUE + return ERROR_MSG + traceback_format_exc(), NO_VALUE finally: - signal.setitimer(signal.ITIMER_REAL, 0) + setitimer(ITIMER_REAL, 0) else: """ @@ -105,13 +110,16 @@ def handler(signum, frame): But not code has been reused from this post. """ - import ctypes - import multiprocessing - import Queue + from ctypes import c_long + from ctypes import py_object + from ctypes import pythonapi + from multiprocessing import TimeoutError as MpTimeoutError + from Queue import Empty as Queue_Empty + from Queue import Queue try: - import thread + from thread import start_new_thread except ImportError: - import _thread as thread + from _thread import start_new_thread def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): @@ -120,20 +128,31 @@ def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): POSIX, but is not reliable and works only if everything is pickable. """ # We run `func` in a thread and block on a queue until timeout - results = Queue.Queue() + results = Queue() def runner(): - results.put(func(*(args or ()), **(kwargs or {}))) + try: + _res = func(*(args or ()), **(kwargs or {})) + results.put((NO_ERROR, _res,)) + except Exception: + results.put((ERROR_MSG + traceback_format_exc(), NO_VALUE,)) - tid = thread.start_new_thread(runner, ()) + tid = start_new_thread(runner, ()) try: - return NO_ERROR, results.get(timeout=timeout) - except (Queue.Empty, multiprocessing.TimeoutError): + err_res = results.get(timeout=timeout) + + if not err_res: + return ERROR_MSG, NO_VALUE + + return err_res + + except (Queue_Empty, MpTimeoutError): return TIMEOUT_MSG % locals(), NO_VALUE + except Exception: - import traceback - return ERROR_MSG + traceback.format_exc(), NO_VALUE + return ERROR_MSG + traceback_format_exc(), NO_VALUE + finally: try: async_raise(tid, Exception) @@ -152,13 +171,26 @@ def async_raise(tid, exctype=Exception): """ assert isinstance(tid, int), 'Invalid thread id: must an integer' - tid = ctypes.c_long(tid) - exception = ctypes.py_object(Exception) - res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, exception) + tid = c_long(tid) + exception = py_object(Exception) + res = pythonapi.PyThreadState_SetAsyncExc(tid, exception) if res == 0: raise ValueError('Invalid thread id.') elif res != 1: # if it returns a number greater than one, you're in trouble, # and you should call it again with exc=NULL to revert the effect - ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0) + pythonapi.PyThreadState_SetAsyncExc(tid, 0) raise SystemError('PyThreadState_SetAsyncExc failed.') + + +def fake_interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): + """ + Fake, non-interruptible, using no threads and no signals + implementation used for debugging. This ignores the timeout and just + the function as-is. + """ + + try: + return NO_ERROR, func(*(args or ()), **(kwargs or {})) + except Exception: + return ERROR_MSG + traceback_format_exc(), NO_VALUE From e7aabf17659f9269ac540bcd0fb4461e99fee5a0 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 01:37:38 +0100 Subject: [PATCH 090/122] Use NOQA tags consistently. Cleanup up dead code Signed-off-by: Philippe Ombredanne --- etc/scripts/test_json2csv.py | 2 +- src/commoncode/command.py | 6 +++--- src/commoncode/fileutils.py | 12 ++++++------ src/commoncode/text.py | 5 +---- src/commoncode/timeutils.py | 11 +++++++---- src/extractcode/tarfile_patch/tarfile.py | 3 ++- src/formattedcode/output_html.py | 4 +++- src/formattedcode/output_spdx.py | 18 +++++++++++------- src/licensedcode/cache.py | 2 +- src/licensedcode/index.py | 1 - src/plugincode/output.py | 6 +++--- src/scancode/__init__.py | 8 ++++---- src/scancode/api.py | 1 - src/scancode/extract_cli.py | 6 +++--- src/scancode/plugin_copyright.py | 2 +- src/scancode/plugin_license.py | 2 +- src/scancode/resource.py | 8 ++++---- src/scancode/utils.py | 8 ++++---- src/scancode_config.py | 4 ++-- src/typecode/magic2.py | 2 +- tests/cluecode/data/finder/email/jardiff.py | 2 +- tests/cluecode/data/finder/email/thomas.py | 1 + .../cluecode/data/finder/url/BeautifulSoup.py | 3 +++ tests/commoncode/test_command.py | 1 - tests/commoncode/test_fileutils.py | 2 +- tests/extractcode/test_archive.py | 1 - tests/licensedcode/data/perf/whatever.py | 1 + tests/licensedcode/license_test_utils.py | 2 +- tests/packagedcode/data/pypi/setup.py | 1 + tests/packagedcode/data/pypi/setup2.py | 1 + .../data/contenttype/code/python/__init__.py | 1 + .../contenttype/code/python/contenttype.py | 1 + .../data/contenttype/code/python/extract.py | 1 + 33 files changed, 71 insertions(+), 58 deletions(-) diff --git a/etc/scripts/test_json2csv.py b/etc/scripts/test_json2csv.py index d083b76aac8..fa834dd21f0 100644 --- a/etc/scripts/test_json2csv.py +++ b/etc/scripts/test_json2csv.py @@ -216,9 +216,9 @@ def test_can_process_scan_from_json_scan(self): rc, _stdout, _stderr = execute(scan_cmd, ['-clip', '--email', '--url', '--strip-root', test_dir, '--json', json_file]) - assert rc == 0 result_file = self.get_temp_file('.csv') with open(result_file, 'wb') as rf: json2csv.json_scan_to_csv(json_file, rf) expected_file = self.get_test_loc('livescan/expected.csv') check_csvs(result_file, expected_file, regen=False) + assert rc == 0 diff --git a/src/commoncode/command.py b/src/commoncode/command.py index 829ba3bc68e..57b90d2a154 100644 --- a/src/commoncode/command.py +++ b/src/commoncode/command.py @@ -55,10 +55,10 @@ try: # Python 2 unicode - str = unicode # @ReservedAssignment + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA """ @@ -328,7 +328,7 @@ def close_pipe(p): try: # Ensure process death otherwise proc.wait may hang in some cases # NB: this will run only on POSIX OSes supporting signals - os.kill(proc.pid, signal.SIGKILL) # @UndefinedVariable + os.kill(proc.pid, signal.SIGKILL) # NOQA except: pass diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index 9772b1f9a95..7b32adc596a 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -30,17 +30,17 @@ try: # Python 2 unicode - str = unicode # @ReservedAssignment + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA try: from os import fsencode from os import fsdecode except ImportError: from backports.os import fsencode - from backports.os import fsdecode # @UnusedImport + from backports.os import fsdecode # NOQA import codecs import errno @@ -65,9 +65,9 @@ # this exception is not available on posix try: - WindowsError # @UndefinedVariable + WindowsError # NOQA except NameError: - WindowsError = None # @ReservedAssignment + WindowsError = None # NOQA TRACE = False @@ -603,7 +603,7 @@ def chmod_tree(location, flags): # DELETION # -def _rm_handler(function, path, excinfo): # @UnusedVariable +def _rm_handler(function, path, excinfo): # NOQA """ shutil.rmtree handler invoked on error when deleting a directory tree. This retries deleting once before giving up. diff --git a/src/commoncode/text.py b/src/commoncode/text.py index 5be67b83fba..b613df485ca 100644 --- a/src/commoncode/text.py +++ b/src/commoncode/text.py @@ -35,15 +35,13 @@ import chardet from text_unidecode import unidecode - # Python 2 and 3 support try: # Python 2 unicode except NameError: # Python 3 - unicode = str - + unicode = str # NOQA """ A text processing module providing functions to process and prepare text @@ -54,7 +52,6 @@ - line separator stripping and conversion """ - LOG = logging.getLogger(__name__) diff --git a/src/commoncode/timeutils.py b/src/commoncode/timeutils.py index 37790f1b05a..99cc33db260 100644 --- a/src/commoncode/timeutils.py +++ b/src/commoncode/timeutils.py @@ -30,21 +30,22 @@ from functools import wraps from time import time - """ Time is of the essence: path safe time stamps creation and conversion to datetime objects. """ + class UTC(tzinfo): """UTC timezone""" - def utcoffset(self, dt): # @UnusedVariable + + def utcoffset(self, dt): # NOQA return None - def tzname(self, dt): # @UnusedVariable + def tzname(self, dt): # NOQA return 'UTC' - def dst(self, dt): # @UnusedVariable + def dst(self, dt): # NOQA return None @@ -115,9 +116,11 @@ def timed(fun): Note: this decorator will not work as expected for functions that return generators. """ + @wraps(fun) def _timed(*args, **kwargs): start = time() result = fun(*args, **kwargs) return time() - start, result + return update_wrapper(_timed, fun) diff --git a/src/extractcode/tarfile_patch/tarfile.py b/src/extractcode/tarfile_patch/tarfile.py index 1b0b2f7d2d3..f826401dd2c 100644 --- a/src/extractcode/tarfile_patch/tarfile.py +++ b/src/extractcode/tarfile_patch/tarfile.py @@ -1,4 +1,5 @@ # -*- coding: iso-8859-1 -*- +# flake8: noqa #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- @@ -2650,7 +2651,7 @@ def writestr(self, zinfo, bytes): from cStringIO import StringIO except ImportError: from StringIO import StringIO - import calendar # @UnresolvedImport + import calendar # NOQA tinfo = TarInfo(zinfo.filename) tinfo.size = len(bytes) tinfo.mtime = calendar.timegm(zinfo.date_time) diff --git a/src/formattedcode/output_html.py b/src/formattedcode/output_html.py index 3614bab2d1a..42b3719c310 100644 --- a/src/formattedcode/output_html.py +++ b/src/formattedcode/output_html.py @@ -139,7 +139,9 @@ class HtmlAppOutput(OutputPlugin): def is_enabled(self, output_html_app, **kwargs): return output_html_app - def process_codebase(self, codebase, input, output_html_app, + def process_codebase(self, codebase, + input, # NOQA + output_html_app, scancode_version, **kwargs): results = self.get_results(codebase, **kwargs) diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index b3c769d9b80..0546518d0c8 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -57,11 +57,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA # Tracing flags @@ -104,7 +104,9 @@ class SpdxTvOutput(OutputPlugin): def is_enabled(self, output_spdx_tv, **kwargs): return output_spdx_tv - def process_codebase(self, codebase, input, output_spdx_tv, + def process_codebase(self, codebase, + input, # NOQA + output_spdx_tv, scancode_version, scancode_notice, **kwargs): results = self.get_results(codebase, **kwargs) @@ -127,7 +129,9 @@ class SpdxRdfOutput(OutputPlugin): def is_enabled(self, output_spdx_rdf, **kwargs): return output_spdx_rdf - def process_codebase(self, codebase, input, output_spdx_rdf, + def process_codebase(self, codebase, + input, #NOQA + output_spdx_rdf, scancode_version, scancode_notice, **kwargs): results = self.get_results(codebase, **kwargs) @@ -277,9 +281,9 @@ def write_spdx(output_file, results, scancode_version, scancode_notice, package.conc_lics = NoAssert() if as_tagvalue: - from spdx.writers.tagvalue import write_document # @UnusedImport + from spdx.writers.tagvalue import write_document # NOQA else: - from spdx.writers.rdf import write_document # @Reimport + from spdx.writers.rdf import write_document # NOQA # The spdx-tools write_document returns either: # - unicode for tag values diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index 384dcd7c6ff..c538f6f6c8a 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -31,7 +31,7 @@ from os.path import getsize from os.path import join -import yg.lockfile # @UnresolvedImport +import yg.lockfile # NOQA from commoncode.fileutils import resource_iter from commoncode.fileutils import create_dir diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index 8f9b8afe15d..d370e2bb7da 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -34,7 +34,6 @@ from functools import partial from itertools import izip from operator import itemgetter -import os import sys from time import time diff --git a/src/plugincode/output.py b/src/plugincode/output.py index d861bc1c84d..1a9d1a3dbf8 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -42,11 +42,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA # Tracing flags diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index bff9c6d289f..46cc28852a8 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -47,11 +47,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA scan_src_dir = abspath(dirname(__file__)) @@ -112,7 +112,7 @@ def __init__(self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, - type=None, help=None, # @ReservedAssignment + type=None, help=None, # NOQA # custom additions # # a string that set the CLI help group for this option help_group=MISC_GROUP, diff --git a/src/scancode/api.py b/src/scancode/api.py index 7883a46e1c8..b578fb9e7f6 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -129,7 +129,6 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, from licensedcode.cache import get_index from licensedcode.cache import get_licenses_db - from scancode_config import SCANCODE_DEV_MODE idx = get_index(cache_dir, SCANCODE_DEV_MODE) licenses = get_licenses_db() diff --git a/src/scancode/extract_cli.py b/src/scancode/extract_cli.py index 0930205e70a..c0d7e51697f 100644 --- a/src/scancode/extract_cli.py +++ b/src/scancode/extract_cli.py @@ -46,10 +46,10 @@ try: # Python 2 unicode - str = unicode # @ReservedAssignment + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA echo_stderr = partial(click.secho, err=True) @@ -103,7 +103,7 @@ class ExtractCommand(utils.BaseCommand): @click.option('--about', is_flag=True, is_eager=True, callback=print_about, help='Show information about ScanCode and licensing and exit.') @click.option('--version', is_flag=True, is_eager=True, callback=print_version, help='Show the version and exit.') -def extractcode(ctx, input, verbose, quiet, shallow, *args, **kwargs): # @ReservedAssignment +def extractcode(ctx, input, verbose, quiet, shallow, *args, **kwargs): # NOQA """extract archives and compressed files found in the file or directory tree. Use this command before scanning proper as an preparation step. diff --git a/src/scancode/plugin_copyright.py b/src/scancode/plugin_copyright.py index 838f64dfbe0..73a66c646b7 100644 --- a/src/scancode/plugin_copyright.py +++ b/src/scancode/plugin_copyright.py @@ -48,7 +48,7 @@ class CopyrightScanner(ScanPlugin): sort_order=50), ] - def is_enabled(self, copyright, **kwargs): # @ReservedAssignment + def is_enabled(self, copyright, **kwargs): # NOQA return copyright def get_scanner(self, **kwargs): diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index 9b5b1bde085..e9ef08deede 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -99,7 +99,7 @@ class LicenseScanner(ScanPlugin): help_group=MISC_GROUP) ] - def is_enabled(self, license, **kwargs): # @ReservedAssignment + def is_enabled(self, license, **kwargs): # NOQA return license def setup(self, cache_dir, **kwargs): diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 298e09d4098..bd0fa23b0f7 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -42,7 +42,7 @@ import sys import attr -import yg.lockfile # @UnresolvedImport +import yg.lockfile # NOQA from scancode_config import scancode_temp_dir @@ -65,11 +65,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA """ diff --git a/src/scancode/utils.py b/src/scancode/utils.py index c51207928f7..57ec8a236f3 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -43,11 +43,11 @@ # Python 2 unicode str_orig = str - bytes = str # @ReservedAssignment - str = unicode # @ReservedAssignment + bytes = str # NOQA + str = unicode # NOQA except NameError: # Python 3 - unicode = str # @ReservedAssignment + unicode = str # NOQA """ @@ -135,7 +135,7 @@ def render_finish(self): def progressmanager(iterable=None, length=None, label=None, show_eta=True, show_percent=None, show_pos=True, item_show_func=None, fill_char='#', empty_char='-', bar_template=None, - info_sep=BAR_SEP, width=BAR_WIDTH, file=None, color=None, # @ReservedAssignment + info_sep=BAR_SEP, width=BAR_WIDTH, file=None, color=None, # NOQA verbose=False): """ diff --git a/src/scancode_config.py b/src/scancode_config.py index f2a206de96a..196eda01c5f 100644 --- a/src/scancode_config.py +++ b/src/scancode_config.py @@ -46,9 +46,9 @@ # this exception is not available on posix try: - WindowsError # @UndefinedVariable + WindowsError # noqa except NameError: - WindowsError = None # @ReservedAssignment + WindowsError = None # NOQA def _create_dir(location): """ diff --git a/src/typecode/magic2.py b/src/typecode/magic2.py index 870a285b5d0..9af702264fe 100644 --- a/src/typecode/magic2.py +++ b/src/typecode/magic2.py @@ -221,7 +221,7 @@ def load_lib(): libmagic = load_lib() -def check_error(result, func, args): # @UnusedVariable +def check_error(result, func, args): # NOQA """ ctypes error handler/checker: Check for errors and raise an exception or return the result otherwise. diff --git a/tests/cluecode/data/finder/email/jardiff.py b/tests/cluecode/data/finder/email/jardiff.py index 30db07c128b..bf0acd06069 100644 --- a/tests/cluecode/data/finder/email/jardiff.py +++ b/tests/cluecode/data/finder/email/jardiff.py @@ -1,5 +1,5 @@ #!/ms/dist/python/PROJ/core/2.4/bin/python - +# flake8: noqa ''' Compares API differences between two jar files diff --git a/tests/cluecode/data/finder/email/thomas.py b/tests/cluecode/data/finder/email/thomas.py index ca17ec40ee1..9eab0f7d8ee 100644 --- a/tests/cluecode/data/finder/email/thomas.py +++ b/tests/cluecode/data/finder/email/thomas.py @@ -1,3 +1,4 @@ +# flake8: noqa # This module is part of the Divmod project and is Copyright 2003 Amir Bakhtiar: # amir@divmod.org. This is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public diff --git a/tests/cluecode/data/finder/url/BeautifulSoup.py b/tests/cluecode/data/finder/url/BeautifulSoup.py index 0e214630c80..975ddd3276e 100644 --- a/tests/cluecode/data/finder/url/BeautifulSoup.py +++ b/tests/cluecode/data/finder/url/BeautifulSoup.py @@ -1,3 +1,6 @@ + +# flake8: noqa + """Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" diff --git a/tests/commoncode/test_command.py b/tests/commoncode/test_command.py index f1cbaf27478..04e22188aab 100644 --- a/tests/commoncode/test_command.py +++ b/tests/commoncode/test_command.py @@ -33,7 +33,6 @@ from commoncode.system import on_linux from commoncode.system import on_mac from commoncode.system import on_windows -from unittest.case import skipUnless class TestCommand(FileBasedTesting): diff --git a/tests/commoncode/test_fileutils.py b/tests/commoncode/test_fileutils.py index c5942b59a42..fb2ffa35c75 100644 --- a/tests/commoncode/test_fileutils.py +++ b/tests/commoncode/test_fileutils.py @@ -253,7 +253,7 @@ def test_copytree_does_not_copy_fifo(self): src = self.get_test_loc('fileutils/filetype', copy=True) dest = self.get_temp_dir() src_file = join(src, 'myfifo') - os.mkfifo(src_file) # @UndefinedVariable + os.mkfifo(src_file) # NOQA dest_dir = join(dest, 'dest') fileutils.copytree(src, dest_dir) assert not os.path.exists(join(dest_dir, 'myfifo')) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index 4e33e176724..28f3d22ad93 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -2439,7 +2439,6 @@ class TestExtractArchiveWithIllegalFilenamesWithPytarOnMacWarnings(TestExtractAr class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnWin(ExtractArchiveWithIllegalFilenamesTestCase): check_only_warnings = False - @expectedFailure # not a problem: we use libarchive for these def test_extract_7zip_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.7z') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') diff --git a/tests/licensedcode/data/perf/whatever.py b/tests/licensedcode/data/perf/whatever.py index 132cb692b3a..52e19fcc1e2 100644 --- a/tests/licensedcode/data/perf/whatever.py +++ b/tests/licensedcode/data/perf/whatever.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# flake8: noqa # # Stonith module for RILOE Stonith device # diff --git a/tests/licensedcode/license_test_utils.py b/tests/licensedcode/license_test_utils.py index 92be2126122..87720c72b77 100644 --- a/tests/licensedcode/license_test_utils.py +++ b/tests/licensedcode/license_test_utils.py @@ -40,7 +40,7 @@ unicode except NameError: # Python 3 - unicode = str + unicode = str #NOQA """ diff --git a/tests/packagedcode/data/pypi/setup.py b/tests/packagedcode/data/pypi/setup.py index b66230b99dd..90274e96609 100644 --- a/tests/packagedcode/data/pypi/setup.py +++ b/tests/packagedcode/data/pypi/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- +# flake8: noqa from __future__ import absolute_import, print_function import io diff --git a/tests/packagedcode/data/pypi/setup2.py b/tests/packagedcode/data/pypi/setup2.py index b66230b99dd..90274e96609 100644 --- a/tests/packagedcode/data/pypi/setup2.py +++ b/tests/packagedcode/data/pypi/setup2.py @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- +# flake8: noqa from __future__ import absolute_import, print_function import io diff --git a/tests/typecode/data/contenttype/code/python/__init__.py b/tests/typecode/data/contenttype/code/python/__init__.py index 2e2033b3c05..cc085fdc029 100644 --- a/tests/typecode/data/contenttype/code/python/__init__.py +++ b/tests/typecode/data/contenttype/code/python/__init__.py @@ -1,4 +1,5 @@ # this is a namespace package +# flake8: noqa try: import pkg_resources pkg_resources.declare_namespace(__name__) diff --git a/tests/typecode/data/contenttype/code/python/contenttype.py b/tests/typecode/data/contenttype/code/python/contenttype.py index ad4e0aed0c7..fe48a8c5a58 100644 --- a/tests/typecode/data/contenttype/code/python/contenttype.py +++ b/tests/typecode/data/contenttype/code/python/contenttype.py @@ -1,4 +1,5 @@ # +# flake8: noqa import unittest from os.path import join diff --git a/tests/typecode/data/contenttype/code/python/extract.py b/tests/typecode/data/contenttype/code/python/extract.py index d2b9e48784c..9a488abb8b1 100644 --- a/tests/typecode/data/contenttype/code/python/extract.py +++ b/tests/typecode/data/contenttype/code/python/extract.py @@ -1,4 +1,5 @@ +# flake8: noqa import os from os.path import join, dirname, basename, exists From 481f9e125e9ec3ff9aac6fe203a7a96c7c8e68a3 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 01:41:02 +0100 Subject: [PATCH 091/122] Improve CLI help text Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 2 +- tests/scancode/data/help/help.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 1c77e85606a..35f2352cbf4 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -379,7 +379,7 @@ def print_plugins(ctx, param, value): type=int, default=1, metavar='INT', help='Set the number of parallel processes to use. ' - 'Disable parallel processing if 0. Disable also threading if -1 [default: 1]', + 'Disable parallel processing if 0. Also disable threading if -1. [default: 1]', help_group=CORE_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--timeout', diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index 2c007bfb209..b3502ac1afb 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -69,7 +69,8 @@ Options: --timeout Stop an unfinished file scan after a timeout in seconds. [default: 120 seconds] -n, --processes INT Set the number of parallel processes to use. Disable - parallel processing if 0. [default: 1] + parallel processing if 0. Also disable threading if -1. + [default: 1] --quiet Do not print summary or progress. --verbose Print progress as file-by-file path instead of a progress bar. Print a verbose scan summary. From 5c6eae5395b45645aa0721b8bcd4243339eb5ece Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 13:23:31 +0100 Subject: [PATCH 092/122] Improve scan test run calls. Cleanup and format code * run_scan* calls now check for return code * removed dead code for printouts and similar * formatted code * ensure that scancode_toot_dir is used consistently Signed-off-by: Philippe Ombredanne --- etc/conf/base.py | 8 +- etc/conf/dev/base.py | 10 +- etc/configure.py | 4 +- etc/scripts/sch2js/sch2js.py | 2 - etc/scripts/synclic.py | 5 +- etc/scripts/test_json2csv.py | 6 +- src/cluecode/copyrights.py | 20 +- src/cluecode/copyrights_hint.py | 8 +- src/cluecode/finder.py | 68 ++-- src/cluecode/finder_data.py | 7 +- src/commoncode/__init__.py | 7 +- src/commoncode/command.py | 2 - src/commoncode/dict_utils.py | 2 - src/commoncode/fetch.py | 1 - src/commoncode/fileset.py | 5 +- src/commoncode/filetype.py | 5 +- src/commoncode/fileutils.py | 11 +- src/commoncode/functional.py | 3 + src/commoncode/hash.py | 12 +- src/commoncode/ignore.py | 4 +- src/commoncode/misc.ABOUT | 8 - src/commoncode/misc.LICENSE | 21 -- src/commoncode/misc.py | 57 ---- src/commoncode/paths.py | 6 +- src/commoncode/saneyaml.py | 9 +- src/commoncode/system.py | 7 +- src/commoncode/testcase.py | 5 +- src/commoncode/version.py | 1 - src/extractcode/__init__.py | 11 +- src/extractcode/archive.py | 7 +- src/extractcode/extract.py | 2 - src/extractcode/libarchive2.py | 45 +-- src/extractcode/patch.py | 1 - src/extractcode/sevenzip.py | 2 - src/extractcode/tar.py | 2 - src/formattedcode/output_html.py | 6 +- src/formattedcode/output_json.py | 4 +- src/formattedcode/output_spdx.py | 14 +- src/licensedcode/cache.py | 2 - src/licensedcode/index.py | 3 +- src/licensedcode/legal.py | 5 +- src/licensedcode/match.py | 5 +- src/licensedcode/match_aho.py | 1 + src/licensedcode/match_hash.py | 3 +- src/licensedcode/match_seq.py | 4 +- src/licensedcode/match_set.py | 5 +- src/licensedcode/models.py | 14 +- src/licensedcode/query.py | 5 +- src/licensedcode/seq.py | 2 - src/licensedcode/spans.py | 2 +- src/licensedcode/tokenize.py | 6 +- src/packagedcode/__init__.py | 3 +- src/packagedcode/maven.py | 6 +- src/packagedcode/models.py | 7 +- src/packagedcode/nevra.py | 5 +- src/packagedcode/npm.py | 3 - src/packagedcode/phpcomposer.py | 9 +- src/packagedcode/pypi.py | 2 - src/packagedcode/pyrpm/rpm.py | 3 +- src/packagedcode/pyrpm/rpmdefs.py | 7 +- src/packagedcode/recognize.py | 5 +- src/packagedcode/rpm.py | 7 +- src/packagedcode/utils.py | 3 +- src/packagedcode/xmlutils.py | 4 +- src/plugincode/__init__.py | 2 - src/plugincode/output.py | 9 +- src/plugincode/output_filter.py | 1 - src/plugincode/post_scan.py | 1 - src/plugincode/pre_scan.py | 1 - src/plugincode/scan.py | 1 - src/scancode/__init__.py | 16 +- src/scancode/api.py | 1 - src/scancode/cli.py | 10 +- src/scancode/cli_test_utils.py | 47 ++- src/scancode/extract_cli.py | 4 - src/scancode/interrupt.py | 5 - src/scancode/pool.py | 5 +- src/scancode/resource.py | 7 +- src/scancode/utils.py | 5 +- src/scancode_config.py | 6 +- src/textcode/markup.py | 3 +- src/textcode/strings.py | 11 +- src/textcode/strings2.py | 5 +- src/typecode/contenttype.py | 12 +- src/typecode/entropy.py | 1 - src/typecode/magic2.py | 8 +- tests/cluecode/test_authors.py | 2 +- tests/cluecode/test_copyrights_ics.py | 6 +- tests/commoncode/test_codec.py | 4 +- tests/commoncode/test_date.py | 7 +- tests/commoncode/test_fileset.py | 4 +- tests/commoncode/test_fileutils.py | 4 +- tests/commoncode/test_functional.py | 4 +- tests/commoncode/test_ignore.py | 7 +- tests/commoncode/test_version.py | 5 +- tests/extractcode/extractcode_assert_utils.py | 5 +- tests/extractcode/test_archive.py | 35 +- tests/extractcode/test_extractcode.py | 7 +- tests/extractcode/test_patch.py | 1 - tests/extractcode/test_tar.py | 4 +- tests/formattedcode/test_output_csv.py | 22 +- tests/formattedcode/test_output_json.py | 38 +-- tests/formattedcode/test_output_jsonlines.py | 19 +- tests/formattedcode/test_output_spdx.py | 82 ++--- tests/formattedcode/test_output_templated.py | 44 +-- tests/licensedcode/license_test_utils.py | 4 +- tests/licensedcode/test_cache.py | 1 - tests/licensedcode/test_detect.py | 4 +- .../licensedcode/test_detection_datadriven.py | 4 +- tests/licensedcode/test_detection_validate.py | 2 +- tests/licensedcode/test_index.py | 9 - tests/licensedcode/test_legal.py | 1 - tests/licensedcode/test_match.py | 2 +- tests/licensedcode/test_match_aho.py | 2 +- tests/licensedcode/test_match_hash.py | 2 - tests/licensedcode/test_match_seq.py | 2 +- tests/licensedcode/test_models.py | 2 +- tests/licensedcode/test_performance.py | 3 +- tests/licensedcode/test_query.py | 3 +- tests/licensedcode/test_tokenize.py | 1 - tests/packagedcode/packages_test_utils.py | 4 +- tests/packagedcode/test_maven.py | 9 + tests/packagedcode/test_nuget.py | 7 +- tests/packagedcode/test_package_utils.py | 2 +- tests/packagedcode/test_pypi.py | 1 - tests/scancode/test_cli.py | 321 +++++++----------- tests/scancode/test_extract_cli.py | 12 +- tests/scancode/test_interrupt.py | 4 +- tests/scancode/test_plugin_ignore.py | 59 ++-- tests/scancode/test_plugin_mark_source.py | 6 +- tests/scancode/test_plugin_only_findings.py | 6 +- tests/scancode/test_resource.py | 7 +- tests/scancode/test_scan_utils.py | 5 +- tests/textcode/test_pdf.py | 10 +- 134 files changed, 576 insertions(+), 899 deletions(-) delete mode 100644 src/commoncode/misc.ABOUT delete mode 100644 src/commoncode/misc.LICENSE delete mode 100644 src/commoncode/misc.py diff --git a/etc/conf/base.py b/etc/conf/base.py index f716895d59c..d5643fb4246 100644 --- a/etc/conf/base.py +++ b/etc/conf/base.py @@ -5,17 +5,18 @@ import sys - """ Check that we run a supported OS and architecture. """ + def unsupported(platform): print('Unsupported OS/platform %r.' % platform) print('See https://github.com/nexB/scancode-toolkit/ for supported OS/platforms.') print('Enter a ticket https://github.com/nexB/scancode-toolkit/issues asking for support of your OS/platform combo.') sys.exit(1) + if sys.maxsize > 2 ** 32: arch = '64' else: @@ -31,11 +32,10 @@ def unsupported(platform): else: unsupported(sys_platform) - supported_combos = { 'linux': ['32', '64'], - 'win': ['32',], - 'mac': ['64',], + 'win': ['32', ], + 'mac': ['64', ], } arches = supported_combos[os] diff --git a/etc/conf/dev/base.py b/etc/conf/dev/base.py index 588a475c0c2..e78bdd149f3 100644 --- a/etc/conf/dev/base.py +++ b/etc/conf/dev/base.py @@ -12,8 +12,8 @@ def setup_dev_mode(): not rely on license data to remain untouched and will always check the license index cache for consistency, rebuilding it if necessary. """ - from scancode import root_dir - with open(os.path.join(root_dir, 'SCANCODE_DEV_MODE'), 'wb') as sdm: + from scancode_config import scancode_root_dir + with open(os.path.join(scancode_root_dir, 'SCANCODE_DEV_MODE'), 'wb') as sdm: sdm.write('This is a tag file to notify that ScanCode is used in development mode.') @@ -21,14 +21,14 @@ def setup_vscode(): """ Add base settings for .vscode """ - from scancode import root_dir + from scancode_config import scancode_root_dir from commoncode.fileutils import create_dir from commoncode.fileutils import copyfile - settings = os.path.join(root_dir, 'etc', 'vscode', 'settings.json') + settings = os.path.join(scancode_root_dir, 'etc', 'vscode', 'settings.json') if os.path.exists(settings): - vscode = os.path.join(root_dir, '.vscode') + vscode = os.path.join(scancode_root_dir, '.vscode') create_dir(vscode) copyfile(settings, vscode) diff --git a/etc/configure.py b/etc/configure.py index 7d5bb6448f0..207e7988f25 100644 --- a/etc/configure.py +++ b/etc/configure.py @@ -64,7 +64,6 @@ import shutil import subprocess - # platform-specific file base names sys_platform = str(sys.platform).lower() on_win = False @@ -79,7 +78,6 @@ raise Exception('Unsupported OS/platform %r' % sys_platform) platform_names = tuple() - # common file basenames for requirements and scripts base = ('base',) @@ -213,7 +211,7 @@ def create_virtualenv(std_python, root_dir, tpp_dirs, quiet=False): def activate(root_dir): """ Activate a virtualenv in the current process.""" - #print("* Activating...") + # print("* Activating...") bin_dir = os.path.join(root_dir, 'bin') activate_this = os.path.join(bin_dir, 'activate_this.py') with open(activate_this) as f: diff --git a/etc/scripts/sch2js/sch2js.py b/etc/scripts/sch2js/sch2js.py index e99527a0b2e..812dd2ab4c9 100644 --- a/etc/scripts/sch2js/sch2js.py +++ b/etc/scripts/sch2js/sch2js.py @@ -46,10 +46,8 @@ from schematics.types.compound import ListType from schematics.types.compound import ModelType - __version__ = '1.0.1.patch' - SCHEMATIC_TYPE_TO_JSON_TYPE = { 'NumberType': 'number', 'IntType': 'integer', diff --git a/etc/scripts/synclic.py b/etc/scripts/synclic.py index a7a3b3e1b96..6fdd2902b74 100644 --- a/etc/scripts/synclic.py +++ b/etc/scripts/synclic.py @@ -50,7 +50,6 @@ from licensedcode.models import load_licenses from licensedcode.models import License - """ Sync and update the ScanCode licenses against: - the SPDX license list @@ -63,6 +62,7 @@ TRACE_DEEP = False TRACE_FETCH = False + class ExternalLicensesSource(object): """ Base class to provide (including possibly fetch) licenses from an @@ -614,11 +614,13 @@ def merge_licenses(scancode_license, other_license, updatable_attributes): (attribute name, value before, value after) """ scancode_updated = [] + def update_sc(_attrib, _sc_val, _o_val): setattr(scancode_license, _attrib, _o_val) scancode_updated.append((_attrib, _sc_val, _o_val)) other_updated = [] + def update_ot(_attrib, _sc_val, _o_val): setattr(other_license, _attrib, _sc_val) other_updated.append((_attrib, _o_val, _sc_val)) @@ -799,7 +801,6 @@ def synchronize_licenses(external_source): for k in others_changed | others_added: others_by_key[k].dump() - # TODO: at last: print report of incorrect OTHER licenses to submit # updates eg. make API calls to DejaCode to create or update # licenses and submit review request e.g. submit requests to SPDX diff --git a/etc/scripts/test_json2csv.py b/etc/scripts/test_json2csv.py index fa834dd21f0..75b17e9cb2f 100644 --- a/etc/scripts/test_json2csv.py +++ b/etc/scripts/test_json2csv.py @@ -208,13 +208,13 @@ class TestJson2CSVWithLiveScans(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'testdata') def test_can_process_scan_from_json_scan(self): - import scancode + from scancode_config import scancode_root_dir from commoncode.command import execute test_dir = self.get_test_loc('livescan/scan') json_file = self.get_temp_file('json') - scan_cmd = os.path.join(scancode.root_dir, 'scancode') + scan_cmd = os.path.join(scancode_root_dir, 'scancode') rc, _stdout, _stderr = execute(scan_cmd, - ['-clip', '--email', '--url', '--strip-root', test_dir, + ['-clip', '--email', '--url', '--strip-root', test_dir, '--json', json_file]) result_file = self.get_temp_file('.csv') with open(result_file, 'wb') as rf: diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index d16757ba54c..296ef0a4a68 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -36,14 +36,13 @@ from textcode import analysis from cluecode import copyrights_hint - -COPYRIGHT_TRACE = 0 +TRACE = 0 logger = logging.getLogger(__name__) if os.environ.get('SCANCODE_DEBUG_COPYRIGHT'): import sys logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) - COPYRIGHT_TRACE = 1 + TRACE = 1 """ Detect and collect copyright statements. @@ -133,7 +132,6 @@ def detect(location): '\ ' # html entity sometimes are double escaped ')*') # repeated 0 or more times - _YEAR_PUNCT = _YEAR + _PUNCT _YEAR_YEAR_PUNCT = _YEAR_YEAR + _PUNCT _YEAR_SHORT_PUNCT = _YEAR_SHORT + _PUNCT @@ -1069,11 +1067,12 @@ class CopyrightDetector(object): """ Class to detect copyrights and authorship. """ + def __init__(self): from nltk import RegexpTagger from nltk import RegexpParser self.tagger = RegexpTagger(patterns) - self.chunker = RegexpParser(grammar, trace=COPYRIGHT_TRACE) + self.chunker = RegexpParser(grammar, trace=TRACE) @classmethod def as_str(cls, node, ignores=()): @@ -1386,24 +1385,29 @@ def lowercase_well_known_word(text): lines_append(' '.join(words)) return '\n'.join(lines) - # FIXME: instead of using functions, use plain re and let the re cache do its work + def IGNORED_PUNCTUATION_RE(): return re.compile(r'[*#"%\[\]\{\}`]+', re.I | re.M | re.U) + def ASCII_LINE_DECO_RE(): return re.compile(r'[-_=!\\*]{2,}') + def ASCII_LINE_DECO2_RE(): return re.compile(r'/{3,}') + def WHITESPACE_RE(): return re.compile(r' +') + def MULTIQUOTES_RE(): return re.compile(r"\'{2,}") + # TODO: add debian POS name taggings def DEBIAN_COPYRIGHT_TAGS_RE(): return re.compile(r"(\|\)") @@ -1418,7 +1422,7 @@ def prepare_text_line(line): # strip whitespace line = line.strip() - #FIXME: how did we get line returns in this???? + # FIXME: how did we get line returns in this???? line = line.replace('\n', ' ') # remove some junk in man pages: \(co diff --git a/src/cluecode/copyrights_hint.py b/src/cluecode/copyrights_hint.py index 90f2be1be0f..33739cfb368 100644 --- a/src/cluecode/copyrights_hint.py +++ b/src/cluecode/copyrights_hint.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -23,7 +23,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import from datetime import datetime @@ -37,7 +36,6 @@ years = r'[\(\.,\-\)\s]+(' + '|'.join(years) + r')[\(\.,\-\)\s]+' years = re.compile(years).findall - statement_markers = u''' © cop @@ -54,7 +52,6 @@ devel '''.split() - # (various copyright/copyleft signs tm, r etc) http://en.wikipedia.org/wiki/Copyright_symbol # ™ U+2122 TRADE MARK SIGN, decimal: 8482, HTML: ™, UTF-8: 0xE2 0x84 0xA2, block: Letterlike Symbols, decomposition: U+0054 U+004D @@ -63,7 +60,6 @@ # � U+00AE (174) # � U+2122 (8482) - '''HTML Entity (decimal) © HTML Entity (hex) © HTML Entity (named) © @@ -79,13 +75,11 @@ Python source code u"\u00A9" ''' - end_of_statement = ''' rights reserve right reserve '''.split() - # others stuffs ''' ® diff --git a/src/cluecode/finder.py b/src/cluecode/finder.py index a1bc5aee525..5ba20343b63 100644 --- a/src/cluecode/finder.py +++ b/src/cluecode/finder.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,22 +22,36 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function -import logging import string import re import url as urlpy import ipaddress -from textcode import analysis from cluecode import finder_data +from textcode import analysis + +# Tracing flags +TRACE = False -LOG = logging.getLogger(__name__) +def logger_debug(*args): + pass -DEBUG = False + +if TRACE: + import logging + import sys + logger = logging.getLogger(__name__) + # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) + logging.basicConfig(stream=sys.stdout) + logger.setLevel(logging.DEBUG) + + def logger_debug(*args): + return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) """ Find patterns in text lines such as a emails and URLs. @@ -53,18 +67,18 @@ def find(location, patterns): Note: the location can be a list of lines for testing convenience. """ - if DEBUG: + if TRACE: from pprint import pformat loc = pformat(location) - print('find(location=%(loc)r,\n patterns=%(patterns)r)' % locals()) + logger_debug('find(location=%(loc)r,\n patterns=%(patterns)r)' % locals()) for i, line in enumerate(analysis.text_lines(location)): lineno = i + 1 for key, pattern in patterns: for match in pattern.findall(line): - if DEBUG: - print('find: yielding match: key=%(key)r, ' + if TRACE: + logger_debug('find: yielding match: key=%(key)r, ' 'match=%(match)r,\n line=%(line)r' % locals()) yield key, unicode(match), line, lineno @@ -110,11 +124,12 @@ def build_regex_filter(pattern): Return a filter function using regex pattern, filtering out matches matching this regex. The pattern should be text, not a compiled re. """ + def re_filt(matches): for key, match, line, lineno in matches: if re.match(regex, match): - if DEBUG: - print('build_regex_filter(pattern=%(pattern)r: ' + if TRACE: + logger_debug('build_regex_filter(pattern=%(pattern)r: ' 'filtering match: %(match)r' % locals()) continue yield key, match, line, lineno @@ -122,7 +137,6 @@ def re_filt(matches): regex = re.compile(pattern, re.UNICODE | re.I) return re_filt - # A good reference page of email address regex is: # http://fightingforalostcause.net/misc/2006/compare-email-regex.php email # regex from http://www.regular-expressions.info/regexbuddy/email.html @@ -172,7 +186,6 @@ def uninteresting_emails_filter(matches): continue yield key, email, line, lineno - # TODO: consider: http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/ # TODO: consider: http://blog.codinghorror.com/the-problem-with-urls/ @@ -180,6 +193,7 @@ def uninteresting_emails_filter(matches): schemes = 'https?|ftps?|sftp|rsync|ssh|svn|git|hg|https?\+git|https?\+svn|https?\+hg' url_body = '[^\s<>\[\]"]' + def urls_regex(): # no space, no < >, no [ ] and no double quote return re.compile(r''' @@ -237,8 +251,8 @@ def empty_urls_filter(matches): for key, match, line, lineno in matches: junk = match.lower().strip(string.punctuation).strip() if not junk or junk in EMPTY_URLS: - if DEBUG: - print('empty_urls_filter: filtering match: %(match)r' + if TRACE: + logger_debug('empty_urls_filter: filtering match: %(match)r' % locals()) continue yield key, match, line, lineno @@ -328,8 +342,8 @@ def user_pass_cleaning_filter(matches): if is_filterable(match): host, _domain = url_host_domain(match) if not host: - if DEBUG: - print('user_pass_cleaning_filter: ' + if TRACE: + logger_debug('user_pass_cleaning_filter: ' 'filtering match(no host): %(match)r' % locals()) continue if '@' in host: @@ -362,14 +376,15 @@ def canonical_url_cleaner(matches): for key, match, line, lineno in matches: if is_filterable(match): match = canonical_url(match) - if DEBUG: - print('canonical_url_cleaner: ' + if TRACE: + logger_debug('canonical_url_cleaner: ' 'match=%(match)r, canonic=%(canonic)r' % locals()) yield key, match , line, lineno IP_V4_RE = r'^(\d{1,3}\.){0,3}\d{1,3}$' + def is_ip_v4(s): return re.compile(IP_V4_RE).match(s) @@ -449,7 +464,6 @@ def is_good_host(host): return False return finder_data.classify_ip(host) - # at this stage we have a host name, not an IP if '.' not in host: @@ -484,14 +498,14 @@ def junk_url_hosts_filter(matches): if is_filterable(match): host, domain = url_host_domain(match) if not is_good_host(host): - if DEBUG: - print('junk_url_hosts_filter: ' + if TRACE: + logger_debug('junk_url_hosts_filter: ' '!is_good_host:%(host)r): %(match)r' % locals()) continue if not is_good_host(domain) and not is_ip(host): - if DEBUG: - print('junk_url_hosts_filter: ''!is_good_host:%(domain)r ' + if TRACE: + logger_debug('junk_url_hosts_filter: ''!is_good_host:%(domain)r ' 'and !is_ip:%(host)r: %(match)r' % locals()) continue yield key, match, line, lineno @@ -506,8 +520,8 @@ def junk_urls_filter(matches): for key, match, line, lineno in matches: good_url = finder_data.classify_url(match) if not good_url: - if DEBUG: - print('junk_url_filter: %(match)r' % locals()) + if TRACE: + logger_debug('junk_url_filter: %(match)r' % locals()) continue yield key, match, line, lineno diff --git a/src/cluecode/finder_data.py b/src/cluecode/finder_data.py index cbecb6533ce..3baf0a8fef2 100644 --- a/src/cluecode/finder_data.py +++ b/src/cluecode/finder_data.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -40,7 +40,6 @@ def set_from_text(text): test.com ''') - JUNK_HOSTS_AND_DOMAINS = set_from_text(u''' exmaple.com example.com @@ -56,12 +55,10 @@ def set_from_text(text): hostname ''') - JUNK_IPS = set_from_text(u''' 1.2.3.4 ''') - JUNK_URLS = set_from_text(u''' http://www.adobe.com/2006/mxml http://www.w3.org/1999/XSL/Transform @@ -134,7 +131,6 @@ def set_from_text(text): http://gcc.gnu.org/bugs.html ''') - JUNK_URL_PREFIXES = tuple(set_from_text(''' http://www.springframework.org/dtd/ http://www.slickedit.com/dtd/ @@ -175,7 +171,6 @@ def set_from_text(text): http://www.oasis-open.org/docbook/xml/ ''')) - JUNK_URL_SUFFIXES = tuple(set_from_text(''' .png .jpg diff --git a/src/commoncode/__init__.py b/src/commoncode/__init__.py index 0eaadbbdb2a..702495e4b65 100644 --- a/src/commoncode/__init__.py +++ b/src/commoncode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -34,15 +34,14 @@ def set_re_max_cache(max_cache=1000000): """ import re import fnmatch - + remax = getattr(re, '_MAXCACHE', 0) if remax < max_cache: setattr(re, '_MAXCACHE', max_cache) - fnmatchmax = getattr(fnmatch, '_MAXCACHE', 0) if fnmatchmax < max_cache: setattr(fnmatch, '_MAXCACHE', max_cache) -set_re_max_cache() \ No newline at end of file +set_re_max_cache() diff --git a/src/commoncode/command.py b/src/commoncode/command.py index 57b90d2a154..4594091cabb 100644 --- a/src/commoncode/command.py +++ b/src/commoncode/command.py @@ -50,7 +50,6 @@ from commoncode.system import on_windows from commoncode.system import on_linux - # Python 2 and 3 support try: # Python 2 @@ -60,7 +59,6 @@ # Python 3 unicode = str # NOQA - """ Minimal wrapper for executing external commands in sub-processes. The approach is unconventionally relying on vendoring scripts or pre-built executable diff --git a/src/commoncode/dict_utils.py b/src/commoncode/dict_utils.py index d9df72d7af8..5c71159e0af 100644 --- a/src/commoncode/dict_utils.py +++ b/src/commoncode/dict_utils.py @@ -36,13 +36,11 @@ import collections import itertools - # Placeholder constants FREE = -1 DUMMY = -2 - class Dict(collections.MutableMapping): """ Space efficient dictionary with fast iteration and cheap resizes. diff --git a/src/commoncode/fetch.py b/src/commoncode/fetch.py index 0e003e2d7df..0a1e656a8ab 100644 --- a/src/commoncode/fetch.py +++ b/src/commoncode/fetch.py @@ -35,7 +35,6 @@ from commoncode import fileutils import os - logger = logging.getLogger(__name__) # import sys # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) diff --git a/src/commoncode/fileset.py b/src/commoncode/fileset.py index 589feb88922..b36e2d51e07 100644 --- a/src/commoncode/fileset.py +++ b/src/commoncode/fileset.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -34,18 +34,15 @@ from commoncode import paths from commoncode.system import on_linux - DEBUG = False logger = logging.getLogger(__name__) # import sys # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) # logger.setLevel(logging.DEBUG) - POSIX_PATH_SEP = b'/' if on_linux else '/' EMPTY_STRING = b'' if on_linux else '' - """ Match files and directories paths based on inclusion and exclusion glob-style patterns. diff --git a/src/commoncode/filetype.py b/src/commoncode/filetype.py index 9e24e00b12d..ca4db6f3117 100644 --- a/src/commoncode/filetype.py +++ b/src/commoncode/filetype.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -33,11 +33,11 @@ from commoncode.system import on_posix from commoncode.functional import memoize - """ Low level file type utilities, essentially a wrapper around os.path and stat. """ + def is_link(location): """ Return True if `location` is a symbolic link. @@ -192,6 +192,7 @@ def get_last_modified_date(location): 'file_size': os.path.getsize, } + @memoize def counter(location, counting_function): """ diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index 7b32adc596a..dea5e94cb19 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -62,23 +62,23 @@ from commoncode.system import on_linux from commoncode import text - # this exception is not available on posix try: WindowsError # NOQA except NameError: WindowsError = None # NOQA - TRACE = False import logging logger = logging.getLogger(__name__) + def logger_debug(*args): pass + if TRACE: logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) @@ -86,7 +86,6 @@ def logger_debug(*args): def logger_debug(*args): return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) - # Paths can only be sanely handled as raw bytes on Linux PATH_TYPE = bytes if on_linux else unicode POSIX_PATH_SEP = b'/' if on_linux else '/' @@ -102,6 +101,7 @@ def logger_debug(*args): # DIRECTORIES # + def create_dir(location): """ Create directory and all sub-directories recursively at location ensuring these @@ -173,6 +173,7 @@ def get_temp_dir(base_dir=scancode_temp_dir, prefix=''): # FILE READING # + def file_chunks(file_object, chunk_size=1024): """ Yield a file piece by piece. Default chunk size: 1k. @@ -368,6 +369,7 @@ def splitext(path, force_posix=False): # DIRECTORY AND FILES WALKING/ITERATION # + ignore_nothing = lambda _: False @@ -439,6 +441,7 @@ def resource_iter(location, ignored=ignore_nothing, with_dirs=True): # COPY # + def copytree(src, dst): """ Copy recursively the `src` directory to the `dst` directory. If `dst` is an @@ -544,6 +547,7 @@ def copytime(src, dst): # PERMISSIONS # + # modes: read, write, executable R = stat.S_IRUSR RW = stat.S_IRUSR | stat.S_IWUSR @@ -603,6 +607,7 @@ def chmod_tree(location, flags): # DELETION # + def _rm_handler(function, path, excinfo): # NOQA """ shutil.rmtree handler invoked on error when deleting a directory tree. diff --git a/src/commoncode/functional.py b/src/commoncode/functional.py index 281dee5e831..93049018a06 100644 --- a/src/commoncode/functional.py +++ b/src/commoncode/functional.py @@ -157,7 +157,9 @@ def memoize_to_attribute(attr_name, _test=False): The Obj().expensive property value will be cached to attr_name self._expensive and computed only once in the life of the Obj instance. """ + def memoized_to_attr(meth): + @functools.wraps(meth) def wrapper(self, *args, **kwargs): if getattr(self, attr_name) is None: @@ -166,6 +168,7 @@ def wrapper(self, *args, **kwargs): else: res = getattr(self, attr_name) return res + return wrapper return memoized_to_attr diff --git a/src/commoncode/hash.py b/src/commoncode/hash.py index d8f9ab94feb..d7b3f48ec40 100644 --- a/src/commoncode/hash.py +++ b/src/commoncode/hash.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -33,7 +33,6 @@ from commoncode.codec import urlsafe_b64encode from commoncode import filetype - """ Hashes and checksums. @@ -44,12 +43,15 @@ Checksums are operating on files. """ + def _hash_mod(bitsize, hmodule): """ Return a hashing class returning hashes with a `bitsize` bit length. The interface of this class is similar to the hash module API. """ + class hasher(object): + def __init__(self, msg=None): self.digest_size = bitsize // 8 self.h = msg and hmodule(msg).digest()[:self.digest_size] or None @@ -94,6 +96,7 @@ class sha1_git_hasher(object): """ Hash content using the git blob SHA1 convention. """ + def __init__(self, msg=None): self.digest_size = 160 // 8 self.h = msg and self._compute(msg) or None @@ -148,18 +151,23 @@ def checksum(location, name, base64=False): def md5(location): return checksum(location, name='md5', base64=False) + def sha1(location): return checksum(location, name='sha1', base64=False) + def b64sha1(location): return checksum(location, name='sha1', base64=True) + def sha256(location): return checksum(location, name='sha256', base64=False) + def sha512(location): return checksum(location, name='sha512', base64=False) + def sha1_git(location): return checksum(location, name='sha1_git', base64=False) diff --git a/src/commoncode/ignore.py b/src/commoncode/ignore.py index 111a70166a8..d04e4892342 100644 --- a/src/commoncode/ignore.py +++ b/src/commoncode/ignore.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -74,6 +74,7 @@ def get_ignores(location, include_defaults=True): # Default ignores # + ignores_MacOSX = { '.DS_Store': 'Default ignore: MacOSX artifact', '._.DS_Store': 'Default ignore: MacOSX artifact', @@ -293,7 +294,6 @@ def get_ignores(location, include_defaults=True): '/.ssh': 'Default ignore: SSH configuration', } - default_ignores = {} default_ignores.update(chain(*[d.items() for d in [ diff --git a/src/commoncode/misc.ABOUT b/src/commoncode/misc.ABOUT deleted file mode 100644 index 5cd542f93b1..00000000000 --- a/src/commoncode/misc.ABOUT +++ /dev/null @@ -1,8 +0,0 @@ -about_resource: misc.py -download_url: - - http://code.activestate.com/recipes/578433-mixin-for-pickling-objects-with-__slots__/ - -dje_license: mit -license_text_file: misc.LICENSE -copyright: Copyright (c) 2013 Oren Tirosh -owner: Oren Tirosh diff --git a/src/commoncode/misc.LICENSE b/src/commoncode/misc.LICENSE deleted file mode 100644 index 4a72b80190d..00000000000 --- a/src/commoncode/misc.LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2013 Oren Tirosh -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/commoncode/misc.py b/src/commoncode/misc.py deleted file mode 100644 index be957dfdaed..00000000000 --- a/src/commoncode/misc.py +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. -# http://nexb.com and https://github.com/nexB/scancode-toolkit/ -# The ScanCode software is licensed under the Apache License version 2.0. -# Data generated with ScanCode require an acknowledgment. -# ScanCode is a trademark of nexB Inc. -# -# You may not use this software except in compliance with the License. -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# When you publish or redistribute any data created with ScanCode or any ScanCode -# derivative work, you must accompany this data with the following acknowledgment: -# -# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from -# ScanCode should be considered or used as legal advice. Consult an Attorney -# for any legal advice. -# ScanCode is a free software code scanning tool from nexB Inc. and others. -# Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -from __future__ import absolute_import, print_function - - -class SlotPickleMixin(object): - # SlotPickelMixin is originally from: - # http://code.activestate.com/recipes/578433-mixin-for-pickling-objects-with-__slots__/ - # Copyright (c) 2013 Created by Oren Tirosh - # - # Permission is hereby granted, free of charge, to any person - # obtaining a copy of this software and associated documentation files - # (the "Software"), to deal in the Software without restriction, - # including without limitation the rights to use, copy, modify, merge, - # publish, distribute, sublicense, and/or sell copies of the Software, - # and to permit persons to whom the Software is furnished to do so, - # subject to the following conditions: - # - # The above copyright notice and this permission notice shall be - # included in all copies or substantial portions of the Software. - # - # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - # OTHER DEALINGS IN THE SOFTWARE. - def __getstate__(self): - return {slot: getattr(self, slot) for slot in self.__slots__ if hasattr(self, slot)} - - def __setstate__(self, state): - for slot, value in state.items(): - setattr(self, slot, value) diff --git a/src/commoncode/paths.py b/src/commoncode/paths.py index 71ff649aa11..17defd15a52 100644 --- a/src/commoncode/paths.py +++ b/src/commoncode/paths.py @@ -38,13 +38,11 @@ from commoncode.fileutils import is_posixpath from commoncode.system import on_linux - """ Various path utilities such as common prefix and suffix functions, conversion to OS-safe paths and to POSIX paths. """ - POSIX_PATH_SEP = b'/' if on_linux else '/' WIN_PATH_SEP = b'\\' if on_linux else '\\' EMPTY_STRING = b'' if on_linux else '' @@ -52,6 +50,7 @@ # # Build OS-portable and safer paths + def safe_path(path, posix=False): """ Convert `path` to a safe and portable POSIX path usable on multiple OSes. The @@ -87,7 +86,6 @@ def safe_path(path, posix=False): return as_posixpath(path) - def path_handlers(path, posix=True): """ Return a path module and path separator to use for handling (e.g. split and join) @@ -221,7 +219,6 @@ def portable_filename(filename): if basename.lower() in windows_illegal_names: filename = ''.join([basename, '_', dot, extension]) - # no name made only of dots. if set(filename) == set(['.']): filename = 'dot' * len(filename) @@ -237,6 +234,7 @@ def portable_filename(filename): # paths comparisons, common prefix and suffix extraction # + def common_prefix(s1, s2): """ Return the common leading subsequence of two sequences and its length. diff --git a/src/commoncode/saneyaml.py b/src/commoncode/saneyaml.py index 2de2aa78d74..17634a6f39e 100644 --- a/src/commoncode/saneyaml.py +++ b/src/commoncode/saneyaml.py @@ -22,7 +22,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import from __future__ import print_function @@ -38,7 +37,6 @@ from yaml import SafeLoader from yaml import SafeDumper - """ Wrapper around PyYAML to provide sane defaults ensuring that dump/load does not damage content, keeps ordering, use always block-style and use four spaces @@ -57,6 +55,7 @@ # https://pypi.python.org/pypi/ruamel.yaml/0.9.1 # https://pypi.python.org/pypi/yaml2rst/0.2 + def load(s): """ Return an object safely loaded from YAML string `s`. `s` must be unicode @@ -90,6 +89,7 @@ class SaneLoader(SafeLoader): """ A safe loader configured with many sane defaults. """ + def ignore_aliases(self, data): return True @@ -120,6 +120,7 @@ def string_loader(loader, node): # keep boolean conversion # SaneLoader.add_constructor(u'tag:yaml.org,2002:boolean', string_loader) + def ordered_loader(loader, node): """ Ensure that YAML maps ordered is preserved and loaded in an OrderedDict. @@ -143,6 +144,7 @@ def ordered_loader(loader, node): class SaneDumper(SafeDumper): + def increase_indent(self, flow=False, indentless=False): """ Ensure that lists items are always indented. @@ -162,6 +164,7 @@ def ordered_dumper(dumper, data): """ return dumper.represent_mapping(u'tag:yaml.org,2002:map', data.items()) + SaneDumper.add_representer(OrderedDict, ordered_dumper) @@ -171,6 +174,7 @@ def null_dumper(dumper, value): """ return dumper.represent_scalar(u'tag:yaml.org,2002:null', u'') + SafeDumper.add_representer(type(None), null_dumper) @@ -210,4 +214,5 @@ def boolean_dumper(dumper, value): style = None return dumper.represent_scalar(u'tag:yaml.org,2002:bool', value, style=style) + SaneDumper.add_representer(bool, boolean_dumper) diff --git a/src/commoncode/system.py b/src/commoncode/system.py index c0264a1ac45..250d1f4b0e6 100644 --- a/src/commoncode/system.py +++ b/src/commoncode/system.py @@ -50,8 +50,9 @@ def os_arch(): raise Exception('Unsupported OS/platform %r' % sys_platform) return os, arch - # FIXME use these for architectures + + ''' darwin/386 darwin/amd64 @@ -85,12 +86,10 @@ def os_arch(): on_linux = current_os == 'linux' on_posix = not on_windows and (on_mac or on_linux) - current_os_arch = '%(current_os)s-%(current_arch)s' % locals() noarch = 'noarch' current_os_noarch = '%(current_os)s-%(noarch)s' % locals() - # # Shared library file extensions # @@ -101,7 +100,6 @@ def os_arch(): if on_linux: lib_ext = '.so' - # # Python versions # @@ -116,7 +114,6 @@ def os_arch(): py36 = py3 and _sys_v1 == 6 py37 = py3 and _sys_v1 == 7 - # Do not let Windows error pop up messages with default SetErrorMode # See http://msdn.microsoft.com/en-us/library/ms680621(VS100).aspx # diff --git a/src/commoncode/testcase.py b/src/commoncode/testcase.py index 1f53a6898da..d341e4b7173 100644 --- a/src/commoncode/testcase.py +++ b/src/commoncode/testcase.py @@ -22,7 +22,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import from __future__ import print_function from __future__ import division @@ -53,7 +52,6 @@ class EnhancedAssertions(TestCaseClass): # always show full diff maxDiff = None - def failUnlessRaisesInstance(self, excInstance, callableObj, *args, **kwargs): """ @@ -79,11 +77,9 @@ def failUnlessRaisesInstance(self, excInstance, callableObj, # to ensure that multiple tests run can be launched in parallel test_run_temp_dir = None - # set to 1 to see the slow tests timing_threshold = sys.maxint - POSIX_PATH_SEP = b'/' if on_linux else '/' WIN_PATH_SEP = b'\\' if on_linux else '\\' EMPTY_STRING = b'' if on_linux else '' @@ -298,6 +294,7 @@ def _extract_tar_raw(test_path, target_dir, to_bytes, *args, **kwargs): tar.extractall(path=target_dir) tar.close() + extract_tar_raw = partial(_extract_tar_raw, to_bytes=True) extract_tar_uni = partial(_extract_tar_raw, to_bytes=False) diff --git a/src/commoncode/version.py b/src/commoncode/version.py index c980ee04f87..61323746a8a 100644 --- a/src/commoncode/version.py +++ b/src/commoncode/version.py @@ -24,7 +24,6 @@ from __future__ import absolute_import, print_function - import re from commoncode.system import on_linux diff --git a/src/extractcode/__init__.py b/src/extractcode/__init__.py index ea885fe269c..8b70e72c64c 100644 --- a/src/extractcode/__init__.py +++ b/src/extractcode/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -44,17 +44,14 @@ from os.path import join from os.path import exists - logger = logging.getLogger(__name__) DEBUG = False # import sys # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) # logger.setLevel(logging.DEBUG) - root_dir = join(dirname(__file__), 'bin') - POSIX_PATH_SEP = b'/' if on_linux else '/' WIN_PATH_SEP = b'\\' if on_linux else '\\' PATHS_SEPS = POSIX_PATH_SEP + WIN_PATH_SEP @@ -66,7 +63,6 @@ # Suffix added to extracted target_dir paths EXTRACT_SUFFIX = b'-extract' if on_linux else r'-extract' - # high level archive "kinds" docs = 1 regular = 2 @@ -76,7 +72,6 @@ patches = 6 special_package = 7 - kind_labels = { 1: 'docs', 2: 'regular', @@ -294,14 +289,18 @@ def to_dict(self): class ExtractError(Exception): pass + class ExtractErrorPasswordProtected(ExtractError): pass + class ExtractErrorFailedToExtract(ExtractError): pass + class ExtractWarningIncorrectEntry(ExtractError): pass + class ExtractWarningTrailingGarbage(ExtractError): pass diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index e641d9014c1..555b33b5a0c 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -51,7 +51,6 @@ from extractcode.uncompress import uncompress_gzip from extractcode.uncompress import uncompress_bzip2 - logger = logging.getLogger(__name__) TRACE = False TRACE_DEEP = False @@ -61,8 +60,6 @@ logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) - - """ Archive formats handling. The purpose of this module is to select an extractor suitable for the accurate extraction of a given kind of archive. An extractor is @@ -391,10 +388,10 @@ def try_to_extract(location, target_dir, extractor): fileutils.delete(temp_target) return warnings - # High level aliases to lower level extraction functions ######################################################## + extract_tar = libarchive2.extract extract_patch = patch.extract @@ -411,7 +408,6 @@ def try_to_extract(location, target_dir, extractor): extract_springboot = functools.partial(try_to_extract, extractor=extract_zip) - extract_iso = sevenzip.extract extract_rar = sevenzip.extract extract_rpm = sevenzip.extract @@ -424,7 +420,6 @@ def try_to_extract(location, target_dir, extractor): extract_Z = sevenzip.extract extract_xarpkg = sevenzip.extract - # Archive handlers. #################### diff --git a/src/extractcode/extract.py b/src/extractcode/extract.py index 08935a1ab1d..88ae9e5d57e 100644 --- a/src/extractcode/extract.py +++ b/src/extractcode/extract.py @@ -46,7 +46,6 @@ logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) - """ Extract archives and compressed files recursively to get the file content available for further processing. This the high level extraction entry point. @@ -86,7 +85,6 @@ the original archive. """ - """ An ExtractEvent contains data about an archive extraction progress: - `source` is the location of the archive being extracted diff --git a/src/extractcode/libarchive2.py b/src/extractcode/libarchive2.py index 40e0011e460..424b41315dc 100644 --- a/src/extractcode/libarchive2.py +++ b/src/extractcode/libarchive2.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,7 +22,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -50,19 +49,16 @@ from extractcode import ExtractError from extractcode import ExtractErrorPasswordProtected - # Python 2 and 3 support try: from os import fsencode except ImportError: from backports.os import fsencode - logger = logging.getLogger(__name__) DEBUG = False # logging.basicConfig(level=logging.DEBUG) - """ libarchive2 is a minimal and specialized wrapper around a vendored libarchive archive extraction library. It only deals with archive extraction and does not know how to @@ -179,6 +175,7 @@ class Archive(object): for entry in archive: # dome something with entry """ + def __init__(self, location, uncompress=True, extract=True, block_size=10240): """ Build an Archive object from file at `location`. @@ -381,6 +378,7 @@ def __repr__(self): class ArchiveException(ExtractError): + def __init__(self, rc=None, archive_struct=None, archive_func=None, root_ex=None): self.root_ex = root_ex if root_ex and isinstance(root_ex, ArchiveException): @@ -405,29 +403,35 @@ def __str__(self): class ArchiveWarning(ArchiveException): pass + class ArchiveErrorRetryable(ArchiveException): pass + class ArchiveError(ArchiveException): pass + class ArchiveErrorFatal(ArchiveException): pass + class ArchiveErrorFailedToWriteEntry(ArchiveException): pass + class ArchiveErrorPasswordProtected(ArchiveException, ExtractErrorPasswordProtected): pass + class ArchiveErrorIllegalOperationOnClosedArchive(ArchiveException): pass - ################################################# # ctypes defintion of the interface to libarchive ################################################# + def errcheck(rc, archive_func, args, null=False): """ ctypes error check handler for functions returning int, or null if null is True. @@ -455,7 +459,6 @@ def errcheck(rc, archive_func, args, null=False): errcheck_null = partial(errcheck, null=True) - # libarchive return codes ARCHIVE_EOF = 1 ARCHIVE_OK = 0 @@ -464,7 +467,6 @@ def errcheck(rc, archive_func, args, null=False): ARCHIVE_FAILED = -25 ARCHIVE_FATAL = -30 - # libarchive stat/file types AE_IFREG = 0o0100000 # Regular file AE_IFLNK = 0o0120000 # Symbolic link @@ -476,7 +478,6 @@ def errcheck(rc, archive_func, args, null=False): AE_IFMT = 0o0170000 # Format mask - ##################################### # libarchive C functions declarations ##################################### @@ -492,7 +493,6 @@ def errcheck(rc, archive_func, args, null=False): # wide string and then store a narrow string for the same data, the previously-set # wide string will be discarded in favor of the new data. - """ To read an archive, you must first obtain an initialized struct archive object from archive_read_new() @@ -506,7 +506,6 @@ def errcheck(rc, archive_func, args, null=False): archive_reader.restype = c_void_p archive_reader.errcheck = errcheck_null - """ Given a struct archive object, you can enable support for formats and filters. Enables support for all available formats except the "raw" format. @@ -522,7 +521,6 @@ def errcheck(rc, archive_func, args, null=False): use_all_formats.restype = c_int use_all_formats.errcheck = errcheck - """ Given a struct archive object, you can enable support for formats and filters. @@ -539,7 +537,6 @@ def errcheck(rc, archive_func, args, null=False): use_raw_formats.restype = c_int use_raw_formats.errcheck = errcheck - """ Given a struct archive object, you can enable support for formats and filters. @@ -555,7 +552,6 @@ def errcheck(rc, archive_func, args, null=False): use_all_filters.restype = c_int use_all_filters.errcheck = errcheck - """ Once formats and filters have been set, you open an archive filename for actual reading. @@ -575,7 +571,6 @@ def errcheck(rc, archive_func, args, null=False): open_file.restype = c_int open_file.errcheck = errcheck - """ Wide char version of archive_read_open_filename. """ @@ -585,7 +580,6 @@ def errcheck(rc, archive_func, args, null=False): open_file_w.restype = c_int open_file_w.errcheck = errcheck - """ When done with reading an archive you must free its resources. @@ -618,7 +612,6 @@ def errcheck(rc, archive_func, args, null=False): new_entry.restype = c_void_p new_entry.errcheck = errcheck_null - """ Given an opened archive struct object, you can iterate through the archive entries. An entry has a header with various data and usually a payload that is @@ -639,7 +632,6 @@ def errcheck(rc, archive_func, args, null=False): next_entry.restype = c_int next_entry.errcheck = errcheck - """ Read data associated with the header just read. Internally, this is a convenience function that calls archive_read_data_block() and fills any gaps @@ -651,7 +643,6 @@ def errcheck(rc, archive_func, args, null=False): read_entry_data.restype = c_ssize_t read_entry_data.errcheck = errcheck - """ Return the next available block of data for this entry. Unlike archive_read_data(), the archive_read_data_block() function avoids copying @@ -667,7 +658,6 @@ def errcheck(rc, archive_func, args, null=False): read_entry_data_block.restype = c_int read_entry_data_block.errcheck = errcheck - """ Releases the struct archive_entry object. The struct entry object must be freed when no longer needed. @@ -677,7 +667,6 @@ def errcheck(rc, archive_func, args, null=False): free_entry.argtypes = [c_void_p] free_entry.restype = None - # # Entry attributes: path, type, size, etc. are collected with these functions: # @@ -704,7 +693,6 @@ def errcheck(rc, archive_func, args, null=False): entry_type.argtypes = [c_void_p] entry_type.restype = c_int - """ This function retrieves the mtime field in an archive_entry. (modification time). @@ -718,7 +706,6 @@ def errcheck(rc, archive_func, args, null=False): entry_time.argtypes = [c_void_p] entry_time.restype = c_int - """ Path in the archive. @@ -737,14 +724,12 @@ def errcheck(rc, archive_func, args, null=False): entry_path_w.argtypes = [c_void_p] entry_path_w.restype = c_wchar_p - # int64_t archive_entry_size(struct archive_entry *a); entry_size = libarchive.archive_entry_size entry_size.argtypes = [c_void_p] entry_size.restype = c_longlong entry_size.errcheck = errcheck - """ Destination of the hardlink. """ @@ -753,13 +738,11 @@ def errcheck(rc, archive_func, args, null=False): hardlink_path.argtypes = [c_void_p] hardlink_path.restype = c_char_p - # const wchar_t * archive_entry_hardlink_w(struct archive_entry *a); hardlink_path_w = libarchive.archive_entry_hardlink_w hardlink_path_w.argtypes = [c_void_p] hardlink_path_w.restype = c_wchar_p - """ The number of references (hardlinks) can be obtained by calling archive_entry_nlinks() @@ -769,7 +752,6 @@ def errcheck(rc, archive_func, args, null=False): hardlink_count.argtypes = [c_void_p] hardlink_count.restype = c_int - """ The functions archive_entry_dev() and archive_entry_ino64() are used by ManPageArchiveEntryLinkify3 to find hardlinks. The pair of device and inode is @@ -779,7 +761,6 @@ def errcheck(rc, archive_func, args, null=False): # dev_t archive_entry_dev(struct archive_entry *a); # int archive_entry_dev_is_set(struct archive_entry *a); - """ Destination of the symbolic link. """ @@ -789,14 +770,12 @@ def errcheck(rc, archive_func, args, null=False): symlink_path.restype = c_char_p symlink_path.errcheck = errcheck_null - # const wchar_t * archive_entry_symlink_w(struct archive_entry *); symlink_path_w = libarchive.archive_entry_symlink_w symlink_path_w.argtypes = [c_void_p] symlink_path_w.restype = c_wchar_p symlink_path_w.errcheck = errcheck_null - # # Utilities and error handling: not all are defined for now # @@ -812,7 +791,6 @@ def errcheck(rc, archive_func, args, null=False): errno.argtypes = [c_void_p] errno.restype = c_int - """ Returns a textual error message suitable for display. The error message here is usually more specific than that obtained from passing the result of @@ -823,7 +801,6 @@ def errcheck(rc, archive_func, args, null=False): err_msg.argtypes = [c_void_p] err_msg.restype = c_char_p - """ Returns a count of the number of files processed by this archive object. The count is incremented by calls to ManPageArchiveWriteHeader3 or @@ -844,13 +821,11 @@ def errcheck(rc, archive_func, args, null=False): """ # int archive_filter_count(struct archive *, int); - """ Synonym for archive_filter_code(a,(0)). """ # int archive_compression(struct archive *); - """ Returns a textual name identifying the indicated filter. See archive_filter_count() for details of the numbering. diff --git a/src/extractcode/patch.py b/src/extractcode/patch.py index 765295ab731..9882a5bce92 100644 --- a/src/extractcode/patch.py +++ b/src/extractcode/patch.py @@ -48,7 +48,6 @@ more conveniently. """ - LOG = logging.getLogger(__name__) diff --git a/src/extractcode/sevenzip.py b/src/extractcode/sevenzip.py index ff800eaa7ca..c21e26d0c10 100644 --- a/src/extractcode/sevenzip.py +++ b/src/extractcode/sevenzip.py @@ -43,12 +43,10 @@ root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'bin')) - """ Low level support for p/7zip-based archive extraction. """ - sevenzip_errors = [ ('unsupported method', 'Unsupported archive or broken archive'), ('wrong password', 'Password protected archive, unable to extract'), diff --git a/src/extractcode/tar.py b/src/extractcode/tar.py index f7c5b0a628d..fa3f3e24c6a 100644 --- a/src/extractcode/tar.py +++ b/src/extractcode/tar.py @@ -50,7 +50,6 @@ # # Credits: Gustavo Niemeyer, Niels Gustabel, Richard Townsend. - from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals @@ -71,7 +70,6 @@ logger = logging.getLogger('extractcode') # logging.basicConfig(level=logging.DEBUG) - """ Low level support for tar-based archive extraction using Python built-in tar support. diff --git a/src/formattedcode/output_html.py b/src/formattedcode/output_html.py index 42b3719c310..5cee9fab016 100644 --- a/src/formattedcode/output_html.py +++ b/src/formattedcode/output_html.py @@ -139,9 +139,9 @@ class HtmlAppOutput(OutputPlugin): def is_enabled(self, output_html_app, **kwargs): return output_html_app - def process_codebase(self, codebase, - input, # NOQA - output_html_app, + def process_codebase(self, codebase, + input, # NOQA + output_html_app, scancode_version, **kwargs): results = self.get_results(codebase, **kwargs) diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py index 7eba8590d59..f168c854543 100644 --- a/src/formattedcode/output_json.py +++ b/src/formattedcode/output_json.py @@ -56,7 +56,7 @@ def is_enabled(self, output_json, **kwargs): return output_json def process_codebase(self, codebase, output_json, files_count, - scancode_version, scancode_notice, pretty_options, + scancode_version, scancode_notice, pretty_options, **kwargs): results = self.get_results(codebase, **kwargs) @@ -84,7 +84,7 @@ def is_enabled(self, output_json_pp, **kwargs): return output_json_pp def process_codebase(self, codebase, output_json_pp, files_count, - scancode_version, scancode_notice, pretty_options, + scancode_version, scancode_notice, pretty_options, **kwargs): results = self.get_results(codebase, **kwargs) diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index 0546518d0c8..3ec2770f5d0 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -63,14 +63,15 @@ # Python 3 unicode = str # NOQA - # Tracing flags TRACE = False TRACE_DEEP = False + def logger_debug(*args): pass + if TRACE or TRACE_DEEP: import logging @@ -82,11 +83,11 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) - """ Output plugins to write scan results in SPDX format. """ + @output_impl class SpdxTvOutput(OutputPlugin): @@ -104,8 +105,8 @@ class SpdxTvOutput(OutputPlugin): def is_enabled(self, output_spdx_tv, **kwargs): return output_spdx_tv - def process_codebase(self, codebase, - input, # NOQA + def process_codebase(self, codebase, + input, # NOQA output_spdx_tv, scancode_version, scancode_notice, **kwargs): @@ -129,8 +130,8 @@ class SpdxRdfOutput(OutputPlugin): def is_enabled(self, output_spdx_rdf, **kwargs): return output_spdx_rdf - def process_codebase(self, codebase, - input, #NOQA + def process_codebase(self, codebase, + input, # NOQA output_spdx_rdf, scancode_version, scancode_notice, **kwargs): @@ -246,7 +247,6 @@ def write_spdx(output_file, results, scancode_version, scancode_notice, else: file_entry.copyright = SPDXNone() - package.add_file(file_entry) if len(package.files) == 0: diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index c538f6f6c8a..31a207b9464 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -41,14 +41,12 @@ from scancode_config import scancode_src_dir from scancode_config import SCANCODE_DEV_MODE - """ An on-disk persistent cache of LicenseIndex. The index is pickled and invalidated if there are any changes in the code or licenses text or rules. Loading and dumping the cached index is safe to use across multiple processes using lock files. """ - LICENSE_INDEX_LOCK_TIMEOUT = 60 * 3 # global in-memory cache of the main license index instance diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index d370e2bb7da..2c298dbc2af 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -82,6 +82,7 @@ def logger_debug(*args): pass + if TRACE or TRACE_INDEXING_PERF or TRACE_QUERY_RUN_SIMPLE or TRACE_NEGATIVE: import logging diff --git a/src/licensedcode/legal.py b/src/licensedcode/legal.py index 7a7e0933af8..e7af15faa9d 100644 --- a/src/licensedcode/legal.py +++ b/src/licensedcode/legal.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -28,17 +28,14 @@ from commoncode import fileutils - """ Recognition of typical "legal" files such as "LICENSE", "COPYING", etc. """ - special_names = ( 'COPYING', 'COPYRIGHT', 'NOTICE', 'LICENSE', 'LICENCE', 'LEGAL', 'EULA', 'AGREEMENT', 'ABOUT', 'COPYLEFT', 'LICENSING') - special_names_lower = tuple(x.lower() for x in special_names) diff --git a/src/licensedcode/match.py b/src/licensedcode/match.py index 9a404ecdde7..d3e35dae75d 100644 --- a/src/licensedcode/match.py +++ b/src/licensedcode/match.py @@ -53,6 +53,7 @@ def logger_debug(*args): pass + if (TRACE or TRACE_FILTER_CONTAINS or TRACE_MERGE or TRACE_REFINE_RULE_MIN_COVERAGE or TRACE_REFINE_SINGLE or TRACE_REFINE_SMALL): @@ -473,7 +474,6 @@ def merge_matches(matches, max_dist=MAX_DIST): if TRACE_MERGE: logger_debug(' ---> ###merge_matches: MAX_DIST reached, breaking') break - # keep one of equal matches # with same qspan: FIXME: is this ever possible? if current_match.qspan == next_match.qspan and current_match.ispan == next_match.ispan: @@ -562,10 +562,10 @@ def merge_matches(matches, max_dist=MAX_DIST): merged.extend(rule_matches) return merged - # FIXME we should consider the length and distance between matches to break # early from the loops: trying to check containment on wildly separated matches does not make sense + def filter_contained_matches(matches): """ Return a filtered list of LicenseMatch given a `matches` list of LicenseMatch by @@ -1066,6 +1066,7 @@ def get_full_matched_text( dictionary_get = idx.dictionary.get import attr + @attr.s(slots=True) class Token(object): value = attr.ib() diff --git a/src/licensedcode/match_aho.py b/src/licensedcode/match_aho.py index 8c7b090775f..d5c706877dd 100644 --- a/src/licensedcode/match_aho.py +++ b/src/licensedcode/match_aho.py @@ -51,6 +51,7 @@ def logger_debug(*args): logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) else: + def logger_debug(*args): pass diff --git a/src/licensedcode/match_hash.py b/src/licensedcode/match_hash.py index 76bfc5de15c..512d2a1e2e3 100644 --- a/src/licensedcode/match_hash.py +++ b/src/licensedcode/match_hash.py @@ -30,7 +30,6 @@ from licensedcode.spans import Span from licensedcode.match import LicenseMatch - """ Matching strategy using hashes to match a whole text chunk at once. """ @@ -51,10 +50,10 @@ def logger_debug(*args): logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) else: + def logger_debug(*args): pass - MATCH_HASH = '1-hash' diff --git a/src/licensedcode/match_seq.py b/src/licensedcode/match_seq.py index 90d5d870f9e..8f70143555e 100644 --- a/src/licensedcode/match_seq.py +++ b/src/licensedcode/match_seq.py @@ -24,7 +24,6 @@ from __future__ import absolute_import, division, print_function - from licensedcode.match import get_texts from licensedcode.match import LicenseMatch from licensedcode.seq import match_blocks @@ -33,8 +32,10 @@ TRACE = False TRACE2 = False + def logger_debug(*args): pass + if TRACE: import logging import sys @@ -54,6 +55,7 @@ def logger_debug(*args): MATCH_SEQ = '3-seq' + def match_sequence(idx, candidate, query_run, start_offset=0): """ Return a list of LicenseMatch by matching the `query_run` tokens sequence diff --git a/src/licensedcode/match_set.py b/src/licensedcode/match_set.py index 4aa99e05865..e7da310e75e 100644 --- a/src/licensedcode/match_set.py +++ b/src/licensedcode/match_set.py @@ -35,7 +35,6 @@ from licensedcode.models import Rule - """ Approximate matching strategies using token sets and multisets. @@ -123,6 +122,7 @@ def logger_debug(*args): pass + if TRACE: import logging import sys @@ -134,10 +134,10 @@ def logger_debug(*args): pass def logger_debug(*args): return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) - # TODO: add bigrams sets and multisets # TODO: see also https://github.com/bolo1729/python-memopt/blob/master/memopt/memopt.py for multisets + def tids_sets_intersector(qset, iset): """ Return the intersection of a query and index token ids sets. @@ -225,6 +225,7 @@ def index_token_sets(token_ids, len_junk, len_good): # would discard when we compute candaites to eventually discard many or all candidates # we compute too many candidates that may waste time in seq matching for no reason + # FIXME: Also we should remove any weak and or small rules from the top candidates # and anything that cannot be seq matched at all. (e.g. no high match) def compute_candidates(query_run, idx, rules_subset, top=30): diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index e6eaa931d0a..99791aa7a52 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -51,14 +51,11 @@ from licensedcode.tokenize import rule_tokenizer from licensedcode.tokenize import query_tokenizer - # these are globals but always side-by-side with the code so not moving data_dir = join(abspath(dirname(__file__)), 'data') licenses_data_dir = join(data_dir, 'licenses') rules_data_dir = join(data_dir, 'rules') - - """ Reference License and license Rule structures persisted as a combo of a YAML data file and one or more text files containing license or notice texts. @@ -396,7 +393,6 @@ def validate(licenses, verbose=False, no_dupe_urls=False): # for global dedupe by_text[license_qtokens].append(key + ': TEXT') - # SPDX consistency if lic.spdx_license_key: by_spdx_key[lic.spdx_license_key].append(key) @@ -747,11 +743,11 @@ def thresholds(self): Return a Thresholds tuple considering the occurrence of all tokens. """ if not self._thresholds: - length = self.length + length = self.length high_length = self.high_length if length > 200: - min_high = high_length//10 - min_len = length//10 + min_high = high_length // 10 + min_len = length // 10 else: min_high = min([high_length, MIN_MATCH_HIGH_LENGTH]) min_len = MIN_MATCH_LENGTH @@ -792,8 +788,8 @@ def thresholds_unique(self): length_unique = self.length_unique if length > 200: - min_high = high_unique//10 - min_len = length//10 + min_high = high_unique // 10 + min_len = length // 10 else: highu = (int(high_unique // 2)) or high_unique min_high = min([highu, MIN_MATCH_HIGH_LENGTH]) diff --git a/src/licensedcode/query.py b/src/licensedcode/query.py index baa94c827a1..2f76bd16226 100644 --- a/src/licensedcode/query.py +++ b/src/licensedcode/query.py @@ -23,7 +23,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import print_function, absolute_import +from __future__ import absolute_import +from __future__ import print_function from collections import defaultdict @@ -35,7 +36,6 @@ from licensedcode.tokenize import query_lines from licensedcode.tokenize import query_tokenizer - """ Build license queries from scanned files to feed the detection pipeline. @@ -84,6 +84,7 @@ def logger_debug(*args): pass + if TRACE: import logging import sys diff --git a/src/licensedcode/seq.py b/src/licensedcode/seq.py index cf23d0dd9ea..68555c4f58e 100644 --- a/src/licensedcode/seq.py +++ b/src/licensedcode/seq.py @@ -3,7 +3,6 @@ from collections import namedtuple as _namedtuple - """ Token sequences alignement and diffing based on the longest common substrings of "high tokens". This essentially a non-optimal and reasonably fast single local @@ -15,7 +14,6 @@ license: PSF. See seq.ABOUT file for details. """ - Match = _namedtuple('Match', 'a b size') diff --git a/src/licensedcode/spans.py b/src/licensedcode/spans.py index bb258ad36f2..4b60d0cf155 100644 --- a/src/licensedcode/spans.py +++ b/src/licensedcode/spans.py @@ -37,7 +37,6 @@ from intbitset import intbitset - """ Ranges and intervals of integers using bitmaps. Used as a compact and faster data structure for token and position sets. @@ -51,6 +50,7 @@ class Span(Set): It is equivalent to a sparse closed interval. Originally derived and heavily modified from Whoosh Span. """ + def __init__(self, *args): """ Create a new Span from a start and end ints or an iterable of ints. diff --git a/src/licensedcode/tokenize.py b/src/licensedcode/tokenize.py index ef53e9094ca..4549621bc7e 100644 --- a/src/licensedcode/tokenize.py +++ b/src/licensedcode/tokenize.py @@ -34,12 +34,12 @@ from textcode.analysis import text_lines - """ Utilities to break texts in lines and tokens (aka. words) with specialized version for queries and rules texts. """ + def query_lines(location=None, query_string=None, strip=True): """ Return an iterable of text lines given a file at `location` or a @@ -70,6 +70,7 @@ def query_lines(location=None, query_string=None, strip=True): query_pattern = '[^\W]+\+?[^\W]*' word_splitter = re.compile(query_pattern, re.UNICODE).findall + def query_tokenizer(text, lower=True): """ Return an iterable of tokens from a unicode query text. @@ -84,11 +85,11 @@ def query_tokenizer(text, lower=True): # matched text collection not_query_pattern = '[\W\s\+]+[\W\s]?' - # collect tokens and non-token texts in two different groups _text_capture_pattern = '(?P' + query_pattern + ')' + '|' + '(?P' + not_query_pattern + ')' tokens_and_non_tokens = re.compile(_text_capture_pattern, re.UNICODE).finditer + def matched_query_text_tokenizer(text): """ Return an iterable of tokens and non-tokens from a unicode query text keeping @@ -118,6 +119,7 @@ def matched_query_text_tokenizer(text): rule_pattern = '%s|%s+' % (query_pattern, template_pattern,) template_splitter = re.compile(rule_pattern , re.UNICODE).findall + def rule_tokenizer(text, lower=True): """ Return an iterable of tokens from a unicode rule text, skipping templated diff --git a/src/packagedcode/__init__.py b/src/packagedcode/__init__.py index 47aab4d7a92..68fd453243e 100644 --- a/src/packagedcode/__init__.py +++ b/src/packagedcode/__init__.py @@ -22,6 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. +from __future__ import absolute_import + from packagedcode import models from packagedcode import maven from packagedcode import npm @@ -29,7 +31,6 @@ from packagedcode import phpcomposer from packagedcode import rpm - # Note: the order matters: from the most to the least specific # Package classes MUST be added to this list to be active PACKAGE_TYPES = [ diff --git a/src/packagedcode/maven.py b/src/packagedcode/maven.py index 4ceb12fe7dd..cb8e5fe9832 100644 --- a/src/packagedcode/maven.py +++ b/src/packagedcode/maven.py @@ -45,7 +45,6 @@ from typecode import contenttype from textcode import analysis - logger = logging.getLogger(__name__) TRACE = False @@ -54,12 +53,12 @@ logging.basicConfig(stream=sys.stdout) logger.setLevel(logging.DEBUG) - """ Support Maven2 POMs. Attempts to resolve Maven properties when possible. """ + class MavenPomPackage(models.Package): metafiles = ('.pom', 'pom.xml',) extensions = ('.pom', '.xml',) @@ -118,6 +117,7 @@ def to_dict(self): class MavenPom(pom.Pom): + def __init__(self, location=None, text=None): """ Build a POM from a location or unicode text. @@ -217,6 +217,7 @@ def _extra_properties(self): def _replace_props(cls, text, properties): if not text: return text + def subfunc(matchobj): """Return the replacement value for a matched property key.""" key = matchobj.group(1) @@ -775,6 +776,7 @@ class MavenRecognizer(object): """ A package recognizer for Maven-based packages. """ + def __init__(self): return NotImplementedError() diff --git a/src/packagedcode/models.py b/src/packagedcode/models.py index ed1f0b07368..ce6e039b779 100644 --- a/src/packagedcode/models.py +++ b/src/packagedcode/models.py @@ -54,7 +54,6 @@ from schematics.types.compound import ModelType from schematics.transforms import blacklist - """ Common data model for package information and dependencies, abstracting the many small differences existing between package management formats and tools. @@ -127,6 +126,7 @@ class BaseListType(ListType): """ ListType with a default of an empty list. """ + def __init__(self, field, **kwargs): super(BaseListType, self).__init__(field=field, default=[], **kwargs) @@ -138,6 +138,7 @@ class PackageIndentifierType(BaseType): """ Global identifier for a package """ + def __init__(self, **kwargs): super(PackageIndentifierType, self).__init__(**kwargs) @@ -298,6 +299,7 @@ class BaseModel(Model): """ Base class for all schematics models. """ + def __init__(self, **kwargs): super(BaseModel, self).__init__(raw_data=kwargs) @@ -514,7 +516,6 @@ def resolve(self): payload_doc = 'doc' PAYLOADS = (payload_src, payload_bin, payload_doc) - # Packaging types ################################# as_archive = 'archive' @@ -946,7 +947,6 @@ def identifier(self): """ return PackageId(self.type, self.name, self.version) - # # Package sub types # NOTE: this is somewhat redundant with extractcode archive handlers @@ -1212,7 +1212,6 @@ class SquashfsPackage(Package): type = StringType(default='squashfs image') packaging = StringType(default=as_archive) - # # these very generic archive packages must come last in recogniztion order # diff --git a/src/packagedcode/nevra.py b/src/packagedcode/nevra.py index a840ff9f651..8d6718a72ca 100644 --- a/src/packagedcode/nevra.py +++ b/src/packagedcode/nevra.py @@ -22,13 +22,13 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import re from commoncode import fileutils - """ Utilities to handle RPM NEVRA (name, epoch, version, release, architecture) """ @@ -50,6 +50,7 @@ # modified and originally from: # https://raw.githubusercontent.com/sassoftware/conary/c26507001b62b0839539908cc5bf28893c45c0b4/conary/rpmhelper.py + def from_name(filename): """ Return an (E, N, V, R, A) tuple given a file name, by splitting diff --git a/src/packagedcode/npm.py b/src/packagedcode/npm.py index 756d1806222..655ded0b885 100644 --- a/src/packagedcode/npm.py +++ b/src/packagedcode/npm.py @@ -48,7 +48,6 @@ https://github.com/pombredanne/normalize-package-data """ - logger = logging.getLogger(__name__) # import sys # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) @@ -129,7 +128,6 @@ def build_package(package_data, base_dir=None, metafile_name='package.json'): ('repository', repository_mapper), ]) - if not package_data.get('name') or not package_data.get('version'): # a package.json without name and version is not a usable NPM package return @@ -404,7 +402,6 @@ def deps_mapper(deps, package, field_name): peer_dependencies_mapper = partial(deps_mapper, field_name='peerDependencies') optional_dependencies_mapper = partial(deps_mapper, field_name='optionalDependencies') - person_parser = re.compile( r'^(?P[^\(<]+)' r'\s?' diff --git a/src/packagedcode/phpcomposer.py b/src/packagedcode/phpcomposer.py index 7877cc58048..909cedb2c81 100644 --- a/src/packagedcode/phpcomposer.py +++ b/src/packagedcode/phpcomposer.py @@ -31,7 +31,6 @@ from collections import OrderedDict from functools import partial - from commoncode import filetype from commoncode import fileutils @@ -42,7 +41,6 @@ Handle PHP composer packages, refer to https://getcomposer.org/ """ - logger = logging.getLogger(__name__) # import sys # logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) @@ -84,7 +82,7 @@ def parse(location): return build_package(package_data, base_dir, metafile_name) -def build_package(package_data, base_dir =None, metafile_name='composer.json'): +def build_package(package_data, base_dir=None, metafile_name='composer.json'): """ Return a composer Package object from a package data mapping or None. @@ -112,11 +110,10 @@ def build_package(package_data, base_dir =None, metafile_name='composer.json'): ('support', support_mapper), ]) - # A composer.json without name and description is not a usable PHP # composer package. Name and description fields are required but # only for published packages: - # https://getcomposer.org/doc/04-schema.md#name + # https://getcomposer.org/doc/04-schema.md#name # We want to catch both published and non-published packages here. package = PHPComposerPackage() @@ -141,7 +138,7 @@ def build_package(package_data, base_dir =None, metafile_name='composer.json'): if value: func(value, package) # Parse vendor from name value - vendor_mapper(package) + vendor_mapper(package) return package diff --git a/src/packagedcode/pypi.py b/src/packagedcode/pypi.py index ae724c4d550..8b76246122a 100644 --- a/src/packagedcode/pypi.py +++ b/src/packagedcode/pypi.py @@ -34,12 +34,10 @@ from packagedcode.models import PythonPackage from packagedcode import models - """ Detect and collect Python packages information. """ - PKG_INFO_ATTRIBUTES = [ 'Name', 'Version', diff --git a/src/packagedcode/pyrpm/rpm.py b/src/packagedcode/pyrpm/rpm.py index 9502c270821..371f69db558 100644 --- a/src/packagedcode/pyrpm/rpm.py +++ b/src/packagedcode/pyrpm/rpm.py @@ -35,7 +35,6 @@ from __future__ import absolute_import - from StringIO import StringIO import struct import re @@ -63,6 +62,7 @@ def find_magic_number(regexp, data): class Entry(object): ''' RPM Header Entry ''' + def __init__(self, entry, store): self.entry = entry self.store = store @@ -155,6 +155,7 @@ def __readbin(self): class Header(object): ''' RPM Header Structure ''' + def __init__(self, header, entries, store): self.header = header self.entries = entries diff --git a/src/packagedcode/pyrpm/rpmdefs.py b/src/packagedcode/pyrpm/rpmdefs.py index bd416ad68b0..f1077874503 100644 --- a/src/packagedcode/pyrpm/rpmdefs.py +++ b/src/packagedcode/pyrpm/rpmdefs.py @@ -27,9 +27,10 @@ ''' rpm definitions - ''' +from __future__ import absolute_import + RPM_LEAD_MAGIC_NUMBER = '\xed\xab\xee\xdb' RPM_HEADER_MAGIC_NUMBER = '\x8e\xad\xe8' @@ -45,11 +46,9 @@ RPMSIGTAG_GPG = 1005 RPMSIGTAG_PGP5 = 1006 - MD5_SIZE = 16 # 16 bytes long PGP_SIZE = 152 # 152 bytes long - # data types definition RPM_DATA_TYPE_NULL = 0 RPM_DATA_TYPE_CHAR = 1 @@ -102,7 +101,6 @@ RPMTAG_SOURCEPACKAGE = 1106 RPMTAG_DISTURL = 1123 - RPMTAGS = { RPMTAG_NAME: 'name', RPMTAG_EPOCH: 'epoch', @@ -124,7 +122,6 @@ RPMTAG_DISTURL: 'dist_url', } - """ from rpm.org lib/rpmtag.h See also: http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/pkgformat.html diff --git a/src/packagedcode/recognize.py b/src/packagedcode/recognize.py index 220d0164f6d..2a6fe4260db 100644 --- a/src/packagedcode/recognize.py +++ b/src/packagedcode/recognize.py @@ -34,12 +34,13 @@ from packagedcode import PACKAGE_TYPES from typecode import contenttype - TRACE = False + def logger_debug(*args): pass + logger = logging.getLogger(__name__) if TRACE: @@ -49,7 +50,6 @@ def logger_debug(*args): def logger_debug(*args): return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) - """ Recognize packages in files or directories. """ @@ -67,7 +67,6 @@ def recognize_package(location): ftype = T.filetype_file.lower() mtype = T.mimetype_file - for package_type in PACKAGE_TYPES: # Note: default to True if there is nothing to match against metafiles = package_type.metafiles diff --git a/src/packagedcode/rpm.py b/src/packagedcode/rpm.py index 5d25131842f..f0c9ee3d7bb 100644 --- a/src/packagedcode/rpm.py +++ b/src/packagedcode/rpm.py @@ -30,19 +30,19 @@ import string import sys - from packagedcode import models from packagedcode import nevra from packagedcode.pyrpm.rpm import RPM import typecode.contenttype - TRACE = False + def logger_debug(*args): pass + logger = logging.getLogger(__name__) if TRACE: @@ -52,7 +52,6 @@ def logger_debug(*args): def logger_debug(*args): return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args)) - # TODO: retrieve dependencies # TODO: parse spec files see: @@ -82,7 +81,6 @@ def logger_debug(*args): 'bin_or_src', ) - RPMInfo = namedtuple('RPMInfo', list(RPM_TAGS)) @@ -125,6 +123,7 @@ class EVR(namedtuple('EVR', 'epoch version release')): """ The RPM Epoch, Version, Release tuple. """ + # note: the order of the named tuple is the sort order. # But for creation we put the rarely used epoch last def __new__(self, version, release, epoch=None): diff --git a/src/packagedcode/utils.py b/src/packagedcode/utils.py index 423033c739f..69ce4aeb8a2 100644 --- a/src/packagedcode/utils.py +++ b/src/packagedcode/utils.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import print_function, absolute_import +from __future__ import absolute_import +from __future__ import print_function VCS_URLS = ( diff --git a/src/packagedcode/xmlutils.py b/src/packagedcode/xmlutils.py index 75b3c5af730..3cd018103f0 100644 --- a/src/packagedcode/xmlutils.py +++ b/src/packagedcode/xmlutils.py @@ -26,13 +26,11 @@ from __future__ import print_function from __future__ import unicode_literals - import chardet from lxml import etree from textcode import analysis - """ Utility functions for dealing with XML. """ @@ -61,7 +59,7 @@ def parse(location, handler): except: parser = etree.XMLParser(recover=True, remove_blank_text=True, resolve_entities=False) text = analysis.unicode_text(location) - xdoc= etree.fromstring(_as_unicode_bytes(text), parser) + xdoc = etree.fromstring(_as_unicode_bytes(text), parser) return handler(xdoc) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 3cdfa01c318..50a9f51a76f 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -22,7 +22,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals @@ -275,7 +274,6 @@ def setup(self): 'Invalid plugin: %(qname)r: %(plugin_class)r ' 'must extend %(plugin_base_class)r.' % locals()) - for option in plugin_class.options: if not isinstance(option, CommandLineOption): qname = '%(entrypoint)s:%(name)s' % locals() diff --git a/src/plugincode/output.py b/src/plugincode/output.py index 1a9d1a3dbf8..5ce2475e76b 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -36,7 +36,6 @@ from plugincode import HookspecMarker from scancode.resource import Resource - # Python 2 and 3 support try: # Python 2 @@ -48,14 +47,15 @@ # Python 3 unicode = str # NOQA - # Tracing flags TRACE = False TRACE_DEEP = False + def logger_debug(*args): pass + if TRACE or TRACE_DEEP: import logging import sys @@ -68,7 +68,6 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) - stage = 'output' entrypoint = 'scancode_output' @@ -93,8 +92,8 @@ def get_results(cls, codebase, info, full_root, strip_root, timing, **kwargs): """ Return an iterable of serialized scan results from a codebase. """ - serializer = partial(Resource.to_dict, - full_root=full_root,strip_root=strip_root, + serializer = partial(Resource.to_dict, + full_root=full_root, strip_root=strip_root, with_info=info, with_timing=timing) resources = codebase.walk(topdown=True, skip_root=strip_root, diff --git a/src/plugincode/output_filter.py b/src/plugincode/output_filter.py index e42eec527db..8f5e06ca84b 100644 --- a/src/plugincode/output_filter.py +++ b/src/plugincode/output_filter.py @@ -32,7 +32,6 @@ from plugincode import HookimplMarker from plugincode import HookspecMarker - stage = 'output_filter' entrypoint = 'scancode_output_filter' diff --git a/src/plugincode/post_scan.py b/src/plugincode/post_scan.py index f165598d8f9..2281f759fb8 100644 --- a/src/plugincode/post_scan.py +++ b/src/plugincode/post_scan.py @@ -30,7 +30,6 @@ from plugincode import HookimplMarker from plugincode import HookspecMarker - stage = 'post_scan' entrypoint = 'scancode_post_scan' diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index 913fe57f0fc..7d67b2d03eb 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -30,7 +30,6 @@ from plugincode import HookimplMarker from plugincode import HookspecMarker - stage = 'pre_scan' entrypoint = 'scancode_pre_scan' diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py index 29f61c33f42..1a79a051c17 100644 --- a/src/plugincode/scan.py +++ b/src/plugincode/scan.py @@ -30,7 +30,6 @@ from plugincode import HookimplMarker from plugincode import HookspecMarker - stage = 'scan' entrypoint = 'scancode_scan' diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index 46cc28852a8..5c07e10a1c7 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -53,23 +53,14 @@ # Python 3 unicode = str # NOQA - -scan_src_dir = abspath(dirname(__file__)) -src_dir = dirname(scan_src_dir) -root_dir = dirname(src_dir) -cache_dir = join(root_dir, '.cache') -scans_cache_dir = join(cache_dir, 'scan_results_caches') - -if not exists(scans_cache_dir): - fileutils.create_dir(scans_cache_dir) - - # Tracing flags TRACE = False + def logger_debug(*args): pass + if TRACE: import logging import sys @@ -81,7 +72,6 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, (unicode, str)) and a or repr(a) for a in args)) - # CLI help groups SCAN_GROUP = 'primary scans' SCAN_OPTIONS_GROUP = 'scan options' @@ -95,7 +85,6 @@ def logger_debug(*args): DOC_GROUP = 'documentation' CORE_GROUP = 'core' - # Holds a scan plugin result "key and the corresponding function. # click.Parameter instance Scanner = namedtuple('Scanner', 'key function') @@ -280,6 +269,7 @@ class FileOptionType(click.File): A click.File subclass that ensures that a file name is not set to an existing option parameter to avoid mistakes. """ + def convert(self, value, param, ctx): known_opts = set(chain.from_iterable(p.opts for p in ctx.command.params if isinstance(p, click.Option))) diff --git a/src/scancode/api.py b/src/scancode/api.py index b578fb9e7f6..5a0092ba41c 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -39,7 +39,6 @@ from commoncode.system import on_linux from typecode.contenttype import get_type - """ Main scanning functions. diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 35f2352cbf4..c66d1e343c8 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -93,14 +93,15 @@ # Python 3 unicode = str # NOQA - # Tracing flags TRACE = False TRACE_DEEP = False + def logger_debug(*args): pass + if TRACE or TRACE_DEEP: import logging @@ -112,10 +113,8 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) - echo_stderr = partial(click.secho, err=True) - info_text = ''' ScanCode scans code and other files for origin and license. Visit https://github.com/nexB/scancode-toolkit/ for support and download. @@ -481,8 +480,7 @@ def print_plugins(ctx, param, value): hidden=True, help='Run ScanCode in a special "test mode". Only for testing.', help_group=MISC_GROUP, sort_order=1000, cls=CommandLineOption) - -def scancode(ctx, input, #NOQA +def scancode(ctx, input, # NOQA info, strip_root, full_root, processes, timeout, @@ -1054,7 +1052,7 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, timings = OrderedDict((scanner.key, 0) for scanner in scanners) if not with_threading: - interruptor= fake_interruptible + interruptor = fake_interruptible else: interruptor = interruptible diff --git a/src/scancode/cli_test_utils.py b/src/scancode/cli_test_utils.py index d2899fd71b4..11137b01aa3 100644 --- a/src/scancode/cli_test_utils.py +++ b/src/scancode/cli_test_utils.py @@ -33,24 +33,38 @@ import os from commoncode.system import on_linux +from scancode_config import scancode_root_dir -def run_scan_plain(options, cwd=None, test_mode=True): +def run_scan_plain(options, cwd=None, test_mode=True, expected_rc=0): """ Run a scan as a plain subprocess. Return rc, stdout, stderr. """ from commoncode.command import execute - import scancode if test_mode and '--test-mode' not in options: options.append('--test-mode') scmd = b'scancode' if on_linux else 'scancode' - scan_cmd = os.path.join(scancode.root_dir, scmd) - return execute(scan_cmd, options, cwd=cwd) + scan_cmd = os.path.join(scancode_root_dir, scmd) + rc, stdout, stderr = execute(scan_cmd, options, cwd=cwd) + if rc != expected_rc: + opts = get_opts(options) + error = ''' +Failure to run: scancode %(opts)s +stdout: +%(stdout)s -def run_scan_click(options, monkeypatch=None, test_mode=True): +stderr: +%(stderr)s +''' % locals() + assert rc == expected_rc, error + + return rc, stdout, stderr + + +def run_scan_click(options, monkeypatch=None, test_mode=True, expected_rc=0): """ Run a scan as a Click-controlled subprocess If monkeypatch is provided, a tty with a size (80, 43) is mocked. @@ -68,7 +82,28 @@ def run_scan_click(options, monkeypatch=None, test_mode=True): monkeypatch.setattr(click , 'get_terminal_size', lambda : (80, 43,)) runner = CliRunner() - return runner.invoke(cli.scancode, options, catch_exceptions=False) + result = runner.invoke(cli.scancode, options, catch_exceptions=False) + + output = result.output + if result.exit_code != expected_rc: + opts = get_opts(options) + error = ''' +Failure to run: scancode %(opts)s +output: +%(output)s +''' % locals() + assert result.exit_code == expected_rc, error + return result + + +def get_opts(options): + try: + return ' '.join(options) + except: + try: + return b' '.join(options) + except: + return b' '.join(map(repr, options)) def check_json_scan(expected_file, result_file, regen=False, diff --git a/src/scancode/extract_cli.py b/src/scancode/extract_cli.py index c0d7e51697f..df4d12f1bbc 100644 --- a/src/scancode/extract_cli.py +++ b/src/scancode/extract_cli.py @@ -41,7 +41,6 @@ from scancode_config import __version__ from scancode import utils - # Python 2 and 3 support try: # Python 2 @@ -51,7 +50,6 @@ # Python 3 unicode = str # NOQA - echo_stderr = partial(click.secho, err=True) @@ -102,7 +100,6 @@ class ExtractCommand(utils.BaseCommand): @click.help_option('-h', '--help') @click.option('--about', is_flag=True, is_eager=True, callback=print_about, help='Show information about ScanCode and licensing and exit.') @click.option('--version', is_flag=True, is_eager=True, callback=print_version, help='Show the version and exit.') - def extractcode(ctx, input, verbose, quiet, shallow, *args, **kwargs): # NOQA """extract archives and compressed files found in the file or directory tree. @@ -161,7 +158,6 @@ def display_extract_summary(): echo_stderr('Extracting done.', fg=summary_color, reset=True) - # use for relative paths computation len_base_path = len(abs_location) base_is_dir = filetype.is_dir(abs_location) diff --git a/src/scancode/interrupt.py b/src/scancode/interrupt.py index 25ff6d2bc2e..913d0859e76 100644 --- a/src/scancode/interrupt.py +++ b/src/scancode/interrupt.py @@ -19,7 +19,6 @@ from commoncode.system import on_windows - """ This modules povides an interruptible() function to run a callable and stop it after a timeout with a windows and POSIX implementation. @@ -52,7 +51,6 @@ class TimeoutError(Exception): NO_ERROR = None NO_VALUE = None - if not on_windows: """ Some code based in part and inspired from the RobotFramework and @@ -79,7 +77,6 @@ class TimeoutError(Exception): from signal import setitimer from signal import signal as create_signal - def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): """ POSIX, signals-based interruptible runner. @@ -121,7 +118,6 @@ def handler(signum, frame): except ImportError: from _thread import start_new_thread - def interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT): """ Windows, threads-based interruptible runner. It can work also on @@ -159,7 +155,6 @@ def runner(): except (SystemExit, ValueError): pass - def async_raise(tid, exctype=Exception): """ Raise an Exception in the Thread with id `tid`. Perform cleanup if diff --git a/src/scancode/pool.py b/src/scancode/pool.py index 6fdc4f71d0a..ba3875e3f92 100644 --- a/src/scancode/pool.py +++ b/src/scancode/pool.py @@ -9,7 +9,6 @@ Apply proper monkeypatch to work around some bugs or limitations. """ - """ Monkeypatch Pool iterators so that Ctrl-C interrupts everything properly derived from https://gist.github.com/aljungberg/626518 @@ -39,15 +38,19 @@ from multiprocessing import pool + def wrapped(func): # ensure that we do not double wrap if func.func_name != 'wrap': + def wrap(self, timeout=None): return func(self, timeout=timeout or 1e10) + return wrap else: return func + pool.IMapIterator.next = wrapped(pool.IMapIterator.next) pool.IMapIterator.__next__ = pool.IMapIterator.next pool.IMapUnorderedIterator.next = wrapped(pool.IMapUnorderedIterator.next) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index bd0fa23b0f7..59df1a1b777 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -59,7 +59,6 @@ from commoncode import ignore from commoncode.system import on_linux - # Python 2 and 3 support try: # Python 2 @@ -71,7 +70,6 @@ # Python 3 unicode = str # NOQA - """ This module provides Codebase and Resource objects as an abstraction for files and directories used throughout ScanCode. ScanCode deals with a lot of these as @@ -83,14 +81,15 @@ scans. """ - # Tracing flags TRACE = False TRACE_DEEP = False + def logger_debug(*args): pass + if TRACE or TRACE_DEEP: import logging @@ -103,7 +102,6 @@ def logger_debug(*args): return logger.debug(' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) - # A global cache of codebase objects, keyed by a unique integer ID. # We use this weird structure such that a Resource object can reference its # parent codebase object without actually storing it as an instance variable. @@ -445,7 +443,6 @@ def compute_counts(self, skip_root=False, skip_filtered=False): return files_count, dirs_count, size_count - def update_counts(self, skip_filtered=False): """ Update files_count, dirs_count and size_count attributes of each diff --git a/src/scancode/utils.py b/src/scancode/utils.py index 57ec8a236f3..621236f14b1 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -37,7 +37,6 @@ from commoncode.fileutils import fsdecode from commoncode.fileutils import splitext - # Python 2 and 3 support try: # Python 2 @@ -49,7 +48,6 @@ # Python 3 unicode = str # NOQA - """ Command line UI utilities for help and and progress reporting. """ @@ -85,6 +83,7 @@ class EnhancedProgressBar(ProgressBar): """ Enhanced progressbar ensuring that nothing is displayed when the bar is hidden. """ + def render_progress(self): if not self.is_hidden: return super(EnhancedProgressBar, self).render_progress() @@ -104,6 +103,7 @@ class ProgressLogger(ProgressBar): If no item_show_func is provided a simple dot is printed for each event. """ + def __init__(self, *args, **kwargs): super(ProgressLogger, self).__init__(*args, **kwargs) self.is_hidden = False @@ -132,6 +132,7 @@ def render_finish(self): BAR_SEP = ' ' BAR_SEP_LEN = len(BAR_SEP) + def progressmanager(iterable=None, length=None, label=None, show_eta=True, show_percent=None, show_pos=True, item_show_func=None, fill_char='#', empty_char='-', bar_template=None, diff --git a/src/scancode_config.py b/src/scancode_config.py index 196eda01c5f..b6ca551d832 100644 --- a/src/scancode_config.py +++ b/src/scancode_config.py @@ -36,20 +36,19 @@ from os.path import exists import tempfile - """ Core configuration globals. Note: this module MUST import ONLY from the standard library. """ - # this exception is not available on posix try: WindowsError # noqa except NameError: WindowsError = None # NOQA + def _create_dir(location): """ Create directory and all sub-directories recursively at `location`. @@ -85,7 +84,6 @@ def _create_dir(location): else: raise - ################################################################################ # INVARIABLE INSTALLATION-SPECIFIC, BUILT-IN LOCATIONS AND FLAGS ################################################################################ @@ -93,6 +91,7 @@ def _create_dir(location): # current installation location. This is where the source code and static data # lives. + from pkg_resources import get_distribution, DistributionNotFound try: __version__ = get_distribution('scancode-toolkit').version @@ -104,7 +103,6 @@ def _create_dir(location): scancode_src_dir = dirname(__file__) scancode_root_dir = dirname(scancode_src_dir) - ################################################################################ # USAGE MODE FLAGS ################################################################################ diff --git a/src/textcode/markup.py b/src/textcode/markup.py index d675e8be83c..c32e51c79bb 100644 --- a/src/textcode/markup.py +++ b/src/textcode/markup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -46,7 +46,6 @@ bin_dir = os.path.join(os.path.dirname(__file__), 'bin') - extensions = ('.html', '.htm', '.php', '.phps', '.jsp', '.jspx' , '.xml', '.pom',) diff --git a/src/textcode/strings.py b/src/textcode/strings.py index 9876e4bf235..6f411402979 100644 --- a/src/textcode/strings.py +++ b/src/textcode/strings.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2016 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,14 +22,14 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function -import string import re +import string from commoncode.text import toascii - """ Extract raw ASCII strings from (possibly) binary strings. Both plain ASCII and UTF-16-LE-encoded (aka. wide) strings are extracted. @@ -78,7 +78,6 @@ def strings_from_file(location, buff_size=1024 * 1024, ascii=False, clean=True, printable = 'A-Za-z0-9' + whitespaces + punctuation null_byte = '\x00' - ascii_strings = re.compile( # plain ASCII is a sequence of printable of a minimum length '(' @@ -145,6 +144,7 @@ def clean_string(s, min_len=MIN_LEN, * not made of only of digits, punctuations and whitespaces """ s = s.strip() + def valid(st): st = remove_junk('', st) return (st and len(st) >= min_len @@ -156,7 +156,6 @@ def valid(st): if valid(s): yield s.strip() - ##################################################################################### # TODO: Strings classification # Classify strings, detect junk, detect paths, symbols, demangle symbols, unescape diff --git a/src/textcode/strings2.py b/src/textcode/strings2.py index 64bb20a7a45..7bddb04cb89 100644 --- a/src/textcode/strings2.py +++ b/src/textcode/strings2.py @@ -23,12 +23,11 @@ # - removed main() # - do not cache compiled patterns. re does cache patterns alright. - -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import re - ASCII_BYTE = ( " !\"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ" "\[\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}\\\~\t" diff --git a/src/typecode/contenttype.py b/src/typecode/contenttype.py index 73052500fff..3731ac5ac6d 100644 --- a/src/typecode/contenttype.py +++ b/src/typecode/contenttype.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import print_function, absolute_import +from __future__ import absolute_import +from __future__ import print_function import contextlib import os @@ -52,13 +53,11 @@ extension and mostly its content. """ - LOG = logging.getLogger(__name__) data_dir = os.path.join(os.path.dirname(__file__), 'data') bin_dir = os.path.join(os.path.dirname(__file__), 'bin') - # Python mimetypes path setup using Apache mimetypes DB os.environ['XDG_DATA_DIRS'] = os.path.join(data_dir, 'apache') os.environ['XDG_DATA_HOME'] = os.environ['XDG_DATA_DIRS'] @@ -67,31 +66,26 @@ # Ensure that all dates are UTC, especially for fine free file. os.environ['TZ'] = 'UTC' - PLAIN_TEXT_EXTENSIONS = ('.rst', '.rest', '.txt', '.md', # This one is actually not handled by Pygments. There # are probably more. '.log') - C_EXTENSIONS = set(['.c', '.cc', '.cp', '.cpp', '.cxx', '.c++', '.h', '.hh', '.s', '.asm', '.hpp', '.hxx', '.h++', '.i', '.ii', '.m']) - ELF_EXE = 'executable' ELF_SHARED = 'shared object' ELF_RELOC = 'relocatable' ELF_UNKNOWN = 'unknown' elf_types = (ELF_EXE, ELF_SHARED, ELF_RELOC,) - # TODO: # http://svn.zope.org/z3c.mimetype/trunk/?pathrev=103648 # http://svn.zope.org/z3c.sharedmimeinfo/trunk/TODO.txt?revision=103668&view=markup # https://pypi.python.org/pypi/z3c.sharedmimeinfo/0.1.0 # https://github.com/plone/Products.MimetypesRegistry/ - # Global registry of Type objects, keyed by location # TODO: can this be a memroy hog for very large scans? _registry = {} @@ -109,9 +103,9 @@ def get_type(location): _registry[abs_loc] = t return t - # TODO: simplify code using a cached property decorator + class Type(object): """ Content, media and mime type information about a file. diff --git a/src/typecode/entropy.py b/src/typecode/entropy.py index 142b46fae2b..9b8d9175d79 100644 --- a/src/typecode/entropy.py +++ b/src/typecode/entropy.py @@ -22,7 +22,6 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. - from __future__ import division from __future__ import absolute_import diff --git a/src/typecode/magic2.py b/src/typecode/magic2.py index 9af702264fe..36e2c92ddd7 100644 --- a/src/typecode/magic2.py +++ b/src/typecode/magic2.py @@ -45,6 +45,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from __future__ import absolute_import +from __future__ import print_function import os.path import ctypes @@ -58,18 +60,15 @@ except ImportError: from backports.os import fsencode - """ magic2 is minimal and specialized wrapper around a vendored libmagic file identification library. This is NOT thread-safe. It is based on python-magic by Adam Hup and adapted to the specific needs of ScanCode. """ - data_dir = os.path.join(os.path.dirname(__file__), 'data') bin_dir = os.path.join(os.path.dirname(__file__), 'bin') - # path to vendored magic DB, possibly OS-specific basemag = os.path.join(data_dir, 'magic') # keep the first which is the most specific directory @@ -81,7 +80,6 @@ # detectors = {} - # libmagic flags MAGIC_NONE = 0 MAGIC_MIME = 16 @@ -90,7 +88,6 @@ MAGIC_NO_CHECK_TEXT = 131072 MAGIC_NO_CHECK_CDF = 262144 - DETECT_TYPE = MAGIC_NONE DETECT_MIME = MAGIC_NONE | MAGIC_MIME DETECT_ENC = MAGIC_NONE | MAGIC_MIME | MAGIC_MIME_ENCODING @@ -149,6 +146,7 @@ class MagicException(Exception): class Detector(object): + def __init__(self, flags, magic_file=magic_db): """ Create a new libmagic detector. diff --git a/tests/cluecode/test_authors.py b/tests/cluecode/test_authors.py index 0c8d18aa169..e77c600445c 100644 --- a/tests/cluecode/test_authors.py +++ b/tests/cluecode/test_authors.py @@ -122,7 +122,7 @@ def test_author_nathan(self): test_file = self.get_test_loc('authors/author_nathan-KEYS') # name +email is not enough to create an author expected = [ - #'Nathan Mittler ', + # 'Nathan Mittler ', ] check_detection(expected, test_file, what='authors') diff --git a/tests/cluecode/test_copyrights_ics.py b/tests/cluecode/test_copyrights_ics.py index c1de9209456..1268aee8a58 100644 --- a/tests/cluecode/test_copyrights_ics.py +++ b/tests/cluecode/test_copyrights_ics.py @@ -23,7 +23,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import os.path from unittest.case import expectedFailure @@ -36,6 +37,7 @@ rather diversified sample of a typical Linux-based user space environment. """ + class TestCopyright(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -8672,7 +8674,6 @@ def test_ics_iptables_extensions_libxt_tcpoptstrip_c(self): ] check_detection(expected, test_file) - def test_ics_iptables_extensions_libxt_tee_c(self): test_file = self.get_test_loc('ics/iptables-extensions/libxt_TEE.c') expected = [ @@ -10752,7 +10753,6 @@ def test_ics_libffi_ltconfig(self): ] check_detection(expected, test_file, what='authors') - def test_ics_libffi_ltmain_sh(self): test_file = self.get_test_loc('ics/libffi/ltmain.sh') expected = [ diff --git a/tests/commoncode/test_codec.py b/tests/commoncode/test_codec.py index cd667c079f8..7f9fddbedd7 100644 --- a/tests/commoncode/test_codec.py +++ b/tests/commoncode/test_codec.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function from unittest import TestCase @@ -32,6 +33,7 @@ class TestCodec(TestCase): + def test_bin_to_num_basic(self): expected = 123 result = bin_to_num('{') diff --git a/tests/commoncode/test_date.py b/tests/commoncode/test_date.py index ed6d62af2fe..33f389953e7 100644 --- a/tests/commoncode/test_date.py +++ b/tests/commoncode/test_date.py @@ -22,17 +22,18 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function -import os from datetime import datetime +import os from commoncode import testcase - import commoncode.date class TestDate(testcase.FileBasedTesting): + def test_secs_from_epoch_can_handle_micro_and_nano_secs(self): test_file = self.get_temp_file() open(test_file, 'w').close() diff --git a/tests/commoncode/test_fileset.py b/tests/commoncode/test_fileset.py index e12f2f29543..0e3f07d6856 100644 --- a/tests/commoncode/test_fileset.py +++ b/tests/commoncode/test_fileset.py @@ -22,13 +22,15 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import os import commoncode.testcase from commoncode import fileset + class FilesetTest(commoncode.testcase.FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/commoncode/test_fileutils.py b/tests/commoncode/test_fileutils.py index fb2ffa35c75..63e9989ef47 100644 --- a/tests/commoncode/test_fileutils.py +++ b/tests/commoncode/test_fileutils.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import os from os.path import join @@ -315,6 +316,7 @@ def test_fsdecode_and_fsencode_are_idempotent(self): assert b == fsdecode(fsencode(a)) assert b == fsdecode(fsencode(b)) + class TestFileUtilsWalk(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/commoncode/test_functional.py b/tests/commoncode/test_functional.py index afc6004bebe..1857f4b8e18 100644 --- a/tests/commoncode/test_functional.py +++ b/tests/commoncode/test_functional.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function from unittest.case import TestCase @@ -37,6 +38,7 @@ def test_flatten(self): assert expected == test def test_flatten_generator(self): + def gen(): for _ in range(2): yield range(5) diff --git a/tests/commoncode/test_ignore.py b/tests/commoncode/test_ignore.py index cc4fb868543..4a4166bdd63 100644 --- a/tests/commoncode/test_ignore.py +++ b/tests/commoncode/test_ignore.py @@ -22,17 +22,16 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import os +from unittest.case import skipIf import commoncode.testcase from commoncode import fileutils - - from commoncode import ignore from commoncode.system import on_mac -from unittest.case import skipIf class IgnoreTest(commoncode.testcase.FileBasedTesting): diff --git a/tests/commoncode/test_version.py b/tests/commoncode/test_version.py index 49ed53b7f19..8c5ed2ce219 100644 --- a/tests/commoncode/test_version.py +++ b/tests/commoncode/test_version.py @@ -22,13 +22,16 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import unittest from commoncode import version + class TestVersionHint(unittest.TestCase): + def test_version_hint(self): data = { '/xmlgraphics/fop/source/fop-1.0-src.zip': '1.0', diff --git a/tests/extractcode/extractcode_assert_utils.py b/tests/extractcode/extractcode_assert_utils.py index b8b4f8a459c..bfda20d4b8b 100644 --- a/tests/extractcode/extractcode_assert_utils.py +++ b/tests/extractcode/extractcode_assert_utils.py @@ -22,17 +22,18 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function import os from commoncode import filetype from commoncode import fileutils - """ Shared archiving test utils. """ + def check_size(expected_size, location): assert expected_size == os.stat(location).st_size diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index 28f3d22ad93..f0af7176df4 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -54,7 +54,6 @@ from extractcode import sevenzip from extractcode import tar - """ For each archive type --when possible-- we are testing extraction of: - basic, plain archive, no tricks @@ -288,7 +287,6 @@ def collect_extracted_path(self, test_dir): result = sorted(result) return result - def assertExceptionContains(self, text, callableObj, *args, **kwargs): try: callableObj(*args, **kwargs) @@ -304,6 +302,7 @@ def assertExceptionContains(self, text, callableObj, *args, **kwargs): class TestTarGzip(BaseArchiveTestCase): + def test_extract_targz_basic(self): test_file = self.get_test_loc('archive/tgz/tarred_gzipped.tar.gz') test_dir = self.get_temp_dir() @@ -412,6 +411,7 @@ def test_extract_targz_with_unicode_path_should_extract_without_error(self): class TestGzip(BaseArchiveTestCase): + def test_uncompress_gzip_basic(self): test_file = self.get_test_loc('archive/gzip/file_4.26-1.diff.gz') test_dir = self.get_temp_dir() @@ -467,12 +467,12 @@ def test_uncompress_gzip_can_uncompress_windows_ntfs_wmz(self): test_file = self.get_test_loc('archive/wmz/image003.wmz') test_dir = self.get_temp_dir() archive.uncompress_gzip(test_file, test_dir) - print(os.listdir(test_dir)) result = os.path.join(test_dir, 'image003.wmz-extract') assert os.path.exists(result) class TestTarBz2(BaseArchiveTestCase): + def test_extract_tar_bz2_basic(self): test_file = self.get_test_loc('archive/tbz/tarred_bzipped.tar.bz2') test_dir = self.get_temp_dir() @@ -548,6 +548,7 @@ def test_extract_tar_bz2_multistream(self): class TestBz2(BaseArchiveTestCase): + def test_uncompress_bzip2_basic(self): test_file = self.get_test_loc('archive/bz2/single_file_not_tarred.bz2') test_dir = self.get_temp_dir() @@ -597,6 +598,7 @@ def test_sevenzip_extract_can_handle_bz2_multistream_differently(self): class TestShellArchives(BaseArchiveTestCase): + def test_extract_springboot(self): # a self executable springboot Jar is a zip with a shell script prefix test_file = self.get_test_loc('archive/shar/demo-spring-boot.jar') @@ -608,6 +610,7 @@ def test_extract_springboot(self): class TestZip(BaseArchiveTestCase): + def test_extract_zip_basic(self): test_file = self.get_test_loc('archive/zip/basic.zip') test_dir = self.get_temp_dir() @@ -864,8 +867,6 @@ def test_extract_zip_with_backslash_in_path_3(self): test_file = self.get_test_loc('archive/zip/backslash/boo-0.3-src.zip') test_dir = self.get_temp_dir() archive.extract_zip(test_file, test_dir) - print() - map(print, fileutils.resource_iter(test_dir, with_dirs=False)) result = os.path.join(test_dir, 'src/Boo.Lang.Compiler/TypeSystem/InternalCallableType.cs') assert os.path.exists(result) @@ -909,6 +910,7 @@ def test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_sla class TestLibarch(BaseArchiveTestCase): + def test_extract_zip_with_relative_path_libarchive(self): test_file = self.get_test_loc('archive/zip/relative_parent_folders.zip') test_dir = self.get_temp_dir() @@ -925,6 +927,7 @@ def test_extract_zip_with_relative_path_libarchive(self): class TestTar(BaseArchiveTestCase): + def test_extract_tar_basic(self): test_file = self.get_test_loc('archive/tar/tarred.tar') test_dir = self.get_temp_dir() @@ -1047,6 +1050,7 @@ def test_extract_python_testtar_tar_archive_with_special_files(self): class TestDebian(BaseArchiveTestCase): + def test_extract_deb_package_1(self): test_file = self.get_test_loc('archive/deb/adduser_3.112ubuntu1_all.deb') test_dir = self.get_temp_dir() @@ -1072,6 +1076,7 @@ def test_extract_deb_package_3(self): class TestAr(BaseArchiveTestCase): + def test_extract_ar_basic_7z(self): test_file = self.get_test_loc('archive/ar/liby.a') test_dir = self.get_temp_dir() @@ -1304,6 +1309,7 @@ def test_extract_ar_with_permissions(self): class TestCpio(BaseArchiveTestCase): + def test_extract_cpio_basic(self): test_file = self.get_test_loc('archive/cpio/elfinfo-1.0-1.fc9.src.cpio') test_dir = self.get_temp_dir() @@ -1371,7 +1377,6 @@ def test_extract_cpio_with_invalidpath(self): result = os.path.join(test_dir, 'this/that') assert os.path.exists(result) - def test_extract_cpio_with_weird_filename_extension(self): test_file = self.get_test_loc('archive/cpio/t.cpio.foo') test_dir = self.get_temp_dir() @@ -1381,6 +1386,7 @@ def test_extract_cpio_with_weird_filename_extension(self): expected = ['/t/', '/t/t.txt'] assert expected == extracted + class TestRpm(BaseArchiveTestCase): def test_extract_rpm_basic_1(self): @@ -1430,6 +1436,7 @@ def test_extract_rpm_broken(self): class TestExtractTwice(BaseArchiveTestCase): + def test_extract_twice_with_rpm_with_xz_compressed_cpio(self): test_file = self.get_test_loc('archive/rpm/xz-compressed-cpio.rpm') test_dir = self.get_temp_dir() @@ -1535,6 +1542,7 @@ def test_extract_twice_can_extract_to_relative_paths(self): class TestRar(BaseArchiveTestCase): + def test_extract_rar_basic(self): test_file = self.get_test_loc('archive/rar/basic.rar') test_dir = self.get_temp_dir() @@ -1610,6 +1618,7 @@ def test_extract_rar_with_non_ascii_path(self): class TestSevenZip(BaseArchiveTestCase): + def test_extract_7z_basic(self): test_file = self.get_test_loc('archive/7z/z.7z') test_dir = self.get_temp_dir() @@ -1725,6 +1734,7 @@ def test_extract_7z_basic_with_space_in_file_name(self): class TestIso(BaseArchiveTestCase): + def test_extract_iso_basic(self): test_file = self.get_test_loc('archive/iso/small.iso') test_dir = self.get_temp_dir() @@ -1754,6 +1764,7 @@ def test_extract_iso_basic_with_with_weird_filename_extension(self): class TestXzLzma(BaseArchiveTestCase): + def check_lzma_extract(self, extract_fun, test_file, expected): """ Run the 'extract_fun' function using the 'test_file' file as an input @@ -1846,6 +1857,7 @@ def test_extract_archive_tar_lzma_5(self): class TestDia(BaseArchiveTestCase): + def test_extract_dia_basic(self): test_file = self.get_test_loc('archive/dia/dia.dia') test_dir = self.get_temp_dir() @@ -1901,6 +1913,7 @@ def test_extract_can_get_extractor_and_uncompress_dia_files(self): class TestTarZ(BaseArchiveTestCase): + def test_extract_tarz_compress_basic(self): test_file = self.get_test_loc('archive/Z/tkWWW-0.11.tar.Z') test_dir = self.get_temp_dir() @@ -1917,6 +1930,7 @@ def test_extract_z_compress_basic(self): class TestXar(BaseArchiveTestCase): + def test_extract_xar_basic(self): test_file = self.get_test_loc('archive/xar/xar-1.4.xar') test_dir = self.get_temp_dir() @@ -1928,6 +1942,7 @@ def test_extract_xar_basic(self): class TestCb7(BaseArchiveTestCase): + def test_get_extractor_cb7(self): test_file = self.get_test_loc('archive/cb7/t .cb7') result = archive.get_extractor(test_file) @@ -1950,7 +1965,9 @@ def test_extract_cb7_basic_with_weird_filename_extension(self): expected = ['/t/', '/t/t.txt'] assert expected == extracted + class TestCab(BaseArchiveTestCase): + def test_get_extractor_cab(self): test_file = self.get_test_loc('archive/cab/basic.cab') result = archive.get_extractor(test_file) @@ -1973,7 +1990,9 @@ def test_extract_cab_basic_with_weird_filename_extension(self): expected = ['/t/', '/t/t.txt'] assert expected == extracted + class TestCbr(BaseArchiveTestCase): + def test_get_extractor_cbr(self): test_file = self.get_test_loc('archive/cbr/t.cbr') result = archive.get_extractor(test_file) @@ -1996,7 +2015,9 @@ def test_extract_cbr_basic_with_weird_filename_extension(self): expected = ['/t/', '/t/t.txt'] assert expected == extracted + class TestCbt(BaseArchiveTestCase): + def test_get_extractor_cbt(self): test_file = self.get_test_loc('archive/cbt/t.cbt') result = archive.get_extractor(test_file) @@ -2019,7 +2040,9 @@ def test_extract_cbt_basic_with_weird_filename_extension(self): expected = ['/t/', '/t/t.txt'] assert expected == extracted + class TestCbz(BaseArchiveTestCase): + def test_get_extractor_cbz(self): test_file = self.get_test_loc('archive/cbz/t.cbz') result = archive.get_extractor(test_file) diff --git a/tests/extractcode/test_extractcode.py b/tests/extractcode/test_extractcode.py index 9d8cf294735..3ed0a7ddf0a 100644 --- a/tests/extractcode/test_extractcode.py +++ b/tests/extractcode/test_extractcode.py @@ -22,16 +22,17 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function - +from __future__ import absolute_import +from __future__ import print_function from os.path import dirname +from os.path import exists from os.path import join from commoncode.testcase import FileBasedTesting from commoncode import fileutils from extractcode import new_name -from os.path import exists + class TestNewName(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') diff --git a/tests/extractcode/test_patch.py b/tests/extractcode/test_patch.py index da8767a8f8b..4138101e153 100644 --- a/tests/extractcode/test_patch.py +++ b/tests/extractcode/test_patch.py @@ -26,7 +26,6 @@ from __future__ import print_function from __future__ import unicode_literals - import codecs import json import os diff --git a/tests/extractcode/test_tar.py b/tests/extractcode/test_tar.py index 0e1e7b41bb9..c1a79d1e2e6 100644 --- a/tests/extractcode/test_tar.py +++ b/tests/extractcode/test_tar.py @@ -26,7 +26,6 @@ from __future__ import print_function from __future__ import unicode_literals - import os from unittest.case import skipIf @@ -38,6 +37,7 @@ class TestTarGzip(BaseArchiveTestCase): + def test_extract_targz_basic(self): test_file = self.get_test_loc('archive/tgz/tarred_gzipped.tar.gz') test_dir = self.get_temp_dir() @@ -141,6 +141,7 @@ def test_extract_targz_from_apache_should_not_return_errors(self): class TestTarBz2(BaseArchiveTestCase): + def test_extract_tar_bz2_basic(self): test_file = self.get_test_loc('archive/tbz/tarred_bzipped.tar.bz2') test_dir = self.get_temp_dir() @@ -217,6 +218,7 @@ def test_extract_tar_bz2_multistream(self): class TestTar(BaseArchiveTestCase): + def test_extract_tar_basic(self): test_file = self.get_test_loc('archive/tar/tarred.tar') test_dir = self.get_temp_dir() diff --git a/tests/formattedcode/test_output_csv.py b/tests/formattedcode/test_output_csv.py index 4328fd7d32a..054e76e2c90 100644 --- a/tests/formattedcode/test_output_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -40,7 +40,6 @@ from formattedcode.output_csv import flatten_scan - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -193,9 +192,8 @@ def test_csv_minimal(): test_dir = test_env.get_test_loc('csv/srp') result_file = test_env.get_temp_file('csv') expected_file = test_env.get_test_loc('csv/srp.csv') - result = run_scan_click(['--copyright', test_dir, '--output-csv', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--copyright', test_dir, '--output-csv', result_file] + run_scan_click(args) check_csvs(result_file, expected_file) @@ -203,23 +201,15 @@ def test_csv_tree(): test_dir = test_env.get_test_loc('csv/tree/scan') result_file = test_env.get_temp_file('csv') expected_file = test_env.get_test_loc('csv/tree/expected.csv') - result = run_scan_click(['--copyright', test_dir, - '--output-csv', result_file]) - assert result.exit_code == 0 + args = ['--copyright', test_dir, '--output-csv', result_file] + run_scan_click(args) check_csvs(result_file, expected_file) def test_can_process_live_scan_with_all_options(): test_dir = test_env.get_test_loc('csv/livescan/scan') result_file = test_env.get_temp_file('csv') - rc, stdout, stderr = run_scan_plain(['-clip', '--email', '--url', - '--strip-root', test_dir, '--output-csv', result_file]) - try: - assert rc == 0 - except: - print(stdout, stderr) - print(stdout, stderr) - raise - + args = ['-clip', '--email', '--url', '--strip-root', test_dir, '--output-csv', result_file] + run_scan_plain(args) expected_file = test_env.get_test_loc('csv/livescan/expected.csv') check_csvs(result_file, expected_file, regen=False) diff --git a/tests/formattedcode/test_output_json.py b/tests/formattedcode/test_output_json.py index 6985a05f3c9..e49e85023ce 100644 --- a/tests/formattedcode/test_output_json.py +++ b/tests/formattedcode/test_output_json.py @@ -33,7 +33,6 @@ from scancode.cli_test_utils import check_json_scan from scancode.cli_test_utils import run_scan_click - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -41,51 +40,34 @@ def test_json_pretty_print(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['-clip', test_dir, '--json-pp', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + args = ['-clip', test_dir, '--json-pp', result_file] + run_scan_click(args) expected = test_env.get_test_loc('json/simple-expected.jsonpp') - check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) + check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) def test_json_compact(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['-clip', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + run_scan_click(['-clip', test_dir, '--json', result_file]) with open(result_file, 'rb') as res: assert len(res.read().splitlines()) == 1 - expected = test_env.get_test_loc('json/simple-expected.json') - check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) + check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) def test_scan_output_does_not_truncate_copyright_json(): test_dir = test_env.get_test_loc('json/tree/scan/') result_file = test_env.get_temp_file('test.json') - - result = run_scan_click( - ['-clip', '--strip-root', test_dir, '--json-pp', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + run_scan_click(['-clip', '--strip-root', test_dir, '--json-pp', result_file]) expected = test_env.get_test_loc('json/tree/expected.json') - check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) + check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) def test_scan_output_does_not_truncate_copyright_with_json_to_stdout(): test_dir = test_env.get_test_loc('json/tree/scan/') result_file = test_env.get_temp_file('test.json') - - result = run_scan_click( - ['-clip', '--strip-root', test_dir, '--json-pp', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + args = ['-clip', '--strip-root', test_dir, '--json-pp', result_file] + run_scan_click(args) expected = test_env.get_test_loc('json/tree/expected.json') - check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True, regen=False) + check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) diff --git a/tests/formattedcode/test_output_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py index f1406bd141f..78ae7202497 100644 --- a/tests/formattedcode/test_output_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -35,7 +35,6 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -91,11 +90,7 @@ def _load_json_result_for_jsonlines(result_file): def test_jsonlines(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('jsonline') - - result = run_scan_click(['-i', test_dir, '--json-lines', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + run_scan_click(['-i', test_dir, '--json-lines', result_file]) expected = test_env.get_test_loc('json/simple-expected.jsonlines') check_jsonlines_scan(test_env.get_test_loc(expected), result_file, regen=False) @@ -103,17 +98,13 @@ def test_jsonlines(): def test_jsonlines_with_timing(): test_dir = test_env.get_test_loc('json/simple') result_file = test_env.get_temp_file('jsonline') - - result = run_scan_click(['-i', '--timing', test_dir, '--json-lines', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['-i', '--timing', test_dir, '--json-lines', result_file]) file_results = _load_jsonlines_result(result_file) - first =True - + first_line = True for res in file_results: - if first: + if first_line: # skip header - first = False + first_line = False continue scan_timings = res['files'][0]['scan_timings'] assert scan_timings diff --git a/tests/formattedcode/test_output_spdx.py b/tests/formattedcode/test_output_spdx.py index be5f41d1417..5c8f64d4d24 100644 --- a/tests/formattedcode/test_output_spdx.py +++ b/tests/formattedcode/test_output_spdx.py @@ -38,7 +38,6 @@ from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -150,71 +149,63 @@ def test_spdx_rdf_basic(): test_file = test_env.get_test_loc('spdx/simple/test.txt') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/simple/expected.rdf') - result = run_scan_click([test_file, '-clip', '--output-spdx-rdf', result_file]) + run_scan_click([test_file, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_tv_basic(): test_dir = test_env.get_test_loc('spdx/simple/test.txt') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/simple/expected.tv') - result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) + run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_rdf_with_known_licenses(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_known/expected.rdf') - result = run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) + run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_rdf_with_license_ref(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_ref/expected.rdf') - result = run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) + run_scan_click([test_dir, '-clip', '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_tv_with_known_licenses(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_known/expected.tv') - result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) + run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_tv_with_license_ref(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_ref/expected.tv') - result = run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) + run_scan_click([test_dir, '-clip', '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_rdf_with_known_licenses_with_text(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_known/expected_with_text.rdf') - result = run_scan_click([ '-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) + run_scan_click([ '-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) - assert result.exit_code == 0 def test_spdx_rdf_with_license_ref_with_text(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/license_ref/expected_with_text.rdf') - result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) - assert result.exit_code == 0 + run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) @@ -222,8 +213,7 @@ def test_spdx_tv_with_known_licenses_with_text(): test_dir = test_env.get_test_loc('spdx/license_known/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_known/expected_with_text.tv') - result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) - assert result.exit_code == 0 + run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) @@ -231,8 +221,7 @@ def test_spdx_tv_with_license_ref_with_text(): test_dir = test_env.get_test_loc('spdx/license_ref/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/license_ref/expected_with_text.tv') - result = run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) - assert result.exit_code == 0 + run_scan_click(['-clip', '--license-text', test_dir, '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) @@ -240,8 +229,7 @@ def test_spdx_tv_tree(): test_dir = test_env.get_test_loc('spdx/tree/scan') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/tree/expected.tv') - result = run_scan_click(['-clip', test_dir, '--output-spdx-tv', result_file]) - assert result.exit_code == 0 + run_scan_click(['-clip', test_dir, '--output-spdx-tv', result_file]) check_tv_scan(expected_file, result_file) @@ -249,8 +237,7 @@ def test_spdx_rdf_tree(): test_dir = test_env.get_test_loc('spdx/tree/scan') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/tree/expected.rdf') - result = run_scan_click(['-clip', test_dir, '--output-spdx-rdf', result_file]) - assert result.exit_code == 0 + run_scan_click(['-clip', test_dir, '--output-spdx-rdf', result_file]) check_rdf_scan(expected_file, result_file) @@ -258,48 +245,27 @@ def test_spdx_tv_with_unicode_license_text_does_not_fail(): test_file = test_env.get_test_loc('spdx/unicode/et131x.h') result_file = test_env.get_temp_file('tv') expected_file = test_env.get_test_loc('spdx/unicode/expected.tv') - rc, stdout, stderr = run_scan_plain([ - '--license', '--copyright', '--info', - '--strip-root', '--license-text', - '--license-diag', - test_file, '--output-spdx-tv', result_file - ]) - if rc != 0: - print('stdout', stdout) - print('stderr', stderr) - assert rc == 0 - check_tv_scan(expected_file, result_file, regen=False) + args = ['--license', '--copyright', '--info', '--strip-root', '--license-text', + '--license-diag', test_file, '--output-spdx-tv', result_file] + run_scan_plain(args) + check_tv_scan(expected_file, result_file) def test_spdx_rdf_with_unicode_license_text_does_not_fail(): test_file = test_env.get_test_loc('spdx/unicode/et131x.h') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/unicode/expected.rdf') - rc, stdout, stderr = run_scan_plain([ - '--license', '--copyright', '--info', - '--strip-root', '--license-text', - '--license-diag', - test_file, '--output-spdx-rdf', result_file - ]) - if rc != 0: - print('stdout', stdout) - print('stderr', stderr) - assert rc == 0 - check_rdf_scan(expected_file, result_file, regen=False) + args = ['--license', '--copyright', '--info', '--strip-root', + '--license-text', '--license-diag', test_file, '--output-spdx-rdf', result_file] + run_scan_plain(args) + check_rdf_scan(expected_file, result_file) def test_spdx_rdf_with_or_later_license_does_not_fail(): test_file = test_env.get_test_loc('spdx/or_later/test.java') result_file = test_env.get_temp_file('rdf') expected_file = test_env.get_test_loc('spdx/or_later/expected.rdf') - rc, stdout, stderr = run_scan_plain([ - '--license', '--copyright', '--info', - '--strip-root', '--license-text', - '--license-diag', - test_file, '--output-spdx-rdf', result_file - ]) - if rc != 0: - print('stdout', stdout) - print('stderr', stderr) - assert rc == 0 - check_rdf_scan(expected_file, result_file, regen=False) + args = ['--license', '--copyright', '--info', '--strip-root', '--license-text', + '--license-diag', test_file, '--output-spdx-rdf', result_file] + run_scan_plain(args) + check_rdf_scan(expected_file, result_file) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index 63eb341e69b..7f3c0c528ed 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2017 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -37,7 +37,6 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -45,11 +44,7 @@ def test_paths_are_posix_paths_in_html_app_format_output(): test_dir = test_env.get_test_loc('templated/simple') result_file = test_env.get_temp_file(extension='html', file_name='test_html') - - result = run_scan_click(['--copyright', test_dir, '--output-html-app', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + run_scan_click(['--copyright', test_dir, '--output-html-app', result_file]) # the data we want to test is in the data.json file data_file = os.path.join(fileutils.parent_directory(result_file), 'test_html_files', 'data.json') assert '/copyright_acme_c-c.c' in open(data_file).read() @@ -60,10 +55,7 @@ def test_paths_are_posix_paths_in_html_app_format_output(): def test_paths_are_posix_in_html_format_output(): test_dir = test_env.get_test_loc('templated/simple') result_file = test_env.get_temp_file('html') - - result = run_scan_click(['--copyright', test_dir, '--output-html', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--copyright', test_dir, '--output-html', result_file]) results = open(result_file).read() assert '/copyright_acme_c-c.c' in results assert __version__ in results @@ -72,13 +64,8 @@ def test_paths_are_posix_in_html_format_output(): def test_scanned_path_is_present_in_html_app_output(): test_dir = test_env.get_test_loc('templated/html_app') result_file = test_env.get_temp_file('test.html') - - result = run_scan_click(['--copyright', '--output-html-app', result_file, test_dir]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + run_scan_click(['--copyright', '--output-html-app', result_file, test_dir]) results = open(result_file).read() - assert 'ScanCode scan results for: %(test_dir)s' % locals() in results assert '

' % locals() in results assert 'scan results for:' % locals() in results @@ -95,12 +82,7 @@ def test_scan_html_output_does_not_truncate_copyright_html(): if on_windows: args += ['--timeout', '400'] - result = run_scan_click(args) - print('------------------------------------------------') - print(result.output) - print('------------------------------------------------') - assert 'Scanning done' in result.output - + run_scan_click(args) results = open(result_file).read() assert __version__ in results @@ -132,17 +114,12 @@ def test_scan_html_output_does_not_truncate_copyright_html(): check = re.findall(exp, results, re.MULTILINE) assert check - assert result.exit_code == 0 - def test_custom_format_with_custom_filename_fails_for_directory(): test_dir = test_env.get_temp_dir('html') result_file = test_env.get_temp_file('html') - - result = run_scan_click(['--custom-template', test_dir, - '--output-custom', result_file, - test_dir]) - assert result.exit_code != 0 + args = ['--custom-template', test_dir, '--output-custom', result_file, test_dir] + result = run_scan_click(args, expected_rc=2) assert 'Invalid value for "--custom-template": Path' in result.output @@ -150,11 +127,8 @@ def test_custom_format_with_custom_filename(): test_dir = test_env.get_test_loc('templated/simple') custom_template = test_env.get_test_loc('templated/sample-template.html') result_file = test_env.get_temp_file('html') - - result = run_scan_click(['--custom-template', custom_template, - '--output-custom', result_file, - test_dir]) - assert result.exit_code == 0 + args = ['--custom-template', custom_template, '--output-custom', result_file, test_dir] + run_scan_click(args) results = open(result_file).read() assert 'Custom Template' in results assert __version__ in results diff --git a/tests/licensedcode/license_test_utils.py b/tests/licensedcode/license_test_utils.py index 87720c72b77..701a22fd176 100644 --- a/tests/licensedcode/license_test_utils.py +++ b/tests/licensedcode/license_test_utils.py @@ -40,13 +40,13 @@ unicode except NameError: # Python 3 - unicode = str #NOQA - + unicode = str # NOQA """ License test utilities. """ + def make_license_test_function( expected_licenses, test_file, test_data_file, test_name, detect_negative=True, min_score=0, diff --git a/tests/licensedcode/test_cache.py b/tests/licensedcode/test_cache.py index 3e65aea5719..54b149b45d0 100644 --- a/tests/licensedcode/test_cache.py +++ b/tests/licensedcode/test_cache.py @@ -35,7 +35,6 @@ from licensedcode import cache from licensedcode.cache import get_license_cache_paths - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/licensedcode/test_detect.py b/tests/licensedcode/test_detect.py index 11c80141213..5581f85c111 100644 --- a/tests/licensedcode/test_detect.py +++ b/tests/licensedcode/test_detect.py @@ -45,11 +45,11 @@ TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') - """ Test the core license detection mechanics. """ + class TestIndexMatch(FileBasedTesting): test_data_dir = TEST_DATA_DIR @@ -1018,7 +1018,7 @@ def test_match_texts_with_short_lgpl_and_gpl_notices(self): matches = idx.match(location=test_loc) assert 6 == len(matches) results = [m.matched_text(whole_lines=False) for m in matches] - expected =[ + expected = [ 'GNU General Public License (GPL', 'GNU Lesser General Public License (LGPL', 'GNU General Public License (GPL', diff --git a/tests/licensedcode/test_detection_datadriven.py b/tests/licensedcode/test_detection_datadriven.py index 359990f649d..4e3c3782b29 100644 --- a/tests/licensedcode/test_detection_datadriven.py +++ b/tests/licensedcode/test_detection_datadriven.py @@ -39,17 +39,16 @@ from license_test_utils import make_license_test_function - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data/licenses') # set to True to print matched texts on test failure. TRACE_TEXTS = True - """ Data-driven tests using expectations stored in YAML files. """ + class LicenseTest(object): """ A license detection test is used to verify that license detection works @@ -69,6 +68,7 @@ class LicenseTest(object): If the list of licenses is empty, then this test should not detect any license in the test file. """ + def __init__(self, data_file=None, test_file=None): self.data_file = data_file self.test_file = test_file diff --git a/tests/licensedcode/test_detection_validate.py b/tests/licensedcode/test_detection_validate.py index 364d21d1735..bfd83b9b1f3 100644 --- a/tests/licensedcode/test_detection_validate.py +++ b/tests/licensedcode/test_detection_validate.py @@ -35,11 +35,11 @@ from license_test_utils import make_license_test_function - """ Validate that each license text and each rule is properly detected. """ + def build_license_validation_tests(licenses_by_key, cls): """ Dynamically build an individual test method for each license texts in a licenses diff --git a/tests/licensedcode/test_index.py b/tests/licensedcode/test_index.py index c5f7a1536c0..efe1b3f53fc 100644 --- a/tests/licensedcode/test_index.py +++ b/tests/licensedcode/test_index.py @@ -39,7 +39,6 @@ from licensedcode.query import Query from licensedcode import match_seq - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -477,14 +476,6 @@ def test_match_with_template_and_multiple_rules(self): NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE """.split() -# q = Query(query_string=querys, idx=idx) - -# print('######################') -# print('######################') -# print('q=', querys.lower().replace('*', ' ').replace('/', ' '). split()) -# print('q2=', [None if t is None else idx.tokens_by_tid[t] for t in q.tokens_with_unknowns()]) -# print('######################') - qtext, itext = get_texts(match, query_string=querys, idx=idx) assert exp_qtext == qtext.split() diff --git a/tests/licensedcode/test_legal.py b/tests/licensedcode/test_legal.py index 215e4f47ead..3a896e4a5bf 100644 --- a/tests/licensedcode/test_legal.py +++ b/tests/licensedcode/test_legal.py @@ -31,7 +31,6 @@ from commoncode.testcase import FileBasedTesting from licensedcode import legal - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/licensedcode/test_match.py b/tests/licensedcode/test_match.py index fdaee87f825..ff6109b86c0 100644 --- a/tests/licensedcode/test_match.py +++ b/tests/licensedcode/test_match.py @@ -39,7 +39,6 @@ from licensedcode.match import merge_matches from licensedcode.match import get_full_matched_text - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -715,6 +714,7 @@ def test_LicenseMatch_score_100_non_contiguous(self): m1 = LicenseMatch(rule=r1, qspan=Span(0, 19) | Span(30, 51), ispan=Span(0, 41)) assert m1.score() == 80.77 + class TestCollectLicenseMatchTexts(FileBasedTesting): test_data_dir = TEST_DATA_DIR diff --git a/tests/licensedcode/test_match_aho.py b/tests/licensedcode/test_match_aho.py index 19111531921..24786e58c3f 100644 --- a/tests/licensedcode/test_match_aho.py +++ b/tests/licensedcode/test_match_aho.py @@ -35,9 +35,9 @@ from licensedcode import models from licensedcode import query - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') + class TestMatchExact(FileBasedTesting): test_data_dir = TEST_DATA_DIR diff --git a/tests/licensedcode/test_match_hash.py b/tests/licensedcode/test_match_hash.py index 00476f919ec..69e41647b1b 100644 --- a/tests/licensedcode/test_match_hash.py +++ b/tests/licensedcode/test_match_hash.py @@ -36,11 +36,9 @@ from licensedcode import models from licensedcode import match_hash - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') - class TestHashMatch(FileBasedTesting): test_data_dir = TEST_DATA_DIR diff --git a/tests/licensedcode/test_match_seq.py b/tests/licensedcode/test_match_seq.py index bebfd81c7c1..9781d3878b2 100644 --- a/tests/licensedcode/test_match_seq.py +++ b/tests/licensedcode/test_match_seq.py @@ -36,9 +36,9 @@ from licensedcode.models import load_rules from licensedcode import match_seq - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') + class TestMatchSeq(FileBasedTesting): test_data_dir = TEST_DATA_DIR diff --git a/tests/licensedcode/test_models.py b/tests/licensedcode/test_models.py index 8bea4026ed5..95d57dd0e92 100644 --- a/tests/licensedcode/test_models.py +++ b/tests/licensedcode/test_models.py @@ -36,7 +36,6 @@ from licensedcode import index from licensedcode import models - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -91,6 +90,7 @@ def test_create_template_rule(self): assert 6 == test_rule.length def test_create_plain_rule_with_text_file(self): + def create_test_file(text): tf = self.get_temp_file() with open(tf, 'wb') as of: diff --git a/tests/licensedcode/test_performance.py b/tests/licensedcode/test_performance.py index 48e4a9a17f9..45c2fa7433b 100644 --- a/tests/licensedcode/test_performance.py +++ b/tests/licensedcode/test_performance.py @@ -35,12 +35,11 @@ from licensedcode import index from licensedcode import models - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') - # Instructions: Comment out the skip decorators to run a test. Do not commit without a skip + class TestMatchingPerf(FileBasedTesting): test_data_dir = TEST_DATA_DIR diff --git a/tests/licensedcode/test_query.py b/tests/licensedcode/test_query.py index 1b4fa3753eb..33f3ec9ec06 100644 --- a/tests/licensedcode/test_query.py +++ b/tests/licensedcode/test_query.py @@ -36,7 +36,6 @@ from licensedcode.models import Rule from licensedcode.query import Query - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -554,7 +553,7 @@ def test_query_run_and_tokenizing_breaking_works__with_plus_as_expected(self): result = [qr.to_dict() for qr in q.query_runs] expected = [ {'end': 121, 'start': 0, - 'tokens': + 'tokens': 'this library is free software you can redistribute it ' 'and or modify it under the terms of the gnu library ' 'general public license as published by the free software ' diff --git a/tests/licensedcode/test_tokenize.py b/tests/licensedcode/test_tokenize.py index 95c40f94079..5bdb6f19dae 100644 --- a/tests/licensedcode/test_tokenize.py +++ b/tests/licensedcode/test_tokenize.py @@ -44,7 +44,6 @@ from licensedcode.tokenize import matched_query_text_tokenizer from licensedcode.tokenize import tokens_and_non_tokens - TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/packagedcode/packages_test_utils.py b/tests/packagedcode/packages_test_utils.py index 4419172f624..2e61491f40e 100644 --- a/tests/packagedcode/packages_test_utils.py +++ b/tests/packagedcode/packages_test_utils.py @@ -22,7 +22,8 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function from collections import OrderedDict import os.path @@ -50,7 +51,6 @@ def make_locations_relative(self, package_dict): package_dict[key] = values return package_dict - def check_package(self, package, expected_loc, regen=False, fix_locations=True): """ Helper to test a package object against an expected JSON file. diff --git a/tests/packagedcode/test_maven.py b/tests/packagedcode/test_maven.py index 8152f271d1e..8652a77644b 100644 --- a/tests/packagedcode/test_maven.py +++ b/tests/packagedcode/test_maven.py @@ -404,11 +404,15 @@ def create_test_function(test_pom_loc, test_name, check_pom=True, regen=False): """ # closure on the test params if check_pom: + def test_pom(self): self.check_parse_pom(test_pom_loc, regen) + else: + def test_pom(self): self.check_parse_to_package(test_pom_loc, regen) + # set a proper function name to display in reports and use in discovery # function names are best as bytes if isinstance(test_name, unicode): @@ -438,24 +442,28 @@ def build_tests(test_dir, clazz, prefix='test_maven2_parse_', check_pom=True, re class TestMavenDataDrivenParsePom(BaseMavenCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + build_tests(test_dir='maven_misc/parse', clazz=TestMavenDataDrivenParsePom, prefix='test_maven2_parse_', check_pom=True, regen=False) class TestMavenDataDrivenParsePomBasic(BaseMavenCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + build_tests(test_dir='maven2', clazz=TestMavenDataDrivenParsePomBasic, prefix='test_maven2_basic_parse_', check_pom=True, regen=False) class TestMavenDataDrivenCreatePackageBasic(BaseMavenCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + build_tests(test_dir='maven2', clazz=TestMavenDataDrivenCreatePackageBasic, prefix='test_maven2_basic_package_', check_pom=False, regen=False) class TestMavenDataDrivenParsePomComprehensive(BaseMavenCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + # note: we use short dir names to deal with Windows long paths limitations build_tests(test_dir='m2', clazz=TestMavenDataDrivenParsePomComprehensive, prefix='test_maven2_parse', check_pom=True, regen=False) @@ -463,6 +471,7 @@ class TestMavenDataDrivenParsePomComprehensive(BaseMavenCase): class TestMavenDataDrivenCreatePackageComprehensive(BaseMavenCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + # note: we use short dir names to deal with Windows long paths limitations build_tests(test_dir='m2', clazz=TestMavenDataDrivenCreatePackageComprehensive, prefix='test_maven2_package', check_pom=False, regen=False) diff --git a/tests/packagedcode/test_nuget.py b/tests/packagedcode/test_nuget.py index 8d78c72783e..52c4681c0f0 100644 --- a/tests/packagedcode/test_nuget.py +++ b/tests/packagedcode/test_nuget.py @@ -22,14 +22,14 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function +from collections import OrderedDict import os.path from commoncode.testcase import FileBasedTesting - from packagedcode import nuget -from collections import OrderedDict class TestNuget(FileBasedTesting): @@ -138,5 +138,4 @@ def test_parse_creates_package_from_nuspec(self): ('legal_file_locations', []), ('license_expression', None), ('license_texts', []), ('notice_texts', []), ('dependencies', {}), ('related_packages', [])]) - assert expected == package.to_dict() diff --git a/tests/packagedcode/test_package_utils.py b/tests/packagedcode/test_package_utils.py index 34dd02a3473..ff1d5731f90 100644 --- a/tests/packagedcode/test_package_utils.py +++ b/tests/packagedcode/test_package_utils.py @@ -101,7 +101,7 @@ def test_parse_repo_url_13(self): test = 'git@gitlab.com:foo/private.git' expected = 'https://gitlab.com/foo/private.git' assert expected == parse_repo_url(test) - + def test_parse_git_repo_url_without_slash_slash(self): test = 'git@github.com/Filirom1/npm2aur.git' expected = 'https://github.com/Filirom1/npm2aur.git' diff --git a/tests/packagedcode/test_pypi.py b/tests/packagedcode/test_pypi.py index 4df781123f4..fbb4a3bd660 100644 --- a/tests/packagedcode/test_pypi.py +++ b/tests/packagedcode/test_pypi.py @@ -28,7 +28,6 @@ import os.path import shutil - from commoncode.testcase import FileBasedTesting from packagedcode import pypi diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 5e25376a36a..da05c1c72bd 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -47,25 +47,22 @@ from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import run_scan_plain - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - """ -Some of these CLI tests are dependent on py.test monkeypatch to ensure -we are testing the actual command outputs as if using a real command -line call. Some are using a subprocess to the same effect. +Most of these tests spawn new process as if launched from the command line. Some +of these CLI tests are dependent on py.test monkeypatch to ensure we are testing +the actual command outputs as if using a real command line call. Some are using +a plain subprocess to the same effect. """ def test_package_option_detects_packages(monkeypatch): test_dir = test_env.get_test_loc('package', copy=True) result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--package', test_dir, '--json', result_file], monkeypatch) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--package', test_dir, '--json', result_file] + run_scan_click(args, monkeypatch=monkeypatch) assert os.path.exists(result_file) result = open(result_file).read() assert 'package.json' in result @@ -74,10 +71,8 @@ def test_package_option_detects_packages(monkeypatch): def test_verbose_option_with_packages(monkeypatch): test_dir = test_env.get_test_loc('package', copy=True) result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--package', '--verbose', test_dir, '--json', result_file], monkeypatch) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--package', '--verbose', test_dir, '--json', result_file] + result = run_scan_click(args, monkeypatch=monkeypatch) assert 'package.json' in result.output assert os.path.exists(result_file) result = open(result_file).read() @@ -87,10 +82,7 @@ def test_verbose_option_with_packages(monkeypatch): def test_copyright_option_detects_copyrights(): test_dir = test_env.get_test_loc('copyright', copy=True) result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--copyright', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--copyright', test_dir, '--json', result_file]) assert os.path.exists(result_file) assert len(open(result_file).read()) > 10 @@ -98,10 +90,8 @@ def test_copyright_option_detects_copyrights(): def test_verbose_option_with_copyrights(monkeypatch): test_dir = test_env.get_test_loc('copyright', copy=True) result_file = test_env.get_temp_file('json') - result = run_scan_click(['--copyright', '--verbose', test_dir, '--json', result_file], monkeypatch) - - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--copyright', '--verbose', test_dir, '--json', result_file] + result = run_scan_click(args, monkeypatch=monkeypatch) assert os.path.exists(result_file) assert 'copyright_acme_c-c.c' in result.output assert len(open(result_file).read()) > 10 @@ -110,13 +100,10 @@ def test_verbose_option_with_copyrights(monkeypatch): def test_license_option_detects_licenses(): test_dir = test_env.get_test_loc('license', copy=True) result_file = test_env.get_temp_file('json') - args = ['--license', test_dir, '--json', result_file] if on_windows: args += ['--timeout', '400'] - result = run_scan_click(args) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(args) assert os.path.exists(result_file) assert len(open(result_file).read()) > 10 @@ -127,12 +114,12 @@ def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): # this was showing up on Windows assert 'scancode-script.py' not in result.output - result = run_scan_click([]) + result = run_scan_click([], expected_rc=2) assert 'Usage: scancode [OPTIONS]' in result.output # this was showing up on Windows assert 'scancode-script.py' not in result.output - result = run_scan_click(['-xyz']) + result = run_scan_click(['-xyz'], expected_rc=2) # this was showing up on Windows assert 'scancode-script.py' not in result.output @@ -140,30 +127,23 @@ def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): def test_scan_info_does_collect_infos(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--info', '--strip-root', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--info', '--strip-root', test_dir, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('info/basic.expected.json'), result_file) def test_scan_info_does_collect_infos_with_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--info', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--info', test_dir, '--json', result_file]) check_json_scan(test_env.get_test_loc('info/basic.rooted.expected.json'), result_file) def test_scan_info_returns_full_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--full-root', test_dir, '--json', result_file]) - - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--info', '--full-root', test_dir, '--json', result_file] + run_scan_click(args) result_data = json.loads(open(result_file, 'rb').read()) file_paths = [f['path'] for f in result_data['files']] assert 12 == len(file_paths) @@ -174,10 +154,8 @@ def test_scan_info_returns_full_root(): def test_scan_info_returns_correct_full_root_with_single_file(): test_file = test_env.get_test_loc('info/basic.tgz') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--full-root', test_file, '--json', result_file]) - - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--info', '--full-root', test_file, '--json', result_file] + run_scan_click(args) result_data = json.loads(open(result_file, 'rb').read()) files = result_data['files'] # we have a single file @@ -190,80 +168,65 @@ def test_scan_info_returns_correct_full_root_with_single_file(): def test_scan_info_returns_does_not_strip_root_with_single_file(): test_file = test_env.get_test_loc('single/iproute.c') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--info', '--strip-root', test_file, '--json', result_file]) - assert result.exit_code == 0 + args = ['--info', '--strip-root', test_file, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('single/iproute.expected.json'), result_file, strip_dates=True) def test_scan_info_license_copyrights(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--info', '--license', '--copyright', '--strip-root', test_dir, '--json', result_file]) - assert 'Scanning done' in result.output + args = ['--info', '--license', '--copyright', '--strip-root', test_dir, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('info/all.expected.json'), result_file) - assert result.exit_code == 0 def test_scan_license_with_url_template(): test_dir = test_env.get_test_loc('plugin_license/license_url', copy=True) result_file = test_env.get_temp_file('json') - - result = run_scan_click( - ['--license', '--license-url-template', 'https://example.com/urn:{}', - test_dir, '--json-pp', result_file]) - + args = ['--license', '--license-url-template', 'https://example.com/urn:{}', + test_dir, '--json-pp', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('plugin_license/license_url.expected.json'), result_file) - assert result.exit_code == 0 def test_scan_noinfo_license_copyrights_with_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--email', '--url', '--license', '--copyright', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--email', '--url', '--license', '--copyright', test_dir, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('info/all.rooted.expected.json'), result_file) def test_scan_email_url_info(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--email', '--url', '--info', '--strip-root', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--email', '--url', '--info', '--strip-root', test_dir, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc('info/email_url_info.expected.json'), result_file) def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_errors_and_keep_trucking_with_json(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - args = ['--copyright', '--strip-root', test_file, '--json', result_file] if on_windows: args += ['--timeout', '400'] - result = run_scan_click(args) - assert result.exit_code == 1 - assert 'Scanning done' in result.output + result = run_scan_click(args, expected_rc=1) check_json_scan(test_env.get_test_loc('failing/patchelf.expected.json'), result_file) assert 'Some files failed to scan' in result.output assert 'patchelf.pdf' in result.output + def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - args = ['--copyright', test_file, '--json', result_file] if on_windows: args += ['--timeout', '400'] - result = run_scan_click(args) - assert result.exit_code == 1 - assert 'Scanning done' in result.output + result = run_scan_click(args, expected_rc=1) assert 'Some files failed to scan' in result.output assert 'patchelf.pdf' in result.output - result_json = json.loads(open(result_file).read()) expected = 'error: unpack requires a string argument of length 8' assert expected in result_json['files'][0]['scan_errors'][-1] @@ -273,28 +236,22 @@ def test_scan_with_errors_always_includes_full_traceback(): def test_failing_scan_return_proper_exit_code(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') - - result = run_scan_click([ '--copyright', test_file, '--json', result_file]) - assert result.exit_code == 1 + args = ['--copyright', test_file, '--json', result_file] + run_scan_click(args, expected_rc=1) def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_errors_and_keep_trucking_with_html(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.html') - - result = run_scan_click([ '--copyright', test_file , '--output-html', result_file]) - print(result.output) - assert 'Scanning done' in result.output - assert result.exit_code == 1 + args = ['--copyright', test_file, '--output-html', result_file] + run_scan_click(args, expected_rc=1) def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_errors_and_keep_trucking_with_html_app(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.app.html') - - result = run_scan_click([ '--copyright', test_file, '--output-html-app', result_file]) - assert result.exit_code == 1 - assert 'Scanning done' in result.output + args = ['--copyright', test_file, '--output-html-app', result_file] + run_scan_click(args, expected_rc=1) def test_scan_works_with_multiple_processes(): @@ -302,12 +259,12 @@ def test_scan_works_with_multiple_processes(): # run the same scan with one or three processes result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) - assert result1.exit_code == 0 + args = ['--copyright', '--processes', '1', test_dir, '--json', result_file_1] + run_scan_click(args) result_file_3 = test_env.get_temp_file('json') - result3 = run_scan_click([ '--copyright', '--processes', '3', test_dir, '--json', result_file_3]) - assert result3.exit_code == 0 + args = ['--copyright', '--processes', '3', test_dir, '--json', result_file_3] + run_scan_click(args) res1 = json.loads(open(result_file_1).read()) res3 = json.loads(open(result_file_3).read()) assert sorted(res1['files']) == sorted(res3['files']) @@ -318,13 +275,13 @@ def test_scan_works_with_no_processes_in_threaded_mode(): # run the same scan with zero or one process result_file_0 = test_env.get_temp_file('json') - result0 = run_scan_click([ '--copyright', '--processes', '0', test_dir, '--json', result_file_0]) - assert result0.exit_code == 0 + args = ['--copyright', '--processes', '0', test_dir, '--json', result_file_0] + result0 = run_scan_click(args) assert 'Disabling multi-processing' in result0.output result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) - assert result1.exit_code == 0 + args = ['--copyright', '--processes', '1', test_dir, '--json', result_file_1] + run_scan_click(args) res0 = json.loads(open(result_file_0).read()) res1 = json.loads(open(result_file_1).read()) assert sorted(res0['files']) == sorted(res1['files']) @@ -335,17 +292,18 @@ def test_scan_works_with_no_processes_non_threaded_mode(): # run the same scan with zero or one process result_file_0 = test_env.get_temp_file('json') - result0 = run_scan_click([ '--copyright', '--processes', '-1', test_dir, '--json', result_file_0]) - assert result0.exit_code == 0 + args = ['--copyright', '--processes', '-1', test_dir, '--json', result_file_0] + result0 = run_scan_click(args) assert 'Disabling multi-processing and multi-threading' in result0.output result_file_1 = test_env.get_temp_file('json') - result1 = run_scan_click([ '--copyright', '--processes', '1', test_dir, '--json', result_file_1]) - assert result1.exit_code == 0 + args = ['--copyright', '--processes', '1', test_dir, '--json', result_file_1] + run_scan_click(args) res0 = json.loads(open(result_file_0).read()) res1 = json.loads(open(result_file_1).read()) assert sorted(res0['files']) == sorted(res1['files']) + def test_scan_works_with_multiple_processes_and_timeouts(): # this contains test files with a lot of copyrights that should # take more thant timeout to scan @@ -355,18 +313,15 @@ def test_scan_works_with_multiple_processes_and_timeouts(): import time, random for tf in fileutils.resource_iter(test_dir, with_dirs=False): with open(tf, 'ab') as tfh: - tfh.write('(c)' + str(time.time()) + repr([random.randint(0, 10 ** 6) for _ in range(10000)]) + '(c)') + tfh.write( + '(c)' + str(time.time()) + repr([random.randint(0, 10 ** 6) for _ in range(10000)]) + '(c)') result_file = test_env.get_temp_file('json') - result = run_scan_click( - [ '--copyright', '--processes', '2', - '--timeout', '0.000001', - '--strip-root', test_dir, '--json', result_file], - ) + args = ['--copyright', '--processes', '2', '--timeout', '0.000001', + '--strip-root', test_dir, '--json', result_file] + run_scan_click(args, expected_rc=1) - assert result.exit_code == 1 - assert 'Scanning done' in result.output expected = [ [(u'path', u'test1.txt'), (u'scan_errors', @@ -397,14 +352,9 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): test_dir = fsencode(test_dir) result_file = fsencode(result_file) - args = ['--info', '--license', '--copyright', - '--package', '--email', '--url', '--strip-root', - test_dir , '--json', result_file] - result = run_scan_click(args) - if result.exit_code != 0: - raise Exception(result.output, args) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['--info', '--license', '--copyright', '--package', '--email', + '--url', '--strip-root', test_dir , '--json', result_file] + run_scan_click(args) # the paths for each OS end up encoded differently. # See for details: @@ -433,44 +383,35 @@ def test_scan_does_not_fail_when_scanning_unicode_test_files_from_express(): test_dir = test_env.extract_test_tar_raw(b'unicode_fixtures.tar.gz') test_dir = fsencode(test_dir) - args = ['-n0', '--info', '--license', '--copyright', - '--package', '--email', '--url', '--strip-root', '--json', '-', - test_dir] - result = run_scan_click(args) - if result.exit_code != 0: - raise Exception(result.output, args) - assert 'Scanning done' in result.output + args = ['-n0', '--info', '--license', '--copyright', '--package', '--email', + '--url', '--strip-root', '--json', '-', test_dir] + run_scan_click(args) def test_scan_can_handle_licenses_with_unicode_metadata(): test_dir = test_env.get_test_loc('license_with_unicode_meta') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--license', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--license', test_dir, '--json', result_file]) def test_scan_quiet_to_file_does_not_echo_anything(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--quiet', '--info', test_dir, '--json', result_file]) + args = ['--quiet', '--info', test_dir, '--json', result_file] + result = run_scan_click(args) assert not result.output - assert result.exit_code == 0 def test_scan_quiet_to_stdout_only_echoes_json_results(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') - - result_to_file = run_scan_click(['--quiet', '--info', test_dir, '--json-pp', result_file]) - assert result_to_file.exit_code == 0 + args = ['--quiet', '--info', test_dir, '--json-pp', result_file] + result_to_file = run_scan_click(args) assert not result_to_file.output # also test with an output of JSON to stdout - result_to_stdout = run_scan_click(['--quiet', '--info', test_dir, '--json-pp', '-']) - assert result_to_stdout.exit_code == 0 + args = ['--quiet', '--info', test_dir, '--json-pp', '-'] + result_to_stdout = run_scan_click(args) # outputs to file or stdout should be identical result1_output = open(result_file).read() @@ -479,9 +420,8 @@ def test_scan_quiet_to_stdout_only_echoes_json_results(): def test_scan_verbose_to_stdout_does_not_echo_ansi_escapes(): test_dir = test_env.extract_test_tar('info/basic.tgz') - - result = run_scan_click(['--verbose', '--info', test_dir, '--json', '-']) - assert result.exit_code == 0 + args = ['--verbose', '--info', test_dir, '--json', '-'] + result = run_scan_click(args) assert '[?' not in result.output @@ -489,9 +429,8 @@ def test_scan_can_return_matched_license_text(): test_file = test_env.get_test_loc('license_text/test.txt') expected_file = test_env.get_test_loc('license_text/test.expected') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['--license', '--license-text', '--strip-root', test_file, '--json', result_file]) - assert result.exit_code == 0 + args = ['--license', '--license-text', '--strip-root', test_file, '--json', result_file] + run_scan_click(args) check_json_scan(test_env.get_test_loc(expected_file), result_file) @@ -499,11 +438,9 @@ def test_scan_can_return_matched_license_text(): def test_scan_can_handle_weird_file_names(): test_dir = test_env.extract_test_tar('weird_file_name/weird_file_name.tar.gz') result_file = test_env.get_temp_file('json') - - result = run_scan_click(['-c', '-i', '--strip-root', test_dir, '--json', result_file]) - assert result.exit_code == 0 + args = ['-c', '-i', '--strip-root', test_dir, '--json', result_file] + result = run_scan_click(args) assert "KeyError: 'sha1'" not in result.output - assert 'Scanning done' in result.output # Some info vary on each OS # See https://github.com/nexB/scancode-toolkit/issues/438 for details @@ -524,9 +461,8 @@ def test_scan_can_handle_non_utf8_file_names_on_posix(): test_dir = fsencode(test_dir) result_file = fsencode(result_file) - result = run_scan_click(['-i', '--strip-root', test_dir, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + args = ['-i', '--strip-root', test_dir, '--json', result_file] + run_scan_click(args) # the paths for each OS end up encoded differently. # See for details: @@ -548,18 +484,8 @@ def test_scan_can_run_from_other_directory(): expected_file = test_env.get_test_loc('altpath/copyright.expected.json') result_file = test_env.get_temp_file('json') work_dir = os.path.dirname(result_file) - - rc, stdout, stderr = run_scan_plain( - ['-ci', '--strip-root', test_file, '--json', result_file], cwd=work_dir) - - if rc != 0: - print() - print('stdout:') - print(stdout) - print() - print('stderr:') - print(stderr) - assert rc == 0 + args = ['-ci', '--strip-root', test_file, '--json', result_file] + run_scan_plain(args, cwd=work_dir) check_json_scan(test_env.get_test_loc(expected_file), result_file, strip_dates=True) @@ -568,8 +494,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr(): args = ['-pi', '-n', '0', test_file, '--json', '-'] if on_windows: args += ['--timeout', '400'] - rc, stdout, stderr = run_scan_plain(args) - assert rc == 1 + _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout assert "Expecting ':' delimiter: line 5 column 12 (char 143)" not in stderr @@ -580,8 +505,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing( args = ['-pi', '-n', '2', test_file, '--json', '-'] if on_windows: args += ['--timeout', '400'] - rc, stdout, stderr = run_scan_plain(args) - assert rc == 1 + _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout assert "Expecting ':' delimiter: line 5 column 12 (char 143)" not in stderr @@ -592,8 +516,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose(): args = ['-pi', '--verbose', '-n', '0', test_file, '--json', '-'] if on_windows: args += ['--timeout', '400'] - rc, stdout, stderr = run_scan_plain(args) - assert rc == 1 + _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout assert 'delimiter: line 5 column 12' in stderr @@ -605,18 +528,18 @@ def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): args = ['-pi', '--verbose', '-n', '2', test_file, '--json', '-'] if on_windows: args += ['--timeout', '400'] - rc, stdout, stderr = run_scan_plain(args) - assert rc == 1 + _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout assert 'delimiter: line 5 column 12' in stderr assert 'ValueError: Expecting' in stdout + def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') - rc, stdout, stderr = run_scan_plain(['--copyright', test_dir, '--json', result_file]) - assert rc == 0 + args = ['--copyright', test_dir, '--json', result_file] + _rc, stdout, stderr = run_scan_plain(args) expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' @@ -631,8 +554,8 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names_plain(): def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): test_dir = test_env.get_test_loc('long_file_name') result_file = test_env.get_temp_file('json') - result = run_scan_click(['--copyright', test_dir, '--json', result_file], monkeypatch) - assert result.exit_code == 0 + args = ['--copyright', test_dir, '--json', result_file] + result = run_scan_click(args, monkeypatch=monkeypatch) if on_windows: expected1 = 'Scanned: 0123456789012345678901234567890123456789.c' expected2 = 'Scanned: abcdefghijklmnopqrt...0123456789012345678' @@ -648,13 +571,12 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): assert expected2 in result.output assert expected3 not in result.output + def test_scan_does_scan_php_composer(): test_file = test_env.get_test_loc('composer/composer.json') expected_file = test_env.get_test_loc('composer/composer.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file) @@ -662,9 +584,7 @@ def test_scan_does_scan_rpm(): test_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm') expected_file = test_env.get_test_loc('rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--package', test_file, '--json', result_file]) - assert result.exit_code == 0 - assert 'Scanning done' in result.output + run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, regen=False) @@ -679,15 +599,15 @@ def test_scan_cli_help(regen=False): def test_scan_errors_out_with_unknown_option(): test_file = test_env.get_test_loc('license_text/test.txt') - result = run_scan_click([ '--json--info', test_file]) - assert result.exit_code == 2 + args = ['--json--info', test_file] + result = run_scan_click(args, expected_rc=2) assert 'Error: no such option: --json--info' in result.output def test_scan_to_json_without_FILE_does_not_write_to_next_option(): test_file = test_env.get_test_loc('license_text/test.txt') - result = run_scan_click([ '--json', '--info', test_file]) - assert result.exit_code == 2 + args = ['--json', '--info', test_file] + result = run_scan_click(args, expected_rc=2) assert ('Error: Invalid value for "--json": Illegal file name ' 'conflicting with an option name: --info.') in result.output @@ -695,8 +615,8 @@ def test_scan_to_json_without_FILE_does_not_write_to_next_option(): def test_scan_errors_out_with_conflicting_root_options(): test_file = test_env.get_test_loc('license_text/test.txt') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--strip-root', '--full-root', '--json', result_file, '--info', test_file]) - assert result.exit_code == 2 + args = ['--strip-root', '--full-root', '--json', result_file, '--info', test_file] + result = run_scan_click(args, expected_rc=2) assert ('Error: The option --strip-root cannot be used together with the ' '--full-root option(s) and --full-root is used.') in result.output @@ -704,57 +624,44 @@ def test_scan_errors_out_with_conflicting_root_options(): def test_scan_errors_out_with_conflicting_verbosity_options(): test_file = test_env.get_test_loc('license_text/test.txt') result_file = test_env.get_temp_file('results.json') - result = run_scan_click(['--quiet', '--verbose', '--json', result_file, '--info', test_file]) - assert result.exit_code == 2 - print(result.output) + args = ['--quiet', '--verbose', '--json', result_file, '--info', test_file] + result = run_scan_click(args, expected_rc=2) assert ('Error: The option --quiet cannot be used together with the ' '--verbose option(s) and --verbose is used. You can set only one of ' 'these options at a time.') in result.output -def test_scan_with_timing_json(): +def test_scan_with_timing_json_return_timings_for_each_scanner(): test_dir = test_env.extract_test_tar('timing/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click( - ['--email', '--url', '--license', '--copyright', '--info', '--package', - '--timing', '--json', result_file, test_dir, ]) - - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + args = ['--email', '--url', '--license', '--copyright', '--info', + '--package', '--timing', '--json', result_file, test_dir] + run_scan_click(args) file_results = load_json_result(result_file)['files'] - expected_scanners = set( - ['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) + expected = set(['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) for res in file_results: scan_timings = res['scan_timings'] assert scan_timings for scanner, timing in scan_timings.items(): - assert scanner in expected_scanners + assert scanner in expected assert timing -def test_scan_with_timing_jsonpp(): +def test_scan_with_timing_jsonpp_return_timings_for_each_scanner(): test_dir = test_env.extract_test_tar('timing/basic.tgz') result_file = test_env.get_temp_file('json') - - result = run_scan_click( - ['--email', '--url', '--license', '--copyright', '--info', '--package', - '--timing', '--json-pp', result_file, test_dir, ]) - - assert result.exit_code == 0 - assert 'Scanning done' in result.output - + args = ['--email', '--url', '--license', '--copyright', '--info', + '--package', '--timing', '--json-pp', result_file, test_dir] + run_scan_click(args) file_results = load_json_result(result_file)['files'] - expected_scanners = set( - ['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) + expected = set(['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) for res in file_results: scan_timings = res['scan_timings'] assert scan_timings for scanner, timing in scan_timings.items(): - assert scanner in expected_scanners + assert scanner in expected assert timing diff --git a/tests/scancode/test_extract_cli.py b/tests/scancode/test_extract_cli.py index 5b0ffca8154..fff78697554 100644 --- a/tests/scancode/test_extract_cli.py +++ b/tests/scancode/test_extract_cli.py @@ -33,17 +33,17 @@ from click.testing import CliRunner from commoncode.fileutils import as_posixpath +from commoncode.fileutils import fsencode from commoncode.fileutils import resource_iter from commoncode.testcase import FileDrivenTesting +from commoncode.system import on_linux from commoncode.system import on_windows from scancode import extract_cli -from commoncode.system import on_linux -from commoncode.fileutils import fsencode + test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - """ These CLI tests are dependent on py.test monkeypatch to ensure we are testing the actual command outputs as if using a TTY or not. @@ -51,6 +51,7 @@ EMPTY_STRING = b'' if on_linux else '' + def test_extractcode_command_can_take_an_empty_directory(monkeypatch): test_dir = test_env.get_temp_dir() monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True) @@ -68,11 +69,6 @@ def test_extractcode_command_does_extract_verbose(monkeypatch): result = runner.invoke(extract_cli.extractcode, ['--verbose', test_dir]) assert result.exit_code == 1 assert os.path.exists(os.path.join(test_dir, 'some.tar.gz-extract')) - print() - print(result.output) - print() - print(repr(result.output)) - print() expected = [ 'Extracting archives...', 'some.tar.gz', diff --git a/tests/scancode/test_interrupt.py b/tests/scancode/test_interrupt.py index 738195ab51b..615318fb22f 100644 --- a/tests/scancode/test_interrupt.py +++ b/tests/scancode/test_interrupt.py @@ -28,8 +28,8 @@ from __future__ import unicode_literals import os -import threading from time import sleep +import threading from commoncode.testcase import FileBasedTesting @@ -40,10 +40,10 @@ verify there is no thread leak. """ + class TestInterrupt(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') - def test_interruptible_can_run_function(self): before = threading.active_count() diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 474a9a62fcd..0729e44b9de 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -23,7 +23,7 @@ # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import -from __future__ import unicode_literals +from __future__ import print_function from os.path import dirname from os.path import join @@ -137,10 +137,8 @@ class TestScanPluginIgnoreFiles(FileDrivenTesting): def test_scancode_ignore_vcs_files_and_dirs_by_default(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', test_dir, - '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should # be listed @@ -151,11 +149,8 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default(self): def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): test_dir = self.extract_test_tar('plugin_ignore/vcs.tgz') result_file = self.get_temp_file('json') - result = run_scan_click(['--copyright', '--strip-root', - '--processes', '0', - test_dir, - '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--processes', '0', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) # a single test.tst file and its directory that is not a VCS file should # be listed @@ -166,11 +161,8 @@ def test_scancode_ignore_vcs_files_and_dirs_by_default_no_multiprocess(self): def test_scancode_ignore_single_file(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click( - ['--copyright', '--strip-root', '--ignore', 'sample.doc', - test_dir, '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--ignore', 'sample.doc', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) assert 3 == scan_result['files_count'] # FIXME: add assert 3 == scan_result['dirs_count'] @@ -188,11 +180,8 @@ def test_scancode_ignore_single_file(self): def test_scancode_ignore_multiple_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', - '--ignore', 'ignore.doc', test_dir, - '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--ignore', 'ignore.doc', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] @@ -207,11 +196,8 @@ def test_scancode_ignore_multiple_files(self): def test_scancode_ignore_glob_files(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', - '--ignore', '*.doc', test_dir, - '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--ignore', '*.doc', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) assert 1 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] @@ -226,19 +212,16 @@ def test_scancode_ignore_glob_files(self): def test_scancode_ignore_glob_path(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', - '--ignore', '*/src/test/*', test_dir, - '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--ignore', '*/src/test/*', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) assert 2 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] expected = [ - u'user', - u'user/ignore.doc', - u'user/src', - u'user/src/ignore.doc', + u'user', + u'user/ignore.doc', + u'user/src', + u'user/src/ignore.doc', u'user/src/test' ] assert expected == scan_locs @@ -246,12 +229,8 @@ def test_scancode_ignore_glob_path(self): def test_scancode_multiple_ignores(self): test_dir = self.extract_test_tar('plugin_ignore/user.tgz') result_file = self.get_temp_file('json') - - result = run_scan_click(['--copyright', '--strip-root', - '--ignore', '*/src/test', - '--ignore', '*.doc', - test_dir, '--json', result_file]) - assert result.exit_code == 0 + args = ['--copyright', '--strip-root', '--ignore', '*/src/test', '--ignore', '*.doc', test_dir, '--json', result_file] + run_scan_click(args) scan_result = load_json_result(result_file) assert 0 == scan_result['files_count'] scan_locs = [x['path'] for x in scan_result['files']] diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py index 3a33e156c68..b087da45869 100644 --- a/tests/scancode/test_plugin_mark_source.py +++ b/tests/scancode/test_plugin_mark_source.py @@ -52,14 +52,12 @@ def test_scan_mark_source_without_info(self): test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/without_info.expected.json') - - _result = run_scan_click(['--mark-source', test_dir, '--json', result_file]) + run_scan_click(['--mark-source', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, regen=False) def test_scan_mark_source_with_info(self): test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_mark_source/with_info.expected.json') - - _result = run_scan_click(['--info', '--mark-source', test_dir, '--json', result_file]) + run_scan_click(['--info', '--mark-source', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file) diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index 453e530fb7b..86181f02821 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -60,9 +60,5 @@ def test_scan_only_findings(self): test_dir = self.extract_test_tar('plugin_only_findings/basic.tgz') result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_only_findings/expected.json') - - result= run_scan_click(['-clip','--only-findings','--json', result_file, test_dir]) - print(result.output) - assert result.exit_code == 0 - + run_scan_click(['-clip', '--only-findings', '--json', result_file, test_dir]) check_json_scan(expected_file, result_file, strip_dates=True) diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index f12c004ec16..c0b62347cca 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -160,7 +160,7 @@ def test_compute_counts_filtered_all(self): for res in codebase.get_resources(None): res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) - expected = (0,0,0) + expected = (0, 0, 0) assert expected == results def test_compute_counts_filtered_all_with_cache(self): @@ -169,7 +169,7 @@ def test_compute_counts_filtered_all_with_cache(self): for res in codebase.get_resources(None): res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) - expected = (0,0,0) + expected = (0, 0, 0) assert expected == results def test_compute_counts_filtered_files(self): @@ -340,7 +340,8 @@ def test_get_resources(self): ('this', True), ] - assert expected == [(r.name, r.is_file) for r in codebase.get_resources([0,1,3,6])] + assert expected == [(r.name, r.is_file) for r in codebase.get_resources([0, 1, 3, 6])] + class TestCodebaseCache(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') diff --git a/tests/scancode/test_scan_utils.py b/tests/scancode/test_scan_utils.py index 6d9171df852..4fc08206587 100644 --- a/tests/scancode/test_scan_utils.py +++ b/tests/scancode/test_scan_utils.py @@ -45,6 +45,7 @@ class TestUtils(FileDrivenTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_click_progressbar_with_labels(self): + # test related to https://github.com/mitsuhiko/click/issues/406 @click.command() def mycli(): @@ -129,6 +130,7 @@ class TestHelpGroups(FileDrivenTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_scan_help_group_and_sort_order_without_custom_class(self): + @click.command(name='scan', cls=ScanCommand) @click.option('--opt', is_flag=True, help='Help text for option') def scan(opt): @@ -140,8 +142,8 @@ def scan(opt): assert MISC_GROUP in result.output assert '--opt Help text for option' in result.output - def test_scan_help_group_and_sort_order_with_custom_class(self): + @click.command(name='scan', cls=ScanCommand) @click.option('--opt', is_flag=True, sort_order=10, help='Help text for option', cls=CommandLineOption) @@ -155,6 +157,7 @@ def scan(opt): def test_scan_help_with_group(self): from scancode import CORE_GROUP + @click.command(name='scan', cls=ScanCommand) @click.option('--opt', is_flag=True, help='Help text for option', help_group=CORE_GROUP, cls=CommandLineOption) diff --git a/tests/textcode/test_pdf.py b/tests/textcode/test_pdf.py index d06895dcf01..2d22392a3af 100644 --- a/tests/textcode/test_pdf.py +++ b/tests/textcode/test_pdf.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2015 nexB Inc. and others. All rights reserved. +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. @@ -22,13 +22,15 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. -from __future__ import absolute_import, print_function +from __future__ import absolute_import +from __future__ import print_function +import os from commoncode.testcase import FileBasedTesting - from textcode import pdf -import os + + class TestPdf(FileBasedTesting): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') From e8d0df798bae365b992353a85418389b42519732 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 14:31:13 +0100 Subject: [PATCH 093/122] Rename test files to work on Windows * two test files were the sane case-insensitive leading to test failures on windows Signed-off-by: Philippe Ombredanne --- .../data/copyrights/{mit_danse-MIT_danse => mit_danse} | 0 .../copyrights/{mit_danse-MIT_Danse => mit_danse-mojibake} | 0 tests/cluecode/test_copyrights.py | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/cluecode/data/copyrights/{mit_danse-MIT_danse => mit_danse} (100%) rename tests/cluecode/data/copyrights/{mit_danse-MIT_Danse => mit_danse-mojibake} (100%) diff --git a/tests/cluecode/data/copyrights/mit_danse-MIT_danse b/tests/cluecode/data/copyrights/mit_danse similarity index 100% rename from tests/cluecode/data/copyrights/mit_danse-MIT_danse rename to tests/cluecode/data/copyrights/mit_danse diff --git a/tests/cluecode/data/copyrights/mit_danse-MIT_Danse b/tests/cluecode/data/copyrights/mit_danse-mojibake similarity index 100% rename from tests/cluecode/data/copyrights/mit_danse-MIT_Danse rename to tests/cluecode/data/copyrights/mit_danse-mojibake diff --git a/tests/cluecode/test_copyrights.py b/tests/cluecode/test_copyrights.py index ae43fd3e8b3..9f7bdca7700 100644 --- a/tests/cluecode/test_copyrights.py +++ b/tests/cluecode/test_copyrights.py @@ -2789,14 +2789,14 @@ def test_mit(self): check_detection(expected, test_file) def test_mit_danse(self): - test_file = self.get_test_loc('copyrights/mit_danse-MIT_danse') + test_file = self.get_test_loc('copyrights/mit_danse') expected = [ 'Copyright (c) 2009 California Institute of Technology.', ] check_detection(expected, test_file) - def test_mit_danse2(self): - test_file = self.get_test_loc('copyrights/mit_danse-MIT_Danse') + def test_mit_danse_mojibake(self): + test_file = self.get_test_loc('copyrights/mit_danse-mojibake') expected = [ 'Copyright (c) 2009 California Institute of Technology.', ] From 9981c637f51c803273b42b8ee851d17891649e6f Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 14:58:20 +0100 Subject: [PATCH 094/122] Do not use expectedFailure on XPASS tests Signed-off-by: Philippe Ombredanne --- tests/extractcode/test_archive.py | 50 ++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index f0af7176df4..6160ef0ab32 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -2351,48 +2351,76 @@ class TestExtractArchiveWithIllegalFilenamesWithPytarOnLinuxWarnings(TestExtract @skipIf(not on_mac, 'Run only on Mac because of specific test expectations.') -class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMac(ExtractArchiveWithIllegalFilenamesTestCase): - check_only_warnings = False +class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings(ExtractArchiveWithIllegalFilenamesTestCase): + check_only_warnings = True - @expectedFailure # not a problem: we use libarchive for these def test_extract_7zip_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.7z') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # not a problem: we use libarchive for these def test_extract_ar_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.ar') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # not a problem: we use libarchive for these def test_extract_cpio_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.cpio') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # This is a problem def test_extract_iso_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.iso') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # This is a problem, but unrar seems to fail the same way def test_extract_rar_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.rar') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # not a problem: we use libarchive for these def test_extract_tar_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.tar') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - @expectedFailure # not a problem: we use libarchive for these def test_extract_zip_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.zip') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') @skipIf(not on_mac, 'Run only on Mac because of specific test expectations.') -class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings(TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMac): - check_only_warnings = True +class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMac(TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings): + check_only_warnings = False + + # not a problem: we use libarchive for these + test_extract_7zip_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_7zip_with_weird_filenames_with_sevenzip) + + # not a problem: we use libarchive for these + test_extract_ar_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_ar_with_weird_filenames_with_sevenzip) + + # not a problem: we use libarchive for these + test_extract_cpio_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_cpio_with_weird_filenames_with_sevenzip) + + # This is a problem + test_extract_iso_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_iso_with_weird_filenames_with_sevenzip) + + # This is a problem, but unrar seems to fail the same way + test_extract_rar_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_rar_with_weird_filenames_with_sevenzip) + + # not a problem: we use libarchive for these + test_extract_tar_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_tar_with_weird_filenames_with_sevenzip) + + # not a problem: we use libarchive for these + test_extract_zip_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnMacWarnings + .test_extract_zip_with_weird_filenames_with_sevenzip) @skipIf(not on_mac, 'Run only on Mac because of specific test expectations.') From 352507be5956d597354ec31846841def9151f8a1 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 15:14:27 +0100 Subject: [PATCH 095/122] Remove Windows-specific test timeouts #787 Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_templated.py | 4 +--- tests/scancode/test_cli.py | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index 7f3c0c528ed..dc202c1ac00 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -33,10 +33,10 @@ from scancode_config import __version__ from commoncode import fileutils -from commoncode.system import on_windows from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click + test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -79,8 +79,6 @@ def test_scan_html_output_does_not_truncate_copyright_html(): args = ['-clip', '--strip-root', '-n', '3', test_dir, '--output-html', result_file] - if on_windows: - args += ['--timeout', '400'] run_scan_click(args) results = open(result_file).read() diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index da05c1c72bd..4a3766ce020 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -101,8 +101,6 @@ def test_license_option_detects_licenses(): test_dir = test_env.get_test_loc('license', copy=True) result_file = test_env.get_temp_file('json') args = ['--license', test_dir, '--json', result_file] - if on_windows: - args += ['--timeout', '400'] run_scan_click(args) assert os.path.exists(result_file) assert len(open(result_file).read()) > 10 @@ -210,8 +208,6 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') args = ['--copyright', '--strip-root', test_file, '--json', result_file] - if on_windows: - args += ['--timeout', '400'] result = run_scan_click(args, expected_rc=1) check_json_scan(test_env.get_test_loc('failing/patchelf.expected.json'), result_file) assert 'Some files failed to scan' in result.output @@ -222,8 +218,6 @@ def test_scan_with_errors_always_includes_full_traceback(): test_file = test_env.get_test_loc('failing/patchelf.pdf') result_file = test_env.get_temp_file('test.json') args = ['--copyright', test_file, '--json', result_file] - if on_windows: - args += ['--timeout', '400'] result = run_scan_click(args, expected_rc=1) assert 'Some files failed to scan' in result.output assert 'patchelf.pdf' in result.output @@ -492,8 +486,6 @@ def test_scan_can_run_from_other_directory(): def test_scan_logs_errors_messages_not_verbosely_on_stderr(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '-n', '0', test_file, '--json', '-'] - if on_windows: - args += ['--timeout', '400'] _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -503,8 +495,6 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr(): def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '-n', '2', test_file, '--json', '-'] - if on_windows: - args += ['--timeout', '400'] _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'Path: errors/package.json' in stderr assert "Expecting ':' delimiter: line 5 column 12 (char 143)" in stdout @@ -514,8 +504,6 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing( def test_scan_logs_errors_messages_verbosely_with_verbose(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '--verbose', '-n', '0', test_file, '--json', '-'] - if on_windows: - args += ['--timeout', '400'] _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout @@ -526,8 +514,6 @@ def test_scan_logs_errors_messages_verbosely_with_verbose(): def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing(): test_file = test_env.get_test_loc('errors', copy=True) args = ['-pi', '--verbose', '-n', '2', test_file, '--json', '-'] - if on_windows: - args += ['--timeout', '400'] _rc, stdout, stderr = run_scan_plain(args, expected_rc=1) assert 'package.json' in stderr assert 'delimiter: line 5 column 12' in stdout From 228143affd0e3845ecb5178bf64179ebb0c9a71a Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 15:40:02 +0100 Subject: [PATCH 096/122] Bump help for Windows Python version Signed-off-by: Philippe Ombredanne --- configure.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.bat b/configure.bat index 437c7d77983..8ba282a0275 100644 --- a/configure.bat +++ b/configure.bat @@ -1,6 +1,6 @@ @echo OFF -@rem Copyright (c) 2015 nexB Inc. http://www.nexb.com/ - All rights reserved. +@rem Copyright (c) 2018 nexB Inc. http://www.nexb.com/ - All rights reserved. @rem ################################ @rem # change these variables to customize this script locally @@ -44,7 +44,7 @@ if not exist "c:\python27\python.exe" ( echo Do NOT install Python v3 or any 64 bits edition. echo Instead download Python from this url and see the README.rst file for more details: echo( - echo https://www.python.org/ftp/python/2.7.10/python-2.7.10.msi + echo https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi echo( exit /b 1 ) From 93ee491f6bd4038e58b4540d38036304242e3164 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 15:50:41 +0100 Subject: [PATCH 097/122] Reset expectedFailure for Windows tests Signed-off-by: Philippe Ombredanne --- tests/extractcode/test_archive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index 6160ef0ab32..bc9a4460f8a 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -2512,7 +2512,6 @@ def test_extract_rar_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.rar') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') - # The results are not correct but not a problem: we use libarchive for these def test_extract_tar_with_weird_filenames_with_sevenzip(self): test_file = self.get_test_loc('archive/weird_names/weird_names.tar') self.check_extract(sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip') @@ -2527,6 +2526,11 @@ def test_extract_zip_with_weird_filenames_with_sevenzip(self): class TestExtractArchiveWithIllegalFilenamesWithSevenzipOnWinWarning(TestExtractArchiveWithIllegalFilenamesWithSevenzipOnWin): check_only_warnings = True + # The results are not correct but not a problem: we use libarchive for these + test_extract_7zip_with_weird_filenames_with_sevenzip = expectedFailure( + TestExtractArchiveWithIllegalFilenamesWithSevenzipOnWin + .test_extract_7zip_with_weird_filenames_with_sevenzip) + @skipIf(not on_windows, 'Run only on Windows because of specific test expectations.') class TestExtractArchiveWithIllegalFilenamesWithPytarOnWin(ExtractArchiveWithIllegalFilenamesTestCase): From 21f86a66ba20a806d7ef95bd8d7f5589cf41c745 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 15:53:01 +0100 Subject: [PATCH 098/122] Add debug print for Windows test failure Signed-off-by: Philippe Ombredanne --- tests/scancode/test_cli.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 4a3766ce020..f6ced819a89 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -546,9 +546,16 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): expected1 = 'Scanned: 0123456789012345678901234567890123456789.c' expected2 = 'Scanned: abcdefghijklmnopqrt...0123456789012345678' expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' - assert expected1 in result.output - assert expected2 in result.output - assert expected3 not in result.output + try: + assert expected1 in result.output + assert expected2 in result.output + assert expected3 not in result.output + except: + print() + print('output:') + print(result.output) + print() + raise else: expected1 = 'Scanned: abcdefghijklmnopqr...234567890123456789.c' expected2 = 'Scanned: 0123456789012345678901234567890123456789.c' From 2938852a365e44441f51485a6ccacf78164374ae Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 15:59:07 +0100 Subject: [PATCH 099/122] Avoid using multiple processes in tests #787 Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_templated.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index dc202c1ac00..9a1b2f37c45 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -36,7 +36,6 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') @@ -77,8 +76,7 @@ def test_scan_html_output_does_not_truncate_copyright_html(): test_dir = test_env.get_test_loc('templated/tree/scan/') result_file = test_env.get_temp_file('test.html') - args = ['-clip', '--strip-root', '-n', '3', test_dir, - '--output-html', result_file] + args = ['-clip', '--strip-root', '--verbose', test_dir, '--output-html', result_file] run_scan_click(args) results = open(result_file).read() From 715e39d27f7db082ed974da7a159554e2eb8946b Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 16:48:17 +0100 Subject: [PATCH 100/122] Update Windows test expectations for failures Signed-off-by: Philippe Ombredanne --- .../weird_names.7z_7zip_win.expected | 212 +++++++++--------- .../unicodepath/unicodepath.expected-win.json | 42 ++-- tests/scancode/test_cli.py | 2 +- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/tests/extractcode/data/archive/weird_names/weird_names.7z_7zip_win.expected b/tests/extractcode/data/archive/weird_names/weird_names.7z_7zip_win.expected index d803623116c..10c554f721e 100644 --- a/tests/extractcode/data/archive/weird_names/weird_names.7z_7zip_win.expected +++ b/tests/extractcode/data/archive/weird_names/weird_names.7z_7zip_win.expected @@ -1,111 +1,111 @@ [ - "/weird_names/man\\1/1.gz", - "/weird_names/man\\1/:.1.gz", - "/weird_names/man\\1/:/.1", - "/weird_names/man\\1/[.1.gz", - "/weird_names/man\\1/[/:*.1", + "/weird_names/man/1/1.gz", + "/weird_names/man/1/[.1.gz", + "/weird_names/man/1/[/__.1", + "/weird_names/man/1/_.1.gz", + "/weird_names/man/1/_/.1", "/weird_names/some 'file", - "/weird_names/some /file", "/weird_names/some file", - "/weird_names/some\"file", - "/weird_names/some/\"file", - "/weird_names/win/AUX", - "/weird_names/win/AUX.txt", - "/weird_names/win/COM1", - "/weird_names/win/COM1.txt", - "/weird_names/win/COM2", - "/weird_names/win/COM2.txt", - "/weird_names/win/COM3", - "/weird_names/win/COM3.txt", - "/weird_names/win/COM4", - "/weird_names/win/COM4.txt", - "/weird_names/win/COM5", - "/weird_names/win/COM5.txt", - "/weird_names/win/COM6", - "/weird_names/win/COM6.txt", - "/weird_names/win/COM7", - "/weird_names/win/COM7.txt", - "/weird_names/win/COM8", - "/weird_names/win/COM8.txt", - "/weird_names/win/COM9", - "/weird_names/win/COM9.txt", - "/weird_names/win/CON", - "/weird_names/win/CON.txt", - "/weird_names/win/LPT1", - "/weird_names/win/LPT1.txt", - "/weird_names/win/LPT2", - "/weird_names/win/LPT2.txt", - "/weird_names/win/LPT3", - "/weird_names/win/LPT3.txt", - "/weird_names/win/LPT4", - "/weird_names/win/LPT4.txt", - "/weird_names/win/LPT5", - "/weird_names/win/LPT5.txt", - "/weird_names/win/LPT6", - "/weird_names/win/LPT6.txt", - "/weird_names/win/LPT7", - "/weird_names/win/LPT7.txt", - "/weird_names/win/LPT8", - "/weird_names/win/LPT8.txt", - "/weird_names/win/LPT9", - "/weird_names/win/LPT9.txt", - "/weird_names/win/NUL", - "/weird_names/win/NUL.txt", - "/weird_names/win/PRN", - "/weird_names/win/PRN.txt", - "/weird_names/win/aux", - "/weird_names/win/aux.txt", - "/weird_names/win/com1", - "/weird_names/win/com1.txt", - "/weird_names/win/com2", - "/weird_names/win/com2.txt", - "/weird_names/win/com3", - "/weird_names/win/com3.txt", - "/weird_names/win/com4", - "/weird_names/win/com4.txt", - "/weird_names/win/com5", - "/weird_names/win/com5.txt", - "/weird_names/win/com6", - "/weird_names/win/com6.txt", - "/weird_names/win/com7", - "/weird_names/win/com7.txt", - "/weird_names/win/com8", - "/weird_names/win/com8.txt", - "/weird_names/win/com9", - "/weird_names/win/com9.txt", - "/weird_names/win/con", - "/weird_names/win/con.txt", - "/weird_names/win/lpt1", - "/weird_names/win/lpt1.txt", - "/weird_names/win/lpt2", - "/weird_names/win/lpt2.txt", - "/weird_names/win/lpt3", - "/weird_names/win/lpt3.txt", - "/weird_names/win/lpt4", - "/weird_names/win/lpt4.txt", - "/weird_names/win/lpt5", - "/weird_names/win/lpt5.txt", - "/weird_names/win/lpt6", - "/weird_names/win/lpt6.txt", - "/weird_names/win/lpt7", - "/weird_names/win/lpt7.txt", - "/weird_names/win/lpt8", - "/weird_names/win/lpt8.txt", - "/weird_names/win/lpt9", - "/weird_names/win/lpt9.txt", - "/weird_names/win/nul", - "/weird_names/win/nul.txt", - "/weird_names/win/prn", - "/weird_names/win/prn.txt", - "/weird_names/winchr/ab\t.t\t", - "/weird_names/winchr/ab\n.t\n", - "/weird_names/winchr/ab\r.t\r", - "/weird_names/winchr/ab\".t\"", - "/weird_names/winchr/ab*_1.t*", + "/weird_names/some/_file", + "/weird_names/some_/file", + "/weird_names/some_file", + "/weird_names/win/_AUX", + "/weird_names/win/_AUX_1.txt", + "/weird_names/win/_COM1", + "/weird_names/win/_COM1.txt", + "/weird_names/win/_COM2", + "/weird_names/win/_COM2_1.txt", + "/weird_names/win/_COM3", + "/weird_names/win/_COM3_1.txt", + "/weird_names/win/_COM4", + "/weird_names/win/_COM4.txt", + "/weird_names/win/_COM5.txt", + "/weird_names/win/_COM5_1", + "/weird_names/win/_COM6", + "/weird_names/win/_COM6.txt", + "/weird_names/win/_COM7", + "/weird_names/win/_COM7.txt", + "/weird_names/win/_COM8", + "/weird_names/win/_COM8.txt", + "/weird_names/win/_COM9", + "/weird_names/win/_COM9.txt", + "/weird_names/win/_CON_1", + "/weird_names/win/_CON_1.txt", + "/weird_names/win/_LPT1", + "/weird_names/win/_LPT1_1.txt", + "/weird_names/win/_LPT2", + "/weird_names/win/_LPT2_1.txt", + "/weird_names/win/_LPT3_1", + "/weird_names/win/_LPT3_1.txt", + "/weird_names/win/_LPT4_1", + "/weird_names/win/_LPT4_1.txt", + "/weird_names/win/_LPT5_1", + "/weird_names/win/_LPT5_1.txt", + "/weird_names/win/_LPT6.txt", + "/weird_names/win/_LPT6_1", + "/weird_names/win/_LPT7", + "/weird_names/win/_LPT7.txt", + "/weird_names/win/_LPT8", + "/weird_names/win/_LPT8.txt", + "/weird_names/win/_LPT9", + "/weird_names/win/_LPT9.txt", + "/weird_names/win/_NUL.txt", + "/weird_names/win/_NUL_1", + "/weird_names/win/_PRN.txt", + "/weird_names/win/_PRN_1", + "/weird_names/win/_aux.txt", + "/weird_names/win/_aux_1", + "/weird_names/win/_com1_1", + "/weird_names/win/_com1_1.txt", + "/weird_names/win/_com2.txt", + "/weird_names/win/_com2_1", + "/weird_names/win/_com3.txt", + "/weird_names/win/_com3_1", + "/weird_names/win/_com4_1", + "/weird_names/win/_com4_1.txt", + "/weird_names/win/_com5", + "/weird_names/win/_com5_1.txt", + "/weird_names/win/_com6_1", + "/weird_names/win/_com6_1.txt", + "/weird_names/win/_com7_1", + "/weird_names/win/_com7_1.txt", + "/weird_names/win/_com8_1", + "/weird_names/win/_com8_1.txt", + "/weird_names/win/_com9_1", + "/weird_names/win/_com9_1.txt", + "/weird_names/win/_con", + "/weird_names/win/_con.txt", + "/weird_names/win/_lpt1.txt", + "/weird_names/win/_lpt1_1", + "/weird_names/win/_lpt2.txt", + "/weird_names/win/_lpt2_1", + "/weird_names/win/_lpt3", + "/weird_names/win/_lpt3.txt", + "/weird_names/win/_lpt4", + "/weird_names/win/_lpt4.txt", + "/weird_names/win/_lpt5", + "/weird_names/win/_lpt5.txt", + "/weird_names/win/_lpt6", + "/weird_names/win/_lpt6_1.txt", + "/weird_names/win/_lpt7_1", + "/weird_names/win/_lpt7_1.txt", + "/weird_names/win/_lpt8_1", + "/weird_names/win/_lpt8_1.txt", + "/weird_names/win/_lpt9_1", + "/weird_names/win/_lpt9_1.txt", + "/weird_names/win/_nul", + "/weird_names/win/_nul_1.txt", + "/weird_names/win/_prn", + "/weird_names/win/_prn_1.txt", "/weird_names/winchr/ab/.t", - "/weird_names/winchr/ab:.t:", - "/weird_names/winchr/ab<.t<", - "/weird_names/winchr/ab>.t>", - "/weird_names/winchr/ab?_2.t?", - "/weird_names/winchr/ab|.t|" + "/weird_names/winchr/ab_.t_", + "/weird_names/winchr/ab__1.t_", + "/weird_names/winchr/ab__2.t_", + "/weird_names/winchr/ab__3.t_", + "/weird_names/winchr/ab__4.t_", + "/weird_names/winchr/ab__5.t_", + "/weird_names/winchr/ab__6.t_", + "/weird_names/winchr/ab__7.t_", + "/weird_names/winchr/ab__8.t_", + "/weird_names/winchr/ab__9.t_" ] \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index a26b6f2f782..2a1ea769eaf 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -42,19 +42,19 @@ "urls": [] }, { - "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "path": "unicodepath/-\u00bf\u00df+\u00c7G\u00ee\u00bf", "type": "file", - "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", - "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", - "extension": ".pdf", - "size": 2, - "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", - "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "name": "-\u00bf\u00df+\u00c7G\u00ee\u00bf", + "base_name": "-\u00bf\u00df+\u00c7G\u00ee\u00bf", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, "size_count": 0, "mime_type": "text/plain", - "file_type": "ASCII text", + "file_type": "ASCII text, with no line terminators", "programming_language": null, "is_binary": false, "is_text": true, @@ -64,16 +64,16 @@ "is_script": false, "scan_errors": [], "licenses": [], - "copyrights": [], + "copyrights": [],0 "packages": [], "emails": [], "urls": [] }, { - "path": "unicodepath/\u03e8\u1f40\u2328", + "path": "unicodepath/-\u00bf\u00df+\u00c7G\u00ee\u00bfa", "type": "file", - "name": "\u03e8\u1f40\u2328", - "base_name": "\u03e8\u1f40\u2328", + "name": "-\u00bf\u00df+\u00c7G\u00ee\u00bfa", + "base_name": "-\u00bf\u00df+\u00c7G\u00ee\u00bfa", "extension": "", "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", @@ -98,19 +98,19 @@ "urls": [] }, { - "path": "unicodepath/\u03e8\u1f40\u2328a", + "path": "unicodepath/Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma.pdf", "type": "file", - "name": "\u03e8\u1f40\u2328a", - "base_name": "\u03e8\u1f40\u2328a", - "extension": "", - "size": 9, - "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", - "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "name": "Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", "files_count": 0, "dirs_count": 0, "size_count": 0, "mime_type": "text/plain", - "file_type": "ASCII text, with no line terminators", + "file_type": "ASCII text", "programming_language": null, "is_binary": false, "is_text": true, @@ -126,4 +126,4 @@ "urls": [] } ] -} +} \ No newline at end of file diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index f6ced819a89..34ecbc24cd5 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -548,7 +548,7 @@ def test_scan_progress_display_is_not_damaged_with_long_file_names(monkeypatch): expected3 = 'abcdefghijklmnopqrtu0123456789012345678901234567890123456789abcdefghijklmnopqrtu0123456789012345678901234567890123456789.c' try: assert expected1 in result.output - assert expected2 in result.output + assert expected2 not in result.output assert expected3 not in result.output except: print() From cf278a8e16912c0b6d888985b5d9edfbc6ad3349 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 16:54:37 +0100 Subject: [PATCH 101/122] Fix typoe in docstring Signed-off-by: Philippe Ombredanne --- src/plugincode/scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py index 1a79a051c17..a11a265b2ae 100644 --- a/src/plugincode/scan.py +++ b/src/plugincode/scan.py @@ -42,7 +42,7 @@ class ScanPlugin(BasePlugin): """ A scan plugin base class that all scan plugins must extend. A scan plugin provides a single `get_scanner()` method that returns a scanner function. - The key under which scan results are retruned for a scanner is the plugin + The key under which scan results are returned for a scanner is the plugin "name" attribute. This attribute is set automatically as the "entrypoint" name used for this plugin. """ From f66a1fdc61ada54428cb6cd3495efc543dcc5e4e Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 17:41:44 +0100 Subject: [PATCH 102/122] Ensure some failing tests run verbosely Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_templated.py | 2 +- tests/scancode/test_cli.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index 9a1b2f37c45..824bbaad508 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -76,7 +76,7 @@ def test_scan_html_output_does_not_truncate_copyright_html(): test_dir = test_env.get_test_loc('templated/tree/scan/') result_file = test_env.get_temp_file('test.html') - args = ['-clip', '--strip-root', '--verbose', test_dir, '--output-html', result_file] + args = ['-clip', '--strip-root', '--verbose', test_dir, '--output-html', result_file, '--verbose'] run_scan_click(args) results = open(result_file).read() diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 34ecbc24cd5..c4c224edc7c 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -100,7 +100,7 @@ def test_verbose_option_with_copyrights(monkeypatch): def test_license_option_detects_licenses(): test_dir = test_env.get_test_loc('license', copy=True) result_file = test_env.get_temp_file('json') - args = ['--license', test_dir, '--json', result_file] + args = ['--license', test_dir, '--json', result_file, '--verbose'] run_scan_click(args) assert os.path.exists(result_file) assert len(open(result_file).read()) > 10 @@ -347,7 +347,7 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): result_file = fsencode(result_file) args = ['--info', '--license', '--copyright', '--package', '--email', - '--url', '--strip-root', test_dir , '--json', result_file] + '--url', '--strip-root', test_dir , '--json', result_file, '--verbose'] run_scan_click(args) # the paths for each OS end up encoded differently. From 74797bca1e4eb3d80b75b092ff4aa06fe8f40b62 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 17:42:06 +0100 Subject: [PATCH 103/122] Fix Windows unicode path test expectations Signed-off-by: Philippe Ombredanne --- .../unicodepath/unicodepath.expected-win.json | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index 2a1ea769eaf..ed205e707c1 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -42,19 +42,19 @@ "urls": [] }, { - "path": "unicodepath/-\u00bf\u00df+\u00c7G\u00ee\u00bf", + "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", "type": "file", - "name": "-\u00bf\u00df+\u00c7G\u00ee\u00bf", - "base_name": "-\u00bf\u00df+\u00c7G\u00ee\u00bf", - "extension": "", - "size": 9, - "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", - "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", "files_count": 0, "dirs_count": 0, "size_count": 0, "mime_type": "text/plain", - "file_type": "ASCII text, with no line terminators", + "file_type": "ASCII text", "programming_language": null, "is_binary": false, "is_text": true, @@ -64,16 +64,16 @@ "is_script": false, "scan_errors": [], "licenses": [], - "copyrights": [],0 + "copyrights": [], "packages": [], "emails": [], "urls": [] }, { - "path": "unicodepath/-\u00bf\u00df+\u00c7G\u00ee\u00bfa", + "path": "unicodepath/\u03e8\u1f40\u2328", "type": "file", - "name": "-\u00bf\u00df+\u00c7G\u00ee\u00bfa", - "base_name": "-\u00bf\u00df+\u00c7G\u00ee\u00bfa", + "name": "\u03e8\u1f40\u2328", + "base_name": "\u03e8\u1f40\u2328", "extension": "", "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", @@ -98,19 +98,19 @@ "urls": [] }, { - "path": "unicodepath/Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma.pdf", + "path": "unicodepath/\u03e8\u1f40\u2328a", "type": "file", - "name": "Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma.pdf", - "base_name": "Izgradnja sufiksnog polja kori+\u00edtenjem K+\u00f1rkk+\u00f1inen G\u00c7\u00f4 Sandersovog algoritma", - "extension": ".pdf", - "size": 2, - "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", - "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "name": "\u03e8\u1f40\u2328a", + "base_name": "\u03e8\u1f40\u2328a", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", "files_count": 0, "dirs_count": 0, "size_count": 0, "mime_type": "text/plain", - "file_type": "ASCII text", + "file_type": "ASCII text, with no line terminators", "programming_language": null, "is_binary": false, "is_text": true, From 1a4284b03376b01c4672a58b56cdad3b797be148 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 18:13:04 +0100 Subject: [PATCH 104/122] Fix tracing output Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index c66d1e343c8..c7168d608c0 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -891,7 +891,7 @@ def run_plugins(ctx, stage, plugins, codebase, kwargs, quiet, verbose, if TRACE_DEEP: from pprint import pformat logger_debug('run_plugins: kwargs passed to %(stage)s:%(name)s' % locals()) - logger_debug(pformat(sorted(kwargs.item()))) + logger_debug(pformat(sorted(kwargs.items()))) logger_debug() plugin.process_codebase(codebase, **kwargs) From 0ad11fea0f71948c5b20e949825152ede09764ea Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 18:32:48 +0100 Subject: [PATCH 105/122] Re-enable license cache warmup * this was disabled by a rogue return statement Signed-off-by: Philippe Ombredanne --- src/licensedcode/cache.py | 13 ++++++++----- src/scancode/plugin_license.py | 7 +++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index 31a207b9464..873ba344bbd 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -53,7 +53,8 @@ _LICENSES_INDEX = None -def get_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE): +def get_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE, + return_value=True): """ Return and eventually cache an index built from an iterable of rules. Build the index from the built-in rules dataset. @@ -61,7 +62,8 @@ def get_index(cache_dir=scancode_cache_dir, check_consistency=SCANCODE_DEV_MODE) global _LICENSES_INDEX if not _LICENSES_INDEX: _LICENSES_INDEX = get_cached_index(cache_dir, check_consistency) - return _LICENSES_INDEX + if return_value: + return _LICENSES_INDEX # global in-memory cache of a mapping of key -> license instance @@ -163,13 +165,14 @@ def load_index(cache_file): from licensedcode.index import LicenseIndex with open(cache_file, 'rb') as ifc: # Note: weird but read() + loads() is much (twice++???) faster than load() - idx = LicenseIndex.loads(ifc.read()) - return idx + return LicenseIndex.loads(ifc.read()) _ignored_from_hash = partial( ignore.is_ignored, - ignores={'*.pyc': 'pyc files', '*~': 'temp gedit files', '*.swp': 'vi swap files'}, + ignores={'*.pyc': 'pyc files', + '*~': 'temp gedit files', + '*.swp': 'vi swap files'}, unignores={} ) diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index e9ef08deede..fb953df8d26 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -103,10 +103,13 @@ def is_enabled(self, license, **kwargs): # NOQA return license def setup(self, cache_dir, **kwargs): - return + """ + This is a cache warmup such that child process inherit from this. + """ from scancode_config import SCANCODE_DEV_MODE from licensedcode.cache import get_index - get_index(cache_dir, check_consistency=SCANCODE_DEV_MODE) + get_index(cache_dir, check_consistency=SCANCODE_DEV_MODE, + return_value=False) def get_scanner(self, license_score=0, license_text=False, license_url_template=DEJACODE_LICENSE_URL, From 403e80c6bf0505727c5c2567ad7939f89094af89 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 26 Jan 2018 18:36:52 +0100 Subject: [PATCH 106/122] Remove unused plugin test mode code Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 3 --- src/scancode/cli.py | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 50a9f51a76f..6a1351996fc 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -64,9 +64,6 @@ class BasePlugin(object): # Subclasses must not set this. name = None - # set to True for testing - _test_mode = False - def __init__(self, *args, **kwargs): """ Initialize a new plugin with a user kwargs. diff --git a/src/scancode/cli.py b/src/scancode/cli.py index c7168d608c0..63030357d59 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -612,8 +612,6 @@ def scancode(ctx, input, # NOQA try: plugin = plugin_cls(**kwargs) if plugin.is_enabled(**kwargs): - # Set special test mode flag that plugins can leverage - plugin._test_mode = test_mode stage_plugins[name] = plugin except: msg = 'ERROR: failed to load plugin: %(stage)s:%(name)s:' % locals() From 877c03e5fd54e099102253e73d0100c1f7407dd7 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sat, 27 Jan 2018 00:04:24 +0100 Subject: [PATCH 107/122] Correct bug in display of non-ascii progressbar * force the display of non-ASCII unicode paths to be ASCII * add new tests for scans of non-ASCII unicode paths with quiet and verbose progress Signed-off-by: Philippe Ombredanne --- src/scancode/utils.py | 4 +- .../unicodepath.expected-linux.json--quiet | 130 +++++++++++++++++ .../unicodepath.expected-linux.json--verbose | 130 +++++++++++++++++ .../unicodepath.expected-mac.json--quiet | 133 ++++++++++++++++++ .../unicodepath.expected-mac.json--verbose | 133 ++++++++++++++++++ .../unicodepath.expected-win.json--quiet | 130 +++++++++++++++++ .../unicodepath.expected-win.json--verbose | 130 +++++++++++++++++ tests/scancode/test_cli.py | 31 +++- 8 files changed, 813 insertions(+), 8 deletions(-) create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet create mode 100644 tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose diff --git a/src/scancode/utils.py b/src/scancode/utils.py index 621236f14b1..b9e76b79eec 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -36,6 +36,8 @@ from commoncode.fileutils import file_name from commoncode.fileutils import fsdecode from commoncode.fileutils import splitext +from commoncode.text import toascii + # Python 2 and 3 support try: @@ -232,7 +234,7 @@ def path_progress_message(item, verbose=False, prefix='Scanned: '): return '' location = item[0] errors = item[2] - location = fsdecode(location) + location = unicode(toascii(location)) progress_line = location if not verbose: max_file_name_len = file_name_max_len() diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet new file mode 100644 index 00000000000..09e60ff2009 --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet @@ -0,0 +1,130 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--quiet": true, + "--strip-root": true, + "--url": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328", + "type": "file", + "name": "\u03e8\u1f40\u2328", + "base_name": "\u03e8\u1f40\u2328", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328a", + "type": "file", + "name": "\u03e8\u1f40\u2328a", + "base_name": "\u03e8\u1f40\u2328a", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose new file mode 100644 index 00000000000..749e6d3e4ea --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose @@ -0,0 +1,130 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--strip-root": true, + "--url": true, + "--verbose": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328", + "type": "file", + "name": "\u03e8\u1f40\u2328", + "base_name": "\u03e8\u1f40\u2328", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328a", + "type": "file", + "name": "\u03e8\u1f40\u2328a", + "base_name": "\u03e8\u1f40\u2328a", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet new file mode 100644 index 00000000000..3ccd9d9f2a8 --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet @@ -0,0 +1,133 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--quiet": true, + "--strip-root": true, + "--url": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u03bf\u0313\u2328", + "type": "file", + "name": "\u03e8\u03bf\u0313\u2328", + "base_name": "\u03e8\u03bf\u0313\u2328", + "extension": "", + "date": "2016-12-05", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u03bf\u0313\u2328a", + "type": "file", + "name": "\u03e8\u03bf\u0313\u2328a", + "base_name": "\u03e8\u03bf\u0313\u2328a", + "extension": "", + "date": "2016-12-05", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "date": "2016-12-05", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose new file mode 100644 index 00000000000..4c9354fb8b7 --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose @@ -0,0 +1,133 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--strip-root": true, + "--url": true, + "--verbose": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u03bf\u0313\u2328", + "type": "file", + "name": "\u03e8\u03bf\u0313\u2328", + "base_name": "\u03e8\u03bf\u0313\u2328", + "extension": "", + "date": "2016-12-05", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u03bf\u0313\u2328a", + "type": "file", + "name": "\u03e8\u03bf\u0313\u2328a", + "base_name": "\u03e8\u03bf\u0313\u2328a", + "extension": "", + "date": "2016-12-05", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "date": "2016-12-05", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet new file mode 100644 index 00000000000..09e60ff2009 --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet @@ -0,0 +1,130 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--quiet": true, + "--strip-root": true, + "--url": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328", + "type": "file", + "name": "\u03e8\u1f40\u2328", + "base_name": "\u03e8\u1f40\u2328", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328a", + "type": "file", + "name": "\u03e8\u1f40\u2328a", + "base_name": "\u03e8\u1f40\u2328a", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose new file mode 100644 index 00000000000..749e6d3e4ea --- /dev/null +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose @@ -0,0 +1,130 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--copyright": true, + "--email": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true, + "--strip-root": true, + "--url": true, + "--verbose": true + }, + "files_count": 3, + "files": [ + { + "path": "unicodepath", + "type": "directory", + "name": "unicodepath", + "base_name": "unicodepath", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "type": "file", + "name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", + "base_name": "Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma", + "extension": ".pdf", + "size": 2, + "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", + "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328", + "type": "file", + "name": "\u03e8\u1f40\u2328", + "base_name": "\u03e8\u1f40\u2328", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + }, + { + "path": "unicodepath/\u03e8\u1f40\u2328a", + "type": "file", + "name": "\u03e8\u1f40\u2328a", + "base_name": "\u03e8\u1f40\u2328a", + "extension": "", + "size": 9, + "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", + "md5": "552e21cd4cd9918678e3c1a0df491bc3", + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "scan_errors": [], + "licenses": [], + "copyrights": [], + "packages": [], + "emails": [], + "urls": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index c4c224edc7c..ec7416e35db 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -338,7 +338,7 @@ def test_scan_works_with_multiple_processes_and_timeouts(): assert sorted(expected) == sorted(x.items() for x in result_json['files']) -def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): +def check_scan_does_not_fail_when_scanning_unicode_files_and_paths(verbosity): test_dir = test_env.get_test_loc(u'unicodepath/uc') result_file = test_env.get_temp_file('json') @@ -346,9 +346,10 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): test_dir = fsencode(test_dir) result_file = fsencode(result_file) - args = ['--info', '--license', '--copyright', '--package', '--email', - '--url', '--strip-root', test_dir , '--json', result_file, '--verbose'] - run_scan_click(args) + args = ['--info', '--license', '--copyright', '--package', + '--email', '--url', '--strip-root', test_dir , '--json', + result_file] + ([verbosity] if verbosity else []) + results = run_scan_click(args) # the paths for each OS end up encoded differently. # See for details: @@ -356,13 +357,29 @@ def test_scan_does_not_fail_when_scanning_unicode_files_and_paths(): # https://github.com/nexB/scancode-toolkit/issues/688 if on_linux: - expected = 'unicodepath/unicodepath.expected-linux.json' + expected = 'unicodepath/unicodepath.expected-linux.json' + verbosity elif on_mac: - expected = 'unicodepath/unicodepath.expected-mac.json' + expected = 'unicodepath/unicodepath.expected-mac.json' + verbosity elif on_windows: - expected = 'unicodepath/unicodepath.expected-win.json' + expected = 'unicodepath/unicodepath.expected-win.json' + verbosity check_json_scan(test_env.get_test_loc(expected), result_file, strip_dates=True) + return results + + +def test_scan_does_not_fail_when_scanning_unicode_files_and_paths_default(): + result = check_scan_does_not_fail_when_scanning_unicode_files_and_paths('') + assert result.output + + +def test_scan_does_not_fail_when_scanning_unicode_files_and_paths_verbose(): + result = check_scan_does_not_fail_when_scanning_unicode_files_and_paths('--verbose') + assert result.output + + +def test_scan_does_not_fail_when_scanning_unicode_files_and_paths_quiet(): + result = check_scan_does_not_fail_when_scanning_unicode_files_and_paths('--quiet') + assert not result.output @skipIf(on_windows, 'Python tar cannot extract these files on Windows') From cec427d7c46e6c46dc513d3165d0cff10998a9fb Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 19:30:25 +0100 Subject: [PATCH 108/122] Allow scan attributes to be direct Resource attributes #787 * all plugins are now required to declare which attributes they add to the scan as a list of attr attributes as declare the sort order in which these should appear on the scan results * To suppprt these plugin-contributed scan attributes, a new Resource subclass is created on the fly based on plugin provided attributes * Since Scanners functions return the actual attributes that are set directty on the Resource oject, the API has been updated accordingly. Scanner functions now return a mapping. * the whole Resource caching system has been updated: resources are either entirely in memory or entirely serialized on disk for caching. The new --max-in-memory option sets how many Resources are kept in RAM, default to 10K. * codebases are no longer cached in a ugly globals * only pre-scan plugins can defined a set of "requires" scans that are executed in a scan stage before the "pre-scan" (a tad of an ugly name). * no option is used as a default anymoe: all options need to be set explicitly (such as mark-source needing info) * codebase.remove_resource can now remove resource during a walk safely * info is now a proper scanner and is no longer super special * the plugin entrypoint name is NOT used anymore as the primary key for scan results attribute of a scan * cli.run_scanners is a new function to encapsulate the scanner runs Signed-off-by: Philippe Ombredanne --- .gitignore | 1 + etc/scripts/testdata/livescan/expected.csv | 8 +- setup.py | 1 + src/formattedcode/output_json.py | 5 +- src/formattedcode/output_spdx.py | 18 +- src/plugincode/__init__.py | 103 +- src/plugincode/output.py | 11 +- src/plugincode/output_filter.py | 2 +- src/plugincode/pre_scan.py | 56 +- src/plugincode/scan.py | 35 +- src/scancode/__init__.py | 2 +- src/scancode/api.py | 82 +- src/scancode/cli.py | 494 +-- src/scancode/plugin_copyright.py | 5 + src/scancode/plugin_email.py | 4 + src/scancode/plugin_ignore.py | 21 +- src/scancode/plugin_info.py | 76 + src/scancode/plugin_license.py | 5 + src/scancode/plugin_mark_source.py | 34 +- src/scancode/plugin_only_findings.py | 22 +- src/scancode/plugin_package.py | 5 + src/scancode/plugin_url.py | 5 + src/scancode/resource.py | 1021 +++--- src/scancode/utils.py | 2 - .../data/csv/livescan/expected.csv | 12 +- .../data/json/simple-expected.json | 20 +- .../data/json/simple-expected.jsonlines | 12 +- .../data/json/simple-expected.jsonpp | 20 +- .../data/json/tree/expected.json | 80 +- tests/formattedcode/test_output_jsonlines.py | 9 +- tests/formattedcode/test_output_templated.py | 4 +- .../data/altpath/copyright.expected.json | 10 +- .../data/composer/composer.expected.json | 4 +- .../data/failing/patchelf.expected.json | 4 +- tests/scancode/data/help/help.txt | 61 +- tests/scancode/data/info/all.expected.json | 132 +- .../data/info/all.rooted.expected.json | 48 +- tests/scancode/data/info/basic.expected.json | 88 +- .../data/info/basic.rooted.expected.json | 96 +- .../data/info/email_url_info.expected.json | 132 +- .../scancode/data/license_text/test.expected | 4 +- .../data/non_utf8/expected-linux.json | 152 +- .../plugin_license/license_url.expected.json | 8 +- .../with_info.expected.json | 144 +- .../without_info.expected.json | 396 --- .../plugin_only_findings/errors.expected.json | 39 + .../errors/illegal.pom.xml | 21 + .../plugin_only_findings/errors/origin.ABOUT | 3 + .../plugin_only_findings/errors/package.json | 96 + .../data/plugin_only_findings/expected.json | 30 +- .../plugin_only_findings/info.expected.json | 11 + .../data/resource/samples/JGroups/EULA | 109 + .../data/resource/samples/JGroups/LICENSE | 504 +++ .../samples/JGroups/licenses/apache-1.1.txt | 58 + .../samples/JGroups/licenses/apache-2.0.txt | 202 ++ .../samples/JGroups/licenses/bouncycastle.txt | 18 + .../samples/JGroups/licenses/cpl-1.0.txt | 213 ++ .../samples/JGroups/licenses/lgpl.txt | 504 +++ .../JGroups/src/FixedMembershipToken.java | 150 + .../samples/JGroups/src/GuardedBy.java | 23 + .../JGroups/src/ImmutableReference.java | 55 + .../samples/JGroups/src/RATE_LIMITER.java | 120 + .../samples/JGroups/src/RouterStub.java | 295 ++ .../JGroups/src/RouterStubManager.java | 213 ++ .../resource/samples/JGroups/src/S3_PING.java | 3025 +++++++++++++++++ tests/scancode/data/resource/samples/README | 4 + .../data/resource/samples/arch/zlib.tar.gz | Bin 0 -> 28103 bytes .../data/resource/samples/screenshot.png | Bin 0 -> 622754 bytes .../data/resource/samples/zlib/ada/zlib.ads | 328 ++ .../data/resource/samples/zlib/adler32.c | 179 + .../data/resource/samples/zlib/deflate.c | 1967 +++++++++++ .../data/resource/samples/zlib/deflate.h | 346 ++ .../samples/zlib/dotzlib/AssemblyInfo.cs | 58 + .../samples/zlib/dotzlib/ChecksumImpl.cs | 202 ++ .../samples/zlib/dotzlib/LICENSE_1_0.txt | 23 + .../resource/samples/zlib/dotzlib/readme.txt | 58 + .../samples/zlib/gcc_gvmat64/gvmat64.S | 574 ++++ .../resource/samples/zlib/infback9/infback9.c | 615 ++++ .../resource/samples/zlib/infback9/infback9.h | 37 + .../resource/samples/zlib/iostream2/zstream.h | 307 ++ .../samples/zlib/iostream2/zstream_test.cpp | 25 + .../data/resource/samples/zlib/zlib.h | 1768 ++++++++++ .../data/resource/samples/zlib/zutil.c | 324 ++ .../data/resource/samples/zlib/zutil.h | 253 ++ ...-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json | 4 +- .../data/single/iproute.expected.json | 6 +- .../unicodepath.expected-linux.json | 40 +- .../unicodepath.expected-linux.json--quiet | 40 +- .../unicodepath.expected-linux.json--verbose | 40 +- .../unicodepath/unicodepath.expected-mac.json | 40 +- .../unicodepath.expected-mac.json--quiet | 40 +- .../unicodepath.expected-mac.json--verbose | 40 +- .../unicodepath/unicodepath.expected-win.json | 40 +- .../unicodepath.expected-win.json--quiet | 40 +- .../unicodepath.expected-win.json--verbose | 40 +- .../data/weird_file_name/expected-linux.json | 64 +- .../data/weird_file_name/expected-mac.json | 60 +- .../data/weird_file_name/expected-win.json | 60 +- tests/scancode/test_api.py | 55 +- tests/scancode/test_cli.py | 49 +- tests/scancode/test_extract_cli.py | 1 - tests/scancode/test_plugin_ignore.py | 5 +- tests/scancode/test_plugin_mark_source.py | 7 +- tests/scancode/test_plugin_only_findings.py | 34 +- tests/scancode/test_resource.py | 332 +- 105 files changed, 14918 insertions(+), 2330 deletions(-) create mode 100644 src/scancode/plugin_info.py delete mode 100644 tests/scancode/data/plugin_mark_source/without_info.expected.json create mode 100644 tests/scancode/data/plugin_only_findings/errors.expected.json create mode 100644 tests/scancode/data/plugin_only_findings/errors/illegal.pom.xml create mode 100644 tests/scancode/data/plugin_only_findings/errors/origin.ABOUT create mode 100644 tests/scancode/data/plugin_only_findings/errors/package.json create mode 100644 tests/scancode/data/plugin_only_findings/info.expected.json create mode 100644 tests/scancode/data/resource/samples/JGroups/EULA create mode 100644 tests/scancode/data/resource/samples/JGroups/LICENSE create mode 100644 tests/scancode/data/resource/samples/JGroups/licenses/apache-1.1.txt create mode 100644 tests/scancode/data/resource/samples/JGroups/licenses/apache-2.0.txt create mode 100644 tests/scancode/data/resource/samples/JGroups/licenses/bouncycastle.txt create mode 100644 tests/scancode/data/resource/samples/JGroups/licenses/cpl-1.0.txt create mode 100644 tests/scancode/data/resource/samples/JGroups/licenses/lgpl.txt create mode 100644 tests/scancode/data/resource/samples/JGroups/src/FixedMembershipToken.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/GuardedBy.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/ImmutableReference.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/RATE_LIMITER.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/RouterStub.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/RouterStubManager.java create mode 100644 tests/scancode/data/resource/samples/JGroups/src/S3_PING.java create mode 100644 tests/scancode/data/resource/samples/README create mode 100644 tests/scancode/data/resource/samples/arch/zlib.tar.gz create mode 100644 tests/scancode/data/resource/samples/screenshot.png create mode 100644 tests/scancode/data/resource/samples/zlib/ada/zlib.ads create mode 100644 tests/scancode/data/resource/samples/zlib/adler32.c create mode 100644 tests/scancode/data/resource/samples/zlib/deflate.c create mode 100644 tests/scancode/data/resource/samples/zlib/deflate.h create mode 100644 tests/scancode/data/resource/samples/zlib/dotzlib/AssemblyInfo.cs create mode 100644 tests/scancode/data/resource/samples/zlib/dotzlib/ChecksumImpl.cs create mode 100644 tests/scancode/data/resource/samples/zlib/dotzlib/LICENSE_1_0.txt create mode 100644 tests/scancode/data/resource/samples/zlib/dotzlib/readme.txt create mode 100644 tests/scancode/data/resource/samples/zlib/gcc_gvmat64/gvmat64.S create mode 100644 tests/scancode/data/resource/samples/zlib/infback9/infback9.c create mode 100644 tests/scancode/data/resource/samples/zlib/infback9/infback9.h create mode 100644 tests/scancode/data/resource/samples/zlib/iostream2/zstream.h create mode 100644 tests/scancode/data/resource/samples/zlib/iostream2/zstream_test.cpp create mode 100644 tests/scancode/data/resource/samples/zlib/zlib.h create mode 100644 tests/scancode/data/resource/samples/zlib/zutil.c create mode 100644 tests/scancode/data/resource/samples/zlib/zutil.h diff --git a/.gitignore b/.gitignore index 8d35930fb9f..a39bc6d78ee 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ docs/_build # pyenv /.python-version +/man/ diff --git a/etc/scripts/testdata/livescan/expected.csv b/etc/scripts/testdata/livescan/expected.csv index 12a85b45888..6950b3d7305 100644 --- a/etc/scripts/testdata/livescan/expected.csv +++ b/etc/scripts/testdata/livescan/expected.csv @@ -1,5 +1,5 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,size_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1599,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,0,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,1599,2017-10-03,6cfb0bd0fb0b784f57164d15bdfca2b734ad87a6,f18e519b77bc7f3e4213215033db3857,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,98.45,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,scancode-acknowledgment,98.45,ScanCode acknowledgment,Permissive,nexB,https://github.com/nexB/scancode-toolkit/,,https://enterprise.dejacode.com/urn/urn:dje:license:scancode-acknowledgment,,,5,24,apache-2.0_scancode.RULE,False,"[u'apache-2.0', u'scancode-acknowledgment']",,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, @@ -7,9 +7,9 @@ Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,file,license,license,,679,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2200,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, diff --git a/setup.py b/setup.py index 8c98901422c..4ccbc0ec9ff 100644 --- a/setup.py +++ b/setup.py @@ -224,6 +224,7 @@ def read(*names, **kwargs): # # See also plugincode.scan module for details and doc. 'scancode_scan': [ + 'info = scancode.plugin_info:InfoScanner', 'licenses = scancode.plugin_license:LicenseScanner', 'copyrights = scancode.plugin_copyright:CopyrightScanner', 'packages = scancode.plugin_package:PackageScanner', diff --git a/src/formattedcode/output_json.py b/src/formattedcode/output_json.py index f168c854543..23751d107de 100644 --- a/src/formattedcode/output_json.py +++ b/src/formattedcode/output_json.py @@ -110,10 +110,9 @@ def write_json(results, output_file, files_count, kwargs = dict(iterable_as_array=True, encoding='utf-8') if pretty: - kwargs['indent'] = 2 * b' ' + kwargs.update(dict(indent=2 * b' ')) else: - kwargs['separators'] = (b',', b':',) + kwargs.update(dict(separators=(b',', b':',))) - # FIXME: Why do we wrap the output in unicode? Test output when we do not wrap the output in unicode output_file.write(simplejson.dumps(scan, **kwargs)) output_file.write(b'\n') diff --git a/src/formattedcode/output_spdx.py b/src/formattedcode/output_spdx.py index 3ec2770f5d0..e910116e17d 100644 --- a/src/formattedcode/output_spdx.py +++ b/src/formattedcode/output_spdx.py @@ -91,19 +91,17 @@ def logger_debug(*args): @output_impl class SpdxTvOutput(OutputPlugin): - needs_info = True - options = [ CommandLineOption(('--output-spdx-tv',), type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output as SPDX Tag/Value to FILE. ' - 'Implies running the --info scan.', + requires=['info'], + help='Write scan output as SPDX Tag/Value to FILE.', help_group=OUTPUT_GROUP) ] - def is_enabled(self, output_spdx_tv, **kwargs): - return output_spdx_tv + def is_enabled(self, output_spdx_tv, info, **kwargs): + return output_spdx_tv and info def process_codebase(self, codebase, input, # NOQA @@ -122,13 +120,13 @@ class SpdxRdfOutput(OutputPlugin): CommandLineOption(('--output-spdx-rdf',), type=FileOptionType(mode='wb', lazy=False), metavar='FILE', - help='Write scan output as SPDX RDF to FILE. ' - 'Implies running the --info scan.', + requires=['info'], + help='Write scan output as SPDX RDF to FILE.', help_group=OUTPUT_GROUP) ] - def is_enabled(self, output_spdx_rdf, **kwargs): - return output_spdx_rdf + def is_enabled(self, output_spdx_rdf, info, **kwargs): + return output_spdx_rdf and info def process_codebase(self, codebase, input, # NOQA diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index 6a1351996fc..f5757b6b81b 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -39,11 +39,6 @@ class BasePlugin(object): """ A base class for all ScanCode plugins. """ - # List of stage:name strings that this plugin requires to run before it - # runs. - # Subclasses should set this as needed - requires = [] - # List of CommandLineOption CLI options for this plugin. # Subclasses should set this as needed options = [] @@ -64,6 +59,17 @@ class BasePlugin(object): # Subclasses must not set this. name = None + # An ordered mapping of attr attributes that specifies the data returned by + # this plugin. These attributes will be added to a Resource subclass. The + # position of these attributes in the returned serialized data is determined + # by the sort_order then the plugin name + attributes = OrderedDict() + + # a relative sort order number (integer or float). In scan results, results + # from scanners are sorted by this sorted_order then by "keys". + # This is also used in the CLI UI to sort the SCAN_GROUP option help group. + sort_order = 100 + def __init__(self, *args, **kwargs): """ Initialize a new plugin with a user kwargs. @@ -113,71 +119,11 @@ def get_option(self, name): """ return self.options_by_name.get(name) - def is_active(self, plugins, *args, **kwargs): - """ - Return True is this plugin is enabled meaning it is enabled and all its - required plugins are enabled. - """ - return (self.is_enabled() - and all(p.is_enabled() for p in self.requirements(plugins))) - - def requirements(self, plugins, resolved=None): - """ - Return a tuple of (original list of `plugins` arg, as-is, list of unique - required plugins by this plugin recursively) given a `plugins` list of all - plugins and an optional list of already `resolved` plugins. - - Raise an Exception if there are inconsistencies in the plugins graph, - such as self-referencing plugins, missing plugins or requirements - cycles. - """ - if resolved is None: - resolved = [] - - qname = self.qname - required_qnames = unique(qn for qn in self.requires if qn != qname) - plugins_by_qname = {p.qname: p for p in plugins} - resolved_by_qname = {p.qname: p for p in resolved} - - direct_requirements = [] - for required_qname in self.requires: - - if required_qname == self.name: - raise Exception( - 'Plugin %(qname)r cannot require itself.' % locals()) - - if required_qname not in plugins_by_qname: - raise Exception( - 'Missing required plugin %(required_qname)r ' - 'for plugin %(qname)r.' % locals()) - - if required_qname in resolved_by_qname: - # already satisfied - continue - - required = plugins_by_qname[required_qname] - direct_requirements.append(required) - resolved.append(required) - - for required in direct_requirements: - plugins, resolved = required.walk_requirements(plugins, resolved) - - if self in resolved: - req_chain = ' -> '.join(p.qname for p in resolved) - raise Exception( - 'Requirements for plugin %(qname)r are circular: ' - '%(req_chain)s.' % locals()) - - return plugins, resolved - class CodebasePlugin(BasePlugin): """ Base class for plugins that process a whole codebase at once. """ - # flag set to True if this plugin needs file information available to run. - # Subclasses should set this as needed. - needs_info = False def process_codebase(self, codebase, **kwargs): """ @@ -188,20 +134,6 @@ def process_codebase(self, codebase, **kwargs): raise NotImplementedError -def unique(iterable): - """ - Return a sequence of unique items in `iterable` keeping their original order. - """ - seen = set() - uni = [] - for item in iterable: - if item in seen: - continue - uni.append(item) - seen.add(item) - return uni - - class PluginManager(object): """ A PluginManager class for plugins. @@ -212,9 +144,9 @@ class PluginManager(object): def __init__(self, stage, module_qname, entrypoint, plugin_base_class): """ - Initialize this manager for the `stage` string in - module `module_qname` with plugins loaded from the setuptools - `entrypoint` that must subclass `plugin_base_class`. + Initialize this plugin manager for the `stage` specified in the fully + qualified Python module name `module_qname` with plugins loaded from the + setuptools `entrypoint` that must subclass `plugin_base_class`. """ self.manager = PluggyPluginManager(project_name=stage) self.managers[stage] = self @@ -232,7 +164,7 @@ def __init__(self, stage, module_qname, entrypoint, plugin_base_class): self.plugin_classes = OrderedDict() @classmethod - def setup_all(cls): + def load_plugins(cls): """ Setup the plugins enviroment. Must be called once to initialize all the plugins of all managers. @@ -266,14 +198,14 @@ def setup(self): for name, plugin_class in self.manager.list_name_plugin(): if not issubclass(plugin_class, self.plugin_base_class): - qname = '%(entrypoint)s:%(name)s' % locals() + qname = '%(stage)s:%(name)s' % locals() raise Exception( 'Invalid plugin: %(qname)r: %(plugin_class)r ' 'must extend %(plugin_base_class)r.' % locals()) for option in plugin_class.options: if not isinstance(option, CommandLineOption): - qname = '%(entrypoint)s:%(name)s' % locals() + qname = '%(stage)s:%(name)s' % locals() oname = option.name clin = CommandLineOption raise Exception( @@ -288,3 +220,4 @@ def setup(self): self.initialized = True return self.plugin_classes.values(), plugin_options + diff --git a/src/plugincode/output.py b/src/plugincode/output.py index 5ce2475e76b..987e6b04774 100644 --- a/src/plugincode/output.py +++ b/src/plugincode/output.py @@ -92,13 +92,10 @@ def get_results(cls, codebase, info, full_root, strip_root, timing, **kwargs): """ Return an iterable of serialized scan results from a codebase. """ - serializer = partial(Resource.to_dict, - full_root=full_root, strip_root=strip_root, - with_info=info, with_timing=timing) - - resources = codebase.walk(topdown=True, skip_root=strip_root, - skip_filtered=True) - + # FIXME: serialization SHOULD NOT be needed: only some format need it + # (e.g. JSON) and only these should serialize + serializer = partial(Resource.to_dict, with_info=info, with_timing=timing) + resources = codebase.walk_filtered(topdown=True, skip_root=strip_root) return imap(serializer, resources) diff --git a/src/plugincode/output_filter.py b/src/plugincode/output_filter.py index 8f5e06ca84b..9c3f4a2e768 100644 --- a/src/plugincode/output_filter.py +++ b/src/plugincode/output_filter.py @@ -45,7 +45,7 @@ class OutputFilterPlugin(CodebasePlugin): Base plugin class for Resource output filter plugins that all output filter plugins must extend. - Filter plugins SHOULD NOT modify the codebase beyond setting the + Filter plugins MUST NOT modify the codebase beyond setting the Resource.is_filtered flag on resources. """ pass diff --git a/src/plugincode/pre_scan.py b/src/plugincode/pre_scan.py index 7d67b2d03eb..a44026c7135 100644 --- a/src/plugincode/pre_scan.py +++ b/src/plugincode/pre_scan.py @@ -42,7 +42,61 @@ class PreScanPlugin(CodebasePlugin): """ A pre-scan plugin base class that all pre-scan plugins must extend. """ - pass + + # List of scanner name strings that this plugin requires to run first + # before this pres-scan plugin runs. + # Subclasses should set this as needed + requires = [] + + def get_required(self, scanner_plugins): + """ + Return a list of required scanner plugin instances that are direct + requirements of self. + + `scanner_plugins` is a {name: plugin} mapping of enabled scanner + plugins. + """ + required = [] + + for name in self.requires: + required_plugin = scanner_plugins.get(name) + + if not required_plugin: + qname = self.qname + raise Exception( + 'Missing required scan plugin: %(name)r ' + 'for plugin: %(qname)r.' % locals()) + + required.append(required_plugin) + + return unique(required) + + @classmethod + def get_all_required(self, prescan_plugins, scanner_plugins): + """ + Return a list of unique required scanner plugin instances that are direct + requirements of any of the `prescan_plugins` pre-scan plugin instances. + `prescan_plugins` is a list of enabled pre-scan plugins. + `scanner_plugins` is a {name: plugin} mapping of enabled scanner + plugins. + """ + required = [] + for plugin in prescan_plugins: + required.extend(plugin.get_required(scanner_plugins)) + return unique(required) + + +def unique(iterable): + """ + Return a sequence of unique items in `iterable` keeping their + original order. + Note: this can be very slow for large sequences as this is using lists. + """ + uniques = [] + for item in iterable: + if item not in uniques: + uniques.append(item) + return uniques pre_scan_plugins = PluginManager( diff --git a/src/plugincode/scan.py b/src/plugincode/scan.py index a11a265b2ae..77f12ac57e4 100644 --- a/src/plugincode/scan.py +++ b/src/plugincode/scan.py @@ -47,19 +47,38 @@ class ScanPlugin(BasePlugin): name used for this plugin. """ - # a relative sort order number (integer or float). In scan results, results - # from scanners are sorted by this sorted_order then by "key" which is the - # scanner plugin name. This is also used in the CLI UI - sort_order = 100 - - # TODO: pass own command options name/values as concrete kwargs def get_scanner(self, **kwargs): """ - Return a scanner callable that takes a single `location` argument. + Return a scanner callable, receiving all the scancode call arguments as + kwargs. + + The returned callable MUST be a top-level module importable function + (e.g. that is picklable and it can be possibly closed on argumenst with + functools.partial) and accept these arguments: + + - a first `location` argument that is always an absolute path string to + a file. This string is using the filesystem encoding (e.g. bytes on + Linux and Unicode elsewhere). + + - other **kwargs that will be all the scancode call arguments. + + The returned callable MUST RETURN an ordered mapping of key/values that + must be serializable to JSON. + + All mapping keys must be strings, including for any nested mappings. + + Any value must be one of: + - None, unicode or str, int, flota, long. + str if not unicode WILL be converted to unicode with UTF-8. + - iterable/list/tuple/generator or dict/mapping preferrably ordered. + - any object beyond these above that has an asdict() ot to_dict() method + that returns an ordered mapping of key/values of the same styke the + top-level mapping defined here. + This callable (typically a bare function) should carry as little state as possible as it may be executed through multiprocessing. + Subclasses must override. - This receives all the ScanCode call arguments as kwargs. """ raise NotImplementedError diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index 5c07e10a1c7..a691742f4d1 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -87,7 +87,7 @@ def logger_debug(*args): # Holds a scan plugin result "key and the corresponding function. # click.Parameter instance -Scanner = namedtuple('Scanner', 'key function') +Scanner = namedtuple('Scanner', 'name function') class CommandLineOption(click.Option): diff --git a/src/scancode/api.py b/src/scancode/api.py index 5a0092ba41c..3675807fc2f 100644 --- a/src/scancode/api.py +++ b/src/scancode/api.py @@ -31,12 +31,7 @@ from os.path import getsize from commoncode.filetype import get_last_modified_date -from commoncode.filetype import get_type as get_simple_type -from commoncode.filetype import is_file as filetype_is_file -from commoncode.fileutils import file_name -from commoncode.fileutils import splitext from commoncode.hash import multi_checksums -from commoncode.system import on_linux from typecode.contenttype import get_type """ @@ -51,7 +46,8 @@ def get_copyrights(location, **kwargs): """ - Return a list of mappings for copyright detected in the file at `location`. + Return a mapping with a single 'copyrights' key with a value that is a list + of mappings for copyright detected in the file at `location`. """ from cluecode.copyrights import detect_copyrights results = [] @@ -64,12 +60,13 @@ def get_copyrights(location, **kwargs): result['authors'] = authors result['start_line'] = start_line result['end_line'] = end_line - return results + return dict(copyrights=results) def get_emails(location, **kwargs): """ - Return a list of mappings for emails detected in the file at `location`. + Return a mapping with a single 'emails' key with a value that is a list of + mappings for emails detected in the file at `location`. """ from cluecode.finder import find_emails results = [] @@ -81,12 +78,13 @@ def get_emails(location, **kwargs): result['email'] = email result['start_line'] = line_num result['end_line'] = line_num - return results + return dict(emails=results) def get_urls(location, **kwargs): """ - Return a list of mappings for urls detected in the file at `location`. + Return a mapping with a single 'urls' key with a value that is a list of + mappings for urls detected in the file at `location`. """ from cluecode.finder import find_urls results = [] @@ -98,7 +96,7 @@ def get_urls(location, **kwargs): result['url'] = urls result['start_line'] = line_num result['end_line'] = line_num - return results + return dict(urls=results) DEJACODE_LICENSE_URL = 'https://enterprise.dejacode.com/urn/urn:dje:license:{}' @@ -110,7 +108,8 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, cache_dir=None, **kwargs): """ - Return a list of mappings for licenses detected in the file at `location`. + Return a mapping with a single 'licenses' key with a value that is list of + mappings for licenses detected in the file at `location`. `minimum_score` is a minimum score threshold from 0 to 100. The default is 0 means that all license matches are returned. Otherwise, matches with a score @@ -173,58 +172,45 @@ def get_licenses(location, min_score=0, include_text=False, diag=False, if include_text: result['matched_text'] = matched_text - return results + return dict(licenses=results) def get_package_info(location, **kwargs): """ - Return a list of mappings for package information detected in the file at - `location`. + mappings for package information detected in the file at `location`. """ from packagedcode.recognize import recognize_package package = recognize_package(location) - results = [] if package: - results.append(package.to_dict()) - return results + return dict(packages=[package.to_dict()]) + return dict(packages=[]) def get_file_info(location, **kwargs): """ - Return a list of mappings for file information collected for the file or - directory at `location`. + Return a mappings of file information collected for the file at `location`. """ result = OrderedDict() - results = [result] + + # TODO: move date and size these to the inventory collection step??? + result['date'] = get_last_modified_date(location) or None + result['size'] = getsize(location) or 0 + + sha1, md5 = multi_checksums(location, ('sha1', 'md5',)).values() + result['sha1'] = sha1 + result['md5'] = md5 collector = get_type(location) - result['type'] = get_simple_type(location, short=False) - is_file = filetype_is_file(location) - - if is_file: - base_name, extension = splitext(location) - else: - # directories have no extension - base_name = file_name(location) - extension = b'' if on_linux else '' - result['base_name'] = base_name - result['extension'] = extension - - if is_file: - result['date'] = get_last_modified_date(location) or None - result['size'] = getsize(location) or 0 - result.update(multi_checksums(location, ('sha1', 'md5',))) - result['mime_type'] = collector.mimetype_file or None - result['file_type'] = collector.filetype_file or None - result['programming_language'] = collector.programming_language or None - result['is_binary'] = bool(collector.is_binary) - result['is_text'] = bool(collector.is_text) - result['is_archive'] = bool(collector.is_archive) - result['is_media'] = bool(collector.is_media) - result['is_source'] = bool(collector.is_source) - result['is_script'] = bool(collector.is_script) - - return results + result['mime_type'] = collector.mimetype_file or None + result['file_type'] = collector.filetype_file or None + result['programming_language'] = collector.programming_language or None + result['is_binary'] = bool(collector.is_binary) + result['is_text'] = bool(collector.is_text) + result['is_archive'] = bool(collector.is_archive) + result['is_media'] = bool(collector.is_media) + result['is_source'] = bool(collector.is_source) + result['is_script'] = bool(collector.is_script) + return result def extract_archives(location, recurse=True): diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 63030357d59..4a93979a013 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -40,12 +40,15 @@ from time import time import traceback +import attr import click +from scancode.resource import Resource click.disable_unicode_literals_warning = True # import early from scancode_config import __version__ as scancode_version -from scancode_config import scancode_temp_dir, scancode_cache_dir +from scancode_config import scancode_cache_dir +from scancode_config import scancode_temp_dir from commoncode.fileutils import PATH_TYPE from commoncode.timeutils import time2tstamp @@ -73,7 +76,6 @@ from scancode import SCAN_OPTIONS_GROUP from scancode import Scanner from scancode import validate_option_dependencies -from scancode.api import get_file_info from scancode.interrupt import DEFAULT_TIMEOUT from scancode.interrupt import fake_interruptible from scancode.interrupt import interruptible @@ -313,7 +315,7 @@ def format_options(self, ctx, formatter): # IMPORTANT: this discovers, loads and validates all available plugins -plugin_classes, plugin_options = PluginManager.setup_all() +plugin_classes, plugin_options = PluginManager.load_plugins() def print_plugins(ctx, param, value): @@ -323,13 +325,9 @@ def print_plugins(ctx, param, value): click.echo('--------------------------------------------') click.echo('Plugin: scancode_{self.stage}:{self.name}'.format(self=plugin_cls), nl=False) click.echo(' class: {self.__module__}:{self.__name__}'.format(self=plugin_cls)) - requires = ', '.join(plugin_cls.requires) - click.echo(' requires: {}'.format(requires), nl=False) - needs_info = getattr(plugin_cls, 'needs_info', False) - if needs_info: - click.echo(' needs_info: yes') - else: - click.echo('') + if hasattr(plugin_cls, 'requires'): + requires = ', '.join(plugin_cls.requires) + click.echo(' requires: {}'.format(requires), nl=False) click.echo(' doc: {self.__doc__}'.format(self=plugin_cls)) click.echo(' options:'.format(self=plugin_cls)) for option in plugin_cls.options: @@ -353,11 +351,6 @@ def print_plugins(ctx, param, value): @click.argument('input', metavar=' ', type=click.Path(exists=True, readable=True, path_type=PATH_TYPE)) -@click.option('-i', '--info', - is_flag=True, - help='Scan for file information (size, type, checksums, etc).', - help_group=OTHER_SCAN_GROUP, sort_order=10, cls=CommandLineOption) - @click.option('--strip-root', is_flag=True, conflicts=['full_root'], @@ -441,35 +434,40 @@ def print_plugins(ctx, param, value): help='Collect scan timing for each scan/scanned file.', help_group=CORE_GROUP, sort_order=250, cls=CommandLineOption) -@click.option('--on-disk-results', - is_flag=True, default=True, +@click.option('--max-in-memory', + type=int, default=10000, show_default=True, - help='Save intermediate scan results in temporary files. Uses less memory.', + help= + 'Maximum number of files and directories scan details kept in memory ' + 'during a scan. Additional files and directories scan details above this ' + 'number are cached on-disk rather than in memory. ' + 'Use 0 to use unlimited memory and disable on-disk caching. ' + 'Use -1 to use only on-disk caching.', help_group=CORE_GROUP, sort_order=300, cls=CommandLineOption) @click.help_option('-h', '--help', help_group=DOC_GROUP, sort_order=10, cls=CommandLineOption) @click.option('--about', - is_flag=True, is_eager=True, + is_flag=True, is_eager=True, expose_value=False, callback=print_about, help='Show information about ScanCode and licensing and exit.', help_group=DOC_GROUP, sort_order=20, cls=CommandLineOption) @click.option('--version', - is_flag=True, is_eager=True, + is_flag=True, is_eager=True, expose_value=False, callback=print_version, help='Show the version and exit.', help_group=DOC_GROUP, sort_order=20, cls=CommandLineOption) @click.option('--examples', - is_flag=True, is_eager=True, + is_flag=True, is_eager=True, expose_value=False, callback=print_examples, help=('Show command examples and exit.'), help_group=DOC_GROUP, sort_order=50, cls=CommandLineOption) @click.option('--plugins', - is_flag=True, is_eager=True, + is_flag=True, is_eager=True, expose_value=False, callback=print_plugins, help='Show the list of available ScanCode plugins and exit.', help_group=DOC_GROUP, cls=CommandLineOption) @@ -480,14 +478,14 @@ def print_plugins(ctx, param, value): hidden=True, help='Run ScanCode in a special "test mode". Only for testing.', help_group=MISC_GROUP, sort_order=1000, cls=CommandLineOption) + def scancode(ctx, input, # NOQA - info, strip_root, full_root, processes, timeout, quiet, verbose, cache_dir, temp_dir, timing, - on_disk_results, + max_in_memory, test_mode, *args, **kwargs): """scan the file or directory for license, origin and packages and save results to FILE(s) using one or more ouput format option. @@ -568,13 +566,16 @@ def scancode(ctx, input, # NOQA # build mappings of all kwargs to pass down to plugins standard_kwargs = dict( input=input, - info=info, - strip_root=strip_root, full_root=full_root, - processes=processes, timeout=timeout, - quiet=quiet, verbose=verbose, - cache_dir=cache_dir, temp_dir=temp_dir, + strip_root=strip_root, + full_root=full_root, + processes=processes, + timeout=timeout, + quiet=quiet, + verbose=verbose, + cache_dir=cache_dir, + temp_dir=temp_dir, timing=timing, - on_disk_results=on_disk_results, + max_in_memory=max_in_memory, test_mode=test_mode ) kwargs.update(standard_kwargs) @@ -586,16 +587,18 @@ def scancode(ctx, input, # NOQA # UTC start timestamp scan_start = time2tstamp() - try: - - if not processes and not quiet: + if not quiet: + if not processes: echo_stderr('Disabling multi-processing for debugging.', fg='yellow') - if processes == -1 and not quiet: - echo_stderr('Disabling multi-processing and multi-threading for debugging.', fg='yellow') + elif processes == -1: + echo_stderr('Disabling multi-processing ' + 'and multi-threading for debugging.', fg='yellow') + try: ######################################################################## - # 1. get command options and create all plugin instances + # 1. create all plugin instances ######################################################################## + # FIXME: validate_option_dependencies(ctx) if TRACE_DEEP: @@ -604,6 +607,8 @@ def scancode(ctx, input, # NOQA for co in ctx.params: logger_debug(' scancode: ctx.params:', co) + # NOTE and FIXME: this is a two level nested mapping, which is TOO + # complicated enabled_plugins = OrderedDict() for stage, manager in PluginManager.managers.items(): @@ -619,23 +624,23 @@ def scancode(ctx, input, # NOQA echo_stderr(traceback.format_exc()) ctx.exit(2) - # these are plugin instances, not classes + # NOTE: these are mappings of plugin instances, not classes! pre_scan_plugins = enabled_plugins[pre_scan.stage] scanner_plugins = enabled_plugins[scan.stage] post_scan_plugins = enabled_plugins[post_scan.stage] output_filter_plugins = enabled_plugins[output_filter.stage] output_plugins = enabled_plugins[output.stage] + if not scanner_plugins: + msg = ('Missing scan option(s): at least one scan ' + 'option is required.') + raise click.UsageError(msg) + if not output_plugins: msg = ('Missing output option(s): at least one output ' - 'option is needed to save scan results.') + 'option is required to save scan results.') raise click.UsageError(msg) - # Use default info scan when no other scan options are requested - if not scanner_plugins and not info: - # add info scan as scan option/kwarg/locals() - info = ctx.params['info'] = kwargs['info'] = True - # TODO: check for plugin dependencies and if a plugin is ACTIVE!!! ######################################################################## @@ -668,6 +673,47 @@ def scancode(ctx, input, # NOQA setup_timings['setup'] = time() - plugins_setup_start + ######################################################################## + # 2.5. Create a new Resource subclass for this scan + ######################################################################## + # Craft a new Resource class with the attributes contributed by plugins + sortable_attributes = [] + + # mapping of {"plugin stage:name": [list of attribute keys]} + # also available as a kwarg entry for plugin + kwargs['attributes_by_plugin'] = attributes_by_plugin = {} + for stage, stage_plugins in enabled_plugins.items(): + for name, plugin in stage_plugins.items(): + try: + sortable_attributes.append( + (plugin.sort_order, name, plugin.attributes,) + ) + attributes_by_plugin[plugin.qname] = plugin.attributes.keys() + except: + msg = ('ERROR: failed to collect attributes for plugin: ' + '%(stage)s:%(name)s:' % locals()) + echo_stderr(msg, fg='red') + echo_stderr(traceback.format_exc()) + ctx.exit(2) + + attributes = OrderedDict() + for _, name, attribs in sorted(sortable_attributes): + attributes.update(attribs) + + # FIXME: workaround for https://github.com/python-attrs/attrs/issues/339 + # we reset the _CountingAttribute internal .counter to a proper value + # that matches our ordering + for order, attrib in enumerate(attributes.values(), 100): + attrib.counter = order + + if TRACE_DEEP: + logger_debug('scancode:attributes') + for a in attributes.items(): + logger_debug(a) + + resource_class = attr.make_class( + name=b'ScannedResource', attrs=attributes, bases=(Resource,)) + ######################################################################## # 3. collect codebase inventory ######################################################################## @@ -679,59 +725,45 @@ def scancode(ctx, input, # NOQA # TODO: add progress indicator # note: inventory timing collection is built in Codebase initialization + # TODO: this should also compute the basic base_name/ext and collect size/dates try: codebase = Codebase( - location=input, use_cache=on_disk_results, temp_dir=temp_dir) + location=input, + resource_class=resource_class, + full_root=full_root, + strip_root=strip_root, + temp_dir=temp_dir, + max_in_memory=max_in_memory + ) except: msg = 'ERROR: failed to collect codebase at: %(input)r' % locals() echo_stderr(msg, fg='red') echo_stderr(traceback.format_exc()) ctx.exit(2) - if TRACE: - logger_debug('scancode: codebase.use_cache:', codebase.use_cache) - + # TODO: this is weird: may be the timings should NOt be stored on the + # codebase, since they exist in abstract of it?? codebase.timings.update(setup_timings) codebase.timings['inventory'] = time() - inventory_start - files_count, dirs_count, size_count = codebase.compute_counts() - codebase.summary['initial_files_count'] = files_count - codebase.summary['initial_dirs_count'] = dirs_count - codebase.summary['initial_size_count'] = size_count + codebase.summary['initial:files_count'] = files_count + codebase.summary['initial:dirs_count'] = dirs_count + codebase.summary['initial:size_count'] = size_count ######################################################################## - # 4. if any prescan plugins needs_info run an info scan first + # 4. prescan scans: run the early scans required by prescan plugins ######################################################################## + # FIXME: this stage is extremely convoluted and needs cleaning! - # do we need to collect info before prescan? - pre_scan_needs_info = any(p.needs_info for p in pre_scan_plugins.values()) - - info_is_collected = False - - if pre_scan_needs_info: - # add info scan as scan option/kwarg/locals() - info = ctx.params['info'] = kwargs['info'] = True + # resolve pre-scan plugin requirements that require a scan first + early_scan_plugins = pre_scan.PreScanPlugin.get_all_required( + pre_scan_plugins.values(), scanner_plugins) - info_start = time() - - progress_manager = None - if not quiet: - echo_stderr('Collect file information for pre-scans ' - 'with %(processes)d process(es)...' % locals()) - item_show_func = partial(path_progress_message, verbose=verbose) - progress_manager = partial(progressmanager, - item_show_func=item_show_func, verbose=verbose, file=sys.stderr) - - scanners = [Scanner(key='infos', function=get_file_info)] - # TODO: add CLI option to bypass cache entirely - info_success = scan_codebase(codebase, scanners, processes, timeout, - with_timing=timing, progress_manager=progress_manager) - - info_is_collected = True - codebase.timings['collect-info'] = time() - info_start - - success = success and info_success + success = success and run_scanners(early_scan_plugins , codebase, + processes, timeout, timing, + quiet, verbose, + stage='pre-scan-scan', kwargs=kwargs) ######################################################################## # 5. run prescans @@ -748,59 +780,14 @@ def scancode(ctx, input, # NOQA # 6. run scans. ######################################################################## - scan_start = time() - scanners = [] - - if not info: - next_stages = (post_scan_plugins.values() - + output_filter_plugins.values() - + output_plugins.values()) - - next_stages_need_info = any(p.needs_info for p in next_stages) - # add info is requested or needed but not yet collected - if next_stages_need_info: - # add info scan as scan option - info = True - ctx.params['info'] = info + # do not rerun scans already done in prescan-scan + scan_plugins = [p for p in scanner_plugins.values() + if p not in early_scan_plugins] - if info and not info_is_collected: - scanners = [Scanner(key='infos', function=get_file_info)] - - scan_sorter = lambda s: (s.sort_order, s.name) - for scanner in sorted(scanner_plugins.values(), key=scan_sorter): - func = scanner.get_scanner(**kwargs) - scanners.append(Scanner(key=scanner.name, function=func)) - - if TRACE_DEEP: logger_debug('scancode: scanners:', scanners) - - if scanners: - scan_names = ', '.join(s.key for s in scanners) - - if not quiet: - echo_stderr('Scan files for: %(scan_names)s ' - 'with %(processes)d process(es)...' % locals()) - - progress_manager = None - if not quiet: - item_show_func = partial(path_progress_message, verbose=verbose) - progress_manager = partial(progressmanager, - item_show_func=item_show_func, - verbose=verbose, file=sys.stderr) - - # TODO: add CLI option to bypass cache entirely? - scan_success = scan_codebase( - codebase, scanners, processes, timeout, - with_timing=timing, progress_manager=progress_manager) - - scanned_fc, scanned_dc, scanned_sc = codebase.compute_counts() - - codebase.summary['scan_names'] = scan_names - codebase.summary['scanned_files_count'] = scanned_fc - codebase.summary['scanned_dirs_count'] = scanned_dc - codebase.summary['scanned_size_count'] = scanned_sc - codebase.timings['scan'] = time() - scan_start - - success = success and scan_success + success = success and run_scanners(scan_plugins, codebase, + processes, timeout, timing, + quiet, verbose, + stage='scan', kwargs=kwargs) ######################################################################## # 7. run postscans @@ -825,19 +812,20 @@ def scancode(ctx, input, # NOQA plugin_msg=' Apply %(stage)s: %(name)s...') ######################################################################## - # 9. run outputs + # 9. save outputs ######################################################################## - # TODO: cleanup kwargs vs. codebase attrs - files_count, dirs_count, size_count = codebase.compute_counts( - skip_root=strip_root, skip_filtered=True) + counts = codebase.compute_counts(skip_root=strip_root, skip_filtered=True) + files_count, dirs_count, size_count = counts - codebase.summary['final_files_count'] = files_count - codebase.summary['final_dirs_count'] = dirs_count - codebase.summary['final_size_count'] = size_count + # TODO: cleanup kwargs vs. codebase attrs + codebase.summary['final:files_count'] = files_count + codebase.summary['final:dirs_count'] = dirs_count + codebase.summary['final:size_count'] = size_count + # WHY this count here? kwargs['files_count'] = files_count - kwargs['pretty_options'] = get_pretty_params(ctx, info=info, generic_paths=test_mode) + kwargs['pretty_options'] = get_pretty_params(ctx, generic_paths=test_mode) kwargs['scancode_notice'] = notice kwargs['scancode_version'] = scancode_version @@ -856,6 +844,7 @@ def scancode(ctx, input, # NOQA # TODO: compute summary for output plugins too?? if not quiet: + scan_names = ', '.join(s.name for s in scan_plugins) echo_stderr('Scanning done.', fg='green' if success else 'red') display_summary(codebase, scan_names, processes, verbose=verbose) finally: @@ -907,38 +896,87 @@ def run_plugins(ctx, stage, plugins, codebase, kwargs, quiet, verbose, codebase.timings[stage] = time() - stage_start +def run_scanners(scan_plugins, codebase, processes, timeout, timing, + quiet, verbose, stage, kwargs): + """ + Run the `scan_plugins` list of ScanPlugin on the `codebase`. Return True on + success or False otherwise. + + Display progress and update the codebase with computed counts and scan + results. + """ + + scan_start = time() + + scanners = [] + scan_sorter = lambda s: (s.sort_order, s.name) + for scanner in sorted(scan_plugins, key=scan_sorter): + func = scanner.get_scanner(**kwargs) + scanners.append(Scanner(name=scanner.name, function=func)) + + if TRACE_DEEP: logger_debug('run_scanners: scanners:', scanners) + if not scanners: + return True + + scan_names = ', '.join(s.name for s in scanners) + + progress_manager = None + if not quiet: + echo_stderr('Scan files for: %(scan_names)s ' + 'with %(processes)d process(es)...' % locals()) + item_show_func = partial(path_progress_message, verbose=verbose) + progress_manager = partial(progressmanager, + item_show_func=item_show_func, + verbose=verbose, file=sys.stderr) + + # TODO: add CLI option to bypass cache entirely? + scan_success = scan_codebase( + codebase, scanners, processes, timeout, + with_timing=timing, progress_manager=progress_manager) + + codebase.timings[stage] = time() - scan_start + scanned_fc, scanned_dc, scanned_sc = codebase.compute_counts() + + codebase.summary[stage + ':scanners'] = scan_names + codebase.summary[stage + ':files_count'] = scanned_fc + codebase.summary[stage + ':dirs_count'] = scanned_dc + codebase.summary[stage + ':size_count'] = scanned_sc + + return scan_success + + def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, with_timing=False, progress_manager=None): """ - Run the `scanners` Scanner object on the `codebase` Codebase. Return True on - success or False otherwise. + Run the `scanners` Scanner objects on the `codebase` Codebase. Return True + on success or False otherwise. - Run the `scanners` ing multiprocessing with `processes` number of - processes allocating one process per scanned `codebase` Resource. + Use multiprocessing with `processes` number of processes. Disable + multiprocessing is processes <=0. Disable threading is processes is < 0 Run each scanner function for up to `timeout` seconds and fail it otherwise. - If `with_timing` is True, per-scanner execution time (as a float in seconds) - is added to the `scan_timings` mapping of each Resource as {scanner.key: - execution time}. + If `with_timing` is True, each Resource is updated with per-scanner + execution time (as a float in seconds). This is added to the `scan_timings` + mapping of each Resource as {scanner.name: execution time}. Provide optional progress feedback in the UI using the `progress_manager` callable that accepts an iterable of tuple of (location, rid, scan_errors, scan_result ) as argument. """ - # FIXME: this path computation is super inefficient - # tuples of (absolute location, resource id) - # TODO: should we walk topdown or not??? + # FIXME: this path computation is super inefficient tuples of (absolute + # location, resource id) - resources = ((r.get_path(absolute=True), r.rid) for r in codebase.walk()) + # NOTE: we never scan directories + resources = ((r.location, r.rid) for r in codebase.walk() if r.is_file) runner = partial(scan_resource, scanners=scanners, timeout=timeout, with_timing=with_timing, with_threading=processes >= 0) if TRACE: - logger_debug('scan_codebase: scanners:', '\n'.join(repr(s) for s in scanners)) + logger_debug('scan_codebase: scanners:', ', '.join(s.name for s in scanners)) get_resource = codebase.get_resource @@ -968,14 +1006,16 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, try: location, rid, scan_errors, scan_time, scan_result, scan_timings = scans.next() - if TRACE_DEEP: logger_debug( + if TRACE_DEEP: + logger_debug( 'scan_codebase: location:', location, 'results:', scan_result) resource = get_resource(rid) + if not resource: # this should never happen msg = ('ERROR: Internal error in scan_codebase: Resource ' - 'at %(location)r is missing from codebase.\n' + 'at %(rid)r is missing from codebase.\n' 'Scan result not saved:\n%(scan_result)r.' % locals()) codebase.errors.append(msg) success = False @@ -983,23 +1023,19 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, if scan_errors: success = False - resource.errors.extend(scan_errors) - - # always set info directly on resources - infos = scan_result.pop('infos', []) - if TRACE: logger_debug('scan_codebase: infos:', infos) - if infos: - resource.set_info(infos) + resource.scan_errors.extend(scan_errors) if TRACE: logger_debug('scan_codebase: scan_timings:', scan_timings) if with_timing and scan_timings: - if resource.scan_timings: + if scan_timings: resource.scan_timings.update(scan_timings) - else: - resource.scan_timings = scan_timings - saved_scans = resource.put_scans(scan_result, update=True) - if TRACE: logger_debug('scan_codebase: saved_scans:', saved_scans) + # NOTE: here we effectively single threaded the saving a + # Resource to the cache! .... not sure this is a good or bad + # thing for scale. Likely not + for key, value in scan_result.items(): + setattr(resource, key, value) + codebase.save_resource(resource) except StopIteration: break @@ -1025,7 +1061,7 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT, def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, with_timing=False, with_threading=True): """ - Return a tuple of (location, rid, errors, scan_time, scan_results, timings) + Return a tuple of (location, rid, scan_errors, scan_time, scan_results, timings) by running the `scanners` Scanner objects for the file or directory resource with id `rid` at `location` provided as a `location_rid` tuple of (location, rid) for up to `timeout` seconds. @@ -1033,10 +1069,10 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, The returned tuple has these values (: - `location` and `rid` are the orginal arguments. - - `errors` is a list of error strings. - - `scan_results` is a mapping of scan results keyed by scanner.key. + - `scan_errors` is a list of error strings. + - `scan_results` is a mapping of scan results from all scanners. - `scan_time` is the duration in seconds to run all scans for this resource. - - `timings` is a mapping of scan {scanner.key: execution time in seconds} + - `timings` is a mapping of scan {scanner.name: execution time in seconds} tracking the execution duration each each scan individually. `timings` is empty unless `with_timing` is True. @@ -1044,75 +1080,109 @@ def scan_resource(location_rid, scanners, timeout=DEFAULT_TIMEOUT, processing/threading works. """ scan_time = time() - - timings = None - if with_timing: - timings = OrderedDict((scanner.key, 0) for scanner in scanners) + location, rid = location_rid + results = OrderedDict() + scan_errors = [] + timings = OrderedDict() if with_timing else None if not with_threading: interruptor = fake_interruptible else: interruptor = interruptible - location, rid = location_rid - errors = [] - results = OrderedDict((scanner.key, []) for scanner in scanners) - # run each scanner in sequence in its own interruptible - for scanner, scanner_result in zip(scanners, results.values()): + for scanner in scanners: if with_timing: start = time() try: runner = partial(scanner.function, location) - error, value = interruptor(runner, timeout=timeout) + error, values_mapping = interruptor(runner, timeout=timeout) if error: - msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + error - errors.append(msg) - if value: - # a scanner function MUST return a sequence - scanner_result.extend(value) + msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + error + scan_errors.append(msg) + # the return value of a scanner fun MUST be a mapping + if values_mapping: + results.update(values_mapping) except Exception: - msg = 'ERROR: for scanner: ' + scanner.key + ':\n' + traceback.format_exc() - errors.append(msg) + msg = 'ERROR: for scanner: ' + scanner.name + ':\n' + traceback.format_exc() + scan_errors.append(msg) finally: if with_timing: - timings[scanner.key] = time() - start + timings[scanner.name] = time() - start scan_time = time() - scan_time - return location, rid, errors, scan_time, results, timings + return location, rid, scan_errors, scan_time, results, timings def display_summary(codebase, scan_names, processes, verbose): """ Display a scan summary. """ - - initial_files_count = codebase.summary.get('initial_files_count', 0) - initial_dirs_count = codebase.summary.get('initial_dirs_count', 0) + initial_files_count = codebase.summary.get('initial:files_count', 0) + initial_dirs_count = codebase.summary.get('initial:dirs_count', 0) initial_res_count = initial_files_count + initial_dirs_count - initial_size_count = codebase.summary.get('initial_size_count', 0) + initial_size_count = codebase.summary.get('initial:size_count', 0) if initial_size_count: initial_size_count = format_size(initial_size_count) - initial_size_count = 'for %(initial_size_count)s' % locals() + initial_size_count = 'for %(initial:size_count)s' % locals() else: initial_size_count = '' - final_files_count = codebase.summary.get('final_files_count', 0) - final_dirs_count = codebase.summary.get('final_dirs_count', 0) + ###################################################################### + prescan_scan_time = codebase.timings.get('pre-scan-scan', 0.) + + if prescan_scan_time: + prescan_scan_files_count = codebase.summary.get('pre-scan-scan:files_count', 0) + prescan_scan_file_speed = round(float(prescan_scan_files_count) / prescan_scan_time , 2) + + prescan_scan_size_count = codebase.summary.get('pre-scan-scan:size_count', 0) + + if prescan_scan_size_count: + prescan_scan_size_speed = format_size(prescan_scan_size_count / prescan_scan_time) + prescan_scan_size_speed = '%(prescan_scan_size_speed)s/sec.' % locals() + + prescan_scan_size_count = format_size(prescan_scan_size_count) + prescan_scan_size_count = 'for %(prescan_scan_size_count)s' % locals() + else: + prescan_scan_size_count = '' + prescan_scan_size_speed = '' + + ###################################################################### + scan_time = codebase.timings.get('scan', 0.) + + scan_files_count = codebase.summary.get('scan:files_count', 0) + scan_file_speed = round(float(scan_files_count) / scan_time , 2) + + scan_size_count = codebase.summary.get('scan:size_count', 0) + + if scan_size_count: + scan_size_speed = format_size(scan_size_count / scan_time) + scan_size_speed = '%(scan_size_speed)s/sec.' % locals() + + scan_size_count = format_size(scan_size_count) + scan_size_count = 'for %(scan_size_count)s' % locals() + else: + scan_size_count = '' + scan_size_speed = '' + + ###################################################################### + final_files_count = codebase.summary.get('final:files_count', 0) + final_dirs_count = codebase.summary.get('final:dirs_count', 0) final_res_count = final_files_count + final_dirs_count - final_size_count = codebase.summary.get('final_size_count', 0) + final_size_count = codebase.summary.get('final:size_count', 0) if final_size_count: final_size_count = format_size(final_size_count) final_size_count = 'for %(final_size_count)s' % locals() else: final_size_count = '' + ###################################################################### top_errors = codebase.errors - path_and_errors = [(r.get_path(decode=True, posix=True), r.errors) - for r in codebase.walk() if r.errors] + path_and_errors = [(r.path, r.scan_errors) + for r in codebase.walk() if r.scan_errors] has_errors = top_errors or path_and_errors @@ -1127,26 +1197,19 @@ def display_summary(codebase, scan_names, processes, verbose): echo_stderr('Path: ' + errored_path, fg='red') if not verbose: continue + for error in errors: for emsg in error.splitlines(False): echo_stderr(' ' + emsg, fg='red') errors_count += 1 - scan_time = codebase.timings.get('scan', 0.) - - scanned_size_count = codebase.summary.get('scanned_size_count', 0) - if scanned_size_count: - scan_size_speed = format_size(scanned_size_count / scan_time) - scan_size_speed = '%(scan_size_speed)s/sec.' % locals() - else: - scan_size_speed = '' - - scanned_files_count = codebase.summary.get('scanned_files_count', 0) - scan_file_speed = round(float(scanned_files_count) / scan_time , 2) + ###################################################################### echo_stderr('Summary: %(scan_names)s with %(processes)d process(es)' % locals()) echo_stderr('Errors count: %(errors_count)d' % locals()) echo_stderr('Scan Speed: %(scan_file_speed).2f files/sec. %(scan_size_speed)s' % locals()) + if prescan_scan_time: + echo_stderr('Early Scanners Speed: %(prescan_scan_file_speed).2f files/sec. %(prescan_scan_size_speed)s' % locals()) echo_stderr('Initial counts: %(initial_res_count)d resource(s): ' '%(initial_files_count)d file(s) ' @@ -1159,10 +1222,11 @@ def display_summary(codebase, scan_names, processes, verbose): '%(final_size_count)s' % locals()) echo_stderr('Timings:') - for key, value, in codebase.timings.items(): + for name, value, in codebase.timings.items(): if value > 0.1: - echo_stderr(' %(key)s: %(value).2fs' % locals()) - # TODO: if timing was requested display per-scan/per-file stats + echo_stderr(' %(name)s: %(value).2fs' % locals()) + + # TODO: if timing was requested display top per-scan/per-file stats? def format_size(size): @@ -1209,7 +1273,7 @@ def format_size(size): return '%(size).2f %(symbol)s' % locals() -def get_pretty_params(ctx, info=False, generic_paths=False): +def get_pretty_params(ctx, generic_paths=False): """ Return a sorted mapping of {CLI option: pretty value string} for the `ctx` Click.context, putting arguments first then options: @@ -1226,8 +1290,7 @@ def get_pretty_params(ctx, info=False, generic_paths=False): if TRACE: logger_debug('get_pretty_params: generic_paths', generic_paths) args = [] - # hack since info option can be changed to True if default - options = [('--info', info)] if info else [] + options = [] param_values = ctx.params for param in ctx.command.params: @@ -1278,4 +1341,3 @@ def get_pretty_params(ctx, info=False, generic_paths=False): options.append((cli_opt, value)) return OrderedDict(sorted(args) + sorted(options)) - diff --git a/src/scancode/plugin_copyright.py b/src/scancode/plugin_copyright.py index 73a66c646b7..d69edccc9c1 100644 --- a/src/scancode/plugin_copyright.py +++ b/src/scancode/plugin_copyright.py @@ -27,6 +27,8 @@ from __future__ import print_function from __future__ import unicode_literals +import attr + from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -38,6 +40,9 @@ class CopyrightScanner(ScanPlugin): """ Scan a Resource for copyrights. """ + + attributes = dict(copyrights=attr.ib(default=attr.Factory(list))) + sort_order = 4 options = [ diff --git a/src/scancode/plugin_email.py b/src/scancode/plugin_email.py index 76000123c2f..9dfea3c8ec0 100644 --- a/src/scancode/plugin_email.py +++ b/src/scancode/plugin_email.py @@ -27,6 +27,8 @@ from __future__ import print_function from __future__ import unicode_literals +import attr + from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -38,6 +40,8 @@ class EmailScanner(ScanPlugin): """ Scan a Resource for emails. """ + attributes = dict(emails=attr.ib(default=attr.Factory(list))) + sort_order = 8 options = [ diff --git a/src/scancode/plugin_ignore.py b/src/scancode/plugin_ignore.py index 280f5f002f4..ecc7126a8de 100644 --- a/src/scancode/plugin_ignore.py +++ b/src/scancode/plugin_ignore.py @@ -64,25 +64,14 @@ def process_codebase(self, codebase, ignore=(), **kwargs): } ignorable = partial(is_ignored, ignores=ignores) - resources_to_remove = [] - resources_to_remove_append = resources_to_remove.append + remove_resource = codebase.remove_resource # first walk top down the codebase and collect ignored resource ids for resource in codebase.walk(topdown=True): - if ignorable(resource.get_path(absolute=False, posix=True)): - resources_to_remove_append(resource) - - # then remove the collected ignored resource ids (that may remove whole - # trees at once) in a second step - removed_rids = set() - removed_rids_update = removed_rids.update - remove_resource = codebase.remove_resource - - for resource in resources_to_remove: - if resource.rid in removed_rids: - continue - pruned_rids = remove_resource(resource) - removed_rids_update(pruned_rids) + if ignorable(resource.path): + for child in resource.children(codebase): + remove_resource(child) + remove_resource(resource) def is_ignored(location, ignores): diff --git a/src/scancode/plugin_info.py b/src/scancode/plugin_info.py new file mode 100644 index 00000000000..ce461d04ddb --- /dev/null +++ b/src/scancode/plugin_info.py @@ -0,0 +1,76 @@ +# +# Copyright (c) 2018 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from collections import OrderedDict + +import attr + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import OTHER_SCAN_GROUP + + +@scan_impl +class InfoScanner(ScanPlugin): + """ + Scan a file Resource for miscellaneous information such as mime/filetype and + basic checksums. + """ + attributes = OrderedDict([ + ('date', attr.ib(default=None)), + ('sha1', attr.ib(default=None)), + ('md5', attr.ib(default=None)), + ('mime_type', attr.ib(default=None)), + ('file_type', attr.ib(default=None)), + ('programming_language', attr.ib(default=None)), + ('is_binary', attr.ib(default=False, type=bool)), + ('is_text', attr.ib(default=False, type=bool)), + ('is_archive', attr.ib(default=False, type=bool)), + ('is_media', attr.ib(default=False, type=bool)), + ('is_source', attr.ib(default=False, type=bool)), + ('is_script', attr.ib(default=False, type=bool)), + ]) + + sort_order = 0 + + options = [ + CommandLineOption(('-i', '--info'), + is_flag=True, default=False, + help='Scan for file information (size, type, checksums, etc).', + help_group=OTHER_SCAN_GROUP, sort_order=10 + ) + ] + + def is_enabled(self, info, **kwargs): + return info + + def get_scanner(self, **kwargs): + from scancode.api import get_file_info + return get_file_info diff --git a/src/scancode/plugin_license.py b/src/scancode/plugin_license.py index fb953df8d26..83da619e1a8 100644 --- a/src/scancode/plugin_license.py +++ b/src/scancode/plugin_license.py @@ -29,6 +29,8 @@ from functools import partial +import attr + from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -56,6 +58,9 @@ class LicenseScanner(ScanPlugin): """ Scan a Resource for licenses. """ + + attributes = dict(licenses=attr.ib(default=attr.Factory(list))) + sort_order = 2 options = [ diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index f22e25f3e62..2a9faf3e071 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -27,6 +27,8 @@ from __future__ import print_function from __future__ import unicode_literals +import attr + from plugincode.post_scan import PostScanPlugin from plugincode.post_scan import post_scan_impl from scancode import CommandLineOption @@ -41,19 +43,22 @@ class MarkSource(PostScanPlugin): Has no effect unless the --info scan is requested. """ - needs_info = True + attributes = dict(source_count=attr.ib(default=0, type=int)) + + sort_order = 8 options = [ CommandLineOption(('--mark-source',), is_flag=True, default=False, + requires=['info'], help='Set the "is_source" to true for directories that contain ' 'over 90% of source files as children and descendants. ' - 'Implies running the --info scan.', + 'Count the number of source files in a directory as a new source_file_counts attribute', help_group=POST_SCAN_GROUP) ] - def is_enabled(self, mark_source, **kwargs): - return mark_source + def is_enabled(self, mark_source, info, **kwargs): + return mark_source and info def process_codebase(self, codebase, mark_source, **kwargs): """ @@ -63,12 +68,27 @@ def process_codebase(self, codebase, mark_source, **kwargs): if not mark_source: return - # TODO: these two nested walk() calls are not super efficient + # FIXME: TODO: these two nested walk() calls are not super efficient for resource in codebase.walk(topdown=False): if resource.is_file: continue - src_count = sum(1 for c in resource.walk(topdown=True) if c.is_file and c.is_source) - resource.is_source = is_source_directory(src_count, resource.files_count) + + children = resource.children(codebase) + if not children: + continue + + src_count = sum(1 for c in children + if c.is_file and c.is_source) + + src_count += sum(c.source_count for c in children + if not c.is_file) + + is_source = is_source_directory(src_count, resource.files_count) + + if src_count and is_source: + resource.is_source = is_source + resource.source_count = src_count + codebase.save_resource(resource) def is_source_directory(src_count, files_count): diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 567eb8d725e..9e8d2233b8c 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -48,19 +48,29 @@ class OnlyFindings(OutputFilterPlugin): def is_enabled(self, only_findings, **kwargs): return only_findings - def process_codebase(self, codebase, **kwargs): + def process_codebase(self, codebase, attributes_by_plugin, **kwargs): """ Set Resource.is_filtered to True for resources from the codebase that do - not have findings e.g. if they have no scan data (excluding info) and no + not have findings e.g. if they have no scan data (cinfo) and no errors. """ + attributes_with_findings = set(['scan_errors']) + for plugin_qname, keys in attributes_by_plugin.items(): + if plugin_qname == 'scan:info': + # skip info attributes + continue + attributes_with_findings.update(keys) + for resource in codebase.walk(): - if not has_findings(resource): - resource.is_filtered = True + if has_findings(resource, attributes_with_findings): + continue + resource.is_filtered = True + codebase.save_resource(resource) -def has_findings(resource): +def has_findings(resource, attributes_with_findings): """ Return True if this resource has findings. """ - return bool(resource.errors or any(resource.get_scans().values())) + attribs = (getattr(resource, key, None) for key in attributes_with_findings) + return bool(any(attribs)) diff --git a/src/scancode/plugin_package.py b/src/scancode/plugin_package.py index d67a6df0743..2784ccca956 100644 --- a/src/scancode/plugin_package.py +++ b/src/scancode/plugin_package.py @@ -27,6 +27,8 @@ from __future__ import print_function from __future__ import unicode_literals +import attr + from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -38,6 +40,9 @@ class PackageScanner(ScanPlugin): """ Scan a Resource for Package manifests. """ + + attributes = dict(packages=attr.ib(default=attr.Factory(list))) + sort_order = 6 options = [ diff --git a/src/scancode/plugin_url.py b/src/scancode/plugin_url.py index d9e1ca2f93a..7e18ef9e687 100644 --- a/src/scancode/plugin_url.py +++ b/src/scancode/plugin_url.py @@ -27,6 +27,8 @@ from __future__ import print_function from __future__ import unicode_literals +import attr + from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -38,6 +40,9 @@ class UrlScanner(ScanPlugin): """ Scan a Resource for URLs. """ + + attributes = dict(urls=attr.ib(default=attr.Factory(list))) + sort_order = 10 options = [ diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 59df1a1b777..db9f6b1aaa0 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -32,23 +32,26 @@ from collections import OrderedDict from functools import partial import json +import os from os import walk as os_walk from os.path import abspath from os.path import exists from os.path import expanduser from os.path import join from os.path import normpath +import posixpath import traceback import sys import attr -import yg.lockfile # NOQA +from intbitset import intbitset from scancode_config import scancode_temp_dir from commoncode.filetype import is_file as filetype_is_file from commoncode.filetype import is_special - +from commoncode.fileutils import POSIX_PATH_SEP +from commoncode.fileutils import WIN_PATH_SEP from commoncode.fileutils import as_posixpath from commoncode.fileutils import create_dir from commoncode.fileutils import delete @@ -56,6 +59,7 @@ from commoncode.fileutils import fsdecode from commoncode.fileutils import fsencode from commoncode.fileutils import parent_directory +from commoncode.fileutils import splitext from commoncode import ignore from commoncode.system import on_linux @@ -76,9 +80,10 @@ they are the basic unit of processing. A Codebase is a tree of Resource. A Resource represents a file or directory and -holds file information as attributes and scans (optionally cached on-disk). This -module handles all the details of walking files, path handling and caching -scans. +holds essential file information as attributes. At runtime, scan data is added +as attributes to a Resource. Resource are kept in memory or saved on disk. + +This module handles all the details of walking files, path handling and caching. """ # Tracing flags @@ -99,67 +104,16 @@ def logger_debug(*args): logger.setLevel(logging.DEBUG) def logger_debug(*args): - return logger.debug(' '.join(isinstance(a, unicode) - and a or repr(a) for a in args)) - -# A global cache of codebase objects, keyed by a unique integer ID. -# We use this weird structure such that a Resource object can reference its -# parent codebase object without actually storing it as an instance variable. -# Instead a Resource only has a pointer to a codebase id and can fetch it from -# this cache with an id lookup. -# This cache is updated when a new codebase object is created or destroyed -# TODO: consider using a class variable instead of a module variable? -_CODEBASES = {} - -_cache_lock_file = join(scancode_temp_dir, 'codebases-lockfile') + return logger.debug( + ' '.join(isinstance(a, unicode) and a or repr(a) for a in args)) -def add_codebase(codebase, cache_lock_file=_cache_lock_file): - """ - Add codebase to codebase cache in a thread- and multiprocess-safe way. - Return the codebase integer id. - """ - try: - # acquire lock and wait until timeout to get a lock or die - with yg.lockfile.FileLock(cache_lock_file, timeout=10): - global _CODEBASES - if _CODEBASES: - for cid, cached_codebase in _CODEBASES.items(): - if codebase is cached_codebase: - return cid - # get a new cid - new_cid = max(_CODEBASES.viewkeys()) + 1 - else: - # or create a new cid - new_cid = 1 - - _CODEBASES[new_cid] = codebase - return new_cid - - except yg.lockfile.FileLockTimeout: - raise - - -def del_codebase(cid, cache_lock_file=_cache_lock_file): - """ - Delete codebase from the codebase cache in a thread- and multiprocess-safe way. - Return the deleted codebase object or None. - """ - try: - # acquire lock and wait until timeout to get a lock or die - with yg.lockfile.FileLock(cache_lock_file, timeout=10): - global _CODEBASES - return _CODEBASES.pop(cid, None) - except yg.lockfile.FileLockTimeout: - raise +class ResourceNotInCache(Exception): + pass -def get_codebase(cid): - """ - Return a codebase object with a `cid` codebaset id or None. - """ - global _CODEBASES - return _CODEBASES.get(cid) +class UnknownResource(Exception): + pass class Codebase(object): @@ -167,16 +121,30 @@ class Codebase(object): Represent a codebase being scanned. A Codebase is a tree of Resources. """ - # TODO: add populate progress manager!!! - - def __init__(self, location, use_cache=True, temp_dir=scancode_temp_dir): + def __init__(self, location, resource_class=None, + full_root=False, strip_root=False, + temp_dir=scancode_temp_dir, + max_in_memory=10000): """ Initialize a new codebase rooted at the `location` existing file or directory. - If `use_cache` is True, scans will be cached on-disk in a file for each - Resource in a new unique directory under `cache_base_dir`. Otherwise, - scans are kept as Resource attributes. + `resource_class` is a Resource sub-class configured to accept plugin- + provided scan attributes. + + `strip_root` and `full_root`: boolean flags: these controls the values + of the path attribute of the codebase Resources. These are mutually + exclusive. + If `strip_root` is True, strip the first `path` segment of a Resource + unless the codebase contains a single root Resource. + If `full_root` is True the path is an an absolute path. + + `temp_dir` is the base temporary directory to use to cache resources on + disk and other temporary files. + + `max_in_memory` is the maximum number of Resource instances to keep in + memory. Beyond this number, Resource are saved on disk instead. -1 means + no memory is used and 0 means unlimited memory is used. """ self.original_location = location @@ -184,7 +152,9 @@ def __init__(self, location, use_cache=True, temp_dir=scancode_temp_dir): location = fsencode(location) else: location = fsdecode(location) + location = abspath(normpath(expanduser(location))) + location = location.rstrip(POSIX_PATH_SEP).rstrip(WIN_PATH_SEP) # TODO: we should also accept to create "virtual" codebase without a # backing filesystem location @@ -192,228 +162,401 @@ def __init__(self, location, use_cache=True, temp_dir=scancode_temp_dir): # FIXME: what if is_special(location)??? self.location = location - self.base_location = parent_directory(location) self.is_file = filetype_is_file(location) - # list of resources in topdown order where the position is the index of - # the resource. The first index, 0, is also the root - self.resources = [] + # True if this codebase root is a file or an empty directory. + self.has_single_resource = bool(self.is_file or not os.listdir(location)) + + self.resource_class = resource_class or Resource + + # maximmum number of Resource objects kept in memory cached in this + # Codebase. When the number of in-memory Resources exceed this number, + # the next Resource instances are saved to disk instead and re-loaded + # from disk when used/needed. + self.max_in_memory = max_in_memory + # use only memory + self.all_in_memory = max_in_memory == 0 + # use only disk + self.all_on_disk = max_in_memory == -1 + + # set index of existing resource ids ints, initially allocated with + # 10000 positions (this will grow as needed) + self.resource_ids = intbitset(10000) + + # root resource, never cached on disk self.root = None + # map of {rid: resource} for resources that are kept in memory + self.resources = {} + # list of errors from collecting the codebase details (such as - # unreadable file, etc) + # unreadable file, etc). self.errors = [] # mapping of scan summary data and statistics at the codebase level such # as ScanCode version, notice, command options, etc. - # This is populated automatically as the scan progresses. - self.summary = OrderedDict() - - # total processing time from start to finish, across all stages. # This is populated automatically. - self.total_time = 0 + self.summary = OrderedDict() # mapping of timings for scan stage as {stage: time in seconds as float} # This is populated automatically. self.timings = OrderedDict() # setup cache - self.use_cache = use_cache self.temp_dir = temp_dir - self.cache_dir = None - if use_cache: - # this is unique to this run and valid for the lifetime of this codebase - self.cache_dir = get_results_cache_dir(temp_dir=temp_dir) - - # this updates the global cache using a file lock - self.cid = add_codebase(self) - - self.populate() - # Flag set to True if file information was requested for results output - self.with_info = False + # this is unique to this codebase instance + self.cache_dir = get_codebase_cache_dir(temp_dir=temp_dir) - # set of resource rid to exclude from outputs - # This is populated automatically. - self.filtered_rids = set() + self.full_root = full_root + self.strip_root = strip_root + self._populate() def _get_next_rid(self): """ Return the next available resource id. """ - return len(self.resources) + return len(self.resource_ids) - def populate(self): + def _get_resource_cache_location(self, rid, create=False): + """ + Return the location where to get/put a Resource in the cache given a + Resource `rid`. Create the directories if requested. + """ + resid = (b'%08x'if on_linux else '%08x') % rid + cache_sub_dir, cache_file_name = resid[-2:], resid + parent = join(self.cache_dir, cache_sub_dir) + if create and not exists(parent): + create_dir(parent) + return join(parent, cache_file_name) + + # TODO: add populate progress manager!!! + def _populate(self): """ Populate this codebase with Resource objects. - The codebase must be populated by walking its `location` topdown, - breadth-first, creating files first then directories both in in sorted - case-insensitive name order. + Population is done by walking its `location` topdown, breadth-first, + first creating first file then directory Resources both sorted in case- + insensitive name order. Special files, links and VCS files are ignored. """ - # clear things - self.resources = [] - resources = self.resources - - resources_append = resources.append - cid = self.cid - rloc = self.location - rid = 0 - self.root = root = Resource( - name=file_name(rloc), rid=rid, pid=None, cid=cid, - is_file=self.is_file, use_cache=self.use_cache) - resources_append(root) - if TRACE: logger_debug('Codebase.collect: root:', root) - - if self.is_file: - # there is nothing else to do + def err(_error): + """os.walk error handler""" + self.errors.append( + ('ERROR: cannot populate codeasbe: %(_error)r\n' % _error) + + traceback.format_exc()) + + def skip_ignored(_loc): + """Always ignore VCS and some special filetypes.""" + ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) + + if TRACE_DEEP: + logger_debug('Codebase.populate: walk: ignored loc:', _loc, + 'ignored:', ignored(_loc), + 'is_special:', is_special(_loc)) + + return is_special(_loc) or ignored(_loc) + + def create_resources(_seq, _top, _parent, _is_file): + """Create Resources of parent from a seq of files or directories.""" + _seq.sort(key=lambda p: (p.lower(), p)) + for name in _seq: + location = join(_top, name) + if skip_ignored(location): + continue + res = self.create_resource(name, parent=_parent, is_file=_is_file) + if not _is_file: + # on the plain, bare FS, files cannot be parents + parent_by_loc[location] = res + if TRACE: logger_debug('Codebase.populate:', res) + + root = self.create_root_resource() + if TRACE: logger_debug('Codebase.populate: root:', root) + + if self.has_single_resource: + # there is nothing else to do for a single file or a single + # childless directory return - res_by_loc = {rloc: root} + # track resources parents by location during construction. + # NOTE: this cannot exhaust memory on a large codebase, because we do + # not keep parents already walked and we walk topdown. + parent_by_loc = {root.location: root} - def err(_error): - self.errors.append( - 'ERROR: cannot collect files: %(error)s\n' % dict(error=_error) - + traceback.format_exc() - ) + # walk proper + for top, dirs, files in os_walk(root.location, topdown=True, onerror=err): + if skip_ignored(top): + continue + # the parent reference is needed only once in a top-doan walk, hence + # the pop + parent = parent_by_loc.pop(top) + create_resources(files, top, parent, _is_file=True) + create_resources(dirs, top, parent, _is_file=False) - # we always ignore VCS and some filetypes. - ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) + def create_root_resource(self): + """ + Create and return the root Resource of this codebase. + """ + # we cannot recreate a root if it exists!! + if self.root: + raise TypeError('Root resource already exists and cannot be recreated') - sorter = lambda p: (p.lower(), p) + location = self.location + name = file_name(location) - # TODO: this is where we would plug archive walking?? - for top, dirs, files in os_walk(rloc, topdown=True, onerror=err): + # do not strip root for codebase with a single Resource. + if self.strip_root: + if self.has_single_resource: + path = fsdecode(name) + else: + # NOTE: this may seem weird but the root path will be an empty + # string for a codebase root with strip_root=True if not + # single_resource + path = '' + else: + path = get_path(location, location, full_root=self.full_root, + strip_root=self.strip_root) + if TRACE: + logger_debug('Codebase.create_resource: root:', path) + logger_debug() - if is_special(top) or ignored(top): - # note: by design the root location is NEVER ignored - if TRACE: logger_debug( - 'Codebase.collect: walk: top ignored:', top, 'ignored:', - ignored(top), 'is_special:', is_special(top)) - continue + root = self.resource_class(name=name, location=location, path=path, + rid=0, pid=None, is_file=self.is_file) - parent = res_by_loc[top] + self.resource_ids.add(0) + self.resources[0] = root + self.root = root + return root - if TRACE: logger_debug('Codebase.collect: parent:', parent) + def create_resource(self, name, parent, is_file=False): + """ + Create and return a new Resource in this codebase with `name` as a child + of the `parent` Resource. + `name` is always in native OS-preferred encoding (e.g. byte on Linux, + unicode elsewhere). + """ + if parent is None: + raise TypeError('Cannot create resource without parent.') - files.sort(key=sorter) - for name in sorted(files): - loc = join(top, name) + rid = self._get_next_rid() - if is_special(loc) or ignored(loc): - if TRACE: logger_debug( - 'Codebase.collect: walk: file ignored:', loc, 'ignored:', - ignored(loc), 'is_special:', is_special(loc)) - continue + if self._must_use_disk_cache(rid): + cache_location = self._get_resource_cache_location(rid, create=True) + else: + cache_location = None - rid += 1 - res = parent._add_child(name, rid, is_file=True) - res_by_loc[loc] = res - resources_append(res) - if TRACE: logger_debug(' Codebase.collect: file:', res) + location = join(parent.location, name) + path = posixpath.join(parent.path, fsdecode(name)) + if TRACE: + logger_debug('Codebase.create_resource: non-root: parent.path', parent.path) + logger_debug('Codebase.create_resource: non-root: path', path) + logger_debug() - dirs.sort(key=sorter) - for name in dirs: - loc = join(top, name) + child = self.resource_class( + name=name, + location=location, + path=path, + cache_location=cache_location, + rid=rid, + pid=parent.rid, + is_file=is_file + ) + + self.resource_ids.add(rid) + parent.children_rids.append(rid) + # TODO: fixme, this is not great to save also the parent :| + self.save_resource(parent) + self.save_resource(child) + return child - if is_special(loc) or ignored(loc): - if TRACE: logger_debug( - 'Codebase.collect: walk: dir ignored:', loc, 'ignored:', - ignored(loc), 'is_special:', is_special(loc)) - continue + def exists(self, resource): + """ + Return True if the Resource with `rid` exists in the codebase. + """ + return resource.rid in self.resource_ids - rid += 1 - res = parent._add_child(name, rid, is_file=False) - res_by_loc[loc] = res - resources_append(res) - if TRACE: logger_debug(' Codebase.collect: dir:', res) + def _must_use_disk_cache(self, rid): + """ + Return True if Resource `rid` should be cached in on disk or False if it + should be cached in memory. + """ + if rid == 0: + return False + if self.all_on_disk: + return True + if self.all_in_memory: + return False + # mixed case where some are in memory and some on disk + if rid < self.max_in_memory: + return False - def walk(self, topdown=True, skip_root=False, skip_filtered=False): + def _exists_in_memory(self, rid): """ - Yield all resources for this Codebase walking its resource tree. - Walk the tree top-down, depth-first if `topdown` is True, otherwise walk - bottom-up. + Return True if Resource `rid` exists in the codebase memory cache. + """ + return rid in self.resources - Each level is sorted by children sort order (e.g. without-children, then - with-children and each group by case-insensitive name) + def _exists_on_disk(self, rid): + """ + Return True if Resource `rid` exists in the codebase disk cache. + """ + cache_location = self._get_resource_cache_location(rid) + return exists(cache_location) - If `skip_root` is True, the root resource is not returned. - If `skip_filtered` is True, resources with `is_filtered` set to True are - not returned. + def get_resource(self, rid): """ - root = self.root + Return the Resource with `rid` or None if it does not exists. + """ + if rid == 0: + return self.root - # do not skip root if has no children (e.g, single root resource) - without_root = (skip_filtered and root.is_filtered) or (skip_root and root.has_children()) + if not rid or rid not in self.resource_ids: + return - if topdown and not without_root: - yield root + if self.all_on_disk: + return self._load_resource(rid) - for res in root.walk(topdown): - if skip_filtered and res.is_filtered: - continue - yield res + if self.all_in_memory or rid < self.max_in_memory: + return self.resources.get(rid) - if not topdown and not without_root: - yield root + return self._load_resource(rid) - def get_resource(self, rid): + def save_resource(self, resource): """ - Return the Resource with `rid` or None if it does not exists. + Save the `resource` Resource to cache (in memory or disk). """ - if rid is not None: - try: - res = self.resources[rid] - if res: - return res - except IndexError: - pass + if not resource: + return + + rid = resource.rid + if rid not in self.resource_ids: + raise UnknownResource('Not part of codebase: %(resource)r' % resource) - def get_resources(self, rids=None): + if resource.is_root: + # we dot nothing for the root at all + return + + if self._must_use_disk_cache(rid): + self._dump_resource(resource) + else: + self.resources[rid] = resource + + def _dump_resource(self, resource): """ - Return a list of Resource with their rid the in the list `rids`. - if `rids` is None, return all resources + Dump a Resource to the disk cache. """ - if rids is None: - return self.resources[:] + cache_location = resource.cache_location - rids = set(rids) - return [res for res in self.resources if res.rid in rids] + if not cache_location: + raise TypeError('Resource cannot be dumped to disk and is used only' + 'in memory: %(resource)r' % resource) - def add_resource(self, name, parent, is_file=False): + # TODO: consider messagepack or protobuf for compact/faster processing? + with codecs.open(cache_location , 'wb', encoding='utf-8') as cached: + json.dump(resource.serialize(), cached, check_circular=False) + + # TODO: consider adding a small LRU cache in frint of this for perf? + def _load_resource(self, rid): """ - Create and return a new Resource object as a child of the - `parent` resource. + Return a Resource with `rid` loaded from the disk cache. """ - return parent.add_child(name, is_file) + cache_location = self._get_resource_cache_location(rid, create=False) + + if not exists(cache_location): + raise ResourceNotInCache( + 'Failed to load Resource: %(rid)d from %(cache_location)r' % locals()) + + # TODO: consider messagepack or protobuf for compact/faster processing + with codecs.open(cache_location, 'r', encoding='utf-8') as cached: + data = json.load(cached, object_pairs_hook=OrderedDict) + return self.resource_class(**data) + + def _remove_resource(self, resource): + """ + Remove the `resource` Resource object from the resource tree. + Does not remove children. + """ + if resource.is_root: + raise TypeError('Cannot remove the root resource from ' + 'codebase:', repr(resource)) + rid = resource.rid + # remove from index. + self.resource_ids.discard(rid) + # remove from in-memory cache. The disk cache is cleared on exit. + self.resources.pop(rid, None) + if TRACE: + logger_debug('Codebase._remove_resource:', resource) def remove_resource(self, resource): """ Remove the `resource` Resource object and all its children from the - resource tree. Return a list of the removed Resource ids. - """ - if resource.pid is None: - raise Exception( - 'Cannot remove the root resource from codebase:', repr(resource)) - rids = [res.rid for res in resource.walk(topdown=True)] - resources = self.resources - for rid in rids: - resources[rid] = None - - parent = resource.parent() - if parent: - try: - parent.children_rids.remove(resource.rid) - except ValueError: - if TRACE: - logger_debug( - 'Codebase.remove_resource() failed for Resource:', resource, - 'at location:', resource.get_path(absolute=True, decode=True)) - return rids + resource tree. + """ + if TRACE: + logger_debug('Codebase.remove_resource') + logger_debug(' resource', resource) + + if resource.is_root: + raise TypeError('Cannot remove the root resource from ' + 'codebase:', repr(resource)) + + removed_rids = set () + + # remove all descendants bottom up to avoid out-of-order access to + # removed resources + for descendant in resource.walk(self, topdown=False): + self._remove_resource(descendant) + removed_rids.add(descendant.rid) + + # remove resource from parent + parent = resource.parent(self) + if TRACE: logger_debug(' parent', parent) + parent.children_rids.remove(resource.rid) + + # remove resource proper + self._remove_resource(resource) + removed_rids.add(resource.rid) + + return removed_rids + + def walk(self, topdown=True, skip_root=False): + """ + Yield all resources for this Codebase walking its resource tree. + Walk the tree top-down, depth-first if `topdown` is True, otherwise walk + bottom-up. + + Each level is sorted by children sort order (e.g. without-children, then + with-children and each group by case-insensitive name) + + If `skip_root` is True, the root resource is not returned unless this is + a codebase with a single resource. + """ + root = self.root + # include root if no children (e.g. codebase with a single resource) + if skip_root and not root.has_children(): + skip_root = False + + if topdown and not skip_root: + yield root + + for res in root.walk(self, topdown): + yield res + + if not topdown and not skip_root: + yield root + + def walk_filtered(self, topdown=True, skip_root=False): + """ + Walk this Codebase as with walk() but doe not return Resources with + `is_filtered` flag set to True. + """ + for resource in self.walk(topdown, skip_root): + if resource.is_filtered: + continue + yield resource def compute_counts(self, skip_root=False, skip_filtered=False): """ @@ -421,6 +564,7 @@ def compute_counts(self, skip_root=False, skip_filtered=False): Return a tuple of top level counters (files_count, dirs_count, size_count) for this codebase. + The counts are computed differently based on these falsg: - If `skip_root` is True, the root resource is not included in counts. - If `skip_filtered` is True, resources with `is_filtered` set to True are not included in counts. @@ -452,20 +596,38 @@ def update_counts(self, skip_filtered=False): not included in counts. """ # note: we walk bottom up to update things in the proper order - # and the walk MUST MNOT skip filtered, only the compute - for resource in self.walk(topdown=False, skip_filtered=False): - resource._compute_children_counts(skip_filtered) + # and the walk MUST NOT skip filtered, only the compute + for resource in self.walk(topdown=False): + resource._compute_children_counts(self, skip_filtered) def clear(self): """ - Purge the codebase cache(s) by deleting the corresponding cached data - files and in-memory data. + Purge the codebase cache(s). """ delete(self.cache_dir) - del_codebase(self.cid) -@attr.attributes(slots=True) +def to_native_path(path): + """ + Return `path` using the preferred OS encoding (bytes on Linux, + Unicode elsewhere) given a unicode or bytes path string. + """ + if not path: + return path + if on_linux: + return fsencode(path) + else: + return fsdecode(path) + + +def to_decoded_posix_path(path): + """ + Return `path` as a Unicode POSIX path given a unicode or bytes path string. + """ + return fsdecode(as_posixpath(path)) + + +@attr.attributes class Resource(object): """ A resource represent a file or directory with essential "file information" @@ -483,56 +645,47 @@ class Resource(object): """ # the file or directory name in the OS preferred representation (either # bytes on Linux and Unicode elsewhere) - name = attr.ib() - - # a integer resource id - rid = attr.ib(type=int) - + name = attr.attrib(converter=to_native_path) + + # the file or directory absolute location in the OS preferred representation + # (either bytes on Linux and Unicode elsewhere) using the OS native path + # separators. + location = attr.attrib(converter=to_native_path, repr=False) + + # the file or directory POSIX path decoded as unicode using the filesystem + # encoding. This is the path that will be reported in output and can be + # either one of these: + # - if the codebase was created with strip_root==True, this is a path + # relative to the root, stripped from its root segment unless the codebase + # contains a single file. + # - if the codebase was created with full_root==True, this is an absolute + # path + path = attr.attrib(converter=to_decoded_posix_path) + + # resource id as an integer + # the root of a Resource tree has a pid==0 by convention + rid = attr.ib() + + # parent resource id of this resource as an integer # the root of a Resource tree has a pid==None by convention - pid = attr.ib(type=int) + pid = attr.ib() - # a integer codebase id - cid = attr.ib(default=None, type=int, repr=False) + # location of the file where this resource can be chached on disk in the OS + # preferred representation (either bytes on Linux and Unicode elsewhere) + cache_location = attr.attrib(default=None, converter=to_native_path, repr=False) # True for file, False for directory - is_file = attr.ib(default=False, type=bool) + is_file = attr.ib(default=False) # True if this Resource should be filtered out, e.g. skipped from the # returned list of resources - is_filtered = attr.ib(default=False, type=bool) + is_filtered = attr.ib(default=False) # a list of rids - children_rids = attr.ib(default=attr.Factory(list), repr=False) - - errors = attr.ib(default=attr.Factory(list), repr=False) - - # a mapping of scan result. Used when scan result is not cached - _scans = attr.ib(default=attr.Factory(OrderedDict), repr=False) - - # True is the cache is used. Set at creation time from the codebase settings - use_cache = attr.ib(default=None, type=bool, repr=False) - - # FIXME: this may not need to be saved?? - # tuple of cache keys: dir and file name - cache_keys = attr.ib(default=None, repr=False) + children_rids = attr.ib(default=attr.Factory(list), repr=TRACE) # external data to serialize - type = attr.ib(default=None, repr=False) - base_name = attr.ib(default=None, repr=False) - extension = attr.ib(default=None, repr=False) - date = attr.ib(default=None, repr=False) - size = attr.ib(default=0, type=int) - sha1 = attr.ib(default=None, repr=False) - md5 = attr.ib(default=None, repr=False) - mime_type = attr.ib(default=None, repr=False) - file_type = attr.ib(default=None, repr=False) - programming_language = attr.ib(default=None, repr=False) - is_binary = attr.ib(default=False, type=bool, repr=False) - is_text = attr.ib(default=False, type=bool, repr=False) - is_archive = attr.ib(default=False, type=bool, repr=False) - is_media = attr.ib(default=False, type=bool, repr=False) - is_source = attr.ib(default=False, type=bool, repr=False) - is_script = attr.ib(default=False, type=bool, repr=False) + size = attr.ib(default=0, type=int, repr=TRACE) # These attributes are re/computed for directories and files with children # they represent are the for the full descendants of a Resource @@ -540,28 +693,38 @@ class Resource(object): files_count = attr.ib(default=0, type=int, repr=False) dirs_count = attr.ib(default=0, type=int, repr=False) + # list of scan error strinsg + scan_errors = attr.ib(default=attr.Factory(list), repr=False) + # Duration in seconds as float to run all scans for this resource scan_time = attr.ib(default=0, repr=False) # mapping of timings for each scan as {scan_key: duration in seconds as a float} - scan_timings = attr.ib(default=None, repr=False) - - def __attrs_post_init__(self): - # TODO: compute rather than store - # build simple cache keys for this resource based on the hex - # representation of the resource id: they are guaranteed to be unique - # within a codebase. - if self.use_cache is None and hasattr(self.codebase, 'use_cache'): - self.use_cache = self.codebase.use_cache - hx = '%08x' % self.rid - if on_linux: - hx = fsencode(hx) - self.cache_keys = hx[-2:], hx + scan_timings = attr.ib(default=attr.Factory(OrderedDict), repr=False) + @property def is_root(self): - return self.pid is None + return self.rid == 0 - def _compute_children_counts(self, skip_filtered=False): + @property + def type(self): + return 'file' if self.is_file else 'directory' + + @property + def base_name(self): + if not self.is_file: + return self.name + base_name, _extension = splitext(self.name) + return base_name + + @property + def extension(self): + if not self.is_file: + return b'' if on_linux else '' + _base_name, extension = splitext(self.name) + return extension + + def _compute_children_counts(self, codebase, skip_filtered=False): """ Compute counts and update self with these counts from direct children. Return a tuple of counters (files_count, dirs_count, size_count) for the @@ -575,7 +738,7 @@ def _compute_children_counts(self, skip_filtered=False): of its files (including the count of files inside archives). """ files_count = dirs_count = size_count = 0 - for child in self.children(): + for child in self.children(codebase): files_count += child.files_count dirs_count += child.dirs_count size_count += child.size_count @@ -594,92 +757,7 @@ def _compute_children_counts(self, skip_filtered=False): self.size_count = size_count return files_count, dirs_count, size_count - @property - def codebase(self): - """ - Return this Resource codebase from the global cache. - """ - return get_codebase(self.cid) - - def _get_cached_path(self, create=False): - """ - Return the path where to get/put a data in the cache given a path. - Create the directories if requested. - Will fail with an Exception if the codebase `use_cache` is False. - """ - if self.use_cache: - cache_sub_dir, cache_file_name = self.cache_keys - parent = join(self.codebase.cache_dir, cache_sub_dir) - if create and not exists(parent): - create_dir(parent) - return join(parent, cache_file_name) - - def get_scans(self, _cached_path=None): - """ - Return a `scans` mapping. Fetch from the cache if the codebase - `use_cache` is True. - """ - if not self.use_cache: - return self._scans - - if not _cached_path: - _cached_path = self._get_cached_path(create=False) - - if not exists(_cached_path): - return OrderedDict() - - # TODO: consider messagepack or protobuf for compact/faster processing - with codecs.open(_cached_path, 'r', encoding='utf-8') as cached: - return json.load(cached, object_pairs_hook=OrderedDict) - - def put_scans(self, scans, update=True): - """ - Save the `scans` mapping of scan results for this resource. Does nothing - if `scans` is empty or None. - Return the saved mapping of `scans`, possibly updated or empty. - If `update` is True, existing scans are updated with `scans`. - If `update` is False, `scans` overwrites existing scans. - If `self.use_cache` is True, `scans` are saved in the cache. - Otherwise they are saved in this resource object. - """ - if TRACE: - logger_debug('put_scans: scans:', scans, 'update:', update, - 'use_cache:', self.use_cache) - - if not scans: - return OrderedDict() - - if not self.use_cache: - if update: - self._scans.update(scans) - else: - self._scans.clear() - self._scans.update(scans) - - if TRACE: logger_debug('put_scans: merged:', self._scans) - return self._scans - - # from here on we use_cache! - self._scans.clear() - cached_path = self._get_cached_path(create=True) - if update: - existing = self.get_scans(cached_path) - if TRACE: logger_debug( - 'put_scans: cached_path:', cached_path, 'existing:', existing) - - existing.update(scans) - - if TRACE: logger_debug('put_scans: merged:', existing) - else: - existing = scans - - # TODO: consider messagepack or protobuf for compact/faster processing - with codecs.open(cached_path, 'wb', encoding='utf-8') as cached_file: - json.dump(existing, cached_file, check_circular=False) - - return existing - - def walk(self, topdown=True): + def walk(self, codebase, topdown=True,): """ Yield all descendant Resources of this Resource. Does not include self. @@ -690,41 +768,21 @@ def walk(self, topdown=True): with-children and each group by case-insensitive name) """ - for child in self.children(): + for child in self.children(codebase): if topdown: yield child - for subchild in child.walk(topdown): + for subchild in child.walk(codebase, topdown): yield subchild if not topdown: yield child - def add_child(self, name, is_file=False): - """ - Create and return a child Resource. Add this child to the codebase - resources and to this Resource children. - """ - rid = self.codebase._get_next_rid() - child = self._add_child(name, rid, is_file) - self.codebase.resources.append(child) - return child - - def _add_child(self, name, rid, is_file=False): - """ - Create a child Resource with `name` and a `rid` Resource id and add its - id to this Resource children. Return the created child. - """ - res = Resource(name=name, rid=rid, pid=self.rid, cid=self.cid, - is_file=is_file, use_cache=self.use_cache) - self.children_rids.append(rid) - return res - def has_children(self): """ Return True is this Resource has children. """ return bool(self.children_rids) - def children(self): + def children(self, codebase): """ Return a sorted sequence of direct children Resource objects for this Resource or an empty sequence. @@ -732,155 +790,136 @@ def children(self): (e.g. directories or files with children), then case-insentive name. """ _sorter = lambda r: (r.has_children(), r.name.lower(), r.name) - resources = self.codebase.resources - return sorted((resources[rid] for rid in self.children_rids), key=_sorter) + get_resource = codebase.get_resource + return sorted((get_resource(rid) for rid in self.children_rids), key=_sorter) def has_parent(self): """ Return True is this Resource has children. """ - return not self.is_root() + return not self.is_root - def parent(self): + def parent(self, codebase): """ Return the parent Resource object for this Resource or None. """ - return self.codebase.get_resource(self.pid) + return codebase.get_resource(self.pid) - def has_siblings(self): + def has_siblings(self, codebase): """ Return True is this Resource has siblings. """ - return self.has_parent() and self.parent().has_children() + return self.has_parent() and self.parent(codebase).has_children() - def siblings(self): + def siblings(self, codebase): """ Return a sequence of sibling Resource objects for this Resource or an empty sequence. """ if self.has_parent(): - return self.parent().children() + return self.parent(codebase).children(codebase) return [] - def ancestors(self): + def ancestors(self, codebase): """ - Return a sequence of ancestor Resource objects from root to self. + Return a sequence of ancestor Resource objects from self to root + (includes self). """ - if self.pid is None: + if self.is_root: return [self] - resources = self.codebase.resources + ancestors = deque() - ancestors_append = ancestors.appendleft current = self - # walk up the tree parent tree: only the root as a pid==None - while current.pid is not None: - ancestors_append(current) - current = resources[current.pid] - ancestors_append(current) + # walk up the tree parent tree up to the root + while not current.is_root: + ancestors.appendleft(current) + current = codebase.get_resource(current.pid) + # append root too + ancestors.appendleft(current) return list(ancestors) - def get_path(self, absolute=False, strip_root=False, decode=False, posix=False): + def to_dict(self, with_timing=False, with_info=False): """ - Return a path to self using the preferred OS encoding (bytes on Linux, - Unicode elsewhere) or Unicode if `decode`=True. - - - If `absolute` is True, return an absolute path. Otherwise return a - relative path where the first segment is the root name. - - - If `strip_root` is True, return a relative path without the first root - segment. Ignored if `absolute` is True. - - - If `decode` is True, return a Unicode path decoded using the filesytem - encoding. - - - If `posix` is True, ensure that the path uses POSIX slash as - separators, otherwise use the native path separators. + Return a mapping of representing this Resource and its scans. """ - ancestors = self.ancestors() - segments = [a.name for a in ancestors] - if absolute: - base_location = self.codebase.base_location - if posix: - base_location = as_posixpath(base_location) - segments.insert(0, base_location) + res = OrderedDict() + res['path'] = self.path - elif strip_root: - if len(segments) > 1: - # we cannot ever strip the root from the root when there is only - # one resource! - segments = segments[1:] + if with_info: + res['type'] = self.type + res['name'] = fsdecode(self.name) + res['base_name'] = fsdecode(self.base_name) + res['extension'] = fsdecode(self.extension) + res['size'] = self.size - path = join(*segments) - if posix: - path = as_posixpath(path) + self_fields_filter = attr.filters.exclude(*attr.fields(Resource)) - if decode: - path = fsdecode(path) - return path + other_data = attr.asdict( + self, filter=self_fields_filter, dict_factory=OrderedDict) - def set_info(self, info): - """ - Set each mapping attribute from the `info` list of mappings of file - information as attributes of this Resource. - """ - if TRACE: - from pprint import pformat - logger_debug() - logger_debug('Resource.set_info:', self, '\n info:', pformat(info)) + res.update(other_data) - if not info: - return - - for inf in info: - for key, value in inf.items(): - setattr(self, key, value) - - if TRACE: - logger_debug('Resource.set_info: to_dict():', pformat(info)) + if with_timing: + res['scan_time'] = self.scan_time or 0 + res['scan_timings'] = self.scan_timings or {} - def to_dict(self, full_root=False, strip_root=False, - with_info=False, with_timing=False): - """ - Return a mapping of representing this Resource and its scans. - """ - res = OrderedDict() - res['path'] = fsdecode(self.get_path( - absolute=full_root, strip_root=strip_root, decode=True, posix=True)) if with_info: - res['type'] = self.type - res['name'] = self.name and fsdecode(self.name) or '' - res['base_name'] = self.base_name and fsdecode(self.base_name) or '' - res['extension'] = self.extension and fsdecode(self.extension) or '' - res['date'] = self.date - res['size'] = self.size - res['sha1'] = self.sha1 - res['md5'] = self.md5 res['files_count'] = self.files_count res['dirs_count'] = self.dirs_count res['size_count'] = self.size_count - res['mime_type'] = self.mime_type - res['file_type'] = self.file_type - res['programming_language'] = self.programming_language - res['is_binary'] = self.is_binary - res['is_text'] = self.is_text - res['is_archive'] = self.is_archive - res['is_media'] = self.is_media - res['is_source'] = self.is_source - res['is_script'] = self.is_script - if with_timing: - res['scan_timings'] = self.scan_timings or {} - res['scan_errors'] = self.errors - res.update(self.get_scans()) + res['scan_errors'] = self.scan_errors if TRACE: logger_debug('Resource.to_dict:', res) return res + def serialize(self): + """ + Return a mapping of representing this Resource and its scans in a form + that is fully serializable and can be used to reconstruct a Resource. + All path-derived OS-native strings are decoded to Unicode for JSON + serialization. + """ + saveable = attr.asdict(self, dict_factory=OrderedDict) + saveable['name'] = fsdecode(self.name) + saveable['location'] = fsdecode(self.location) + if self.cache_location: + saveable['cache_location'] = fsdecode(self.cache_location) + return saveable + + +def get_path(root_location, location, full_root=False, strip_root=False): + """ + Return a Unicode POSIX `path` (using "/" separators) derived from + `root_location` and `location` (both absolute native locations + respectively the root location of the codebase and to the Resource). + + - If `full_root` is True, return an absolute path. Otherwise return a + relative path where the first segment is the root name. + + - If `strip_root` is True, return a relative path without the first root + segment. Ignored if `full_root` is True. + """ + + posix_loc = fsdecode(as_posixpath(location)) + if full_root: + return posix_loc + + if not strip_root: + # keep the root directory name by default + root_loc = parent_directory(root_location) + else: + root_loc = root_location + + posix_root_loc = fsdecode(as_posixpath(root_loc)).rstrip('/') + '/' + + return posix_loc.replace(posix_root_loc, '', 1) + -def get_results_cache_dir(temp_dir=scancode_temp_dir): +def get_codebase_cache_dir(temp_dir=scancode_temp_dir): """ Return a new, created and unique per-run cache storage directory path rooted - at the `temp_dir` base temp directory in the OS- preferred representation + at the `temp_dir` base temp directory in the OS-preferred representation (either bytes on Linux and Unicode elsewhere). """ from commoncode.fileutils import get_temp_dir diff --git a/src/scancode/utils.py b/src/scancode/utils.py index b9e76b79eec..c513ef5e3c6 100644 --- a/src/scancode/utils.py +++ b/src/scancode/utils.py @@ -34,11 +34,9 @@ from click._termui_impl import ProgressBar from commoncode.fileutils import file_name -from commoncode.fileutils import fsdecode from commoncode.fileutils import splitext from commoncode.text import toascii - # Python 2 and 3 support try: # Python 2 diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index bbf4af81230..e38066deeab 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,16 +1,16 @@ -Resource,type,name,base_name,extension,date,size,sha1,md5,files_count,dirs_count,size_count,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level -/json2csv.rb,file,json2csv.rb,json2csv,.rb,2017-10-03,1014,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,0,0,0,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level +/json2csv.rb,file,json2csv.rb,json2csv,.rb,1014,2017-10-03,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, -/license,file,license,license,,2017-10-03,679,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,0,0,0,text/plain,ASCII text,,False,True,False,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,[u'gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2017-10-03,2200,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,0,0,0,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,file,license,license,,679,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,['gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2200,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,[u'mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,['mit'],,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index aaeae70f17e..9b273013432 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -19,9 +19,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -31,10 +28,13 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], - "packages": [] + "packages": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 55, + "scan_errors": [] }, { "path": "simple/copyright_acme_c-c.c", @@ -45,9 +45,6 @@ "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", @@ -57,7 +54,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -72,7 +68,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index 2d6420943a1..c643a3ffdd4 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -21,9 +21,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -33,6 +30,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 1, + "dirs_count": 0, + "size_count": 55, "scan_errors": [] } ] @@ -48,9 +48,6 @@ "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", @@ -60,6 +57,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 75e606fe7e3..b542ca37de6 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -19,9 +19,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 55, "mime_type": null, "file_type": null, "programming_language": null, @@ -31,10 +28,13 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], - "packages": [] + "packages": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 55, + "scan_errors": [] }, { "path": "simple/copyright_acme_c-c.c", @@ -45,9 +45,6 @@ "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", @@ -57,7 +54,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -72,7 +68,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index c9a2259e987..235cef0a411 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -20,9 +20,6 @@ "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -32,7 +29,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -47,7 +43,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "copy2.c", @@ -58,9 +58,6 @@ "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -70,7 +67,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -85,7 +81,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "copy3.c", @@ -96,9 +96,6 @@ "size": 91, "sha1": "c91811eb5fdc7ab440355f9f8d1580e1518b0c2f", "md5": "e999e21c9d7de4d0f943aefbb6f21b99", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -108,7 +105,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -123,7 +119,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "subdir", @@ -134,9 +134,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 4, - "dirs_count": 0, - "size_count": 361, "mime_type": null, "file_type": null, "programming_language": null, @@ -146,10 +143,13 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], - "packages": [] + "packages": [], + "files_count": 4, + "dirs_count": 0, + "size_count": 361, + "scan_errors": [] }, { "path": "subdir/copy1.c", @@ -160,9 +160,6 @@ "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -172,7 +169,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -187,7 +183,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "subdir/copy2.c", @@ -198,9 +198,6 @@ "size": 91, "sha1": "3922760d8492eb8f853c10a627f5a73f9eaec6ff", "md5": "fc7f53659b7a9db8b6dff0638641778e", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -210,7 +207,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -225,7 +221,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "subdir/copy3.c", @@ -236,9 +236,6 @@ "size": 84, "sha1": "389af7e629a9853056e42b262d5e30bf4579a74f", "md5": "290627a1387288ef77ae7e07946f3ecf", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -248,7 +245,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -263,7 +259,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "subdir/copy4.c", @@ -274,9 +274,6 @@ "size": 95, "sha1": "58748872d25374160692f1ed7075d0fe80a544b1", "md5": "88e46475db9b1a68f415f6a3544eeb16", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", "programming_language": "C", @@ -286,7 +283,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [ { @@ -301,7 +297,11 @@ "end_line": 1 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/formattedcode/test_output_jsonlines.py b/tests/formattedcode/test_output_jsonlines.py index 78ae7202497..9c01cdefcd9 100644 --- a/tests/formattedcode/test_output_jsonlines.py +++ b/tests/formattedcode/test_output_jsonlines.py @@ -107,7 +107,14 @@ def test_jsonlines_with_timing(): first_line = False continue scan_timings = res['files'][0]['scan_timings'] + + if not res['files'][0]['type'] == 'file': + # should be an empty dict for dirs + assert not scan_timings + continue + assert scan_timings + for scanner, timing in scan_timings.items(): - assert scanner in ('infos',) + assert scanner in ('info',) assert timing diff --git a/tests/formattedcode/test_output_templated.py b/tests/formattedcode/test_output_templated.py index 824bbaad508..75b03f61210 100644 --- a/tests/formattedcode/test_output_templated.py +++ b/tests/formattedcode/test_output_templated.py @@ -114,7 +114,7 @@ def test_scan_html_output_does_not_truncate_copyright_html(): def test_custom_format_with_custom_filename_fails_for_directory(): test_dir = test_env.get_temp_dir('html') result_file = test_env.get_temp_file('html') - args = ['--custom-template', test_dir, '--output-custom', result_file, test_dir] + args = ['--info', '--custom-template', test_dir, '--output-custom', result_file, test_dir] result = run_scan_click(args, expected_rc=2) assert 'Invalid value for "--custom-template": Path' in result.output @@ -123,7 +123,7 @@ def test_custom_format_with_custom_filename(): test_dir = test_env.get_test_loc('templated/simple') custom_template = test_env.get_test_loc('templated/sample-template.html') result_file = test_env.get_temp_file('html') - args = ['--custom-template', custom_template, '--output-custom', result_file, test_dir] + args = ['--info', '--custom-template', custom_template, '--output-custom', result_file, test_dir] run_scan_click(args) results = open(result_file).read() assert 'Custom Template' in results diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index 77c1c876a4d..baf21fed85b 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -18,9 +18,6 @@ "size": 55, "sha1": "e2466d5b764d27fb301ceb439ffb5da22e43ab1d", "md5": "bdf7c572beb4094c2059508fa73c05a4", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", @@ -30,7 +27,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "copyrights": [ { "statements": [ @@ -43,7 +39,11 @@ "start_line": 1, "end_line": 1 } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/composer/composer.expected.json b/tests/scancode/data/composer/composer.expected.json index cf4d348dfe6..126dbc1d7d1 100644 --- a/tests/scancode/data/composer/composer.expected.json +++ b/tests/scancode/data/composer/composer.expected.json @@ -9,7 +9,6 @@ "files": [ { "path": "composer.json", - "scan_errors": [], "packages": [ { "type": "phpcomposer", @@ -119,7 +118,8 @@ }, "related_packages": [] } - ] + ], + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/failing/patchelf.expected.json b/tests/scancode/data/failing/patchelf.expected.json index 3666b1f8f92..68f8b43fa6b 100644 --- a/tests/scancode/data/failing/patchelf.expected.json +++ b/tests/scancode/data/failing/patchelf.expected.json @@ -10,10 +10,10 @@ "files": [ { "path": "patchelf.pdf", + "copyrights": [], "scan_errors": [ "ERROR: for scanner: copyrights:\nerror: unpack requires a string argument of length 8\n" - ], - "copyrights": [] + ] } ] } \ No newline at end of file diff --git a/tests/scancode/data/help/help.txt b/tests/scancode/data/help/help.txt index b3502ac1afb..8030e231f4d 100644 --- a/tests/scancode/data/help/help.txt +++ b/tests/scancode/data/help/help.txt @@ -39,10 +39,8 @@ Options: Jinja template file. --custom-template FILE Use this Jinja template FILE as a custom template. --output-html-app FILE Write scan output as a mini HTML application to FILE. - --output-spdx-rdf FILE Write scan output as SPDX RDF to FILE. Implies running - the --info scan. - --output-spdx-tv FILE Write scan output as SPDX Tag/Value to FILE. Implies - running the --info scan. + --output-spdx-rdf FILE Write scan output as SPDX RDF to FILE. + --output-spdx-tv FILE Write scan output as SPDX Tag/Value to FILE. output filters: --only-findings Only return files or directories with findings for the @@ -62,33 +60,38 @@ Options: post-scan: --mark-source Set the "is_source" to true for directories that contain over - 90% of source files as children and descendants. Implies - running the --info scan. + 90% of source files as children and descendants. Count the + number of source files in a directory as a new + source_file_counts attribute core: - --timeout Stop an unfinished file scan after a timeout in seconds. - [default: 120 seconds] - -n, --processes INT Set the number of parallel processes to use. Disable - parallel processing if 0. Also disable threading if -1. - [default: 1] - --quiet Do not print summary or progress. - --verbose Print progress as file-by-file path instead of a - progress bar. Print a verbose scan summary. - --cache-dir DIR Set the path to an existing directory where ScanCode can - cache files available across runs.If not set, the value - of the `SCANCODE_CACHE` environment variable is used if - available. If `SCANCODE_CACHE` is not set, a default sub- - directory in the user home directory is used instead. - [default: ~/.cache/scancode-tk/version] - --temp-dir DIR Set the path to an existing directory where ScanCode can - create temporary files. If not set, the value of the - `SCANCODE_TMP` environment variable is used if available. - If `SCANCODE_TMP` is not set, a default sub-directory in - the system temp directory is used instead. [default: TMP - /scancode-tk-] - --timing Collect scan timing for each scan/scanned file. - --on-disk-results Save intermediate scan results in temporary files. Uses - less memory. [default: True] + --timeout Stop an unfinished file scan after a timeout in + seconds. [default: 120 seconds] + -n, --processes INT Set the number of parallel processes to use. Disable + parallel processing if 0. Also disable threading if + -1. [default: 1] + --quiet Do not print summary or progress. + --verbose Print progress as file-by-file path instead of a + progress bar. Print a verbose scan summary. + --cache-dir DIR Set the path to an existing directory where ScanCode + can cache files available across runs.If not set, the + value of the `SCANCODE_CACHE` environment variable is + used if available. If `SCANCODE_CACHE` is not set, a + default sub-directory in the user home directory is + used instead. [default: ~/.cache/scancode-tk/version] + --temp-dir DIR Set the path to an existing directory where ScanCode + can create temporary files. If not set, the value of + the `SCANCODE_TMP` environment variable is used if + available. If `SCANCODE_TMP` is not set, a default + sub-directory in the system temp directory is used + instead. [default: TMP/scancode-tk-] + --timing Collect scan timing for each scan/scanned file. + --max-in-memory INTEGER Maximum number of files and directories scan details + kept in memory during a scan. Additional files and + directories scan details above this number are cached + on-disk rather than in memory. Use 0 to use unlimited + memory and disable on-disk caching. Use -1 to use + only on-disk caching. [default: 10000] miscellaneous: --reindex-licenses Check the license index cache and reindex if needed and diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index ab9f38c9a44..dc7b27cb980 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -16,13 +16,10 @@ "name": "basic", "base_name": "basic", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 6, - "dirs_count": 4, - "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -32,9 +29,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 6, + "dirs_count": 4, + "size_count": 57066, + "scan_errors": [] }, { "path": "basic/dbase.fdt", @@ -42,13 +42,10 @@ "name": "dbase.fdt", "base_name": "dbase", "extension": ".fdt", - "date": "2015-06-19", "size": 183, + "date": "2015-06-19", "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -58,9 +55,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir", @@ -68,13 +68,10 @@ "name": "dir", "base_name": "dir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -84,9 +81,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 18486, + "scan_errors": [] }, { "path": "basic/dir/e.tar", @@ -94,13 +94,10 @@ "name": "e.tar", "base_name": "e", "extension": ".tar", - "date": "2015-06-19", "size": 10240, + "date": "2015-06-19", "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -110,9 +107,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir/subdir", @@ -120,13 +120,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -136,9 +133,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 8246, + "scan_errors": [] }, { "path": "basic/dir/subdir/a.aif", @@ -146,13 +146,10 @@ "name": "a.aif", "base_name": "a", "extension": ".aif", - "date": "2015-06-19", "size": 8246, + "date": "2015-06-19", "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -162,9 +159,12 @@ "is_media": true, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir2", @@ -172,13 +172,10 @@ "name": "dir2", "base_name": "dir2", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -188,9 +185,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 36457, + "scan_errors": [] }, { "path": "basic/dir2/subdir", @@ -198,13 +198,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 0, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -214,9 +211,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 2, + "dirs_count": 0, + "size_count": 36457, + "scan_errors": [] }, { "path": "basic/dir2/subdir/bcopy.s", @@ -224,13 +224,10 @@ "name": "bcopy.s", "base_name": "bcopy", "extension": ".s", - "date": "2015-06-19", "size": 32452, + "date": "2015-06-19", "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -240,7 +237,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [ { "key": "bsd-original-uc", @@ -285,7 +281,11 @@ "start_line": 34, "end_line": 37 } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir2/subdir/config.conf", @@ -293,13 +293,10 @@ "name": "config.conf", "base_name": "config", "extension": ".conf", - "date": "2015-06-19", "size": 4005, + "date": "2015-06-19", "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -309,9 +306,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/main.c", @@ -319,13 +319,10 @@ "name": "main.c", "base_name": "main", "extension": ".c", - "date": "2015-06-19", "size": 1940, + "date": "2015-06-19", "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", @@ -335,7 +332,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [ { "key": "gpl-2.0", @@ -394,7 +390,11 @@ "start_line": 2, "end_line": 3 } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/info/all.rooted.expected.json b/tests/scancode/data/info/all.rooted.expected.json index d4ab5003188..0552a6bfe29 100644 --- a/tests/scancode/data/info/all.rooted.expected.json +++ b/tests/scancode/data/info/all.rooted.expected.json @@ -12,79 +12,78 @@ "files": [ { "path": "basic.tgz", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dbase.fdt", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir/e.tar", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir/subdir", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir/subdir/a.aif", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir2", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir2/subdir", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], - "urls": [] + "urls": [], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir2/subdir/bcopy.s", - "scan_errors": [], "licenses": [ { "key": "bsd-original-uc", @@ -143,11 +142,11 @@ "start_line": 17, "end_line": 17 } - ] + ], + "scan_errors": [] }, { "path": "basic.tgz/basic/dir2/subdir/config.conf", - "scan_errors": [], "licenses": [], "copyrights": [], "emails": [], @@ -157,11 +156,11 @@ "start_line": 2, "end_line": 2 } - ] + ], + "scan_errors": [] }, { "path": "basic.tgz/basic/main.c", - "scan_errors": [], "licenses": [ { "key": "gpl-2.0", @@ -228,7 +227,8 @@ "end_line": 3 } ], - "urls": [] + "urls": [], + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index a226ed9ca2d..bc955859f59 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -14,13 +14,10 @@ "name": "basic", "base_name": "basic", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 6, - "dirs_count": 4, - "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -30,6 +27,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 6, + "dirs_count": 4, + "size_count": 57066, "scan_errors": [] }, { @@ -38,13 +38,10 @@ "name": "dbase.fdt", "base_name": "dbase", "extension": ".fdt", - "date": "2015-06-19", "size": 183, + "date": "2015-06-19", "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -54,6 +51,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -62,13 +62,10 @@ "name": "dir", "base_name": "dir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -78,6 +75,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 1, + "size_count": 18486, "scan_errors": [] }, { @@ -86,13 +86,10 @@ "name": "e.tar", "base_name": "e", "extension": ".tar", - "date": "2015-06-19", "size": 10240, + "date": "2015-06-19", "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -102,6 +99,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -110,13 +110,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -126,6 +123,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 1, + "dirs_count": 0, + "size_count": 8246, "scan_errors": [] }, { @@ -134,13 +134,10 @@ "name": "a.aif", "base_name": "a", "extension": ".aif", - "date": "2015-06-19", "size": 8246, + "date": "2015-06-19", "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -150,6 +147,9 @@ "is_media": true, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -158,13 +158,10 @@ "name": "dir2", "base_name": "dir2", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -174,6 +171,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 1, + "size_count": 36457, "scan_errors": [] }, { @@ -182,13 +182,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 0, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -198,6 +195,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 0, + "size_count": 36457, "scan_errors": [] }, { @@ -206,13 +206,10 @@ "name": "bcopy.s", "base_name": "bcopy", "extension": ".s", - "date": "2015-06-19", "size": 32452, + "date": "2015-06-19", "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -222,6 +219,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -230,13 +230,10 @@ "name": "config.conf", "base_name": "config", "extension": ".conf", - "date": "2015-06-19", "size": 4005, + "date": "2015-06-19", "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -246,6 +243,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -254,13 +254,10 @@ "name": "main.c", "base_name": "main", "extension": ".c", - "date": "2015-06-19", "size": 1940, + "date": "2015-06-19", "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", @@ -270,6 +267,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index da3feca0ee1..cbb8333b1d3 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -13,13 +13,10 @@ "name": "basic.tgz", "base_name": "basic.tgz", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 6, - "dirs_count": 5, - "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -29,6 +26,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 6, + "dirs_count": 5, + "size_count": 57066, "scan_errors": [] }, { @@ -37,13 +37,10 @@ "name": "basic", "base_name": "basic", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 6, - "dirs_count": 4, - "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -53,6 +50,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 6, + "dirs_count": 4, + "size_count": 57066, "scan_errors": [] }, { @@ -61,13 +61,10 @@ "name": "dbase.fdt", "base_name": "dbase", "extension": ".fdt", - "date": "2015-06-19", "size": 183, + "date": "2015-06-19", "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -77,6 +74,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -85,13 +85,10 @@ "name": "dir", "base_name": "dir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -101,6 +98,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 1, + "size_count": 18486, "scan_errors": [] }, { @@ -109,13 +109,10 @@ "name": "e.tar", "base_name": "e", "extension": ".tar", - "date": "2015-06-19", "size": 10240, + "date": "2015-06-19", "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -125,6 +122,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -133,13 +133,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -149,6 +146,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 1, + "dirs_count": 0, + "size_count": 8246, "scan_errors": [] }, { @@ -157,13 +157,10 @@ "name": "a.aif", "base_name": "a", "extension": ".aif", - "date": "2015-06-19", "size": 8246, + "date": "2015-06-19", "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -173,6 +170,9 @@ "is_media": true, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -181,13 +181,10 @@ "name": "dir2", "base_name": "dir2", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -197,6 +194,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 1, + "size_count": 36457, "scan_errors": [] }, { @@ -205,13 +205,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 0, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -221,6 +218,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 2, + "dirs_count": 0, + "size_count": 36457, "scan_errors": [] }, { @@ -229,13 +229,10 @@ "name": "bcopy.s", "base_name": "bcopy", "extension": ".s", - "date": "2015-06-19", "size": 32452, + "date": "2015-06-19", "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -245,6 +242,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -253,13 +253,10 @@ "name": "config.conf", "base_name": "config", "extension": ".conf", - "date": "2015-06-19", "size": 4005, + "date": "2015-06-19", "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -269,6 +266,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -277,13 +277,10 @@ "name": "main.c", "base_name": "main", "extension": ".c", - "date": "2015-06-19", "size": 1940, + "date": "2015-06-19", "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", @@ -293,6 +290,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index cf9340c1f28..bbc1ac28045 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -16,13 +16,10 @@ "name": "basic", "base_name": "basic", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 6, - "dirs_count": 4, - "size_count": 57066, "mime_type": null, "file_type": null, "programming_language": null, @@ -32,9 +29,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 6, + "dirs_count": 4, + "size_count": 57066, + "scan_errors": [] }, { "path": "basic/dbase.fdt", @@ -42,13 +42,10 @@ "name": "dbase.fdt", "base_name": "dbase", "extension": ".fdt", - "date": "2015-06-19", "size": 183, + "date": "2015-06-19", "sha1": "94f059d6478d5f460e79b6b948a7fa9849d4dfdc", "md5": "15240737ec72b9e88b485a663bd045f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/octet-stream", "file_type": "data", "programming_language": null, @@ -58,9 +55,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir", @@ -68,13 +68,10 @@ "name": "dir", "base_name": "dir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 18486, "mime_type": null, "file_type": null, "programming_language": null, @@ -84,9 +81,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 18486, + "scan_errors": [] }, { "path": "basic/dir/e.tar", @@ -94,13 +94,10 @@ "name": "e.tar", "base_name": "e", "extension": ".tar", - "date": "2015-06-19", "size": 10240, + "date": "2015-06-19", "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -110,9 +107,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir/subdir", @@ -120,13 +120,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 1, - "dirs_count": 0, - "size_count": 8246, "mime_type": null, "file_type": null, "programming_language": null, @@ -136,9 +133,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 8246, + "scan_errors": [] }, { "path": "basic/dir/subdir/a.aif", @@ -146,13 +146,10 @@ "name": "a.aif", "base_name": "a", "extension": ".aif", - "date": "2015-06-19", "size": 8246, + "date": "2015-06-19", "sha1": "03cfd28bb49d1dab105dcce1663630be1ddd821a", "md5": "b2b073a64e4d568ce7b641c1857a7116", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "audio/x-aiff", "file_type": "IFF data, AIFF audio", "programming_language": null, @@ -162,9 +159,12 @@ "is_media": true, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir2", @@ -172,13 +172,10 @@ "name": "dir2", "base_name": "dir2", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 1, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -188,9 +185,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 36457, + "scan_errors": [] }, { "path": "basic/dir2/subdir", @@ -198,13 +198,10 @@ "name": "subdir", "base_name": "subdir", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 2, - "dirs_count": 0, - "size_count": 36457, "mime_type": null, "file_type": null, "programming_language": null, @@ -214,9 +211,12 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 2, + "dirs_count": 0, + "size_count": 36457, + "scan_errors": [] }, { "path": "basic/dir2/subdir/bcopy.s", @@ -224,13 +224,10 @@ "name": "bcopy.s", "base_name": "bcopy", "extension": ".s", - "date": "2015-06-19", "size": 32452, + "date": "2015-06-19", "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -240,7 +237,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "emails": [ { "email": "ws@tools.de", @@ -254,7 +250,11 @@ "start_line": 17, "end_line": 17 } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/dir2/subdir/config.conf", @@ -262,13 +262,10 @@ "name": "config.conf", "base_name": "config", "extension": ".conf", - "date": "2015-06-19", "size": 4005, + "date": "2015-06-19", "sha1": "4d567dc15d2117445389edfb64ced872329bceaa", "md5": "107dd38273ab10ce12058a3c8977e4ee", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -278,7 +275,6 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "emails": [], "urls": [ { @@ -286,7 +282,11 @@ "start_line": 2, "end_line": 2 } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic/main.c", @@ -294,13 +294,10 @@ "name": "main.c", "base_name": "main", "extension": ".c", - "date": "2015-06-19", "size": 1940, + "date": "2015-06-19", "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", @@ -310,7 +307,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "emails": [ { "email": "j@w1.fi", @@ -318,7 +314,11 @@ "end_line": 3 } ], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/license_text/test.expected b/tests/scancode/data/license_text/test.expected index b1411758535..12eda46c42e 100644 --- a/tests/scancode/data/license_text/test.expected +++ b/tests/scancode/data/license_text/test.expected @@ -11,7 +11,6 @@ "files": [ { "path": "test.txt", - "scan_errors": [], "licenses": [ { "key": "lgpl-2.1", @@ -35,7 +34,8 @@ }, "matched_text": "license: LGPL-2.1" } - ] + ], + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/non_utf8/expected-linux.json b/tests/scancode/data/non_utf8/expected-linux.json index 505c1e8cb9c..1c936f53042 100644 --- a/tests/scancode/data/non_utf8/expected-linux.json +++ b/tests/scancode/data/non_utf8/expected-linux.json @@ -14,13 +14,10 @@ "name": "non_unicode", "base_name": "non_unicode", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 18, - "dirs_count": 0, - "size_count": 0, "mime_type": null, "file_type": null, "programming_language": null, @@ -30,6 +27,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 18, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -38,13 +38,10 @@ "name": "foo\udcb1bar", "base_name": "foo\udcb1bar", "extension": "", - "date": "2017-07-14", "size": 0, + "date": "2017-07-14", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -54,6 +51,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -62,13 +62,10 @@ "name": "non_ascii_-\u00e0\u00f2\u0258\u0141\u011f", "base_name": "non_ascii_-\u00e0\u00f2\u0258\u0141\u011f", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -78,6 +75,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -86,13 +86,10 @@ "name": "non_ascii_10_\u0e01", "base_name": "non_ascii_10_\u0e01", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -102,6 +99,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -110,13 +110,10 @@ "name": "non_ascii_11_\u00a0", "base_name": "non_ascii_11_\u00a0", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -126,6 +123,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -134,13 +134,10 @@ "name": "non_ascii_12_\u20ac", "base_name": "non_ascii_12_\u20ac", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -150,6 +147,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -158,13 +158,10 @@ "name": "non_ascii_2_\u00e6", "base_name": "non_ascii_2_\u00e6", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -174,6 +171,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -182,13 +182,10 @@ "name": "non_ascii_3_\u0130", "base_name": "non_ascii_3_\u0130", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -198,6 +195,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -206,13 +206,10 @@ "name": "non_ascii_4_\u0141", "base_name": "non_ascii_4_\u0141", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -222,6 +219,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -230,13 +230,10 @@ "name": "non_ascii_5_\u03c6", "base_name": "non_ascii_5_\u03c6", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -246,6 +243,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -254,13 +254,10 @@ "name": "non_ascii_6_\u041a", "base_name": "non_ascii_6_\u041a", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -270,6 +267,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -278,13 +278,10 @@ "name": "non_ascii_7_\u05d0", "base_name": "non_ascii_7_\u05d0", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -294,6 +291,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -302,13 +302,10 @@ "name": "non_ascii_8_\u060c", "base_name": "non_ascii_8_\u060c", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -318,6 +315,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -326,13 +326,10 @@ "name": "non_ascii_9_\u062a", "base_name": "non_ascii_9_\u062a", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -342,6 +339,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -350,13 +350,10 @@ "name": "non_cp12_decodable_\udc81\udc98", "base_name": "non_cp12_decodable_\udc81\udc98", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -366,6 +363,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -374,13 +374,10 @@ "name": "non_cp932_decodable_\udce7w\udcf0", "base_name": "non_cp932_decodable_\udce7w\udcf0", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -390,6 +387,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -398,13 +398,10 @@ "name": "non_utf8_decodable_2_\udced\udcb2\udc80", "base_name": "non_utf8_decodable_2_\udced\udcb2\udc80", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -414,6 +411,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -422,13 +422,10 @@ "name": "non_utf8_decodable_3_\udced\udcb4\udc80", "base_name": "non_utf8_decodable_3_\udced\udcb4\udc80", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -438,6 +435,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -446,13 +446,10 @@ "name": "non_utf8_decodable_\udcff", "base_name": "non_utf8_decodable_\udcff", "extension": "", - "date": "2017-08-27", "size": 0, + "date": "2017-08-27", "sha1": null, "md5": null, - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "inode/x-empty", "file_type": "empty", "programming_language": null, @@ -462,6 +459,9 @@ "is_media": false, "is_source": false, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/scancode/data/plugin_license/license_url.expected.json b/tests/scancode/data/plugin_license/license_url.expected.json index b61b7e94328..8d8dcf7366d 100644 --- a/tests/scancode/data/plugin_license/license_url.expected.json +++ b/tests/scancode/data/plugin_license/license_url.expected.json @@ -10,12 +10,11 @@ "files": [ { "path": "license_url", - "scan_errors": [], - "licenses": [] + "licenses": [], + "scan_errors": [] }, { "path": "license_url/apache-1.0.txt", - "scan_errors": [], "licenses": [ { "key": "apache-1.0", @@ -61,7 +60,8 @@ ] } } - ] + ], + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/plugin_mark_source/with_info.expected.json b/tests/scancode/data/plugin_mark_source/with_info.expected.json index a3a002ba4d3..ab0b6745412 100644 --- a/tests/scancode/data/plugin_mark_source/with_info.expected.json +++ b/tests/scancode/data/plugin_mark_source/with_info.expected.json @@ -14,13 +14,10 @@ "name": "JGroups.tgz", "base_name": "JGroups.tgz", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 12, - "dirs_count": 3, - "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -30,6 +27,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 12, + "dirs_count": 3, + "size_count": 206642, "scan_errors": [] }, { @@ -38,13 +39,10 @@ "name": "JGroups", "base_name": "JGroups", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 12, - "dirs_count": 2, - "size_count": 206642, "mime_type": null, "file_type": null, "programming_language": null, @@ -54,6 +52,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 12, + "dirs_count": 2, + "size_count": 206642, "scan_errors": [] }, { @@ -62,13 +64,10 @@ "name": "licenses", "base_name": "licenses", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 5, - "dirs_count": 0, - "size_count": 54552, "mime_type": null, "file_type": null, "programming_language": null, @@ -78,6 +77,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 5, + "dirs_count": 0, + "size_count": 54552, "scan_errors": [] }, { @@ -86,13 +89,10 @@ "name": "apache-1.1.txt", "base_name": "apache-1.1", "extension": ".txt", - "date": "2017-08-05", "size": 2885, + "date": "2017-08-05", "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", "md5": "276982197c941f4cbf3d218546e17ae2", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -102,6 +102,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -110,13 +114,10 @@ "name": "apache-2.0.txt", "base_name": "apache-2.0", "extension": ".txt", - "date": "2017-08-05", "size": 11560, + "date": "2017-08-05", "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", "md5": "d273d63619c9aeaf15cdaf76422c4f87", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -126,6 +127,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -134,13 +139,10 @@ "name": "bouncycastle.txt", "base_name": "bouncycastle", "extension": ".txt", - "date": "2017-08-05", "size": 1186, + "date": "2017-08-05", "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", "md5": "9fffd8de865a5705969f62b128381f85", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -150,6 +152,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -158,13 +164,10 @@ "name": "cpl-1.0.txt", "base_name": "cpl-1.0", "extension": ".txt", - "date": "2017-08-05", "size": 11987, + "date": "2017-08-05", "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -174,6 +177,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -182,13 +189,10 @@ "name": "lgpl.txt", "base_name": "lgpl", "extension": ".txt", - "date": "2017-08-05", "size": 26934, + "date": "2017-08-05", "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", "md5": "f14599a2f089f6ff8c97e2baa4e3d575", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, @@ -198,6 +202,10 @@ "is_media": false, "is_source": false, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -206,13 +214,10 @@ "name": "src", "base_name": "src", "extension": "", - "date": null, "size": 0, + "date": null, "sha1": null, "md5": null, - "files_count": 7, - "dirs_count": 0, - "size_count": 152090, "mime_type": null, "file_type": null, "programming_language": null, @@ -222,6 +227,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 7, + "files_count": 7, + "dirs_count": 0, + "size_count": 152090, "scan_errors": [] }, { @@ -230,13 +239,10 @@ "name": "FixedMembershipToken.java", "base_name": "FixedMembershipToken", "extension": ".java", - "date": "2017-08-05", "size": 5144, + "date": "2017-08-05", "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", "md5": "aca9640ec8beee21b098bcf8ecc91442", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -246,6 +252,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -254,13 +264,10 @@ "name": "GuardedBy.java", "base_name": "GuardedBy", "extension": ".java", - "date": "2017-08-05", "size": 813, + "date": "2017-08-05", "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", "md5": "c5064400f759d3e81771005051d17dc1", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -270,6 +277,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -278,13 +289,10 @@ "name": "ImmutableReference.java", "base_name": "ImmutableReference", "extension": ".java", - "date": "2017-08-05", "size": 1838, + "date": "2017-08-05", "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", "md5": "48ca3c72fb9a65c771a321222f118b88", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -294,6 +302,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -302,13 +314,10 @@ "name": "RATE_LIMITER.java", "base_name": "RATE_LIMITER", "extension": ".java", - "date": "2017-08-05", "size": 3692, + "date": "2017-08-05", "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", "md5": "4626bdbc48871b55513e1a12991c61a8", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -318,6 +327,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -326,13 +339,10 @@ "name": "RouterStub.java", "base_name": "RouterStub", "extension": ".java", - "date": "2017-08-05", "size": 9913, + "date": "2017-08-05", "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", "md5": "eecfe23494acbcd8088c93bc1e83c7f2", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -342,6 +352,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -350,13 +364,10 @@ "name": "RouterStubManager.java", "base_name": "RouterStubManager", "extension": ".java", - "date": "2017-08-05", "size": 8162, + "date": "2017-08-05", "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", "md5": "20bee9631b7c82a45c250e095352aec7", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -366,6 +377,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] }, { @@ -374,13 +389,10 @@ "name": "S3_PING.java", "base_name": "S3_PING", "extension": ".java", - "date": "2017-08-05", "size": 122528, + "date": "2017-08-05", "sha1": "08dba9986f69719970ead3592dc565465164df0d", "md5": "83d8324f37d0e3f120bc89865cf0bd39", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "Java", @@ -390,6 +402,10 @@ "is_media": false, "is_source": true, "is_script": false, + "source_count": 0, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/scancode/data/plugin_mark_source/without_info.expected.json b/tests/scancode/data/plugin_mark_source/without_info.expected.json deleted file mode 100644 index a3a002ba4d3..00000000000 --- a/tests/scancode/data/plugin_mark_source/without_info.expected.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "scancode_options": { - "input": "", - "--info": true, - "--json": "", - "--mark-source": true - }, - "files_count": 12, - "files": [ - { - "path": "JGroups.tgz", - "type": "directory", - "name": "JGroups.tgz", - "base_name": "JGroups.tgz", - "extension": "", - "date": null, - "size": 0, - "sha1": null, - "md5": null, - "files_count": 12, - "dirs_count": 3, - "size_count": 206642, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups", - "type": "directory", - "name": "JGroups", - "base_name": "JGroups", - "extension": "", - "date": null, - "size": 0, - "sha1": null, - "md5": null, - "files_count": 12, - "dirs_count": 2, - "size_count": 206642, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses", - "type": "directory", - "name": "licenses", - "base_name": "licenses", - "extension": "", - "date": null, - "size": 0, - "sha1": null, - "md5": null, - "files_count": 5, - "dirs_count": 0, - "size_count": 54552, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/apache-1.1.txt", - "type": "file", - "name": "apache-1.1.txt", - "base_name": "apache-1.1", - "extension": ".txt", - "date": "2017-08-05", - "size": 2885, - "sha1": "6b5608d35c3e304532af43db8bbfc5947bef46a6", - "md5": "276982197c941f4cbf3d218546e17ae2", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/apache-2.0.txt", - "type": "file", - "name": "apache-2.0.txt", - "base_name": "apache-2.0", - "extension": ".txt", - "date": "2017-08-05", - "size": 11560, - "sha1": "47b573e3824cd5e02a1a3ae99e2735b49e0256e4", - "md5": "d273d63619c9aeaf15cdaf76422c4f87", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/bouncycastle.txt", - "type": "file", - "name": "bouncycastle.txt", - "base_name": "bouncycastle", - "extension": ".txt", - "date": "2017-08-05", - "size": 1186, - "sha1": "74facb0e9a734479f9cd893b5be3fe1bf651b760", - "md5": "9fffd8de865a5705969f62b128381f85", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/cpl-1.0.txt", - "type": "file", - "name": "cpl-1.0.txt", - "base_name": "cpl-1.0", - "extension": ".txt", - "date": "2017-08-05", - "size": 11987, - "sha1": "681cf776bcd79752543d42490ec7ed22a29fd888", - "md5": "9a6d2c9ae73d59eb3dd38e3909750d14", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/licenses/lgpl.txt", - "type": "file", - "name": "lgpl.txt", - "base_name": "lgpl", - "extension": ".txt", - "date": "2017-08-05", - "size": 26934, - "sha1": "8f1a637d2e2ed1bdb9eb01a7dccb5c12cc0557e1", - "md5": "f14599a2f089f6ff8c97e2baa4e3d575", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", - "programming_language": null, - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": false, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src", - "type": "directory", - "name": "src", - "base_name": "src", - "extension": "", - "date": null, - "size": 0, - "sha1": null, - "md5": null, - "files_count": 7, - "dirs_count": 0, - "size_count": 152090, - "mime_type": null, - "file_type": null, - "programming_language": null, - "is_binary": false, - "is_text": false, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/FixedMembershipToken.java", - "type": "file", - "name": "FixedMembershipToken.java", - "base_name": "FixedMembershipToken", - "extension": ".java", - "date": "2017-08-05", - "size": 5144, - "sha1": "5901f73dcc78155a1a2c7b5663a3a11fba400b19", - "md5": "aca9640ec8beee21b098bcf8ecc91442", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/GuardedBy.java", - "type": "file", - "name": "GuardedBy.java", - "base_name": "GuardedBy", - "extension": ".java", - "date": "2017-08-05", - "size": 813, - "sha1": "981d67087e65e9a44957c026d4b10817cf77d966", - "md5": "c5064400f759d3e81771005051d17dc1", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/ImmutableReference.java", - "type": "file", - "name": "ImmutableReference.java", - "base_name": "ImmutableReference", - "extension": ".java", - "date": "2017-08-05", - "size": 1838, - "sha1": "30f56b876d5576d9869e2c5c509b08db57110592", - "md5": "48ca3c72fb9a65c771a321222f118b88", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RATE_LIMITER.java", - "type": "file", - "name": "RATE_LIMITER.java", - "base_name": "RATE_LIMITER", - "extension": ".java", - "date": "2017-08-05", - "size": 3692, - "sha1": "a8087e5d50da3273536ebda9b87b77aa4ff55deb", - "md5": "4626bdbc48871b55513e1a12991c61a8", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RouterStub.java", - "type": "file", - "name": "RouterStub.java", - "base_name": "RouterStub", - "extension": ".java", - "date": "2017-08-05", - "size": 9913, - "sha1": "c1f6818f8ee7bddcc9f444bc94c099729d716d52", - "md5": "eecfe23494acbcd8088c93bc1e83c7f2", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/RouterStubManager.java", - "type": "file", - "name": "RouterStubManager.java", - "base_name": "RouterStubManager", - "extension": ".java", - "date": "2017-08-05", - "size": 8162, - "sha1": "eb419dc94cfe11ca318a3e743a7f9f080e70c751", - "md5": "20bee9631b7c82a45c250e095352aec7", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - }, - { - "path": "JGroups.tgz/JGroups/src/S3_PING.java", - "type": "file", - "name": "S3_PING.java", - "base_name": "S3_PING", - "extension": ".java", - "date": "2017-08-05", - "size": 122528, - "sha1": "08dba9986f69719970ead3592dc565465164df0d", - "md5": "83d8324f37d0e3f120bc89865cf0bd39", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, - "mime_type": "text/plain", - "file_type": "ASCII text", - "programming_language": "Java", - "is_binary": false, - "is_text": true, - "is_archive": false, - "is_media": false, - "is_source": true, - "is_script": false, - "scan_errors": [] - } - ] -} \ No newline at end of file diff --git a/tests/scancode/data/plugin_only_findings/errors.expected.json b/tests/scancode/data/plugin_only_findings/errors.expected.json new file mode 100644 index 00000000000..224f1684a03 --- /dev/null +++ b/tests/scancode/data/plugin_only_findings/errors.expected.json @@ -0,0 +1,39 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--info": true, + "--json-pp": "", + "--only-findings": true, + "--package": true + }, + "files_count": 1, + "files": [ + { + "path": "errors/package.json", + "type": "file", + "name": "package.json", + "base_name": "package", + "extension": ".json", + "size": 2264, + "sha1": "a749017a2d1b53aeb780dc0f66292e37bb6c0d25", + "md5": "ed579407b7aa99bcf4b12e1a6ea1c4ae", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "JSON", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [ + "ERROR: for scanner: packages:\nValueError: Expecting ':' delimiter: line 5 column 12 (char 143)\n" + ] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/plugin_only_findings/errors/illegal.pom.xml b/tests/scancode/data/plugin_only_findings/errors/illegal.pom.xml new file mode 100644 index 00000000000..c9ad800ffce --- /dev/null +++ b/tests/scancode/data/plugin_only_findings/errors/illegal.pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + + net.bytebuddy + byte-buddy-maven-plugin + + + + net.bytebuddy.test.IllegalTransformPlugin + + + + + + + diff --git a/tests/scancode/data/plugin_only_findings/errors/origin.ABOUT b/tests/scancode/data/plugin_only_findings/errors/origin.ABOUT new file mode 100644 index 00000000000..a583e2a11c5 --- /dev/null +++ b/tests/scancode/data/plugin_only_findings/errors/origin.ABOUT @@ -0,0 +1,3 @@ +date: 2017-05-24 +notes: malformed test Maven POMs from byte-buddy/byte-buddy-maven-plugin/src/test/resources/net/bytebuddy/test/ +download_url: https://github.com/raphw/byte-buddy/archive/838148dd9b735651720094e59f7ce10c1fe7880f.zip diff --git a/tests/scancode/data/plugin_only_findings/errors/package.json b/tests/scancode/data/plugin_only_findings/errors/package.json new file mode 100644 index 00000000000..fa4a53965a6 --- /dev/null +++ b/tests/scancode/data/plugin_only_findings/errors/package.json @@ -0,0 +1,96 @@ +{ + "name": "async", + "description": "Higher-order functions and common patterns for asynchronous code", + "main": "lib/async.js", + "author" { + "name": "Caolan McMahon" + }, + "version": "1.2.1", + "keywords": [ + "async", + "callback", + "utility", + "module" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/caolan/async.git" + }, + "bugs": { + "url": "https://github.com/caolan/async/issues" + }, + "license": "MIT", + "devDependencies": { + "benchmark": "github:bestiejs/benchmark.js", + "coveralls": "^2.11.2", + "jshint": "~2.7.0", + "lodash": ">=2.4.1", + "mkdirp": "~0.5.1", + "nodeunit": ">0.0.0", + "nyc": "^2.1.0", + "uglify-js": "1.2.x", + "yargs": "~3.9.1" + }, + "jam": { + "main": "lib/async.js", + "include": [ + "lib/async.js", + "README.md", + "LICENSE" + ], + "categories": [ + "Utilities" + ] + }, + "scripts": { + "test": "npm run-script lint && nodeunit test/test-async.js", + "lint": "jshint lib/*.js test/*.js perf/*.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" + }, + "spm": { + "main": "lib/async.js" + }, + "volo": { + "main": "lib/async.js", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] + }, + "gitHead": "b66e85d1cca8c8056313253f22d18f571e7001d2", + "homepage": "https://github.com/caolan/async#readme", + "_id": "async@1.2.1", + "_shasum": "a4816a17cd5ff516dfa2c7698a453369b9790de0", + "_from": "async@*", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.0.2", + "_npmUser": { + "name": "aearly", + "email": "alexander.early@gmail.com" + }, + "maintainers": [ + { + "name": "caolan", + "email": "caolan.mcmahon@gmail.com" + }, + { + "name": "beaugunderson", + "email": "beau@beaugunderson.com" + }, + { + "name": "aearly", + "email": "alexander.early@gmail.com" + } + ], + "dist": { + "shasum": "a4816a17cd5ff516dfa2c7698a453369b9790de0", + "tarball": "http://registry.npmjs.org/async/-/async-1.2.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/async/-/async-1.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index cccddcda568..3b9bbcdc4b9 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -20,9 +20,6 @@ "size": 10240, "sha1": "b655d4fc48e19910b9ab7a7102a8c051a39818f1", "md5": "393e789f4e4b2be93a46d0619380b445", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/x-tar", "file_type": "POSIX tar archive (GNU)", "programming_language": null, @@ -32,7 +29,6 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [ @@ -80,7 +76,11 @@ "dependencies": {}, "related_packages": [] } - ] + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic.tgz/basic/dir2/subdir/bcopy.s", @@ -91,9 +91,6 @@ "size": 32452, "sha1": "99f20eafc7b7e1c8e21bced55c8cdd05339bec77", "md5": "e1c66adaf6b8aa90e348668ac4869a61", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text, with CRLF line terminators", "programming_language": "GAS", @@ -103,7 +100,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [ { "key": "bsd-original-uc", @@ -149,7 +145,11 @@ "end_line": 37 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "basic.tgz/basic/main.c", @@ -160,9 +160,6 @@ "size": 1940, "sha1": "35017ed9762bdc9d16054a40ceefdda8b362083a", "md5": "8d0a3b3fe1c96a49af2a66040193291b", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-c", "file_type": "C source, ASCII text", "programming_language": "C", @@ -172,7 +169,6 @@ "is_media": false, "is_source": true, "is_script": false, - "scan_errors": [], "licenses": [ { "key": "gpl-2.0", @@ -232,7 +228,11 @@ "end_line": 3 } ], - "packages": [] + "packages": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/plugin_only_findings/info.expected.json b/tests/scancode/data/plugin_only_findings/info.expected.json new file mode 100644 index 00000000000..2072a2ada24 --- /dev/null +++ b/tests/scancode/data/plugin_only_findings/info.expected.json @@ -0,0 +1,11 @@ +{ + "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "scancode_options": { + "input": "", + "--info": true, + "--json": "", + "--only-findings": true + }, + "files_count": 0, + "files": [] +} \ No newline at end of file diff --git a/tests/scancode/data/resource/samples/JGroups/EULA b/tests/scancode/data/resource/samples/JGroups/EULA new file mode 100644 index 00000000000..0dcb788ede5 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/EULA @@ -0,0 +1,109 @@ +// $Id: EULA,v 1.1 2006/11/02 08:04:26 belaban Exp $ + +LICENSE AGREEMENT +JBOSS(r) + +This License Agreement governs the use of the Software Packages and any updates to the Software +Packages, regardless of the delivery mechanism. Each Software Package is a collective work +under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to +the user ("Client") a license to the applicable collective work(s) pursuant to the +GNU Lesser General Public License v. 2.1 except for the following Software Packages: +(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the +GNU General Public License v.2; + +(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0; + +(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the +(open source) Sleepycat License (if Client does not wish to use the open source version of this database, +it may purchase a license from Sleepycat Software); + +and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, +and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various +royalty-free patent licenses. + +Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php. + +1. The Software. "Software Packages" refer to the various software modules that are created and made available +for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages +may be comprised of hundreds of software components. The end user license agreement for each component is located in +the component's source code. With the exception of certain image files identified in Section 2 below, +the license terms for the components permit Client to copy, modify, and redistribute the component, +in both source code and binary code forms. This agreement does not limit Client's rights under, +or grant Client rights that supersede, the license terms of any particular component. + +2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright +and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall +remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the +individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates +in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages +using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's +trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by +these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. +If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at +http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted. +Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages. + +3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular +component, to the maximum extent permitted under applicable law, the Software Packages and the +components are provided and licensed "as is" without warranty of any kind, expressed or implied, +including the implied warranties of merchantability, non-infringement or fitness for a particular purpose. +Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in +materials and manufacture under normal use for a period of 30 days from the date of delivery to Client. +Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements +or that the operation of the Software Packages will be entirely error free or appear precisely as described +in the accompanying documentation. This warranty extends only to the party that purchases the Services +pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. + +4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies +described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's +exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of +delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or +refund the money paid by Client for the Software. To the maximum extent permitted by applicable law, +Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential +damages, including lost profits or lost savings arising out of the use or inability to use the Software, +even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall +Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this +Agreement during the twelve months preceding the action. + +5. Export Control. As required by U.S. law, Client represents and warrants that it: +(a) understands that the Software Packages are subject to export controls under the +U.S. Commerce Department's Export Administration Regulations ("EAR"); + +(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations +(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); + +(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, +or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; + +(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or +biological weapons, or missile technology end-uses unless authorized by the U.S. Government by +regulation or specific license; + +(e) understands and agrees that if it is in the United States and exports or transfers the Software +Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual +reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and +address (including country) of each transferee; + +and (f) understands that countries other than the United States may restrict the import, use, or +export of encryption products and that it shall be solely responsible for compliance with any such +import, use, or export restrictions. + +6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages +that are not part of the Software Packages and which Client must install separately. These third party +programs are subject to their own license terms. The license terms either accompany the programs or +can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable +license terms for such programs, then Client may not install them. If Client wishes to install the programs +on more than one system or transfer the programs to another party, then Client must contact the licensor +of the programs. + +7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the +enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the +State of North Carolina and of the United States, without regard to any conflict of laws provisions, +except that the United Nations Convention on the International Sale of Goods shall not apply. + +Copyright 2006 Red Hat, Inc. All rights reserved. +"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc. +All other trademarks are the property of their respective owners. + + Page 1 of 1 18 October 2006 + diff --git a/tests/scancode/data/resource/samples/JGroups/LICENSE b/tests/scancode/data/resource/samples/JGroups/LICENSE new file mode 100644 index 00000000000..b1e3f5a2638 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/tests/scancode/data/resource/samples/JGroups/licenses/apache-1.1.txt b/tests/scancode/data/resource/samples/JGroups/licenses/apache-1.1.txt new file mode 100644 index 00000000000..dae2270c2c0 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/licenses/apache-1.1.txt @@ -0,0 +1,58 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + diff --git a/tests/scancode/data/resource/samples/JGroups/licenses/apache-2.0.txt b/tests/scancode/data/resource/samples/JGroups/licenses/apache-2.0.txt new file mode 100644 index 00000000000..75b52484ea4 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/licenses/apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/tests/scancode/data/resource/samples/JGroups/licenses/bouncycastle.txt b/tests/scancode/data/resource/samples/JGroups/licenses/bouncycastle.txt new file mode 100644 index 00000000000..3cf73c2f032 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/licenses/bouncycastle.txt @@ -0,0 +1,18 @@ +// $Id: bouncycastle.txt,v 1.1 2006/07/07 16:09:48 belaban Exp $ + +License + +Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/data/resource/samples/JGroups/licenses/cpl-1.0.txt b/tests/scancode/data/resource/samples/JGroups/licenses/cpl-1.0.txt new file mode 100644 index 00000000000..2243be15b29 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/licenses/cpl-1.0.txt @@ -0,0 +1,213 @@ +Common Public License Version 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and documentation + distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' from + a Contributor if it was added to the Program by such Contributor itself or + anyone acting on such Contributor's behalf. Contributions do not include + additions to the Program which: (i) are separate modules of software + distributed in conjunction with the Program under their own license + agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including +all Contributors. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such Contributor, if any, and + such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by + the Contributor, such addition of the Contribution causes such combination + to be covered by the Licensed Patents. The patent license shall not apply to + any other combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility + to acquire that license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of title + and non-infringement, and implied warranties or conditions of merchantability + and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered + by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such Contributor, + and informs licensees how to obtain it in a reasonable manner on or through + a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product offering. +The obligations in this section do not apply to any claims or Losses relating to +any actual or alleged intellectual property infringement. In order to qualify, +an Indemnified Contributor must: a) promptly notify the Commercial Contributor +n writing of such claim, and b) allow the Commercial Contributor to control, +and cooperate with the Commercial Contributor in, the defense and any related +settlement negotiations. The Indemnified Contributor may participate in any such +claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such Commercial +Contributor's responsibility alone. Under this section, the Commercial +Contributor would have to defend claims against the other Contributors related +to those performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor must pay +those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with its exercise +of rights under this Agreement, including but not limited to the risks and costs +of program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such Recipient +under this Agreement shall terminate as of the date such litigation is filed. +In addition, if Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the Program +itself (excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply +with any of the material terms or conditions of this Agreement and does not cure +such failure in a reasonable period of time after becoming aware of such +noncompliance. If all Recipient's rights under this Agreement terminate, Recipient +agrees to cease use and distribution of the Program as soon as reasonably +practicable. However, Recipient's obligations under this Agreement and any +licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be modified +in the following manner. The Agreement Steward reserves the right to publish new +versions (including revisions) of this Agreement from time to time. No one other +than the Agreement Steward has the right to modify this Agreement. IBM is the +initial Agreement Steward. IBM may assign the responsibility to serve as the +Agreement Steward to a suitable separate entity. Each new version of the Agreement +will be given a distinguishing version number. The Program (including Contributions) +may always be distributed subject to the version of the Agreement under which it +was received. In addition, after a new version of the Agreement is published, +Contributor may elect to distribute the Program (including its Contributions) +under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, +Recipient receives no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this Agreement +are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year after +the cause of action arose. Each party waives its rights to a jury trial in any +resulting litigation. + diff --git a/tests/scancode/data/resource/samples/JGroups/licenses/lgpl.txt b/tests/scancode/data/resource/samples/JGroups/licenses/lgpl.txt new file mode 100644 index 00000000000..cbee875ba6d --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/licenses/lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/tests/scancode/data/resource/samples/JGroups/src/FixedMembershipToken.java b/tests/scancode/data/resource/samples/JGroups/src/FixedMembershipToken.java new file mode 100644 index 00000000000..46cf578d6de --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/FixedMembershipToken.java @@ -0,0 +1,150 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jgroups.auth; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +import org.jgroups.Event; +import org.jgroups.Message; +import org.jgroups.PhysicalAddress; +import org.jgroups.annotations.Property; +import org.jgroups.util.Util; + +/** + *

+ * The FixedMemberShipToken object predefines a list of IP addresses and ports that can join the + * group. + *

+ *

+ * Configuration parameters for this example are shown below: + *

+ *
    + *
  • fixed_members_value (required) = List of IP addresses & ports (optionally) - ports must be + * seperated by a '/' e.g. 127.0.0.1/1010*127.0.0.1/4567
  • + *
  • fixed_members_seperator (required) = The seperator used between IP addresses - e.g. *
  • + *
+ * + * @author Chris Mills (millsy@jboss.com) + */ +public class FixedMembershipToken extends AuthToken { + private List memberList = null; + private String token = "emptyToken"; + + @Property + private String fixed_members_seperator = ","; + private static final long serialVersionUID = 4717069536900221681L; + + public FixedMembershipToken() { + } + + public String getName() { + return "org.jgroups.auth.FixedMembershipToken"; + } + + @Property + public void setFixedMembersSeparator(String value) { + fixed_members_seperator = value; + } + + public boolean authenticate(AuthToken token, Message msg) { + if ((token != null) && (token instanceof FixedMembershipToken) && (this.memberList != null)) { + PhysicalAddress src = (PhysicalAddress) auth.down(new Event(Event.GET_PHYSICAL_ADDRESS, + msg.getSrc())); + if (src == null) { + if (log.isErrorEnabled()) + log.error("didn't find physical address for " + msg.getSrc()); + return false; + } + + String sourceAddressWithPort = src.toString(); + String sourceAddressWithoutPort = sourceAddressWithPort.substring(0, + sourceAddressWithPort.indexOf(":")); + + if (log.isDebugEnabled()) { + log.debug("AUTHToken received from " + sourceAddressWithPort); + } + + for (String member : memberList) { + if (hasPort(member)) { + if (member.equals(sourceAddressWithPort)) + return true; + } else { + if (member.equals(sourceAddressWithoutPort)) + return true; + } + } + return false; + } + + if (log.isWarnEnabled()) { + log.warn("Invalid AuthToken instance - wrong type or null"); + } + return false; + } + + private static boolean hasPort(String member) { + return member.contains(":"); + } + + @Property(name = "fixed_members_value") + public void setMemberList(String list) { + memberList = new ArrayList(); + StringTokenizer memberListTokenizer = new StringTokenizer(list, fixed_members_seperator); + while (memberListTokenizer.hasMoreTokens()) { + memberList.add(memberListTokenizer.nextToken().replace('/', ':')); + } + } + + /** + * Required to serialize the object to pass across the wire + * + * @param out + * @throws java.io.IOException + */ + public void writeTo(DataOutputStream out) throws IOException { + if (log.isDebugEnabled()) { + log.debug("SimpleToken writeTo()"); + } + Util.writeString(this.token, out); + } + + /** + * Required to deserialize the object when read in from the wire + * + * @param in + * @throws IOException + * @throws IllegalAccessException + * @throws InstantiationException + */ + public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, + InstantiationException { + if (log.isDebugEnabled()) { + log.debug("SimpleToken readFrom()"); + } + this.token = Util.readString(in); + } +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/GuardedBy.java b/tests/scancode/data/resource/samples/JGroups/src/GuardedBy.java new file mode 100644 index 00000000000..6d9a9ec4a3f --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/GuardedBy.java @@ -0,0 +1,23 @@ +package org.jgroups.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Copyright (c) 2005 Brian Goetz and Tim Peierls + * Released under the Creative Commons Attribution License + * (http://creativecommons.org/licenses/by/2.5) + * Official home: http://www.jcip.net + * + * Adopted from Java Concurrency in Practice. This annotation defines the monitor that protects the variable + * annotated by @GuardedBy, e.g. @GuardedBy("lock") or @GuardedBy("this") + * @author Bela Ban + * @version $Id: GuardedBy.java,v 1.3 2007/02/27 14:49:40 belaban Exp $ + */ +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.SOURCE) +public @interface GuardedBy { + String value(); +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/ImmutableReference.java b/tests/scancode/data/resource/samples/JGroups/src/ImmutableReference.java new file mode 100644 index 00000000000..50c720e0bf0 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/ImmutableReference.java @@ -0,0 +1,55 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2010, Red Hat, Inc. and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jgroups.util; + +/** + * Simple class that holds an immutable reference to another object (or to + * null). + * + * @author Brian Stansberry + * + * @version $Id: ImmutableReference.java,v 1.1 2010/06/19 02:24:46 bstansberry Exp $ + */ +public class ImmutableReference { + + private final T referent; + + /** + * Create a new ImmutableReference. + * + * @param referent the object to refer to, or null + */ + public ImmutableReference(T referent) { + this.referent = referent; + } + + /** + * Gets the wrapped object, if there is one. + * + * @return the object passed to the constructor, or null if + * null was passed to the constructor + */ + public T get() { + return referent; + } +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/RATE_LIMITER.java b/tests/scancode/data/resource/samples/JGroups/src/RATE_LIMITER.java new file mode 100644 index 00000000000..d0765aa5f29 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/RATE_LIMITER.java @@ -0,0 +1,120 @@ +package org.jgroups.protocols; + +import org.jgroups.Event; +import org.jgroups.Message; +import org.jgroups.annotations.*; +import org.jgroups.stack.Protocol; + +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * Protocol which sends at most max_bytes in time_period milliseconds. Can be used instead of a flow control protocol, + * e.g. FC or SFC (same position in the stack) + * @author Bela Ban + * @version $Id: RATE_LIMITER.java,v 1.3 2009/12/11 13:08:03 belaban Exp $ + */ +@Experimental @Unsupported +public class RATE_LIMITER extends Protocol { + + @Property(description="Max number of bytes to be sent in time_period ms. Blocks the sender if exceeded until a new " + + "time period has started") + protected long max_bytes=500000; + + @Property(description="Number of milliseconds during which max_bytes bytes can be sent") + protected long time_period=1000L; + + + /** Keeps track of the number of bytes sent in the current time period */ + @GuardedBy("lock") + @ManagedAttribute + protected long num_bytes_sent=0L; + + @GuardedBy("lock") + protected long end_of_current_period=0L; + + protected final Lock lock=new ReentrantLock(); + protected final Condition block=lock.newCondition(); + + @ManagedAttribute + protected int num_blockings=0; + + @ManagedAttribute + protected long total_block_time=0L; + + + + public Object down(Event evt) { + if(evt.getType() == Event.MSG) { + Message msg=(Message)evt.getArg(); + int len=msg.getLength(); + + lock.lock(); + try { + if(len > max_bytes) { + log.error("message length (" + len + " bytes) exceeded max_bytes (" + max_bytes + "); " + + "adjusting max_bytes to " + len); + max_bytes=len; + } + + while(true) { + boolean size_exceeded=num_bytes_sent + len >= max_bytes, + time_exceeded=System.currentTimeMillis() > end_of_current_period; + if(!size_exceeded && !time_exceeded) + break; + + if(time_exceeded) { + reset(); + } + else { // size exceeded + long block_time=end_of_current_period - System.currentTimeMillis(); + if(block_time > 0) { + try { + block.await(block_time, TimeUnit.MILLISECONDS); + num_blockings++; + total_block_time+=block_time; + } + catch(InterruptedException e) { + } + } + } + } + } + finally { + num_bytes_sent+=len; + lock.unlock(); + } + + return down_prot.down(evt); + } + + return down_prot.down(evt); + } + + + public void init() throws Exception { + super.init(); + if(time_period <= 0) + throw new IllegalArgumentException("time_period needs to be positive"); + } + + public void stop() { + super.stop(); + reset(); + } + + protected void reset() { + lock.lock(); + try { + // blocking=false; + num_bytes_sent=0L; + end_of_current_period=System.currentTimeMillis() + time_period; + block.signalAll(); + } + finally { + lock.unlock(); + } + } +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/RouterStub.java b/tests/scancode/data/resource/samples/JGroups/src/RouterStub.java new file mode 100644 index 00000000000..1e0b9f9ef4c --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/RouterStub.java @@ -0,0 +1,295 @@ +package org.jgroups.stack; + +import org.jgroups.Address; +import org.jgroups.PhysicalAddress; +import org.jgroups.logging.Log; +import org.jgroups.logging.LogFactory; +import org.jgroups.protocols.PingData; +import org.jgroups.protocols.TUNNEL.StubReceiver; +import org.jgroups.util.Util; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketException; +import java.util.ArrayList; +import java.util.List; + +/** + * Client stub that talks to a remote GossipRouter + * @author Bela Ban + * @version $Id: RouterStub.java,v 1.62 2010/06/09 14:22:00 belaban Exp $ + */ +public class RouterStub { + + public static enum ConnectionStatus {INITIAL, CONNECTION_BROKEN, CONNECTION_ESTABLISHED, CONNECTED,DISCONNECTED}; + + private final String router_host; // name of the router host + + private final int router_port; // port on which router listens on + + private Socket sock=null; // socket connecting to the router + + private DataOutputStream output=null; + + private DataInputStream input=null; + + private volatile ConnectionStatus connectionState=ConnectionStatus.INITIAL; + + private static final Log log=LogFactory.getLog(RouterStub.class); + + private final ConnectionListener conn_listener; + + private final InetAddress bind_addr; + + private int sock_conn_timeout=3000; // max number of ms to wait for socket establishment to + // GossipRouter + + private int sock_read_timeout=3000; // max number of ms to wait for socket reads (0 means block + // forever, or until the sock is closed) + + private boolean tcp_nodelay=true; + + private StubReceiver receiver; + + public interface ConnectionListener { + void connectionStatusChange(RouterStub stub, ConnectionStatus state); + } + + /** + * Creates a stub for a remote Router object. + * @param routerHost The name of the router's host + * @param routerPort The router's port + * @throws SocketException + */ + public RouterStub(String routerHost, int routerPort, InetAddress bindAddress, ConnectionListener l) { + router_host=routerHost != null? routerHost : "localhost"; + router_port=routerPort; + bind_addr=bindAddress; + conn_listener=l; + } + + public synchronized void setReceiver(StubReceiver receiver) { + this.receiver = receiver; + } + + public synchronized StubReceiver getReceiver() { + return receiver; + } + + public boolean isTcpNoDelay() { + return tcp_nodelay; + } + + public void setTcpNoDelay(boolean tcp_nodelay) { + this.tcp_nodelay=tcp_nodelay; + } + + public synchronized void interrupt() { + if(receiver != null) { + Thread thread = receiver.getThread(); + if(thread != null) + thread.interrupt(); + } + } + + public synchronized void join(long wait) throws InterruptedException { + if(receiver != null) { + Thread thread = receiver.getThread(); + if(thread != null) + thread.join(wait); + } + } + + + public int getSocketConnectionTimeout() { + return sock_conn_timeout; + } + + public void setSocketConnectionTimeout(int sock_conn_timeout) { + this.sock_conn_timeout=sock_conn_timeout; + } + + public int getSocketReadTimeout() { + return sock_read_timeout; + } + + public void setSocketReadTimeout(int sock_read_timeout) { + this.sock_read_timeout=sock_read_timeout; + } + + public boolean isConnected() { + return !(connectionState == ConnectionStatus.CONNECTION_BROKEN || connectionState == ConnectionStatus.INITIAL); + } + + public ConnectionStatus getConnectionStatus() { + return connectionState; + } + + + /** + * Register this process with the router under group. + * @param group The name of the group under which to register + */ + public synchronized void connect(String group, Address addr, String logical_name, List phys_addrs) throws Exception { + doConnect(); + GossipData request=new GossipData(GossipRouter.CONNECT, group, addr, logical_name, phys_addrs); + request.writeTo(output); + output.flush(); + byte result = input.readByte(); + if(result == GossipRouter.CONNECT_OK) { + connectionStateChanged(ConnectionStatus.CONNECTED); + } else { + connectionStateChanged(ConnectionStatus.DISCONNECTED); + throw new Exception("Connect failed received from GR " + getGossipRouterAddress()); + } + } + + public synchronized void doConnect() throws Exception { + if(!isConnected()) { + try { + sock=new Socket(); + sock.bind(new InetSocketAddress(bind_addr, 0)); + sock.setSoTimeout(sock_read_timeout); + sock.setSoLinger(true, 2); + sock.setTcpNoDelay(tcp_nodelay); + sock.setKeepAlive(true); + Util.connect(sock, new InetSocketAddress(router_host, router_port), sock_conn_timeout); + output=new DataOutputStream(sock.getOutputStream()); + input=new DataInputStream(sock.getInputStream()); + connectionStateChanged(ConnectionStatus.CONNECTION_ESTABLISHED); + } + catch(Exception e) { + Util.close(sock); + Util.close(input); + Util.close(output); + connectionStateChanged(ConnectionStatus.CONNECTION_BROKEN); + throw new Exception("Could not connect to " + getGossipRouterAddress() , e); + } + } + } + + /** + * Checks whether the connection is open + * @return + */ + public synchronized void checkConnection() { + GossipData request=new GossipData(GossipRouter.PING); + try { + request.writeTo(output); + output.flush(); + } + catch(IOException e) { + connectionStateChanged(ConnectionStatus.CONNECTION_BROKEN); + } + } + + + public synchronized void disconnect(String group, Address addr) { + try { + GossipData request=new GossipData(GossipRouter.DISCONNECT, group, addr); + request.writeTo(output); + output.flush(); + } + catch(Exception e) { + } finally { + connectionStateChanged(ConnectionStatus.DISCONNECTED); + } + } + + public synchronized void destroy() { + try { + GossipData request = new GossipData(GossipRouter.CLOSE); + request.writeTo(output); + output.flush(); + } catch (Exception e) { + } finally { + Util.close(output); + Util.close(input); + Util.close(sock); + } + } + + + /* + * Used only in testing, never access socket directly + * + */ + public Socket getSocket() { + return sock; + } + + + public synchronized List getMembers(final String group) throws Exception { + List retval=new ArrayList(); + try { + + if(!isConnected() || input == null) throw new Exception ("not connected"); + // we might get a spurious SUSPECT message from the router, just ignore it + if(input.available() > 0) // fixes https://jira.jboss.org/jira/browse/JGRP-1151 + input.skipBytes(input.available()); + + GossipData request=new GossipData(GossipRouter.GOSSIP_GET, group, null); + request.writeTo(output); + output.flush(); + + short num_rsps=input.readShort(); + for(int i=0; i < num_rsps; i++) { + PingData rsp=new PingData(); + rsp.readFrom(input); + retval.add(rsp); + } + } + catch(Exception e) { + connectionStateChanged(ConnectionStatus.CONNECTION_BROKEN); + throw new Exception("Connection to " + getGossipRouterAddress() + " broken. Could not send GOSSIP_GET request", e); + } + return retval; + } + + public InetSocketAddress getGossipRouterAddress() { + return new InetSocketAddress(router_host, router_port); + } + + public String toString() { + return "RouterStub[localsocket=" + ((sock != null) ? sock.getLocalSocketAddress().toString() + : "null")+ ",router_host=" + router_host + "::" + router_port + + ",connected=" + isConnected() + "]"; + } + + public void sendToAllMembers(String group, byte[] data, int offset, int length) throws Exception { + sendToMember(group, null, data, offset, length); // null destination represents mcast + } + + public synchronized void sendToMember(String group, Address dest, byte[] data, int offset, int length) throws Exception { + try { + GossipData request = new GossipData(GossipRouter.MESSAGE, group, dest, data, offset, length); + request.writeTo(output); + output.flush(); + } catch (Exception e) { + connectionStateChanged(ConnectionStatus.CONNECTION_BROKEN); + throw new Exception("Connection to " + getGossipRouterAddress() + + " broken. Could not send message to " + dest, e); + } + } + + public DataInputStream getInputStream() { + return input; + } + + private void connectionStateChanged(ConnectionStatus newState) { + boolean notify=connectionState != newState; + connectionState=newState; + if(notify && conn_listener != null) { + try { + conn_listener.connectionStatusChange(this, newState); + } + catch(Throwable t) { + log.error("failed notifying ConnectionListener " + conn_listener, t); + } + } + } +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/RouterStubManager.java b/tests/scancode/data/resource/samples/JGroups/src/RouterStubManager.java new file mode 100644 index 00000000000..47153252434 --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/RouterStubManager.java @@ -0,0 +1,213 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2009, Red Hat Middleware LLC, and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jgroups.stack; + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import org.jgroups.Address; +import org.jgroups.Event; +import org.jgroups.PhysicalAddress; +import org.jgroups.annotations.GuardedBy; +import org.jgroups.logging.Log; +import org.jgroups.logging.LogFactory; +import org.jgroups.util.TimeScheduler; + +public class RouterStubManager implements RouterStub.ConnectionListener { + + @GuardedBy("reconnectorLock") + private final Map> futures = new HashMap>(); + private final Lock reconnectorLock = new ReentrantLock(); + private final List stubs; + + private final Protocol owner; + private final TimeScheduler timer; + private final String channelName; + private final Address logicalAddress; + private final long interval; + + protected final Log log; + + public RouterStubManager(Protocol owner, String channelName, Address logicalAddress, long interval) { + this.owner = owner; + this.stubs = new CopyOnWriteArrayList(); + this.log = LogFactory.getLog(owner.getClass()); + this.timer = owner.getTransport().getTimer(); + this.channelName = channelName; + this.logicalAddress = logicalAddress; + this.interval = interval; + } + + private RouterStubManager(Protocol p) { + this(p,null,null,0L); + } + + public List getStubs(){ + return stubs; + } + + public RouterStub createAndRegisterStub(String routerHost, int routerPort, InetAddress bindAddress) { + RouterStub s = new RouterStub(routerHost,routerPort,bindAddress,this); + unregisterAndDestroyStub(s.getGossipRouterAddress()); + stubs.add(s); + return s; + } + + public void registerStub(RouterStub s) { + unregisterAndDestroyStub(s.getGossipRouterAddress()); + stubs.add(s); + } + + public boolean unregisterStub(final RouterStub s) { + return stubs.remove(s); + } + + public RouterStub unregisterStub(final InetSocketAddress address) { + if(address == null) + throw new IllegalArgumentException("Cannot remove null address"); + for (RouterStub s : stubs) { + if (s.getGossipRouterAddress().equals(address)) { + stubs.remove(address); + return s; + } + } + return null; + } + + public boolean unregisterAndDestroyStub(final InetSocketAddress address) { + RouterStub unregisteredStub = unregisterStub(address); + if(unregisteredStub !=null) { + unregisteredStub.destroy(); + return true; + } + return false; + } + + public void disconnectStubs() { + for (RouterStub stub : stubs) { + try { + stub.disconnect(channelName, logicalAddress); + } catch (Exception e) { + } + } + } + + public void destroyStubs() { + for (RouterStub s : stubs) { + stopReconnecting(s); + s.destroy(); + } + stubs.clear(); + } + + public void startReconnecting(final RouterStub stub) { + reconnectorLock.lock(); + try { + InetSocketAddress routerAddress = stub.getGossipRouterAddress(); + Future f = futures.get(routerAddress); + if (f != null) { + f.cancel(true); + futures.remove(routerAddress); + } + + final Runnable reconnector = new Runnable() { + public void run() { + try { + if (log.isTraceEnabled()) log.trace("Reconnecting " + stub); + String logical_name = org.jgroups.util.UUID.get(logicalAddress); + PhysicalAddress physical_addr = (PhysicalAddress) owner.down(new Event( + Event.GET_PHYSICAL_ADDRESS, logicalAddress)); + List physical_addrs = Arrays.asList(physical_addr); + stub.connect(channelName, logicalAddress, logical_name, physical_addrs); + if (log.isTraceEnabled()) log.trace("Reconnected " + stub); + } catch (Throwable ex) { + if (log.isWarnEnabled()) + log.warn("failed reconnecting stub to GR at "+ stub.getGossipRouterAddress() + ": " + ex); + } + } + }; + f = timer.scheduleWithFixedDelay(reconnector, 0, interval, TimeUnit.MILLISECONDS); + futures.put(stub.getGossipRouterAddress(), f); + } finally { + reconnectorLock.unlock(); + } + } + + public void stopReconnecting(final RouterStub stub) { + reconnectorLock.lock(); + try { + InetSocketAddress routerAddress = stub.getGossipRouterAddress(); + Future f = futures.get(stub.getGossipRouterAddress()); + if (f != null) { + f.cancel(true); + futures.remove(routerAddress); + } + + final Runnable pinger = new Runnable() { + public void run() { + try { + if(log.isTraceEnabled()) log.trace("Pinging " + stub); + stub.checkConnection(); + if(log.isTraceEnabled()) log.trace("Pinged " + stub); + } catch (Throwable ex) { + if (log.isWarnEnabled()) + log.warn("failed pinging stub, GR at " + stub.getGossipRouterAddress()+ ": " + ex); + } + } + }; + f = timer.scheduleWithFixedDelay(pinger, 0, interval, TimeUnit.MILLISECONDS); + futures.put(stub.getGossipRouterAddress(), f); + } finally { + reconnectorLock.unlock(); + } + } + + + public void connectionStatusChange(RouterStub stub, RouterStub.ConnectionStatus newState) { + if (newState == RouterStub.ConnectionStatus.CONNECTION_BROKEN) { + stub.interrupt(); + stub.destroy(); + startReconnecting(stub); + } else if (newState == RouterStub.ConnectionStatus.CONNECTED) { + stopReconnecting(stub); + } else if (newState == RouterStub.ConnectionStatus.DISCONNECTED) { + // wait for disconnect ack; + try { + stub.join(interval); + } catch (InterruptedException e) { + } + } + } + + public static RouterStubManager emptyGossipClientStubManager(Protocol p) { + return new RouterStubManager(p); + } +} diff --git a/tests/scancode/data/resource/samples/JGroups/src/S3_PING.java b/tests/scancode/data/resource/samples/JGroups/src/S3_PING.java new file mode 100644 index 00000000000..2f93ec6cc9c --- /dev/null +++ b/tests/scancode/data/resource/samples/JGroups/src/S3_PING.java @@ -0,0 +1,3025 @@ +package org.jgroups.protocols; + +import org.jgroups.Address; +import org.jgroups.annotations.Experimental; +import org.jgroups.annotations.Property; +import org.jgroups.annotations.Unsupported; +import org.jgroups.util.Util; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; +import org.xml.sax.helpers.XMLReaderFactory; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +import static java.lang.String.valueOf; + + +/** + * Discovery protocol using Amazon's S3 storage. The S3 access code reuses the example shipped by Amazon. + * This protocol is unsupported and experimental ! + * @author Bela Ban + * @version $Id: S3_PING.java,v 1.11 2010/06/18 04:39:08 belaban Exp $ + */ +@Experimental +public class S3_PING extends FILE_PING { + + @Property(description="The access key to AWS (S3)") + protected String access_key=null; + + @Property(description="The secret access key to AWS (S3)") + protected String secret_access_key=null; + + @Property(description="When non-null, we set location to prefix-UUID") + protected String prefix=null; + + protected AWSAuthConnection conn=null; + + + + public void init() throws Exception { + super.init(); + if(access_key == null || secret_access_key == null) + throw new IllegalArgumentException("access_key and secret_access_key must be non-null"); + + conn=new AWSAuthConnection(access_key, secret_access_key); + + if(prefix != null && prefix.length() > 0) { + ListAllMyBucketsResponse bucket_list=conn.listAllMyBuckets(null); + List buckets=bucket_list.entries; + if(buckets != null) { + boolean found=false; + for(Object tmp: buckets) { + if(tmp instanceof Bucket) { + Bucket bucket=(Bucket)tmp; + if(bucket.name.startsWith(prefix)) { + location=bucket.name; + found=true; + } + } + } + if(!found) { + location=prefix + "-" + java.util.UUID.randomUUID().toString(); + } + } + } + + + if(!conn.checkBucketExists(location)) { + conn.createBucket(location, AWSAuthConnection.LOCATION_DEFAULT, null).connection.getResponseMessage(); + } + + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { + remove(group_addr, local_addr); + } + }); + } + + protected void createRootDir() { + ; // do *not* create root file system (don't remove !) + } + + protected List readAll(String clustername) { + if(clustername == null) + return null; + + List retval=new ArrayList(); + try { + ListBucketResponse rsp=conn.listBucket(location, clustername, null, null, null); + if(rsp.entries != null) { + for(Iterator it=rsp.entries.iterator(); it.hasNext();) { + ListEntry key=it.next(); + GetResponse val=conn.get(location, key.key, null); + if(val.object != null) { + byte[] buf=val.object.data; + if(buf != null) { + try { + PingData data=(PingData)Util.objectFromByteBuffer(buf); + retval.add(data); + } + catch(Exception e) { + log.error("failed marshalling buffer to address", e); + } + } + } + } + } + + return retval; + } + catch(IOException ex) { + log.error("failed reading addresses", ex); + return retval; + } + } + + + protected void writeToFile(PingData data, String clustername) { + if(clustername == null || data == null) + return; + String filename=local_addr instanceof org.jgroups.util.UUID? ((org.jgroups.util.UUID)local_addr).toStringLong() : local_addr.toString(); + String key=clustername + "/" + filename; + try { + Map headers=new TreeMap(); + headers.put("Content-Type", Arrays.asList("text/plain")); + byte[] buf=Util.objectToByteBuffer(data); + S3Object val=new S3Object(buf, null); + conn.put(location, key, val, headers).connection.getResponseMessage(); + } + catch(Exception e) { + log.error("failed marshalling " + data + " to buffer", e); + } + } + + + protected void remove(String clustername, Address addr) { + if(clustername == null || addr == null) + return; + String filename=addr instanceof org.jgroups.util.UUID? ((org.jgroups.util.UUID)addr).toStringLong() : addr.toString(); + String key=clustername + "/" + filename; + try { + Map headers=new TreeMap(); + headers.put("Content-Type", Arrays.asList("text/plain")); + conn.delete(location, key, headers).connection.getResponseMessage(); + if(log.isTraceEnabled()) + log.trace("removing " + location + "/" + key); + } + catch(Exception e) { + log.error("failure removing data", e); + } + } + + + + + + + + /** + * The following classes have been copied from Amazon's sample code + */ + static class AWSAuthConnection { + public static final String LOCATION_DEFAULT=null; + public static final String LOCATION_EU="EU"; + + private String awsAccessKeyId; + private String awsSecretAccessKey; + private boolean isSecure; + private String server; + private int port; + private CallingFormat callingFormat; + + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey) { + this(awsAccessKeyId, awsSecretAccessKey, true); + } + + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey, boolean isSecure) { + this(awsAccessKeyId, awsSecretAccessKey, isSecure, Utils.DEFAULT_HOST); + } + + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey, boolean isSecure, + String server) { + this(awsAccessKeyId, awsSecretAccessKey, isSecure, server, + isSecure? Utils.SECURE_PORT : Utils.INSECURE_PORT); + } + + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey, boolean isSecure, + String server, int port) { + this(awsAccessKeyId, awsSecretAccessKey, isSecure, server, port, CallingFormat.getSubdomainCallingFormat()); + + } + + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey, boolean isSecure, + String server, CallingFormat format) { + this(awsAccessKeyId, awsSecretAccessKey, isSecure, server, + isSecure? Utils.SECURE_PORT : Utils.INSECURE_PORT, + format); + } + + /** + * Create a new interface to interact with S3 with the given credential and connection + * parameters + * @param awsAccessKeyId Your user key into AWS + * @param awsSecretAccessKey The secret string used to generate signatures for authentication. + * @param isSecure use SSL encryption + * @param server Which host to connect to. Usually, this will be s3.amazonaws.com + * @param port Which port to use. + * @param format Type of request Regular/Vanity or Pure Vanity domain + */ + public AWSAuthConnection(String awsAccessKeyId, String awsSecretAccessKey, boolean isSecure, + String server, int port, CallingFormat format) { + this.awsAccessKeyId=awsAccessKeyId; + this.awsSecretAccessKey=awsSecretAccessKey; + this.isSecure=isSecure; + this.server=server; + this.port=port; + this.callingFormat=format; + } + + /** + * Creates a new bucket. + * @param bucket The name of the bucket to create. + * @param headers A Map of String to List of Strings representing the http headers to pass (can be null). + */ + public Response createBucket(String bucket, Map headers) throws IOException { + return createBucket(bucket, null, headers); + } + + /** + * Creates a new bucket. + * @param bucket The name of the bucket to create. + * @param location Desired location ("EU") (or null for default). + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + * @throws IllegalArgumentException on invalid location + */ + public Response createBucket(String bucket, String location, Map headers) throws IOException { + String body; + if(location == null) { + body=null; + } + else if(LOCATION_EU.equals(location)) { + if(!callingFormat.supportsLocatedBuckets()) + throw new IllegalArgumentException("Creating location-constrained bucket with unsupported calling-format"); + body="" + location + ""; + } + else + throw new IllegalArgumentException("Invalid Location: " + location); + + // validate bucket name + if(!Utils.validateBucketName(bucket, callingFormat)) + throw new IllegalArgumentException("Invalid Bucket Name: " + bucket); + + HttpURLConnection request=makeRequest("PUT", bucket, "", null, headers); + if(body != null) { + request.setDoOutput(true); + request.getOutputStream().write(body.getBytes("UTF-8")); + } + return new Response(request); + } + + /** + * Check if the specified bucket exists (via a HEAD request) + * @param bucket The name of the bucket to check + * @return true if HEAD access returned success + */ + public boolean checkBucketExists(String bucket) throws IOException { + HttpURLConnection response=makeRequest("HEAD", bucket, "", null, null); + int httpCode=response.getResponseCode(); + + if(httpCode >= 200 && httpCode < 300) + return true; + if(httpCode == HttpURLConnection.HTTP_NOT_FOUND) // bucket doesn't exist + return false; + throw new IOException("bucket '" + bucket + "' could not be accessed (rsp=" + + httpCode + " (" + response.getResponseMessage() + "). Maybe the bucket is owned by somebody else or " + + "the authentication failed"); + + } + + /** + * Lists the contents of a bucket. + * @param bucket The name of the bucket to create. + * @param prefix All returned keys will start with this string (can be null). + * @param marker All returned keys will be lexographically greater than + * this string (can be null). + * @param maxKeys The maximum number of keys to return (can be null). + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public ListBucketResponse listBucket(String bucket, String prefix, String marker, + Integer maxKeys, Map headers) throws IOException { + return listBucket(bucket, prefix, marker, maxKeys, null, headers); + } + + /** + * Lists the contents of a bucket. + * @param bucket The name of the bucket to list. + * @param prefix All returned keys will start with this string (can be null). + * @param marker All returned keys will be lexographically greater than + * this string (can be null). + * @param maxKeys The maximum number of keys to return (can be null). + * @param delimiter Keys that contain a string between the prefix and the first + * occurrence of the delimiter will be rolled up into a single element. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public ListBucketResponse listBucket(String bucket, String prefix, String marker, + Integer maxKeys, String delimiter, Map headers) throws IOException { + + Map pathArgs=Utils.paramsForListOptions(prefix, marker, maxKeys, delimiter); + return new ListBucketResponse(makeRequest("GET", bucket, "", pathArgs, headers)); + } + + /** + * Deletes a bucket. + * @param bucket The name of the bucket to delete. + * @param headers A Map of String to List of Strings representing the http headers to pass (can be null). + */ + public Response deleteBucket(String bucket, Map headers) throws IOException { + return new Response(makeRequest("DELETE", bucket, "", null, headers)); + } + + /** + * Writes an object to S3. + * @param bucket The name of the bucket to which the object will be added. + * @param key The name of the key to use. + * @param object An S3Object containing the data to write. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public Response put(String bucket, String key, S3Object object, Map headers) throws IOException { + HttpURLConnection request= + makeRequest("PUT", bucket, Utils.urlencode(key), null, headers, object); + + request.setDoOutput(true); + request.getOutputStream().write(object.data == null? new byte[]{} : object.data); + + return new Response(request); + } + + /** + * Creates a copy of an existing S3 Object. In this signature, we will copy the + * existing metadata. The default access control policy is private; if you want + * to override it, please use x-amz-acl in the headers. + * @param sourceBucket The name of the bucket where the source object lives. + * @param sourceKey The name of the key to copy. + * @param destinationBucket The name of the bucket to which the object will be added. + * @param destinationKey The name of the key to use. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). You may wish to set the x-amz-acl header appropriately. + */ + public Response copy(String sourceBucket, String sourceKey, String destinationBucket, String destinationKey, Map headers) + throws IOException { + S3Object object=new S3Object(new byte[]{}, new HashMap()); + headers=headers == null? new HashMap() : new HashMap(headers); + headers.put("x-amz-copy-source", Arrays.asList(sourceBucket + "/" + sourceKey)); + headers.put("x-amz-metadata-directive", Arrays.asList("COPY")); + return verifyCopy(put(destinationBucket, destinationKey, object, headers)); + } + + /** + * Creates a copy of an existing S3 Object. In this signature, we will replace the + * existing metadata. The default access control policy is private; if you want + * to override it, please use x-amz-acl in the headers. + * @param sourceBucket The name of the bucket where the source object lives. + * @param sourceKey The name of the key to copy. + * @param destinationBucket The name of the bucket to which the object will be added. + * @param destinationKey The name of the key to use. + * @param metadata A Map of String to List of Strings representing the S3 metadata + * for the new object. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). You may wish to set the x-amz-acl header appropriately. + */ + public Response copy(String sourceBucket, String sourceKey, String destinationBucket, String destinationKey, Map metadata, Map headers) + throws IOException { + S3Object object=new S3Object(new byte[]{}, metadata); + headers=headers == null? new HashMap() : new HashMap(headers); + headers.put("x-amz-copy-source", Arrays.asList(sourceBucket + "/" + sourceKey)); + headers.put("x-amz-metadata-directive", Arrays.asList("REPLACE")); + return verifyCopy(put(destinationBucket, destinationKey, object, headers)); + } + + /** + * Copy sometimes returns a successful response and starts to send whitespace + * characters to us. This method processes those whitespace characters and + * will throw an exception if the response is either unknown or an error. + * @param response Response object from the PUT request. + * @return The response with the input stream drained. + * @throws IOException If anything goes wrong. + */ + private static Response verifyCopy(Response response) throws IOException { + if(response.connection.getResponseCode() < 400) { + byte[] body=GetResponse.slurpInputStream(response.connection.getInputStream()); + String message=new String(body); + if(message.contains("")) { + // It worked! + } + else { + throw new IOException("Unexpected response: " + message); + } + } + return response; + } + + /** + * Reads an object from S3. + * @param bucket The name of the bucket where the object lives. + * @param key The name of the key to use. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public GetResponse get(String bucket, String key, Map headers) throws IOException { + return new GetResponse(makeRequest("GET", bucket, Utils.urlencode(key), null, headers)); + } + + /** + * Deletes an object from S3. + * @param bucket The name of the bucket where the object lives. + * @param key The name of the key to use. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public Response delete(String bucket, String key, Map headers) throws IOException { + return new Response(makeRequest("DELETE", bucket, Utils.urlencode(key), null, headers)); + } + + /** + * Get the requestPayment xml document for a given bucket + * @param bucket The name of the bucket + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public GetResponse getBucketRequestPayment(String bucket, Map headers) throws IOException { + Map pathArgs=new HashMap(); + pathArgs.put("requestPayment", null); + return new GetResponse(makeRequest("GET", bucket, "", pathArgs, headers)); + } + + /** + * Write a new requestPayment xml document for a given bucket + * @param bucket The name of the bucket + * @param requestPaymentXMLDoc + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public Response putBucketRequestPayment(String bucket, String requestPaymentXMLDoc, Map headers) + throws IOException { + Map pathArgs=new HashMap(); + pathArgs.put("requestPayment", null); + S3Object object=new S3Object(requestPaymentXMLDoc.getBytes(), null); + HttpURLConnection request=makeRequest("PUT", bucket, "", pathArgs, headers, object); + + request.setDoOutput(true); + request.getOutputStream().write(object.data == null? new byte[]{} : object.data); + + return new Response(request); + } + + /** + * Get the logging xml document for a given bucket + * @param bucket The name of the bucket + * @param headers A Map of String to List of Strings representing the http headers to pass (can be null). + */ + public GetResponse getBucketLogging(String bucket, Map headers) throws IOException { + Map pathArgs=new HashMap(); + pathArgs.put("logging", null); + return new GetResponse(makeRequest("GET", bucket, "", pathArgs, headers)); + } + + /** + * Write a new logging xml document for a given bucket + * @param loggingXMLDoc The xml representation of the logging configuration as a String + * @param bucket The name of the bucket + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public Response putBucketLogging(String bucket, String loggingXMLDoc, Map headers) throws IOException { + Map pathArgs=new HashMap(); + pathArgs.put("logging", null); + S3Object object=new S3Object(loggingXMLDoc.getBytes(), null); + HttpURLConnection request=makeRequest("PUT", bucket, "", pathArgs, headers, object); + + request.setDoOutput(true); + request.getOutputStream().write(object.data == null? new byte[]{} : object.data); + + return new Response(request); + } + + /** + * Get the ACL for a given bucket + * @param bucket The name of the bucket where the object lives. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public GetResponse getBucketACL(String bucket, Map headers) throws IOException { + return getACL(bucket, "", headers); + } + + /** + * Get the ACL for a given object (or bucket, if key is null). + * @param bucket The name of the bucket where the object lives. + * @param key The name of the key to use. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public GetResponse getACL(String bucket, String key, Map headers) throws IOException { + if(key == null) key=""; + + Map pathArgs=new HashMap(); + pathArgs.put("acl", null); + + return new GetResponse( + makeRequest("GET", bucket, Utils.urlencode(key), pathArgs, headers) + ); + } + + /** + * Write a new ACL for a given bucket + * @param aclXMLDoc The xml representation of the ACL as a String + * @param bucket The name of the bucket where the object lives. + * @param headers A Map of String to List of Strings representing the http headers to pass (can be null). + */ + public Response putBucketACL(String bucket, String aclXMLDoc, Map headers) throws IOException { + return putACL(bucket, "", aclXMLDoc, headers); + } + + /** + * Write a new ACL for a given object + * @param aclXMLDoc The xml representation of the ACL as a String + * @param bucket The name of the bucket where the object lives. + * @param key The name of the key to use. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public Response putACL(String bucket, String key, String aclXMLDoc, Map headers) + throws IOException { + S3Object object=new S3Object(aclXMLDoc.getBytes(), null); + + Map pathArgs=new HashMap(); + pathArgs.put("acl", null); + + HttpURLConnection request= + makeRequest("PUT", bucket, Utils.urlencode(key), pathArgs, headers, object); + + request.setDoOutput(true); + request.getOutputStream().write(object.data == null? new byte[]{} : object.data); + + return new Response(request); + } + + public LocationResponse getBucketLocation(String bucket) + throws IOException { + Map pathArgs=new HashMap(); + pathArgs.put("location", null); + return new LocationResponse(makeRequest("GET", bucket, "", pathArgs, null)); + } + + + /** + * List all the buckets created by this account. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + public ListAllMyBucketsResponse listAllMyBuckets(Map headers) + throws IOException { + return new ListAllMyBucketsResponse(makeRequest("GET", "", "", null, headers)); + } + + + /** + * Make a new HttpURLConnection without passing an S3Object parameter. + * Use this method for key operations that do require arguments + * @param method The method to invoke + * @param bucketName the bucket this request is for + * @param key the key this request is for + * @param pathArgs the + * @param headers + * @return + * @throws MalformedURLException + * @throws IOException + */ + private HttpURLConnection makeRequest(String method, String bucketName, String key, Map pathArgs, Map headers) + throws IOException { + return makeRequest(method, bucketName, key, pathArgs, headers, null); + } + + + /** + * Make a new HttpURLConnection. + * @param method The HTTP method to use (GET, PUT, DELETE) + * @param bucket The bucket name this request affects + * @param key The key this request is for + * @param pathArgs parameters if any to be sent along this request + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + * @param object The S3Object that is to be written (can be null). + */ + private HttpURLConnection makeRequest(String method, String bucket, String key, Map pathArgs, Map headers, + S3Object object) + throws IOException { + CallingFormat format=Utils.getCallingFormatForBucket(this.callingFormat, bucket); + if(isSecure && format != CallingFormat.getPathCallingFormat() && bucket.contains(".")) { + System.err.println("You are making an SSL connection, however, the bucket contains periods and the wildcard certificate will not match by default. Please consider using HTTP."); + } + + // build the domain based on the calling format + URL url=format.getURL(isSecure, server, this.port, bucket, key, pathArgs); + + HttpURLConnection connection=(HttpURLConnection)url.openConnection(); + connection.setRequestMethod(method); + + // subdomain-style urls may encounter http redirects. + // Ensure that redirects are supported. + if(!connection.getInstanceFollowRedirects() + && format.supportsLocatedBuckets()) + throw new RuntimeException("HTTP redirect support required."); + + addHeaders(connection, headers); + if(object != null) addMetadataHeaders(connection, object.metadata); + addAuthHeader(connection, method, bucket, key, pathArgs); + + return connection; + } + + /** + * Add the given headers to the HttpURLConnection. + * @param connection The HttpURLConnection to which the headers will be added. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + */ + private static void addHeaders(HttpURLConnection connection, Map headers) { + addHeaders(connection, headers, ""); + } + + /** + * Add the given metadata fields to the HttpURLConnection. + * @param connection The HttpURLConnection to which the headers will be added. + * @param metadata A Map of String to List of Strings representing the s3 + * metadata for this resource. + */ + private static void addMetadataHeaders(HttpURLConnection connection, Map metadata) { + addHeaders(connection, metadata, Utils.METADATA_PREFIX); + } + + /** + * Add the given headers to the HttpURLConnection with a prefix before the keys. + * @param connection The HttpURLConnection to which the headers will be added. + * @param headers A Map of String to List of Strings representing the http + * headers to pass (can be null). + * @param prefix The string to prepend to each key before adding it to the connection. + */ + private static void addHeaders(HttpURLConnection connection, Map headers, String prefix) { + if(headers != null) { + for(Iterator i=headers.keySet().iterator(); i.hasNext();) { + String key=(String)i.next(); + for(Iterator j=((List)headers.get(key)).iterator(); j.hasNext();) { + String value=(String)j.next(); + connection.addRequestProperty(prefix + key, value); + } + } + } + } + + /** + * Add the appropriate Authorization header to the HttpURLConnection. + * @param connection The HttpURLConnection to which the header will be added. + * @param method The HTTP method to use (GET, PUT, DELETE) + * @param bucket the bucket name this request is for + * @param key the key this request is for + * @param pathArgs path arguments which are part of this request + */ + private void addAuthHeader(HttpURLConnection connection, String method, String bucket, String key, Map pathArgs) { + if(connection.getRequestProperty("Date") == null) { + connection.setRequestProperty("Date", httpDate()); + } + if(connection.getRequestProperty("Content-Type") == null) { + connection.setRequestProperty("Content-Type", ""); + } + + String canonicalString= + Utils.makeCanonicalString(method, bucket, key, pathArgs, connection.getRequestProperties()); + String encodedCanonical=Utils.encode(this.awsSecretAccessKey, canonicalString, false); + connection.setRequestProperty("Authorization", + "AWS " + this.awsAccessKeyId + ":" + encodedCanonical); + } + + + /** + * Generate an rfc822 date for use in the Date HTTP header. + */ + public static String httpDate() { + final String DateFormat="EEE, dd MMM yyyy HH:mm:ss "; + SimpleDateFormat format=new SimpleDateFormat(DateFormat, Locale.US); + format.setTimeZone(TimeZone.getTimeZone("GMT")); + return format.format(new Date()) + "GMT"; + } + } + + static class ListEntry { + /** + * The name of the object + */ + public String key; + + /** + * The date at which the object was last modified. + */ + public Date lastModified; + + /** + * The object's ETag, which can be used for conditional GETs. + */ + public String eTag; + + /** + * The size of the object in bytes. + */ + public long size; + + /** + * The object's storage class + */ + public String storageClass; + + /** + * The object's owner + */ + public Owner owner; + + public String toString() { + return key; + } + } + + static class Owner { + public String id; + public String displayName; + } + + + static class Response { + public HttpURLConnection connection; + + public Response(HttpURLConnection connection) throws IOException { + this.connection=connection; + } + } + + + static class GetResponse extends Response { + public S3Object object; + + /** + * Pulls a representation of an S3Object out of the HttpURLConnection response. + */ + public GetResponse(HttpURLConnection connection) throws IOException { + super(connection); + if(connection.getResponseCode() < 400) { + Map metadata=extractMetadata(connection); + byte[] body=slurpInputStream(connection.getInputStream()); + this.object=new S3Object(body, metadata); + } + } + + /** + * Examines the response's header fields and returns a Map from String to List of Strings + * representing the object's metadata. + */ + private static Map extractMetadata(HttpURLConnection connection) { + TreeMap metadata=new TreeMap(); + Map headers=connection.getHeaderFields(); + for(Iterator i=headers.keySet().iterator(); i.hasNext();) { + String key=(String)i.next(); + if(key == null) continue; + if(key.startsWith(Utils.METADATA_PREFIX)) { + metadata.put(key.substring(Utils.METADATA_PREFIX.length()), headers.get(key)); + } + } + + return metadata; + } + + /** + * Read the input stream and dump it all into a big byte array + */ + static byte[] slurpInputStream(InputStream stream) throws IOException { + final int chunkSize=2048; + byte[] buf=new byte[chunkSize]; + ByteArrayOutputStream byteStream=new ByteArrayOutputStream(chunkSize); + int count; + + while((count=stream.read(buf)) != -1) byteStream.write(buf, 0, count); + + return byteStream.toByteArray(); + } + } + + static class LocationResponse extends Response { + String location; + + /** + * Parse the response to a ?location query. + */ + public LocationResponse(HttpURLConnection connection) throws IOException { + super(connection); + if(connection.getResponseCode() < 400) { + try { + XMLReader xr=Utils.createXMLReader(); + ; + LocationResponseHandler handler=new LocationResponseHandler(); + xr.setContentHandler(handler); + xr.setErrorHandler(handler); + + xr.parse(new InputSource(connection.getInputStream())); + this.location=handler.loc; + } + catch(SAXException e) { + throw new RuntimeException("Unexpected error parsing ListAllMyBuckets xml", e); + } + } + else { + this.location=""; + } + } + + /** + * Report the location-constraint for a bucket. + * A value of null indicates an error; + * the empty string indicates no constraint; + * and any other value is an actual location constraint value. + */ + public String getLocation() { + return location; + } + + /** + * Helper class to parse LocationConstraint response XML + */ + static class LocationResponseHandler extends DefaultHandler { + String loc=null; + private StringBuffer currText=null; + + public void startDocument() { + } + + public void startElement(String uri, String name, String qName, Attributes attrs) { + if(name.equals("LocationConstraint")) { + this.currText=new StringBuffer(); + } + } + + public void endElement(String uri, String name, String qName) { + if(name.equals("LocationConstraint")) { + loc=this.currText.toString(); + this.currText=null; + } + } + + public void characters(char ch[], int start, int length) { + if(currText != null) + this.currText.append(ch, start, length); + } + } + } + + + static class Bucket { + /** + * The name of the bucket. + */ + public String name; + + /** + * The bucket's creation date. + */ + public Date creationDate; + + public Bucket() { + this.name=null; + this.creationDate=null; + } + + public Bucket(String name, Date creationDate) { + this.name=name; + this.creationDate=creationDate; + } + + public String toString() { + return this.name; + } + } + + static class ListBucketResponse extends Response { + + /** + * The name of the bucket being listed. Null if request fails. + */ + public String name=null; + + /** + * The prefix echoed back from the request. Null if request fails. + */ + public String prefix=null; + + /** + * The marker echoed back from the request. Null if request fails. + */ + public String marker=null; + + /** + * The delimiter echoed back from the request. Null if not specified in + * the request, or if it fails. + */ + public String delimiter=null; + + /** + * The maxKeys echoed back from the request if specified. 0 if request fails. + */ + public int maxKeys=0; + + /** + * Indicates if there are more results to the list. True if the current + * list results have been truncated. false if request fails. + */ + public boolean isTruncated=false; + + /** + * Indicates what to use as a marker for subsequent list requests in the event + * that the results are truncated. Present only when a delimiter is specified. + * Null if request fails. + */ + public String nextMarker=null; + + /** + * A List of ListEntry objects representing the objects in the given bucket. + * Null if the request fails. + */ + public List entries=null; + + /** + * A List of CommonPrefixEntry objects representing the common prefixes of the + * keys that matched up to the delimiter. Null if the request fails. + */ + public List commonPrefixEntries=null; + + public ListBucketResponse(HttpURLConnection connection) throws IOException { + super(connection); + if(connection.getResponseCode() < 400) { + try { + XMLReader xr=Utils.createXMLReader(); + ListBucketHandler handler=new ListBucketHandler(); + xr.setContentHandler(handler); + xr.setErrorHandler(handler); + + xr.parse(new InputSource(connection.getInputStream())); + + this.name=handler.getName(); + this.prefix=handler.getPrefix(); + this.marker=handler.getMarker(); + this.delimiter=handler.getDelimiter(); + this.maxKeys=handler.getMaxKeys(); + this.isTruncated=handler.getIsTruncated(); + this.nextMarker=handler.getNextMarker(); + this.entries=handler.getKeyEntries(); + this.commonPrefixEntries=handler.getCommonPrefixEntries(); + + } + catch(SAXException e) { + throw new RuntimeException("Unexpected error parsing ListBucket xml", e); + } + } + } + + static class ListBucketHandler extends DefaultHandler { + + private String name=null; + private String prefix=null; + private String marker=null; + private String delimiter=null; + private int maxKeys=0; + private boolean isTruncated=false; + private String nextMarker=null; + private boolean isEchoedPrefix=false; + private List keyEntries=null; + private ListEntry keyEntry=null; + private List commonPrefixEntries=null; + private CommonPrefixEntry commonPrefixEntry=null; + private StringBuffer currText=null; + private SimpleDateFormat iso8601Parser=null; + + public ListBucketHandler() { + super(); + keyEntries=new ArrayList(); + commonPrefixEntries=new ArrayList(); + this.iso8601Parser=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + this.iso8601Parser.setTimeZone(new SimpleTimeZone(0, "GMT")); + this.currText=new StringBuffer(); + } + + public void startDocument() { + this.isEchoedPrefix=true; + } + + public void endDocument() { + // ignore + } + + public void startElement(String uri, String name, String qName, Attributes attrs) { + if(name.equals("Contents")) { + this.keyEntry=new ListEntry(); + } + else if(name.equals("Owner")) { + this.keyEntry.owner=new Owner(); + } + else if(name.equals("CommonPrefixes")) { + this.commonPrefixEntry=new CommonPrefixEntry(); + } + } + + public void endElement(String uri, String name, String qName) { + if(name.equals("Name")) { + this.name=this.currText.toString(); + } + // this prefix is the one we echo back from the request + else if(name.equals("Prefix") && this.isEchoedPrefix) { + this.prefix=this.currText.toString(); + this.isEchoedPrefix=false; + } + else if(name.equals("Marker")) { + this.marker=this.currText.toString(); + } + else if(name.equals("MaxKeys")) { + this.maxKeys=Integer.parseInt(this.currText.toString()); + } + else if(name.equals("Delimiter")) { + this.delimiter=this.currText.toString(); + } + else if(name.equals("IsTruncated")) { + this.isTruncated=Boolean.valueOf(this.currText.toString()); + } + else if(name.equals("NextMarker")) { + this.nextMarker=this.currText.toString(); + } + else if(name.equals("Contents")) { + this.keyEntries.add(this.keyEntry); + } + else if(name.equals("Key")) { + this.keyEntry.key=this.currText.toString(); + } + else if(name.equals("LastModified")) { + try { + this.keyEntry.lastModified=this.iso8601Parser.parse(this.currText.toString()); + } + catch(ParseException e) { + throw new RuntimeException("Unexpected date format in list bucket output", e); + } + } + else if(name.equals("ETag")) { + this.keyEntry.eTag=this.currText.toString(); + } + else if(name.equals("Size")) { + this.keyEntry.size=Long.parseLong(this.currText.toString()); + } + else if(name.equals("StorageClass")) { + this.keyEntry.storageClass=this.currText.toString(); + } + else if(name.equals("ID")) { + this.keyEntry.owner.id=this.currText.toString(); + } + else if(name.equals("DisplayName")) { + this.keyEntry.owner.displayName=this.currText.toString(); + } + else if(name.equals("CommonPrefixes")) { + this.commonPrefixEntries.add(this.commonPrefixEntry); + } + // this is the common prefix for keys that match up to the delimiter + else if(name.equals("Prefix")) { + this.commonPrefixEntry.prefix=this.currText.toString(); + } + if(this.currText.length() != 0) + this.currText=new StringBuffer(); + } + + public void characters(char ch[], int start, int length) { + this.currText.append(ch, start, length); + } + + public String getName() { + return this.name; + } + + public String getPrefix() { + return this.prefix; + } + + public String getMarker() { + return this.marker; + } + + public String getDelimiter() { + return this.delimiter; + } + + public int getMaxKeys() { + return this.maxKeys; + } + + public boolean getIsTruncated() { + return this.isTruncated; + } + + public String getNextMarker() { + return this.nextMarker; + } + + public List getKeyEntries() { + return this.keyEntries; + } + + public List getCommonPrefixEntries() { + return this.commonPrefixEntries; + } + } + } + + + static class CommonPrefixEntry { + /** + * The prefix common to the delimited keys it represents + */ + public String prefix; + } + + + static class ListAllMyBucketsResponse extends Response { + /** + * A list of Bucket objects, one for each of this account's buckets. Will be null if + * the request fails. + */ + public List entries; + + public ListAllMyBucketsResponse(HttpURLConnection connection) throws IOException { + super(connection); + if(connection.getResponseCode() < 400) { + try { + XMLReader xr=Utils.createXMLReader(); + ; + ListAllMyBucketsHandler handler=new ListAllMyBucketsHandler(); + xr.setContentHandler(handler); + xr.setErrorHandler(handler); + + xr.parse(new InputSource(connection.getInputStream())); + this.entries=handler.getEntries(); + } + catch(SAXException e) { + throw new RuntimeException("Unexpected error parsing ListAllMyBuckets xml", e); + } + } + } + + static class ListAllMyBucketsHandler extends DefaultHandler { + + private List entries=null; + private Bucket currBucket=null; + private StringBuffer currText=null; + private SimpleDateFormat iso8601Parser=null; + + public ListAllMyBucketsHandler() { + super(); + entries=new ArrayList(); + this.iso8601Parser=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + this.iso8601Parser.setTimeZone(new SimpleTimeZone(0, "GMT")); + this.currText=new StringBuffer(); + } + + public void startDocument() { + // ignore + } + + public void endDocument() { + // ignore + } + + public void startElement(String uri, String name, String qName, Attributes attrs) { + if(name.equals("Bucket")) { + this.currBucket=new Bucket(); + } + } + + public void endElement(String uri, String name, String qName) { + if(name.equals("Bucket")) { + this.entries.add(this.currBucket); + } + else if(name.equals("Name")) { + this.currBucket.name=this.currText.toString(); + } + else if(name.equals("CreationDate")) { + try { + this.currBucket.creationDate=this.iso8601Parser.parse(this.currText.toString()); + } + catch(ParseException e) { + throw new RuntimeException("Unexpected date format in list bucket output", e); + } + } + this.currText=new StringBuffer(); + } + + public void characters(char ch[], int start, int length) { + this.currText.append(ch, start, length); + } + + public List getEntries() { + return this.entries; + } + } + } + + + static class S3Object { + + public byte[] data; + + /** + * A Map from String to List of Strings representing the object's metadata + */ + public Map metadata; + + public S3Object(byte[] data, Map metadata) { + this.data=data; + this.metadata=metadata; + } + } + + + abstract static class CallingFormat { + + protected static CallingFormat pathCallingFormat=new PathCallingFormat(); + protected static CallingFormat subdomainCallingFormat=new SubdomainCallingFormat(); + protected static CallingFormat vanityCallingFormat=new VanityCallingFormat(); + + public abstract boolean supportsLocatedBuckets(); + + public abstract String getEndpoint(String server, int port, String bucket); + + public abstract String getPathBase(String bucket, String key); + + public abstract URL getURL(boolean isSecure, String server, int port, String bucket, String key, Map pathArgs) + throws MalformedURLException; + + public static CallingFormat getPathCallingFormat() { + return pathCallingFormat; + } + + public static CallingFormat getSubdomainCallingFormat() { + return subdomainCallingFormat; + } + + public static CallingFormat getVanityCallingFormat() { + return vanityCallingFormat; + } + + private static class PathCallingFormat extends CallingFormat { + public boolean supportsLocatedBuckets() { + return false; + } + + public String getPathBase(String bucket, String key) { + return isBucketSpecified(bucket)? "/" + bucket + "/" + key : "/"; + } + + public String getEndpoint(String server, int port, String bucket) { + return server + ":" + port; + } + + public URL getURL(boolean isSecure, String server, int port, String bucket, String key, Map pathArgs) + throws MalformedURLException { + String pathBase=isBucketSpecified(bucket)? "/" + bucket + "/" + key : "/"; + String pathArguments=Utils.convertPathArgsHashToString(pathArgs); + return new URL(isSecure? "https" : "http", server, port, pathBase + pathArguments); + } + + private static boolean isBucketSpecified(String bucket) { + return bucket != null && bucket.length() != 0; + } + } + + private static class SubdomainCallingFormat extends CallingFormat { + public boolean supportsLocatedBuckets() { + return true; + } + + public String getServer(String server, String bucket) { + return bucket + "." + server; + } + + public String getEndpoint(String server, int port, String bucket) { + return getServer(server, bucket) + ":" + port; + } + + public String getPathBase(String bucket, String key) { + return "/" + key; + } + + public URL getURL(boolean isSecure, String server, int port, String bucket, String key, Map pathArgs) + throws MalformedURLException { + if(bucket == null || bucket.length() == 0) { + //The bucket is null, this is listAllBuckets request + String pathArguments=Utils.convertPathArgsHashToString(pathArgs); + return new URL(isSecure? "https" : "http", server, port, "/" + pathArguments); + } + else { + String serverToUse=getServer(server, bucket); + String pathBase=getPathBase(bucket, key); + String pathArguments=Utils.convertPathArgsHashToString(pathArgs); + return new URL(isSecure? "https" : "http", serverToUse, port, pathBase + pathArguments); + } + } + } + + private static class VanityCallingFormat extends SubdomainCallingFormat { + public String getServer(String server, String bucket) { + return bucket; + } + } + } + + static class Utils { + static final String METADATA_PREFIX="x-amz-meta-"; + static final String AMAZON_HEADER_PREFIX="x-amz-"; + static final String ALTERNATIVE_DATE_HEADER="x-amz-date"; + public static final String DEFAULT_HOST="s3.amazonaws.com"; + + public static final int SECURE_PORT=443; + public static final int INSECURE_PORT=80; + + + /** + * HMAC/SHA1 Algorithm per RFC 2104. + */ + private static final String HMAC_SHA1_ALGORITHM="HmacSHA1"; + + static String makeCanonicalString(String method, String bucket, String key, Map pathArgs, Map headers) { + return makeCanonicalString(method, bucket, key, pathArgs, headers, null); + } + + /** + * Calculate the canonical string. When expires is non-null, it will be + * used instead of the Date header. + */ + static String makeCanonicalString(String method, String bucketName, String key, Map pathArgs, + Map headers, String expires) { + StringBuilder buf=new StringBuilder(); + buf.append(method + "\n"); + + // Add all interesting headers to a list, then sort them. "Interesting" + // is defined as Content-MD5, Content-Type, Date, and x-amz- + SortedMap interestingHeaders=new TreeMap(); + if(headers != null) { + for(Iterator i=headers.keySet().iterator(); i.hasNext();) { + String hashKey=(String)i.next(); + if(hashKey == null) continue; + String lk=hashKey.toLowerCase(); + + // Ignore any headers that are not particularly interesting. + if(lk.equals("content-type") || lk.equals("content-md5") || lk.equals("date") || + lk.startsWith(AMAZON_HEADER_PREFIX)) { + List s=(List)headers.get(hashKey); + interestingHeaders.put(lk, concatenateList(s)); + } + } + } + + if(interestingHeaders.containsKey(ALTERNATIVE_DATE_HEADER)) { + interestingHeaders.put("date", ""); + } + + // if the expires is non-null, use that for the date field. this + // trumps the x-amz-date behavior. + if(expires != null) { + interestingHeaders.put("date", expires); + } + + // these headers require that we still put a new line in after them, + // even if they don't exist. + if(!interestingHeaders.containsKey("content-type")) { + interestingHeaders.put("content-type", ""); + } + if(!interestingHeaders.containsKey("content-md5")) { + interestingHeaders.put("content-md5", ""); + } + + // Finally, add all the interesting headers (i.e.: all that startwith x-amz- ;-)) + for(Iterator i=interestingHeaders.keySet().iterator(); i.hasNext();) { + String headerKey=(String)i.next(); + if(headerKey.startsWith(AMAZON_HEADER_PREFIX)) { + buf.append(headerKey).append(':').append(interestingHeaders.get(headerKey)); + } + else { + buf.append(interestingHeaders.get(headerKey)); + } + buf.append("\n"); + } + + // build the path using the bucket and key + if(bucketName != null && bucketName.length() != 0) { + buf.append("/" + bucketName); + } + + // append the key (it might be an empty string) + // append a slash regardless + buf.append("/"); + if(key != null) { + buf.append(key); + } + + // if there is an acl, logging or torrent parameter + // add them to the string + if(pathArgs != null) { + if(pathArgs.containsKey("acl")) { + buf.append("?acl"); + } + else if(pathArgs.containsKey("torrent")) { + buf.append("?torrent"); + } + else if(pathArgs.containsKey("logging")) { + buf.append("?logging"); + } + else if(pathArgs.containsKey("location")) { + buf.append("?location"); + } + } + + return buf.toString(); + + } + + /** + * Calculate the HMAC/SHA1 on a string. + * @return Signature + * @throws java.security.NoSuchAlgorithmException + * If the algorithm does not exist. Unlikely + * @throws java.security.InvalidKeyException + * If the key is invalid. + */ + static String encode(String awsSecretAccessKey, String canonicalString, + boolean urlencode) { + // The following HMAC/SHA1 code for the signature is taken from the + // AWS Platform's implementation of RFC2104 (amazon.webservices.common.Signature) + // + // Acquire an HMAC/SHA1 from the raw key bytes. + SecretKeySpec signingKey= + new SecretKeySpec(awsSecretAccessKey.getBytes(), HMAC_SHA1_ALGORITHM); + + // Acquire the MAC instance and initialize with the signing key. + Mac mac=null; + try { + mac=Mac.getInstance(HMAC_SHA1_ALGORITHM); + } + catch(NoSuchAlgorithmException e) { + // should not happen + throw new RuntimeException("Could not find sha1 algorithm", e); + } + try { + mac.init(signingKey); + } + catch(InvalidKeyException e) { + // also should not happen + throw new RuntimeException("Could not initialize the MAC algorithm", e); + } + + // Compute the HMAC on the digest, and set it. + String b64=Base64.encodeBytes(mac.doFinal(canonicalString.getBytes())); + + if(urlencode) { + return urlencode(b64); + } + else { + return b64; + } + } + + static Map paramsForListOptions(String prefix, String marker, Integer maxKeys) { + return paramsForListOptions(prefix, marker, maxKeys, null); + } + + static Map paramsForListOptions(String prefix, String marker, Integer maxKeys, String delimiter) { + + Map argParams=new HashMap(); + // these three params must be url encoded + if(prefix != null) + argParams.put("prefix", urlencode(prefix)); + if(marker != null) + argParams.put("marker", urlencode(marker)); + if(delimiter != null) + argParams.put("delimiter", urlencode(delimiter)); + + if(maxKeys != null) + argParams.put("max-keys", Integer.toString(maxKeys.intValue())); + + return argParams; + + } + + /** + * Converts the Path Arguments from a map to String which can be used in url construction + * @param pathArgs a map of arguments + * @return a string representation of pathArgs + */ + public static String convertPathArgsHashToString(Map pathArgs) { + StringBuilder pathArgsString=new StringBuilder(); + String argumentValue; + boolean firstRun=true; + if(pathArgs != null) { + for(Iterator argumentIterator=pathArgs.keySet().iterator(); argumentIterator.hasNext();) { + String argument=(String)argumentIterator.next(); + if(firstRun) { + firstRun=false; + pathArgsString.append("?"); + } + else { + pathArgsString.append("&"); + } + + argumentValue=(String)pathArgs.get(argument); + pathArgsString.append(argument); + if(argumentValue != null) { + pathArgsString.append("="); + pathArgsString.append(argumentValue); + } + } + } + + return pathArgsString.toString(); + } + + + static String urlencode(String unencoded) { + try { + return URLEncoder.encode(unencoded, "UTF-8"); + } + catch(UnsupportedEncodingException e) { + // should never happen + throw new RuntimeException("Could not url encode to UTF-8", e); + } + } + + static XMLReader createXMLReader() { + try { + return XMLReaderFactory.createXMLReader(); + } + catch(SAXException e) { + // oops, lets try doing this (needed in 1.4) + System.setProperty("org.xml.sax.driver", "org.apache.crimson.parser.XMLReaderImpl"); + } + try { + // try once more + return XMLReaderFactory.createXMLReader(); + } + catch(SAXException e) { + throw new RuntimeException("Couldn't initialize a sax driver for the XMLReader"); + } + } + + /** + * Concatenates a bunch of header values, seperating them with a comma. + * @param values List of header values. + * @return String of all headers, with commas. + */ + private static String concatenateList(List values) { + StringBuilder buf=new StringBuilder(); + for(int i=0, size=values.size(); i < size; ++i) { + buf.append(((String)values.get(i)).replaceAll("\n", "").trim()); + if(i != (size - 1)) { + buf.append(","); + } + } + return buf.toString(); + } + + /** + * Validate bucket-name + */ + static boolean validateBucketName(String bucketName, CallingFormat callingFormat) { + if(callingFormat == CallingFormat.getPathCallingFormat()) { + final int MIN_BUCKET_LENGTH=3; + final int MAX_BUCKET_LENGTH=255; + final String BUCKET_NAME_REGEX="^[0-9A-Za-z\\.\\-_]*$"; + + return null != bucketName && + bucketName.length() >= MIN_BUCKET_LENGTH && + bucketName.length() <= MAX_BUCKET_LENGTH && + bucketName.matches(BUCKET_NAME_REGEX); + } + else { + return isValidSubdomainBucketName(bucketName); + } + } + + static boolean isValidSubdomainBucketName(String bucketName) { + final int MIN_BUCKET_LENGTH=3; + final int MAX_BUCKET_LENGTH=63; + // don't allow names that look like 127.0.0.1 + final String IPv4_REGEX="^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$"; + // dns sub-name restrictions + final String BUCKET_NAME_REGEX="^[a-z0-9]([a-z0-9\\-\\_]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9\\-\\_]*[a-z0-9])?)*$"; + + // If there wasn't a location-constraint, then the current actual + // restriction is just that no 'part' of the name (i.e. sequence + // of characters between any 2 '.'s has to be 63) but the recommendation + // is to keep the entire bucket name under 63. + return null != bucketName && + bucketName.length() >= MIN_BUCKET_LENGTH && + bucketName.length() <= MAX_BUCKET_LENGTH && + !bucketName.matches(IPv4_REGEX) && + bucketName.matches(BUCKET_NAME_REGEX); + } + + static CallingFormat getCallingFormatForBucket(CallingFormat desiredFormat, String bucketName) { + CallingFormat callingFormat=desiredFormat; + if(callingFormat == CallingFormat.getSubdomainCallingFormat() && !Utils.isValidSubdomainBucketName(bucketName)) { + callingFormat=CallingFormat.getPathCallingFormat(); + } + return callingFormat; + } + } + + +// +// NOTE: The following source code is the iHarder.net public domain +// Base64 library and is provided here as a convenience. For updates, +// problems, questions, etc. regarding this code, please visit: +// http://iharder.sourceforge.net/current/java/base64/ +// + + + /** + * Encodes and decodes to and from Base64 notation. + *

+ *

+ * Change Log: + *

+ *
    + *
  • v2.1 - Cleaned up javadoc comments and unused variables and methods. Added + * some convenience methods for reading and writing to and from files.
  • + *
  • v2.0.2 - Now specifies UTF-8 encoding in places where the code fails on systems + * with other encodings (like EBCDIC).
  • + *
  • v2.0.1 - Fixed an error when decoding a single byte, that is, when the + * encoded data was a single byte.
  • + *
  • v2.0 - I got rid of methods that used booleans to set options. + * Now everything is more consolidated and cleaner. The code now detects + * when data that's being decoded is gzip-compressed and will decompress it + * automatically. Generally things are cleaner. You'll probably have to + * change some method calls that you were making to support the new + * options format (ints that you "OR" together).
  • + *
  • v1.5.1 - Fixed bug when decompressing and decoding to a + * byte[] using decode( String s, boolean gzipCompressed ). + * Added the ability to "suspend" encoding in the Output Stream so + * you can turn on and off the encoding if you need to embed base64 + * data in an otherwise "normal" stream (like an XML file).
  • + *
  • v1.5 - Output stream pases on flush() command but doesn't do anything itself. + * This helps when using GZIP streams. + * Added the ability to GZip-compress objects before encoding them.
  • + *
  • v1.4 - Added helper methods to read/write files.
  • + *
  • v1.3.6 - Fixed OutputStream.flush() so that 'position' is reset.
  • + *
  • v1.3.5 - Added flag to turn on and off line breaks. Fixed bug in input stream + * where last buffer being read, if not completely full, was not returned.
  • + *
  • v1.3.4 - Fixed when "improperly padded stream" error was thrown at the wrong time.
  • + *
  • v1.3.3 - Fixed I/O streams which were totally messed up.
  • + *
+ *

+ *

+ * I am placing this code in the Public Domain. Do with it as you will. + * This software comes with no guarantees or warranties but with + * plenty of well-wishing instead! + * Please visit http://iharder.net/base64 + * periodically to check for updates or to contribute improvements. + *

+ * @author Robert Harder + * @author rob@iharder.net + * @version 2.1 + */ + static class Base64 { + +/* ******** P U B L I C F I E L D S ******** */ + + + /** + * No options specified. Value is zero. + */ + public final static int NO_OPTIONS=0; + + /** + * Specify encoding. + */ + public final static int ENCODE=1; + + + /** + * Specify decoding. + */ + public final static int DECODE=0; + + + /** + * Specify that data should be gzip-compressed. + */ + public final static int GZIP=2; + + + /** + * Don't break lines when encoding (violates strict Base64 specification) + */ + public final static int DONT_BREAK_LINES=8; + + +/* ******** P R I V A T E F I E L D S ******** */ + + + /** + * Maximum line length (76) of Base64 output. + */ + private final static int MAX_LINE_LENGTH=76; + + + /** + * The equals sign (=) as a byte. + */ + private final static byte EQUALS_SIGN=(byte)'='; + + + /** + * The new line character (\n) as a byte. + */ + private final static byte NEW_LINE=(byte)'\n'; + + + /** + * Preferred encoding. + */ + private final static String PREFERRED_ENCODING="UTF-8"; + + + /** + * The 64 valid Base64 values. + */ + private static final byte[] ALPHABET; + private static final byte[] _NATIVE_ALPHABET= /* May be something funny like EBCDIC */ + { + (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G', + (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N', + (byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U', + (byte)'V', (byte)'W', (byte)'X', (byte)'Y', (byte)'Z', + (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g', + (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n', + (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', (byte)'u', + (byte)'v', (byte)'w', (byte)'x', (byte)'y', (byte)'z', + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', + (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/' + }; + + /** Determine which ALPHABET to use. */ + static { + byte[] __bytes; + try { + __bytes="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(PREFERRED_ENCODING); + } // end try + catch(java.io.UnsupportedEncodingException use) { + __bytes=_NATIVE_ALPHABET; // Fall back to native encoding + } // end catch + ALPHABET=__bytes; + } // end static + + + /** + * Translates a Base64 value to either its 6-bit reconstruction value + * or a negative number indicating some other meaning. + */ + private final static byte[] DECODABET= + { + -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8 + -5, -5, // Whitespace: Tab and Linefeed + -9, -9, // Decimal 11 - 12 + -5, // Whitespace: Carriage Return + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 14 - 26 + -9, -9, -9, -9, -9, // Decimal 27 - 31 + -5, // Whitespace: Space + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 33 - 42 + 62, // Plus sign at decimal 43 + -9, -9, -9, // Decimal 44 - 46 + 63, // Slash at decimal 47 + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, // Numbers zero through nine + -9, -9, -9, // Decimal 58 - 60 + -1, // Equals sign at decimal 61 + -9, -9, -9, // Decimal 62 - 64 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, // Letters 'A' through 'N' + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // Letters 'O' through 'Z' + -9, -9, -9, -9, -9, -9, // Decimal 91 - 96 + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, // Letters 'a' through 'm' + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // Letters 'n' through 'z' + -9, -9, -9, -9 // Decimal 123 - 126 + /*,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 127 - 139 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243 + -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */ + }; + + // I think I end up not using the BAD_ENCODING indicator. + //private final static byte BAD_ENCODING = -9; // Indicates error in encoding + private final static byte WHITE_SPACE_ENC=-5; // Indicates white space in encoding + private final static byte EQUALS_SIGN_ENC=-1; // Indicates equals sign in encoding + + + /** + * Defeats instantiation. + */ + private Base64() { + } + + +/* ******** E N C O D I N G M E T H O D S ******** */ + + + /** + * Encodes up to the first three bytes of array threeBytes + * and returns a four-byte array in Base64 notation. + * The actual number of significant bytes in your array is + * given by numSigBytes. + * The array threeBytes needs only be as big as + * numSigBytes. + * Code can reuse a byte array by passing a four-byte array as b4. + * @param b4 A reusable byte array to reduce array instantiation + * @param threeBytes the array to convert + * @param numSigBytes the number of significant bytes in your array + * @return four byte array in Base64 notation. + * @since 1.5.1 + */ + private static byte[] encode3to4(byte[] b4, byte[] threeBytes, int numSigBytes) { + encode3to4(threeBytes, 0, numSigBytes, b4, 0); + return b4; + } // end encode3to4 + + + /** + * Encodes up to three bytes of the array source + * and writes the resulting four Base64 bytes to destination. + * The source and destination arrays can be manipulated + * anywhere along their length by specifying + * srcOffset and destOffset. + * This method does not check to make sure your arrays + * are large enough to accomodate srcOffset + 3 for + * the source array or destOffset + 4 for + * the destination array. + * The actual number of significant bytes in your array is + * given by numSigBytes. + * @param source the array to convert + * @param srcOffset the index where conversion begins + * @param numSigBytes the number of significant bytes in your array + * @param destination the array to hold the conversion + * @param destOffset the index where output will be put + * @return the destination array + * @since 1.3 + */ + private static byte[] encode3to4( + byte[] source, int srcOffset, int numSigBytes, + byte[] destination, int destOffset) { + // 1 2 3 + // 01234567890123456789012345678901 Bit position + // --------000000001111111122222222 Array position from threeBytes + // --------| || || || | Six bit groups to index ALPHABET + // >>18 >>12 >> 6 >> 0 Right shift necessary + // 0x3f 0x3f 0x3f Additional AND + + // Create buffer with zero-padding if there are only one or two + // significant bytes passed in the array. + // We have to shift left 24 in order to flush out the 1's that appear + // when Java treats a value as negative that is cast from a byte to an int. + int inBuff=(numSigBytes > 0? ((source[srcOffset] << 24) >>> 8) : 0) + | (numSigBytes > 1? ((source[srcOffset + 1] << 24) >>> 16) : 0) + | (numSigBytes > 2? ((source[srcOffset + 2] << 24) >>> 24) : 0); + + switch(numSigBytes) { + case 3: + destination[destOffset]=ALPHABET[(inBuff >>> 18)]; + destination[destOffset + 1]=ALPHABET[(inBuff >>> 12) & 0x3f]; + destination[destOffset + 2]=ALPHABET[(inBuff >>> 6) & 0x3f]; + destination[destOffset + 3]=ALPHABET[(inBuff) & 0x3f]; + return destination; + + case 2: + destination[destOffset]=ALPHABET[(inBuff >>> 18)]; + destination[destOffset + 1]=ALPHABET[(inBuff >>> 12) & 0x3f]; + destination[destOffset + 2]=ALPHABET[(inBuff >>> 6) & 0x3f]; + destination[destOffset + 3]=EQUALS_SIGN; + return destination; + + case 1: + destination[destOffset]=ALPHABET[(inBuff >>> 18)]; + destination[destOffset + 1]=ALPHABET[(inBuff >>> 12) & 0x3f]; + destination[destOffset + 2]=EQUALS_SIGN; + destination[destOffset + 3]=EQUALS_SIGN; + return destination; + + default: + return destination; + } // end switch + } // end encode3to4 + + + /** + * Serializes an object and returns the Base64-encoded + * version of that serialized object. If the object + * cannot be serialized or there is another error, + * the method will return null. + * The object is not GZip-compressed before being encoded. + * @param serializableObject The object to encode + * @return The Base64-encoded object + * @since 1.4 + */ + public static String encodeObject(java.io.Serializable serializableObject) { + return encodeObject(serializableObject, NO_OPTIONS); + } // end encodeObject + + + /** + * Serializes an object and returns the Base64-encoded + * version of that serialized object. If the object + * cannot be serialized or there is another error, + * the method will return null. + *

+ * Valid options:

+         *   GZIP: gzip-compresses object before encoding it.
+         *   DONT_BREAK_LINES: don't break lines at 76 characters
+         *     Note: Technically, this makes your encoding non-compliant.
+         * 
+ *

+ * Example: encodeObject( myObj, Base64.GZIP ) or + *

+ * Example: encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES ) + * @param serializableObject The object to encode + * @param options Specified options + * @return The Base64-encoded object + * @see Base64#GZIP + * @see Base64#DONT_BREAK_LINES + * @since 2.0 + */ + public static String encodeObject(java.io.Serializable serializableObject, int options) { + // Streams + java.io.ByteArrayOutputStream baos=null; + java.io.OutputStream b64os=null; + java.io.ObjectOutputStream oos=null; + java.util.zip.GZIPOutputStream gzos=null; + + // Isolate options + int gzip=(options & GZIP); + int dontBreakLines=(options & DONT_BREAK_LINES); + + try { + // ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream + baos=new java.io.ByteArrayOutputStream(); + b64os=new Base64.OutputStream(baos, ENCODE | dontBreakLines); + + // GZip? + if(gzip == GZIP) { + gzos=new java.util.zip.GZIPOutputStream(b64os); + oos=new java.io.ObjectOutputStream(gzos); + } // end if: gzip + else + oos=new java.io.ObjectOutputStream(b64os); + + oos.writeObject(serializableObject); + } // end try + catch(java.io.IOException e) { + e.printStackTrace(); + return null; + } // end catch + finally { + try { + oos.close(); + } + catch(Exception e) { + } + try { + gzos.close(); + } + catch(Exception e) { + } + try { + b64os.close(); + } + catch(Exception e) { + } + try { + baos.close(); + } + catch(Exception e) { + } + } // end finally + + // Return value according to relevant encoding. + try { + return new String(baos.toByteArray(), PREFERRED_ENCODING); + } // end try + catch(java.io.UnsupportedEncodingException uue) { + return new String(baos.toByteArray()); + } // end catch + + } // end encode + + + /** + * Encodes a byte array into Base64 notation. + * Does not GZip-compress data. + * @param source The data to convert + * @since 1.4 + */ + public static String encodeBytes(byte[] source) { + return encodeBytes(source, 0, source.length, NO_OPTIONS); + } // end encodeBytes + + + /** + * Encodes a byte array into Base64 notation. + *

+ * Valid options:

+         *   GZIP: gzip-compresses object before encoding it.
+         *   DONT_BREAK_LINES: don't break lines at 76 characters
+         *     Note: Technically, this makes your encoding non-compliant.
+         * 
+ *

+ * Example: encodeBytes( myData, Base64.GZIP ) or + *

+ * Example: encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES ) + * @param source The data to convert + * @param options Specified options + * @see Base64#GZIP + * @see Base64#DONT_BREAK_LINES + * @since 2.0 + */ + public static String encodeBytes(byte[] source, int options) { + return encodeBytes(source, 0, source.length, options); + } // end encodeBytes + + + /** + * Encodes a byte array into Base64 notation. + * Does not GZip-compress data. + * @param source The data to convert + * @param off Offset in array where conversion should begin + * @param len Length of data to convert + * @since 1.4 + */ + public static String encodeBytes(byte[] source, int off, int len) { + return encodeBytes(source, off, len, NO_OPTIONS); + } // end encodeBytes + + + /** + * Encodes a byte array into Base64 notation. + *

+ * Valid options:

+         *   GZIP: gzip-compresses object before encoding it.
+         *   DONT_BREAK_LINES: don't break lines at 76 characters
+         *     Note: Technically, this makes your encoding non-compliant.
+         * 
+ *

+ * Example: encodeBytes( myData, Base64.GZIP ) or + *

+ * Example: encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES ) + * @param source The data to convert + * @param off Offset in array where conversion should begin + * @param len Length of data to convert + * @param options Specified options + * @see Base64#GZIP + * @see Base64#DONT_BREAK_LINES + * @since 2.0 + */ + public static String encodeBytes(byte[] source, int off, int len, int options) { + // Isolate options + int dontBreakLines=(options & DONT_BREAK_LINES); + int gzip=(options & GZIP); + + // Compress? + if(gzip == GZIP) { + java.io.ByteArrayOutputStream baos=null; + java.util.zip.GZIPOutputStream gzos=null; + Base64.OutputStream b64os=null; + + + try { + // GZip -> Base64 -> ByteArray + baos=new java.io.ByteArrayOutputStream(); + b64os=new Base64.OutputStream(baos, ENCODE | dontBreakLines); + gzos=new java.util.zip.GZIPOutputStream(b64os); + + gzos.write(source, off, len); + gzos.close(); + } // end try + catch(java.io.IOException e) { + e.printStackTrace(); + return null; + } // end catch + finally { + try { + gzos.close(); + } + catch(Exception e) { + } + try { + b64os.close(); + } + catch(Exception e) { + } + try { + baos.close(); + } + catch(Exception e) { + } + } // end finally + + // Return value according to relevant encoding. + try { + return new String(baos.toByteArray(), PREFERRED_ENCODING); + } // end try + catch(java.io.UnsupportedEncodingException uue) { + return new String(baos.toByteArray()); + } // end catch + } // end if: compress + + // Else, don't compress. Better not to use streams at all then. + else { + // Convert option to boolean in way that code likes it. + boolean breakLines=dontBreakLines == 0; + + int len43=len * 4 / 3; + byte[] outBuff=new byte[(len43) // Main 4:3 + + ((len % 3) > 0? 4 : 0) // Account for padding + + (breakLines? (len43 / MAX_LINE_LENGTH) : 0)]; // New lines + int d=0; + int e=0; + int len2=len - 2; + int lineLength=0; + for(; d < len2; d+=3, e+=4) { + encode3to4(source, d + off, 3, outBuff, e); + + lineLength+=4; + if(breakLines && lineLength == MAX_LINE_LENGTH) { + outBuff[e + 4]=NEW_LINE; + e++; + lineLength=0; + } // end if: end of line + } // en dfor: each piece of array + + if(d < len) { + encode3to4(source, d + off, len - d, outBuff, e); + e+=4; + } // end if: some padding needed + + + // Return value according to relevant encoding. + try { + return new String(outBuff, 0, e, PREFERRED_ENCODING); + } // end try + catch(java.io.UnsupportedEncodingException uue) { + return new String(outBuff, 0, e); + } // end catch + + } // end else: don't compress + + } // end encodeBytes + + +/* ******** D E C O D I N G M E T H O D S ******** */ + + + /** + * Decodes four bytes from array source + * and writes the resulting bytes (up to three of them) + * to destination. + * The source and destination arrays can be manipulated + * anywhere along their length by specifying + * srcOffset and destOffset. + * This method does not check to make sure your arrays + * are large enough to accomodate srcOffset + 4 for + * the source array or destOffset + 3 for + * the destination array. + * This method returns the actual number of bytes that + * were converted from the Base64 encoding. + * @param source the array to convert + * @param srcOffset the index where conversion begins + * @param destination the array to hold the conversion + * @param destOffset the index where output will be put + * @return the number of decoded bytes converted + * @since 1.3 + */ + private static int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset) { + // Example: Dk== + if(source[srcOffset + 2] == EQUALS_SIGN) { + // Two ways to do the same thing. Don't know which way I like best. + //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 ) + // | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 ); + int outBuff=((DECODABET[source[srcOffset]] & 0xFF) << 18) + | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12); + + destination[destOffset]=(byte)(outBuff >>> 16); + return 1; + } + + // Example: DkL= + else if(source[srcOffset + 3] == EQUALS_SIGN) { + // Two ways to do the same thing. Don't know which way I like best. + //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 ) + // | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 ) + // | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 ); + int outBuff=((DECODABET[source[srcOffset]] & 0xFF) << 18) + | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12) + | ((DECODABET[source[srcOffset + 2]] & 0xFF) << 6); + + destination[destOffset]=(byte)(outBuff >>> 16); + destination[destOffset + 1]=(byte)(outBuff >>> 8); + return 2; + } + + // Example: DkLE + else { + try { + // Two ways to do the same thing. Don't know which way I like best. + //int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 ) + // | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 ) + // | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 ) + // | ( ( DECODABET[ source[ srcOffset + 3 ] ] << 24 ) >>> 24 ); + int outBuff=((DECODABET[source[srcOffset]] & 0xFF) << 18) + | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12) + | ((DECODABET[source[srcOffset + 2]] & 0xFF) << 6) + | ((DECODABET[source[srcOffset + 3]] & 0xFF)); + + + destination[destOffset]=(byte)(outBuff >> 16); + destination[destOffset + 1]=(byte)(outBuff >> 8); + destination[destOffset + 2]=(byte)(outBuff); + + return 3; + } + catch(Exception e) { + System.out.println(valueOf(source[srcOffset]) + ": " + (DECODABET[source[srcOffset]])); + System.out.println(valueOf(source[srcOffset + 1]) + ": " + (DECODABET[source[srcOffset + 1]])); + System.out.println(valueOf(source[srcOffset + 2]) + ": " + (DECODABET[source[srcOffset + 2]])); + System.out.println(String.valueOf(source[srcOffset + 3]) + ": " + (DECODABET[source[srcOffset + 3]])); + return -1; + } //e nd catch + } + } // end decodeToBytes + + + /** + * Very low-level access to decoding ASCII characters in + * the form of a byte array. Does not support automatically + * gunzipping or any other "fancy" features. + * @param source The Base64 encoded data + * @param off The offset of where to begin decoding + * @param len The length of characters to decode + * @return decoded data + * @since 1.3 + */ + public static byte[] decode(byte[] source, int off, int len) { + int len34=len * 3 / 4; + byte[] outBuff=new byte[len34]; // Upper limit on size of output + int outBuffPosn=0; + + byte[] b4=new byte[4]; + int b4Posn=0; + int i=0; + byte sbiCrop=0; + byte sbiDecode=0; + for(i=off; i < off + len; i++) { + sbiCrop=(byte)(source[i] & 0x7f); // Only the low seven bits + sbiDecode=DECODABET[sbiCrop]; + + if(sbiDecode >= WHITE_SPACE_ENC) // White space, Equals sign or better + { + if(sbiDecode >= EQUALS_SIGN_ENC) { + b4[b4Posn++]=sbiCrop; + if(b4Posn > 3) { + outBuffPosn+=decode4to3(b4, 0, outBuff, outBuffPosn); + b4Posn=0; + + // If that was the equals sign, break out of 'for' loop + if(sbiCrop == EQUALS_SIGN) + break; + } // end if: quartet built + + } // end if: equals sign or better + + } // end if: white space, equals sign or better + else { + System.err.println("Bad Base64 input character at " + i + ": " + source[i] + "(decimal)"); + return null; + } // end else: + } // each input character + + byte[] out=new byte[outBuffPosn]; + System.arraycopy(outBuff, 0, out, 0, outBuffPosn); + return out; + } // end decode + + + /** + * Decodes data from Base64 notation, automatically + * detecting gzip-compressed data and decompressing it. + * @param s the string to decode + * @return the decoded data + * @since 1.4 + */ + public static byte[] decode(String s) { + byte[] bytes; + try { + bytes=s.getBytes(PREFERRED_ENCODING); + } // end try + catch(java.io.UnsupportedEncodingException uee) { + bytes=s.getBytes(); + } // end catch + // + + // Decode + bytes=decode(bytes, 0, bytes.length); + + + // Check to see if it's gzip-compressed + // GZIP Magic Two-Byte Number: 0x8b1f (35615) + if(bytes != null && bytes.length >= 4) { + + int head=((int)bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00); + if(java.util.zip.GZIPInputStream.GZIP_MAGIC == head) { + java.io.ByteArrayInputStream bais=null; + java.util.zip.GZIPInputStream gzis=null; + java.io.ByteArrayOutputStream baos=null; + byte[] buffer=new byte[2048]; + int length=0; + + try { + baos=new java.io.ByteArrayOutputStream(); + bais=new java.io.ByteArrayInputStream(bytes); + gzis=new java.util.zip.GZIPInputStream(bais); + + while((length=gzis.read(buffer)) >= 0) { + baos.write(buffer, 0, length); + } // end while: reading input + + // No error? Get new bytes. + bytes=baos.toByteArray(); + + } // end try + catch(java.io.IOException e) { + // Just return originally-decoded bytes + } // end catch + finally { + try { + baos.close(); + } + catch(Exception e) { + } + try { + gzis.close(); + } + catch(Exception e) { + } + try { + bais.close(); + } + catch(Exception e) { + } + } // end finally + + } // end if: gzipped + } // end if: bytes.length >= 2 + + return bytes; + } // end decode + + + /** + * Attempts to decode Base64 data and deserialize a Java + * Object within. Returns null if there was an error. + * @param encodedObject The Base64 data to decode + * @return The decoded and deserialized object + * @since 1.5 + */ + public static Object decodeToObject(String encodedObject) { + // Decode and gunzip if necessary + byte[] objBytes=decode(encodedObject); + + java.io.ByteArrayInputStream bais=null; + java.io.ObjectInputStream ois=null; + Object obj=null; + + try { + bais=new java.io.ByteArrayInputStream(objBytes); + ois=new java.io.ObjectInputStream(bais); + + obj=ois.readObject(); + } // end try + catch(java.io.IOException e) { + e.printStackTrace(); + obj=null; + } // end catch + catch(java.lang.ClassNotFoundException e) { + e.printStackTrace(); + obj=null; + } // end catch + finally { + try { + if(bais != null) + bais.close(); + } + catch(Exception e) { + } + try { + if(ois != null) + ois.close(); + } + catch(Exception e) { + } + } // end finally + + return obj; + } // end decodeObject + + + /** + * Convenience method for encoding data to a file. + * @param dataToEncode byte array of data to encode in base64 form + * @param filename Filename for saving encoded data + * @return true if successful, false otherwise + * @since 2.1 + */ + public static boolean encodeToFile(byte[] dataToEncode, String filename) { + boolean success=false; + Base64.OutputStream bos=null; + try { + bos=new Base64.OutputStream( + new java.io.FileOutputStream(filename), Base64.ENCODE); + bos.write(dataToEncode); + success=true; + } // end try + catch(java.io.IOException e) { + + success=false; + } // end catch: IOException + finally { + try { + if(bos != null) + bos.close(); + } + catch(Exception e) { + } + } // end finally + + return success; + } // end encodeToFile + + + /** + * Convenience method for decoding data to a file. + * @param dataToDecode Base64-encoded data as a string + * @param filename Filename for saving decoded data + * @return true if successful, false otherwise + * @since 2.1 + */ + public static boolean decodeToFile(String dataToDecode, String filename) { + boolean success=false; + Base64.OutputStream bos=null; + try { + bos=new Base64.OutputStream( + new java.io.FileOutputStream(filename), Base64.DECODE); + bos.write(dataToDecode.getBytes(PREFERRED_ENCODING)); + success=true; + } // end try + catch(java.io.IOException e) { + success=false; + } // end catch: IOException + finally { + try { + if(bos != null) + bos.close(); + } + catch(Exception e) { + } + } // end finally + + return success; + } // end decodeToFile + + + /** + * Convenience method for reading a base64-encoded + * file and decoding it. + * @param filename Filename for reading encoded data + * @return decoded byte array or null if unsuccessful + * @since 2.1 + */ + public static byte[] decodeFromFile(String filename) { + byte[] decodedData=null; + Base64.InputStream bis=null; + try { + // Set up some useful variables + java.io.File file=new java.io.File(filename); + byte[] buffer=null; + int length=0; + int numBytes=0; + + // Check for size of file + if(file.length() > Integer.MAX_VALUE) { + System.err.println("File is too big for this convenience method (" + file.length() + " bytes)."); + return null; + } // end if: file too big for int index + buffer=new byte[(int)file.length()]; + + // Open a stream + bis=new Base64.InputStream( + new java.io.BufferedInputStream( + new java.io.FileInputStream(file)), Base64.DECODE); + + // Read until done + while((numBytes=bis.read(buffer, length, 4096)) >= 0) + length+=numBytes; + + // Save in a variable to return + decodedData=new byte[length]; + System.arraycopy(buffer, 0, decodedData, 0, length); + + } // end try + catch(java.io.IOException e) { + System.err.println("Error decoding from file " + filename); + } // end catch: IOException + finally { + try { + if(bis != null) + bis.close(); + } + catch(Exception e) { + } + } // end finally + + return decodedData; + } // end decodeFromFile + + + /** + * Convenience method for reading a binary file + * and base64-encoding it. + * @param filename Filename for reading binary data + * @return base64-encoded string or null if unsuccessful + * @since 2.1 + */ + public static String encodeFromFile(String filename) { + String encodedData=null; + Base64.InputStream bis=null; + try { + // Set up some useful variables + java.io.File file=new java.io.File(filename); + byte[] buffer=new byte[(int)(file.length() * 1.4)]; + int length=0; + int numBytes=0; + + // Open a stream + bis=new Base64.InputStream( + new java.io.BufferedInputStream( + new java.io.FileInputStream(file)), Base64.ENCODE); + + // Read until done + while((numBytes=bis.read(buffer, length, 4096)) >= 0) + length+=numBytes; + + // Save in a variable to return + encodedData=new String(buffer, 0, length, Base64.PREFERRED_ENCODING); + + } // end try + catch(java.io.IOException e) { + System.err.println("Error encoding from file " + filename); + } // end catch: IOException + finally { + try { + if(bis != null) + bis.close(); + } + catch(Exception e) { + } + } // end finally + + return encodedData; + } // end encodeFromFile + + + /* ******** I N N E R C L A S S I N P U T S T R E A M ******** */ + + + /** + * A {@link Base64.InputStream} will read data from another + * java.io.InputStream, given in the constructor, + * and encode/decode to/from Base64 notation on the fly. + * @see Base64 + * @since 1.3 + */ + public static class InputStream extends java.io.FilterInputStream { + private boolean encode; // Encoding or decoding + private int position; // Current position in the buffer + private byte[] buffer; // Small buffer holding converted data + private int bufferLength; // Length of buffer (3 or 4) + private int numSigBytes; // Number of meaningful bytes in the buffer + private int lineLength; + private boolean breakLines; // Break lines at less than 80 characters + + + /** + * Constructs a {@link Base64.InputStream} in DECODE mode. + * @param in the java.io.InputStream from which to read data. + * @since 1.3 + */ + public InputStream(java.io.InputStream in) { + this(in, DECODE); + } // end constructor + + + /** + * Constructs a {@link Base64.InputStream} in + * either ENCODE or DECODE mode. + *

+ * Valid options:

+             *   ENCODE or DECODE: Encode or Decode as data is read.
+             *   DONT_BREAK_LINES: don't break lines at 76 characters
+             *     (only meaningful when encoding)
+             *     Note: Technically, this makes your encoding non-compliant.
+             * 
+ *

+ * Example: new Base64.InputStream( in, Base64.DECODE ) + * @param in the java.io.InputStream from which to read data. + * @param options Specified options + * @see Base64#ENCODE + * @see Base64#DECODE + * @see Base64#DONT_BREAK_LINES + * @since 2.0 + */ + public InputStream(java.io.InputStream in, int options) { + super(in); + this.breakLines=(options & DONT_BREAK_LINES) != DONT_BREAK_LINES; + this.encode=(options & ENCODE) == ENCODE; + this.bufferLength=encode? 4 : 3; + this.buffer=new byte[bufferLength]; + this.position=-1; + this.lineLength=0; + } // end constructor + + /** + * Reads enough of the input stream to convert + * to/from Base64 and returns the next byte. + * @return next byte + * @since 1.3 + */ + public int read() throws java.io.IOException { + // Do we need to get data? + if(position < 0) { + if(encode) { + byte[] b3=new byte[3]; + int numBinaryBytes=0; + for(int i=0; i < 3; i++) { + try { + int b=in.read(); + + // If end of stream, b is -1. + if(b >= 0) { + b3[i]=(byte)b; + numBinaryBytes++; + } // end if: not end of stream + + } // end try: read + catch(java.io.IOException e) { + // Only a problem if we got no data at all. + if(i == 0) + throw e; + + } // end catch + } // end for: each needed input byte + + if(numBinaryBytes > 0) { + encode3to4(b3, 0, numBinaryBytes, buffer, 0); + position=0; + numSigBytes=4; + } // end if: got data + else { + return -1; + } // end else + } // end if: encoding + + // Else decoding + else { + byte[] b4=new byte[4]; + int i=0; + for(i=0; i < 4; i++) { + // Read four "meaningful" bytes: + int b=0; + do { + b=in.read(); + } + while(b >= 0 && DECODABET[b & 0x7f] <= WHITE_SPACE_ENC); + + if(b < 0) + break; // Reads a -1 if end of stream + + b4[i]=(byte)b; + } // end for: each needed input byte + + if(i == 4) { + numSigBytes=decode4to3(b4, 0, buffer, 0); + position=0; + } // end if: got four characters + else if(i == 0) { + return -1; + } // end else if: also padded correctly + else { + // Must have broken out from above. + throw new java.io.IOException("Improperly padded Base64 input."); + } // end + + } // end else: decode + } // end else: get data + + // Got data? + if(position >= 0) { + // End of relevant data? + if( /*!encode &&*/ position >= numSigBytes) + return -1; + + if(encode && breakLines && lineLength >= MAX_LINE_LENGTH) { + lineLength=0; + return '\n'; + } // end if + else { + lineLength++; // This isn't important when decoding + // but throwing an extra "if" seems + // just as wasteful. + + int b=buffer[position++]; + + if(position >= bufferLength) + position=-1; + + return b & 0xFF; // This is how you "cast" a byte that's + // intended to be unsigned. + } // end else + } // end if: position >= 0 + + // Else error + else { + // When JDK1.4 is more accepted, use an assertion here. + throw new java.io.IOException("Error in Base64 code reading stream."); + } // end else + } // end read + + + /** + * Calls {@link #read()} repeatedly until the end of stream + * is reached or len bytes are read. + * Returns number of bytes read into array or -1 if + * end of stream is encountered. + * @param dest array to hold values + * @param off offset for array + * @param len max number of bytes to read into array + * @return bytes read into array or -1 if end of stream is encountered. + * @since 1.3 + */ + public int read(byte[] dest, int off, int len) throws java.io.IOException { + int i; + int b; + for(i=0; i < len; i++) { + b=read(); + + //if( b < 0 && i == 0 ) + // return -1; + + if(b >= 0) + dest[off + i]=(byte)b; + else if(i == 0) + return -1; + else + break; // Out of 'for' loop + } // end for: each byte read + return i; + } // end read + + } // end inner class InputStream + + + /* ******** I N N E R C L A S S O U T P U T S T R E A M ******** */ + + + /** + * A {@link Base64.OutputStream} will write data to another + * java.io.OutputStream, given in the constructor, + * and encode/decode to/from Base64 notation on the fly. + * @see Base64 + * @since 1.3 + */ + public static class OutputStream extends java.io.FilterOutputStream { + private boolean encode; + private int position; + private byte[] buffer; + private int bufferLength; + private int lineLength; + private boolean breakLines; + private byte[] b4; // Scratch used in a few places + private boolean suspendEncoding; + + /** + * Constructs a {@link Base64.OutputStream} in ENCODE mode. + * @param out the java.io.OutputStream to which data will be written. + * @since 1.3 + */ + public OutputStream(java.io.OutputStream out) { + this(out, ENCODE); + } // end constructor + + + /** + * Constructs a {@link Base64.OutputStream} in + * either ENCODE or DECODE mode. + *

+ * Valid options:

+             *   ENCODE or DECODE: Encode or Decode as data is read.
+             *   DONT_BREAK_LINES: don't break lines at 76 characters
+             *     (only meaningful when encoding)
+             *     Note: Technically, this makes your encoding non-compliant.
+             * 
+ *

+ * Example: new Base64.OutputStream( out, Base64.ENCODE ) + * @param out the java.io.OutputStream to which data will be written. + * @param options Specified options. + * @see Base64#ENCODE + * @see Base64#DECODE + * @see Base64#DONT_BREAK_LINES + * @since 1.3 + */ + public OutputStream(java.io.OutputStream out, int options) { + super(out); + this.breakLines=(options & DONT_BREAK_LINES) != DONT_BREAK_LINES; + this.encode=(options & ENCODE) == ENCODE; + this.bufferLength=encode? 3 : 4; + this.buffer=new byte[bufferLength]; + this.position=0; + this.lineLength=0; + this.suspendEncoding=false; + this.b4=new byte[4]; + } // end constructor + + + /** + * Writes the byte to the output stream after + * converting to/from Base64 notation. + * When encoding, bytes are buffered three + * at a time before the output stream actually + * gets a write() call. + * When decoding, bytes are buffered four + * at a time. + * @param theByte the byte to write + * @since 1.3 + */ + public void write(int theByte) throws java.io.IOException { + // Encoding suspended? + if(suspendEncoding) { + super.out.write(theByte); + return; + } // end if: supsended + + // Encode? + if(encode) { + buffer[position++]=(byte)theByte; + if(position >= bufferLength) // Enough to encode. + { + out.write(encode3to4(b4, buffer, bufferLength)); + + lineLength+=4; + if(breakLines && lineLength >= MAX_LINE_LENGTH) { + out.write(NEW_LINE); + lineLength=0; + } // end if: end of line + + position=0; + } // end if: enough to output + } // end if: encoding + + // Else, Decoding + else { + // Meaningful Base64 character? + if(DECODABET[theByte & 0x7f] > WHITE_SPACE_ENC) { + buffer[position++]=(byte)theByte; + if(position >= bufferLength) // Enough to output. + { + int len=Base64.decode4to3(buffer, 0, b4, 0); + out.write(b4, 0, len); + //out.write( Base64.decode4to3( buffer ) ); + position=0; + } // end if: enough to output + } // end if: meaningful base64 character + else if(DECODABET[theByte & 0x7f] != WHITE_SPACE_ENC) { + throw new java.io.IOException("Invalid character in Base64 data."); + } // end else: not white space either + } // end else: decoding + } // end write + + + /** + * Calls {@link #write(int)} repeatedly until len + * bytes are written. + * @param theBytes array from which to read bytes + * @param off offset for array + * @param len max number of bytes to read into array + * @since 1.3 + */ + public void write(byte[] theBytes, int off, int len) throws java.io.IOException { + // Encoding suspended? + if(suspendEncoding) { + super.out.write(theBytes, off, len); + return; + } // end if: supsended + + for(int i=0; i < len; i++) { + write(theBytes[off + i]); + } // end for: each byte written + + } // end write + + + /** + * Method added by PHIL. [Thanks, PHIL. -Rob] + * This pads the buffer without closing the stream. + */ + public void flushBase64() throws java.io.IOException { + if(position > 0) { + if(encode) { + out.write(encode3to4(b4, buffer, position)); + position=0; + } // end if: encoding + else { + throw new java.io.IOException("Base64 input not properly padded."); + } // end else: decoding + } // end if: buffer partially full + + } // end flush + + + /** + * Flushes and closes (I think, in the superclass) the stream. + * @since 1.3 + */ + public void close() throws java.io.IOException { + // 1. Ensure that pending characters are written + flushBase64(); + + // 2. Actually close the stream + // Base class both flushes and closes. + super.close(); + + buffer=null; + out=null; + } // end close + + + /** + * Suspends encoding of the stream. + * May be helpful if you need to embed a piece of + * base640-encoded data in a stream. + * @since 1.5.1 + */ + public void suspendEncoding() throws java.io.IOException { + flushBase64(); + this.suspendEncoding=true; + } // end suspendEncoding + + + /** + * Resumes encoding of the stream. + * May be helpful if you need to embed a piece of + * base640-encoded data in a stream. + * @since 1.5.1 + */ + public void resumeEncoding() { + this.suspendEncoding=false; + } // end resumeEncoding + + + } // end inner class OutputStream + + + } // end class Base64 + +} + + + + + diff --git a/tests/scancode/data/resource/samples/README b/tests/scancode/data/resource/samples/README new file mode 100644 index 00000000000..1d61df81ffb --- /dev/null +++ b/tests/scancode/data/resource/samples/README @@ -0,0 +1,4 @@ +This directory contains a few sample files extracted from these two archives: + +download_url: http://zlib.net/zlib-1.2.8.tar.gz +download_url: http://master.dl.sourceforge.net/project/javagroups/JGroups/2.10.0.GA/JGroups-2.10.0.GA.src.zip \ No newline at end of file diff --git a/tests/scancode/data/resource/samples/arch/zlib.tar.gz b/tests/scancode/data/resource/samples/arch/zlib.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b57920bb555f6881693d57da741cd1cce9cf2847 GIT binary patch literal 28103 zcmV(#K;*w4iwFP%Bc@dV1MR(Qd)wBPC_JC_D^Pb%O*$ka(zfD6ao&+-Dbd81{77=r zbY@;Y5D7}CNq_}F%W^0G{jBTWYXcx9B~DK}Q$0;Bk-)yJz4p3aKF-sN{%|lFJp24# zeygAD?d>m~K8@(#9sYNF^o0MFpJ+H5KK|nI<1e;{+tK#$@%GNnzeG=evlW@2RawOa zEM*Z-=Si{tIe2U~+c1vo!~OdY^7GN3KLOzJXfXNIa{xSco;+E1{=?zZr*QtmoyVgu zcD~qovIFP;N}@gdqW^d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|g>_G)K`gqPlr#cxlhNrVSsP4RH{HIg zHS2A#DsKa&P872`W=u$jac)|8fE#Cju4#vZk zw++V&?{?@FKic`}Ph%di7cB*y;NL&_&j5XpLYyWT_@9`JJSvs+ctmlQoR)+HLsxnB zlmP$~cRJMo literal 0 HcmV?d00001 diff --git a/tests/scancode/data/resource/samples/screenshot.png b/tests/scancode/data/resource/samples/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..97155e4a9b903a58abf29d62925d8db01c748a2e GIT binary patch literal 622754 zcmeFYbyQp3);Ee33I$4`SSe84C0KE2so+o~XmKeL+?^IF?pmz0K=BeFxD?j}x8N4s zi<8{+Ip;a&-1ocVyJNife*e9U!5GQjd#)+Jx%Qft2zAxBL9u z#lXP*cpnRWMQmI$_cC76hA_wTo88ADzhEynq5UE1q*cRdHfekBJMpXe$K4>>*E|G@Jj8}S zZlOe-(*AR(fD3PE!=ZoMq2I+_tM7p~6mz78ylF6Ct$}xsR z3OiF0N#QL#^d7^H)ONYcT6vNuF+U$+K(#iR?-7~V1!FO!$k1`~L@Pe+>W|z${&ak7 zuXliB8;~b@`7}b*_I_H_gAP)XIHBd)jIks3kkPshPf8_HO_Dd_$JdNDCpaNu_n%X) zGpj%OA*vI}!tl8A2YLbSuce9~dUNxWgq4bvWW{GP;4iFl*lEY=}G5J?)=lf$9KtRY!K z>19>;D?G60w&@XpK5BGDrlsLbUR*P5cFXIM2Q9D zm^8E~sCUTnsE|0+Cmd9Clx5(^ulJ90!)Al4V&jX!6vc1W+s)6yB*)^<*!=scCh+n% zU-~30%B@{y%875Ao~ipVOJzAc?+PL*hQ3z891C2@Pf&>lYvvh=BzLBH)%4bg%*oBU z>r3p5Fn7|Iuz$)>P2$xczJ6I}B7UAM)E@VcBn)8v5#|91Ep(>`;Y5YF2% zB1_U&xOwyQk0i9D6l+~{;c5EBlm2~i8p9}q*iVwZIcw5C7|q$a&RD`Zk74Y_+!`bd zm0N*6q)VjXpR2nRRwbR2e_%^HfBeCw|Jn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I8R~T| z)42jxa4)0jfzr|Da89U&qe^lP_t4R2bMm3sr#>7hHn}z_%Kb7of~c84V^NAZ7mhLh z3iA8Gf#lTL{PwC8#)KcBeZ+FAE!er#NAaZ8P@aKO>|^kt2bHje)_VLXI|`Z4(9i{a zH~h18|E-LF;&TjwPPg(jL@7dNGKBDk8N-Au6)f4{jYd+!egVH1ED}JU)%DSN0n^DK z8|6CBbWznguMuG3U&<5(qKXdM>=93UhPxg|0ORSwLp&srgU}}Yp=tAL6uIIi2dfw#Fn!tue(G0Y@=?M456OpQ6Jl>s3?u{Pdz^ zu^ukTqs(%jUR>puu*AQ|9WL@7%-O<>L+ZrgqW@X?Wv|?{b)zyK2f|>%%;O~rifK2o zmbP9xr~aJ@{DU3-$04ECh}5iEJ(hy*s&@lvS2!ljxQC)9o*meXz~eo!&bZ}u--D@b z)k%aVEZ*q`OLdi<8uLyu2Hijxdx|Q)pHW4!h4D*~VxjRROW}s?Q(|W)!}(66Abogc zc3bZ+9ziu;bwAH#vh6S$(o4ZaY2WfU?H?{=JN;7oK=jSg%so(#H8#qpSCO1mAlco1 z^{2m#9m26sW$`e5*YU&2FV*s7T<(-?WRr+x^KAx}e~#pPc@g%}U%M_`JMHC3*C-c7JjXjgk`M zC#QdchQLe|6!(wtvV4Bl?!V8WOf~jjLjCzDK98bY`I*n{vA@EkzmTKkjoZEd^do

;K_I{y)8S&^10< X*ATiVm}=z)>Zd5HDpMi#;`RRl`G+ZG literal 0 HcmV?d00001 diff --git a/tests/scancode/data/resource/samples/zlib/ada/zlib.ads b/tests/scancode/data/resource/samples/zlib/ada/zlib.ads new file mode 100644 index 00000000000..79ffc4095cf --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/ada/zlib.ads @@ -0,0 +1,328 @@ +------------------------------------------------------------------------------ +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2004 Dmitriy Anisimkov -- +-- -- +-- This library is free software; you can redistribute it and/or modify -- +-- it under the terms of the GNU General Public License as published by -- +-- the Free Software Foundation; either version 2 of the License, or (at -- +-- your option) any later version. -- +-- -- +-- This library is distributed in the hope that it will be useful, but -- +-- WITHOUT ANY WARRANTY; without even the implied warranty of -- +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- +-- General Public License for more details. -- +-- -- +-- You should have received a copy of the GNU General Public License -- +-- along with this library; if not, write to the Free Software Foundation, -- +-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +------------------------------------------------------------------------------ + +-- $Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp $ + +with Ada.Streams; + +with Interfaces; + +package ZLib is + + ZLib_Error : exception; + Status_Error : exception; + + type Compression_Level is new Integer range -1 .. 9; + + type Flush_Mode is private; + + type Compression_Method is private; + + type Window_Bits_Type is new Integer range 8 .. 15; + + type Memory_Level_Type is new Integer range 1 .. 9; + + type Unsigned_32 is new Interfaces.Unsigned_32; + + type Strategy_Type is private; + + type Header_Type is (None, Auto, Default, GZip); + -- Header type usage have a some limitation for inflate. + -- See comment for Inflate_Init. + + subtype Count is Ada.Streams.Stream_Element_Count; + + Default_Memory_Level : constant Memory_Level_Type := 8; + Default_Window_Bits : constant Window_Bits_Type := 15; + + ---------------------------------- + -- Compression method constants -- + ---------------------------------- + + Deflated : constant Compression_Method; + -- Only one method allowed in this ZLib version + + --------------------------------- + -- Compression level constants -- + --------------------------------- + + No_Compression : constant Compression_Level := 0; + Best_Speed : constant Compression_Level := 1; + Best_Compression : constant Compression_Level := 9; + Default_Compression : constant Compression_Level := -1; + + -------------------------- + -- Flush mode constants -- + -------------------------- + + No_Flush : constant Flush_Mode; + -- Regular way for compression, no flush + + Partial_Flush : constant Flush_Mode; + -- Will be removed, use Z_SYNC_FLUSH instead + + Sync_Flush : constant Flush_Mode; + -- All pending output is flushed to the output buffer and the output + -- is aligned on a byte boundary, so that the decompressor can get all + -- input data available so far. (In particular avail_in is zero after the + -- call if enough output space has been provided before the call.) + -- Flushing may degrade compression for some compression algorithms and so + -- it should be used only when necessary. + + Block_Flush : constant Flush_Mode; + -- Z_BLOCK requests that inflate() stop + -- if and when it get to the next deflate block boundary. When decoding the + -- zlib or gzip format, this will cause inflate() to return immediately + -- after the header and before the first block. When doing a raw inflate, + -- inflate() will go ahead and process the first block, and will return + -- when it gets to the end of that block, or when it runs out of data. + + Full_Flush : constant Flush_Mode; + -- All output is flushed as with SYNC_FLUSH, and the compression state + -- is reset so that decompression can restart from this point if previous + -- compressed data has been damaged or if random access is desired. Using + -- Full_Flush too often can seriously degrade the compression. + + Finish : constant Flush_Mode; + -- Just for tell the compressor that input data is complete. + + ------------------------------------ + -- Compression strategy constants -- + ------------------------------------ + + -- RLE stategy could be used only in version 1.2.0 and later. + + Filtered : constant Strategy_Type; + Huffman_Only : constant Strategy_Type; + RLE : constant Strategy_Type; + Default_Strategy : constant Strategy_Type; + + Default_Buffer_Size : constant := 4096; + + type Filter_Type is tagged limited private; + -- The filter is for compression and for decompression. + -- The usage of the type is depend of its initialization. + + function Version return String; + pragma Inline (Version); + -- Return string representation of the ZLib version. + + procedure Deflate_Init + (Filter : in out Filter_Type; + Level : in Compression_Level := Default_Compression; + Strategy : in Strategy_Type := Default_Strategy; + Method : in Compression_Method := Deflated; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Memory_Level : in Memory_Level_Type := Default_Memory_Level; + Header : in Header_Type := Default); + -- Compressor initialization. + -- When Header parameter is Auto or Default, then default zlib header + -- would be provided for compressed data. + -- When Header is GZip, then gzip header would be set instead of + -- default header. + -- When Header is None, no header would be set for compressed data. + + procedure Inflate_Init + (Filter : in out Filter_Type; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Header : in Header_Type := Default); + -- Decompressor initialization. + -- Default header type mean that ZLib default header is expecting in the + -- input compressed stream. + -- Header type None mean that no header is expecting in the input stream. + -- GZip header type mean that GZip header is expecting in the + -- input compressed stream. + -- Auto header type mean that header type (GZip or Native) would be + -- detected automatically in the input stream. + -- Note that header types parameter values None, GZip and Auto are + -- supported for inflate routine only in ZLib versions 1.2.0.2 and later. + -- Deflate_Init is supporting all header types. + + function Is_Open (Filter : in Filter_Type) return Boolean; + pragma Inline (Is_Open); + -- Is the filter opened for compression or decompression. + + procedure Close + (Filter : in out Filter_Type; + Ignore_Error : in Boolean := False); + -- Closing the compression or decompressor. + -- If stream is closing before the complete and Ignore_Error is False, + -- The exception would be raised. + + generic + with procedure Data_In + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + with procedure Data_Out + (Item : in Ada.Streams.Stream_Element_Array); + procedure Generic_Translate + (Filter : in out Filter_Type; + In_Buffer_Size : in Integer := Default_Buffer_Size; + Out_Buffer_Size : in Integer := Default_Buffer_Size); + -- Compress/decompress data fetch from Data_In routine and pass the result + -- to the Data_Out routine. User should provide Data_In and Data_Out + -- for compression/decompression data flow. + -- Compression or decompression depend on Filter initialization. + + function Total_In (Filter : in Filter_Type) return Count; + pragma Inline (Total_In); + -- Returns total number of input bytes read so far + + function Total_Out (Filter : in Filter_Type) return Count; + pragma Inline (Total_Out); + -- Returns total number of bytes output so far + + function CRC32 + (CRC : in Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array) + return Unsigned_32; + pragma Inline (CRC32); + -- Compute CRC32, it could be necessary for make gzip format + + procedure CRC32 + (CRC : in out Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array); + pragma Inline (CRC32); + -- Compute CRC32, it could be necessary for make gzip format + + ------------------------------------------------- + -- Below is more complex low level routines. -- + ------------------------------------------------- + + procedure Translate + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + -- Compress/decompress the In_Data buffer and place the result into + -- Out_Data. In_Last is the index of last element from In_Data accepted by + -- the Filter. Out_Last is the last element of the received data from + -- Filter. To tell the filter that incoming data are complete put the + -- Flush parameter to Finish. + + function Stream_End (Filter : in Filter_Type) return Boolean; + pragma Inline (Stream_End); + -- Return the true when the stream is complete. + + procedure Flush + (Filter : in out Filter_Type; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + pragma Inline (Flush); + -- Flushing the data from the compressor. + + generic + with procedure Write + (Item : in Ada.Streams.Stream_Element_Array); + -- User should provide this routine for accept + -- compressed/decompressed data. + + Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size; + -- Buffer size for Write user routine. + + procedure Write + (Filter : in out Filter_Type; + Item : in Ada.Streams.Stream_Element_Array; + Flush : in Flush_Mode := No_Flush); + -- Compress/Decompress data from Item to the generic parameter procedure + -- Write. Output buffer size could be set in Buffer_Size generic parameter. + + generic + with procedure Read + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + -- User should provide data for compression/decompression + -- thru this routine. + + Buffer : in out Ada.Streams.Stream_Element_Array; + -- Buffer for keep remaining data from the previous + -- back read. + + Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset; + -- Rest_First have to be initialized to Buffer'Last + 1 + -- Rest_Last have to be initialized to Buffer'Last + -- before usage. + + Allow_Read_Some : in Boolean := False; + -- Is it allowed to return Last < Item'Last before end of data. + + procedure Read + (Filter : in out Filter_Type; + Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode := No_Flush); + -- Compress/Decompress data from generic parameter procedure Read to the + -- Item. User should provide Buffer and initialized Rest_First, Rest_Last + -- indicators. If Allow_Read_Some is True, Read routines could return + -- Last < Item'Last only at end of stream. + +private + + use Ada.Streams; + + pragma Assert (Ada.Streams.Stream_Element'Size = 8); + pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8); + + type Flush_Mode is new Integer range 0 .. 5; + + type Compression_Method is new Integer range 8 .. 8; + + type Strategy_Type is new Integer range 0 .. 3; + + No_Flush : constant Flush_Mode := 0; + Partial_Flush : constant Flush_Mode := 1; + Sync_Flush : constant Flush_Mode := 2; + Full_Flush : constant Flush_Mode := 3; + Finish : constant Flush_Mode := 4; + Block_Flush : constant Flush_Mode := 5; + + Filtered : constant Strategy_Type := 1; + Huffman_Only : constant Strategy_Type := 2; + RLE : constant Strategy_Type := 3; + Default_Strategy : constant Strategy_Type := 0; + + Deflated : constant Compression_Method := 8; + + type Z_Stream; + + type Z_Stream_Access is access all Z_Stream; + + type Filter_Type is tagged limited record + Strm : Z_Stream_Access; + Compression : Boolean; + Stream_End : Boolean; + Header : Header_Type; + CRC : Unsigned_32; + Offset : Stream_Element_Offset; + -- Offset for gzip header/footer output. + end record; + +end ZLib; diff --git a/tests/scancode/data/resource/samples/zlib/adler32.c b/tests/scancode/data/resource/samples/zlib/adler32.c new file mode 100644 index 00000000000..a868f073d8a --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/adler32.c @@ -0,0 +1,179 @@ +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2011 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zutil.h" + +#define local static + +local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); + +#define BASE 65521 /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* use NO_DIVIDE if your processor does not do division in hardware -- + try it both ways to see which is faster */ +#ifdef NO_DIVIDE +/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 + (thank you to John Reiser for pointing this out) */ +# define CHOP(a) \ + do { \ + unsigned long tmp = a >> 16; \ + a &= 0xffffUL; \ + a += (tmp << 4) - tmp; \ + } while (0) +# define MOD28(a) \ + do { \ + CHOP(a); \ + if (a >= BASE) a -= BASE; \ + } while (0) +# define MOD(a) \ + do { \ + CHOP(a); \ + MOD28(a); \ + } while (0) +# define MOD63(a) \ + do { /* this assumes a is not negative */ \ + z_off64_t tmp = a >> 32; \ + a &= 0xffffffffL; \ + a += (tmp << 8) - (tmp << 5) + tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + if (a >= BASE) a -= BASE; \ + } while (0) +#else +# define MOD(a) a %= BASE +# define MOD28(a) a %= BASE +# define MOD63(a) a %= BASE +#endif + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD28(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +/* ========================================================================= */ +local uLong adler32_combine_(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off64_t len2; +{ + unsigned long sum1; + unsigned long sum2; + unsigned rem; + + /* for negative len, return invalid adler32 as a clue for debugging */ + if (len2 < 0) + return 0xffffffffUL; + + /* the derivation of this formula is left as an exercise for the reader */ + MOD63(len2); /* assumes len2 >= 0 */ + rem = (unsigned)len2; + sum1 = adler1 & 0xffff; + sum2 = rem * sum1; + MOD(sum2); + sum1 += (adler2 & 0xffff) + BASE - 1; + sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; + if (sum1 >= BASE) sum1 -= BASE; + if (sum1 >= BASE) sum1 -= BASE; + if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 >= BASE) sum2 -= BASE; + return sum1 | (sum2 << 16); +} + +/* ========================================================================= */ +uLong ZEXPORT adler32_combine(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off_t len2; +{ + return adler32_combine_(adler1, adler2, len2); +} + +uLong ZEXPORT adler32_combine64(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off64_t len2; +{ + return adler32_combine_(adler1, adler2, len2); +} diff --git a/tests/scancode/data/resource/samples/zlib/deflate.c b/tests/scancode/data/resource/samples/zlib/deflate.c new file mode 100644 index 00000000000..696957705b7 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/deflate.c @@ -0,0 +1,1967 @@ +/* deflate.c -- compress data using the deflation algorithm + * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process depends on being able to identify portions + * of the input text which are identical to earlier input (within a + * sliding window trailing behind the input currently being processed). + * + * The most straightforward technique turns out to be the fastest for + * most input files: try all possible matches and select the longest. + * The key feature of this algorithm is that insertions into the string + * dictionary are very simple and thus fast, and deletions are avoided + * completely. Insertions are performed at each input character, whereas + * string matches are performed only when the previous match ends. So it + * is preferable to spend more time in matches to allow very fast string + * insertions and avoid deletions. The matching algorithm for small + * strings is inspired from that of Rabin & Karp. A brute force approach + * is used to find longer strings when a small match has been found. + * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze + * (by Leonid Broukhis). + * A previous version of this file used a more sophisticated algorithm + * (by Fiala and Greene) which is guaranteed to run in linear amortized + * time, but has a larger average cost, uses more memory and is patented. + * However the F&G algorithm may be faster for some highly redundant + * files if the parameter max_chain_length (described below) is too large. + * + * ACKNOWLEDGEMENTS + * + * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and + * I found it in 'freeze' written by Leonid Broukhis. + * Thanks to many people for bug reports and testing. + * + * REFERENCES + * + * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". + * Available in http://tools.ietf.org/html/rfc1951 + * + * A description of the Rabin and Karp algorithm is given in the book + * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. + * + * Fiala,E.R., and Greene,D.H. + * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 + * + */ + +/* @(#) $Id$ */ + +#include "deflate.h" + +const char deflate_copyright[] = + " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* =========================================================================== + * Function prototypes. + */ +typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ +} block_state; + +typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +/* Compression function. Returns the block state after the call. */ + +local void fill_window OF((deflate_state *s)); +local block_state deflate_stored OF((deflate_state *s, int flush)); +local block_state deflate_fast OF((deflate_state *s, int flush)); +#ifndef FASTEST +local block_state deflate_slow OF((deflate_state *s, int flush)); +#endif +local block_state deflate_rle OF((deflate_state *s, int flush)); +local block_state deflate_huff OF((deflate_state *s, int flush)); +local void lm_init OF((deflate_state *s)); +local void putShortMSB OF((deflate_state *s, uInt b)); +local void flush_pending OF((z_streamp strm)); +local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +#ifdef ASMV + void match_init OF((void)); /* asm code initialization */ + uInt longest_match OF((deflate_state *s, IPos cur_match)); +#else +local uInt longest_match OF((deflate_state *s, IPos cur_match)); +#endif + +#ifdef DEBUG +local void check_match OF((deflate_state *s, IPos start, IPos match, + int length)); +#endif + +/* =========================================================================== + * Local data + */ + +#define NIL 0 +/* Tail of hash chains */ + +#ifndef TOO_FAR +# define TOO_FAR 4096 +#endif +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +typedef struct config_s { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; + compress_func func; +} config; + +#ifdef FASTEST +local const config configuration_table[2] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ +#else +local const config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8, deflate_fast}, +/* 3 */ {4, 6, 32, 32, deflate_fast}, + +/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32, deflate_slow}, +/* 6 */ {8, 16, 128, 128, deflate_slow}, +/* 7 */ {8, 32, 128, 256, deflate_slow}, +/* 8 */ {32, 128, 258, 1024, deflate_slow}, +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ +#endif + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +#define EQUAL 0 +/* result of memcmp for equal strings */ + +#ifndef NO_DUMMY_DECL +struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ +#endif + +/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ +#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to to UPDATE_HASH are made with consecutive + * input characters, so that a running hash key can be computed from the + * previous key instead of complete recalculation each time. + */ +#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) + + +/* =========================================================================== + * Insert string str in the dictionary and set match_head to the previous head + * of the hash chain (the most recent string with same hash key). Return + * the previous length of the hash chain. + * If this file is compiled with -DFASTEST, the compression level is forced + * to 1, and no hash chains are maintained. + * IN assertion: all calls to to INSERT_STRING are made with consecutive + * input characters and the first MIN_MATCH bytes of str are valid + * (except for the last MIN_MATCH-1 bytes of the input file). + */ +#ifdef FASTEST +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#else +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#endif + +/* =========================================================================== + * Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ +#define CLEAR_HASH(s) \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + +/* ========================================================================= */ +int ZEXPORT deflateInit_(strm, level, version, stream_size) + z_streamp strm; + int level; + const char *version; + int stream_size; +{ + return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY, version, stream_size); + /* To do: ignore strm->next_in if we use it as window */ +} + +/* ========================================================================= */ +int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, + version, stream_size) + z_streamp strm; + int level; + int method; + int windowBits; + int memLevel; + int strategy; + const char *version; + int stream_size; +{ + deflate_state *s; + int wrap = 1; + static const char my_version[] = ZLIB_VERSION; + + ushf *overlay; + /* We overlay pending_buf and d_buf+l_buf. This works since the average + * output size for (length,distance) codes is <= 24 bits. + */ + + if (version == Z_NULL || version[0] != my_version[0] || + stream_size != sizeof(z_stream)) { + return Z_VERSION_ERROR; + } + if (strm == Z_NULL) return Z_STREAM_ERROR; + + strm->msg = Z_NULL; + if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; +#endif + } + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } +#ifdef GZIP + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } +#endif + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ + s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == Z_NULL) return Z_MEM_ERROR; + strm->state = (struct internal_state FAR *)s; + s->strm = strm; + + s->wrap = wrap; + s->gzhead = Z_NULL; + s->w_bits = windowBits; + s->w_size = 1 << s->w_bits; + s->w_mask = s->w_size - 1; + + s->hash_bits = memLevel + 7; + s->hash_size = 1 << s->hash_bits; + s->hash_mask = s->hash_size - 1; + s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + + s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + + s->high_water = 0; /* nothing written to s->window yet */ + + s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + s->pending_buf = (uchf *) overlay; + s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + + if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || + s->pending_buf == Z_NULL) { + s->status = FINISH_STATE; + strm->msg = ERR_MSG(Z_MEM_ERROR); + deflateEnd (strm); + return Z_MEM_ERROR; + } + s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + + s->level = level; + s->strategy = strategy; + s->method = (Byte)method; + + return deflateReset(strm); +} + +/* ========================================================================= */ +int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) + z_streamp strm; + const Bytef *dictionary; + uInt dictLength; +{ + deflate_state *s; + uInt str, n; + int wrap; + unsigned avail; + z_const unsigned char *next; + + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + return Z_STREAM_ERROR; + s = strm->state; + wrap = s->wrap; + if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead) + return Z_STREAM_ERROR; + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap == 1) + strm->adler = adler32(strm->adler, dictionary, dictLength); + s->wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s->w_size) { + if (wrap == 0) { /* already empty otherwise */ + CLEAR_HASH(s); + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + dictionary += dictLength - s->w_size; /* use the tail */ + dictLength = s->w_size; + } + + /* insert dictionary into window and hash */ + avail = strm->avail_in; + next = strm->next_in; + strm->avail_in = dictLength; + strm->next_in = (z_const Bytef *)dictionary; + fill_window(s); + while (s->lookahead >= MIN_MATCH) { + str = s->strstart; + n = s->lookahead - (MIN_MATCH-1); + do { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + } while (--n); + s->strstart = str; + s->lookahead = MIN_MATCH-1; + fill_window(s); + } + s->strstart += s->lookahead; + s->block_start = (long)s->strstart; + s->insert = s->lookahead; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + strm->next_in = next; + strm->avail_in = avail; + s->wrap = wrap; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateResetKeep (strm) + z_streamp strm; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { + return Z_STREAM_ERROR; + } + + strm->total_in = strm->total_out = 0; + strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = Z_UNKNOWN; + + s = (deflate_state *)strm->state; + s->pending = 0; + s->pending_out = s->pending_buf; + + if (s->wrap < 0) { + s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ + } + s->status = s->wrap ? INIT_STATE : BUSY_STATE; + strm->adler = +#ifdef GZIP + s->wrap == 2 ? crc32(0L, Z_NULL, 0) : +#endif + adler32(0L, Z_NULL, 0); + s->last_flush = Z_NO_FLUSH; + + _tr_init(s); + + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateReset (strm) + z_streamp strm; +{ + int ret; + + ret = deflateResetKeep(strm); + if (ret == Z_OK) + lm_init(strm->state); + return ret; +} + +/* ========================================================================= */ +int ZEXPORT deflateSetHeader (strm, head) + z_streamp strm; + gz_headerp head; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm->state->wrap != 2) return Z_STREAM_ERROR; + strm->state->gzhead = head; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflatePending (strm, pending, bits) + unsigned *pending; + int *bits; + z_streamp strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (pending != Z_NULL) + *pending = strm->state->pending; + if (bits != Z_NULL) + *bits = strm->state->bi_valid; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflatePrime (strm, bits, value) + z_streamp strm; + int bits; + int value; +{ + deflate_state *s; + int put; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; + do { + put = Buf_size - s->bi_valid; + if (put > bits) + put = bits; + s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); + s->bi_valid += put; + _tr_flush_bits(s); + value >>= put; + bits -= put; + } while (bits); + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateParams(strm, level, strategy) + z_streamp strm; + int level; + int strategy; +{ + deflate_state *s; + compress_func func; + int err = Z_OK; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + func = configuration_table[s->level].func; + + if ((strategy != s->strategy || func != configuration_table[level].func) && + strm->total_in != 0) { + /* Flush the last buffer: */ + err = deflate(strm, Z_BLOCK); + if (err == Z_BUF_ERROR && s->pending == 0) + err = Z_OK; + } + if (s->level != level) { + s->level = level; + s->max_lazy_match = configuration_table[level].max_lazy; + s->good_match = configuration_table[level].good_length; + s->nice_match = configuration_table[level].nice_length; + s->max_chain_length = configuration_table[level].max_chain; + } + s->strategy = strategy; + return err; +} + +/* ========================================================================= */ +int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) + z_streamp strm; + int good_length; + int max_lazy; + int nice_length; + int max_chain; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + s->good_match = good_length; + s->max_lazy_match = max_lazy; + s->nice_match = nice_length; + s->max_chain_length = max_chain; + return Z_OK; +} + +/* ========================================================================= + * For the default windowBits of 15 and memLevel of 8, this function returns + * a close to exact, as well as small, upper bound on the compressed size. + * They are coded as constants here for a reason--if the #define's are + * changed, then this function needs to be changed as well. The return + * value for 15 and 8 only works for those exact settings. + * + * For any setting other than those defaults for windowBits and memLevel, + * the value returned is a conservative worst case for the maximum expansion + * resulting from using fixed blocks instead of stored blocks, which deflate + * can emit on compressed data for some combinations of the parameters. + * + * This function could be more sophisticated to provide closer upper bounds for + * every combination of windowBits and memLevel. But even the conservative + * upper bound of about 14% expansion does not seem onerous for output buffer + * allocation. + */ +uLong ZEXPORT deflateBound(strm, sourceLen) + z_streamp strm; + uLong sourceLen; +{ + deflate_state *s; + uLong complen, wraplen; + Bytef *str; + + /* conservative upper bound for compressed data */ + complen = sourceLen + + ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + + /* if can't get parameters, return conservative bound plus zlib wrapper */ + if (strm == Z_NULL || strm->state == Z_NULL) + return complen + 6; + + /* compute wrapper length */ + s = strm->state; + switch (s->wrap) { + case 0: /* raw deflate */ + wraplen = 0; + break; + case 1: /* zlib wrapper */ + wraplen = 6 + (s->strstart ? 4 : 0); + break; + case 2: /* gzip wrapper */ + wraplen = 18; + if (s->gzhead != Z_NULL) { /* user-supplied gzip header */ + if (s->gzhead->extra != Z_NULL) + wraplen += 2 + s->gzhead->extra_len; + str = s->gzhead->name; + if (str != Z_NULL) + do { + wraplen++; + } while (*str++); + str = s->gzhead->comment; + if (str != Z_NULL) + do { + wraplen++; + } while (*str++); + if (s->gzhead->hcrc) + wraplen += 2; + } + break; + default: /* for compiler happiness */ + wraplen = 6; + } + + /* if not default parameters, return conservative bound */ + if (s->w_bits != 15 || s->hash_bits != 8 + 7) + return complen + wraplen; + + /* default settings: return tight bound for that case */ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + + (sourceLen >> 25) + 13 - 6 + wraplen; +} + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +local void putShortMSB (s, b) + deflate_state *s; + uInt b; +{ + put_byte(s, (Byte)(b >> 8)); + put_byte(s, (Byte)(b & 0xff)); +} + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->next_out buffer and copying into it. + * (See also read_buf()). + */ +local void flush_pending(strm) + z_streamp strm; +{ + unsigned len; + deflate_state *s = strm->state; + + _tr_flush_bits(s); + len = s->pending; + if (len > strm->avail_out) len = strm->avail_out; + if (len == 0) return; + + zmemcpy(strm->next_out, s->pending_out, len); + strm->next_out += len; + s->pending_out += len; + strm->total_out += len; + strm->avail_out -= len; + s->pending -= len; + if (s->pending == 0) { + s->pending_out = s->pending_buf; + } +} + +/* ========================================================================= */ +int ZEXPORT deflate (strm, flush) + z_streamp strm; + int flush; +{ + int old_flush; /* value of flush param for previous deflate call */ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + flush > Z_BLOCK || flush < 0) { + return Z_STREAM_ERROR; + } + s = strm->state; + + if (strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0) || + (s->status == FINISH_STATE && flush != Z_FINISH)) { + ERR_RETURN(strm, Z_STREAM_ERROR); + } + if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + + s->strm = strm; /* just in case */ + old_flush = s->last_flush; + s->last_flush = flush; + + /* Write the header */ + if (s->status == INIT_STATE) { +#ifdef GZIP + if (s->wrap == 2) { + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == Z_NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s->status = BUSY_STATE; + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != Z_NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); + } + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; + } + } + else +#endif + { + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; + else + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + s->status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + } + } +#ifdef GZIP + if (s->status == EXTRA_STATE) { + if (s->gzhead->extra != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + + while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) + break; + } + put_byte(s, s->gzhead->extra[s->gzindex]); + s->gzindex++; + } + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (s->gzindex == s->gzhead->extra_len) { + s->gzindex = 0; + s->status = NAME_STATE; + } + } + else + s->status = NAME_STATE; + } + if (s->status == NAME_STATE) { + if (s->gzhead->name != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->name[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) { + s->gzindex = 0; + s->status = COMMENT_STATE; + } + } + else + s->status = COMMENT_STATE; + } + if (s->status == COMMENT_STATE) { + if (s->gzhead->comment != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->comment[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) + s->status = HCRC_STATE; + } + else + s->status = HCRC_STATE; + } + if (s->status == HCRC_STATE) { + if (s->gzhead->hcrc) { + if (s->pending + 2 > s->pending_buf_size) + flush_pending(strm); + if (s->pending + 2 <= s->pending_buf_size) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + } + } + else + s->status = BUSY_STATE; + } +#endif + + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm->avail_in != 0 || s->lookahead != 0 || + (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + block_state bstate; + + bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : + (s->strategy == Z_RLE ? deflate_rle(s, flush) : + (*(configuration_table[s->level].func))(s, flush)); + + if (bstate == finish_started || bstate == finish_done) { + s->status = FINISH_STATE; + } + if (bstate == need_more || bstate == finish_started) { + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate == block_done) { + if (flush == Z_PARTIAL_FLUSH) { + _tr_align(s); + } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + _tr_stored_block(s, (char*)0, 0L, 0); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush == Z_FULL_FLUSH) { + CLEAR_HASH(s); /* forget history */ + if (s->lookahead == 0) { + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + } + } + flush_pending(strm); + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + Assert(strm->avail_out > 0, "bug2"); + + if (flush != Z_FINISH) return Z_OK; + if (s->wrap <= 0) return Z_STREAM_END; + + /* Write the trailer */ +#ifdef GZIP + if (s->wrap == 2) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); + put_byte(s, (Byte)(strm->total_in & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); + } + else +#endif + { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ + return s->pending != 0 ? Z_OK : Z_STREAM_END; +} + +/* ========================================================================= */ +int ZEXPORT deflateEnd (strm) + z_streamp strm; +{ + int status; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + + status = strm->state->status; + if (status != INIT_STATE && + status != EXTRA_STATE && + status != NAME_STATE && + status != COMMENT_STATE && + status != HCRC_STATE && + status != BUSY_STATE && + status != FINISH_STATE) { + return Z_STREAM_ERROR; + } + + /* Deallocate in reverse order of allocations: */ + TRY_FREE(strm, strm->state->pending_buf); + TRY_FREE(strm, strm->state->head); + TRY_FREE(strm, strm->state->prev); + TRY_FREE(strm, strm->state->window); + + ZFREE(strm, strm->state); + strm->state = Z_NULL; + + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; +} + +/* ========================================================================= + * Copy the source state to the destination state. + * To simplify the source, this is not supported for 16-bit MSDOS (which + * doesn't have enough memory anyway to duplicate compression states). + */ +int ZEXPORT deflateCopy (dest, source) + z_streamp dest; + z_streamp source; +{ +#ifdef MAXSEG_64K + return Z_STREAM_ERROR; +#else + deflate_state *ds; + deflate_state *ss; + ushf *overlay; + + + if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + return Z_STREAM_ERROR; + } + + ss = source->state; + + zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); + + ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); + if (ds == Z_NULL) return Z_MEM_ERROR; + dest->state = (struct internal_state FAR *) ds; + zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); + ds->strm = dest; + + ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); + ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); + ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); + overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); + ds->pending_buf = (uchf *) overlay; + + if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || + ds->pending_buf == Z_NULL) { + deflateEnd (dest); + return Z_MEM_ERROR; + } + /* following zmemcpy do not work for 16-bit MSDOS */ + zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); + zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); + zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); + zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + + ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); + ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); + ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; + + ds->l_desc.dyn_tree = ds->dyn_ltree; + ds->d_desc.dyn_tree = ds->dyn_dtree; + ds->bl_desc.dyn_tree = ds->bl_tree; + + return Z_OK; +#endif /* MAXSEG_64K */ +} + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local int read_buf(strm, buf, size) + z_streamp strm; + Bytef *buf; + unsigned size; +{ + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + zmemcpy(buf, strm->next_in, len); + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, buf, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, buf, len); + } +#endif + strm->next_in += len; + strm->total_in += len; + + return (int)len; +} + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init (s) + deflate_state *s; +{ + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->insert = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +#ifndef FASTEST +#ifdef ASMV + match_init(); /* initialize the asm code */ +#endif +#endif +} + +#ifndef FASTEST +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +#ifndef ASMV +/* For 80x86 and 680x0, an optimized version will be provided in match.asm or + * match.S. The code will be functionally equivalent. + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + unsigned chain_length = s->max_chain_length;/* max hash chain length */ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + int best_len = s->prev_length; /* best match length so far */ + int nice_match = s->nice_match; /* stop if match long enough */ + IPos limit = s->strstart > (IPos)MAX_DIST(s) ? + s->strstart - (IPos)MAX_DIST(s) : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + Posf *prev = s->prev; + uInt wmask = s->w_mask; + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + register ush scan_start = *(ushf*)scan; + register ush scan_end = *(ushf*)(scan+best_len-1); +#else + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end = scan[best_len]; +#endif + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s->prev_length >= s->good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + Assert(cur_match < s->strstart, "no future"); + match = s->window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ushf*)(match+best_len-1) != scan_end || + *(ushf*)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + Assert(scan[2] == match[2], "scan[2]?"); + scan++, match++; + do { + } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + s->match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ushf*)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & wmask]) > limit + && --chain_length != 0); + + if ((uInt)best_len <= s->lookahead) return (uInt)best_len; + return s->lookahead; +} +#endif /* ASMV */ + +#else /* FASTEST */ + +/* --------------------------------------------------------------------------- + * Optimized version for FASTEST only + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + Assert(cur_match < s->strstart, "no future"); + + match = s->window + cur_match; + + /* Return failure if the match length is less than 2: + */ + if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match += 2; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + + if (len < MIN_MATCH) return MIN_MATCH - 1; + + s->match_start = cur_match; + return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; +} + +#endif /* FASTEST */ + +#ifdef DEBUG +/* =========================================================================== + * Check that the match at match_start is indeed a match. + */ +local void check_match(s, start, match, length) + deflate_state *s; + IPos start, match; + int length; +{ + /* check that the match is indeed a match */ + if (zmemcmp(s->window + match, + s->window + start, length) != EQUAL) { + fprintf(stderr, " start %u, match %u, length %d\n", + start, match, length); + do { + fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); + } while (--length != 0); + z_error("invalid match"); + } + if (z_verbose > 1) { + fprintf(stderr,"\\[%d,%d]", start-match, length); + do { putc(s->window[start++], stderr); } while (--length != 0); + } +} +#else +# define check_match(s, start, match, length) +#endif /* DEBUG */ + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(s) + deflate_state *s; +{ + register unsigned n, m; + register Posf *p; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize+MAX_DIST(s)) { + + zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + } while (--n); + + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif + more += wsize; + } + if (s->strm->avail_in == 0) break; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ + if (s->high_water < s->window_size) { + ulg curr = s->strstart + (ulg)(s->lookahead); + ulg init; + + if (s->high_water < curr) { + /* Previous high water mark below current data -- zero WIN_INIT + * bytes or up to end of window, whichever is less. + */ + init = s->window_size - curr; + if (init > WIN_INIT) + init = WIN_INIT; + zmemzero(s->window + curr, (unsigned)init); + s->high_water = curr + init; + } + else if (s->high_water < (ulg)curr + WIN_INIT) { + /* High water mark at or above current data, but below current data + * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up + * to end of window, whichever is less. + */ + init = (ulg)curr + WIN_INIT - s->high_water; + if (init > s->window_size - s->high_water) + init = s->window_size - s->high_water; + zmemzero(s->window + s->high_water, (unsigned)init); + s->high_water += init; + } + } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK_ONLY(s, last) { \ + _tr_flush_block(s, (s->block_start >= 0L ? \ + (charf *)&s->window[(unsigned)s->block_start] : \ + (charf *)Z_NULL), \ + (ulg)((long)s->strstart - s->block_start), \ + (last)); \ + s->block_start = s->strstart; \ + flush_pending(s->strm); \ + Tracev((stderr,"[FLUSH]")); \ +} + +/* Same but force premature exit if necessary. */ +#define FLUSH_BLOCK(s, last) { \ + FLUSH_BLOCK_ONLY(s, last); \ + if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +local block_state deflate_stored(s, flush) + deflate_state *s; + int flush; +{ + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + ulg max_block_size = 0xffff; + ulg max_start; + + if (max_block_size > s->pending_buf_size - 5) { + max_block_size = s->pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s->lookahead <= 1) { + + Assert(s->strstart < s->w_size+MAX_DIST(s) || + s->block_start >= (long)s->w_size, "slide too late"); + + fill_window(s); + if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + + if (s->lookahead == 0) break; /* flush the current block */ + } + Assert(s->block_start >= 0L, "block gone"); + + s->strstart += s->lookahead; + s->lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + max_start = s->block_start + max_block_size; + if (s->strstart == 0 || (ulg)s->strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s->lookahead = (uInt)(s->strstart - max_start); + s->strstart = (uInt)max_start; + FLUSH_BLOCK(s, 0); + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { + FLUSH_BLOCK(s, 0); + } + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if ((long)s->strstart > s->block_start) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +local block_state deflate_fast(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head; /* head of the hash chain */ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + } + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->match_start, s->match_length); + + _tr_tally_dist(s, s->strstart - s->match_start, + s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +#ifndef FASTEST + if (s->match_length <= s->max_insert_length && + s->lookahead >= MIN_MATCH) { + s->match_length--; /* string at strstart already in table */ + do { + s->strstart++; + INSERT_STRING(s, s->strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s->match_length != 0); + s->strstart++; + } else +#endif + { + s->strstart += s->match_length; + s->match_length = 0; + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +#ifndef FASTEST +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +local block_state deflate_slow(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head; /* head of hash chain */ + int bflush; /* set if current block must be flushed */ + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + */ + s->prev_length = s->match_length, s->prev_match = s->match_start; + s->match_length = MIN_MATCH-1; + + if (hash_head != NIL && s->prev_length < s->max_lazy_match && + s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + + if (s->match_length <= 5 && (s->strategy == Z_FILTERED +#if TOO_FAR <= 32767 + || (s->match_length == MIN_MATCH && + s->strstart - s->match_start > TOO_FAR) +#endif + )) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s->match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { + uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + check_match(s, s->strstart-1, s->prev_match, s->prev_length); + + _tr_tally_dist(s, s->strstart -1 - s->prev_match, + s->prev_length - MIN_MATCH, bflush); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s->lookahead -= s->prev_length-1; + s->prev_length -= 2; + do { + if (++s->strstart <= max_insert) { + INSERT_STRING(s, s->strstart, hash_head); + } + } while (--s->prev_length != 0); + s->match_available = 0; + s->match_length = MIN_MATCH-1; + s->strstart++; + + if (bflush) FLUSH_BLOCK(s, 0); + + } else if (s->match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + if (bflush) { + FLUSH_BLOCK_ONLY(s, 0); + } + s->strstart++; + s->lookahead--; + if (s->strm->avail_out == 0) return need_more; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s->match_available = 1; + s->strstart++; + s->lookahead--; + } + } + Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s->match_available) { + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + s->match_available = 0; + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} +#endif /* FASTEST */ + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +local block_state deflate_rle(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + uInt prev; /* byte at distance one to match */ + Bytef *scan, *strend; /* scan goes up to strend for length of run */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s->lookahead <= MAX_MATCH) { + fill_window(s); + if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s->match_length = 0; + if (s->lookahead >= MIN_MATCH && s->strstart > 0) { + scan = s->window + s->strstart - 1; + prev = *scan; + if (prev == *++scan && prev == *++scan && prev == *++scan) { + strend = s->window + s->strstart + MAX_MATCH; + do { + } while (prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + scan < strend); + s->match_length = MAX_MATCH - (int)(strend - scan); + if (s->match_length > s->lookahead) + s->match_length = s->lookahead; + } + Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->strstart - 1, s->match_length); + + _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + s->strstart += s->match_length; + s->match_length = 0; + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +local block_state deflate_huff(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s->lookahead == 0) { + fill_window(s); + if (s->lookahead == 0) { + if (flush == Z_NO_FLUSH) + return need_more; + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s->match_length = 0; + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} diff --git a/tests/scancode/data/resource/samples/zlib/deflate.h b/tests/scancode/data/resource/samples/zlib/deflate.h new file mode 100644 index 00000000000..ce0299edd19 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/deflate.h @@ -0,0 +1,346 @@ +/* deflate.h -- internal compression state + * Copyright (C) 1995-2012 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef DEFLATE_H +#define DEFLATE_H + +#include "zutil.h" + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer creation by deflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip encoding + should be left enabled. */ +#ifndef NO_GZIP +# define GZIP +#endif + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define Buf_size 16 +/* size of bit buffer in bi_buf */ + +#define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + uInt pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ + Byte method; /* can only be DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to suppress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + uInt insert; /* bytes at end of window left to insert */ + +#ifdef DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + ulg high_water; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + +#define WIN_INIT MAX_MATCH +/* Number of bytes after end of data in window to initialize in order to avoid + memory checker errors from longest match routines */ + + /* in trees.c */ +void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); +int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, + ulg stored_len, int last)); +void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s)); +void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); +void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, + ulg stored_len, int last)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch ZLIB_INTERNAL _length_code[]; + extern uch ZLIB_INTERNAL _dist_code[]; +#else + extern const uch ZLIB_INTERNAL _length_code[]; + extern const uch ZLIB_INTERNAL _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif /* DEFLATE_H */ diff --git a/tests/scancode/data/resource/samples/zlib/dotzlib/AssemblyInfo.cs b/tests/scancode/data/resource/samples/zlib/dotzlib/AssemblyInfo.cs new file mode 100644 index 00000000000..0491bfc2b03 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/dotzlib/AssemblyInfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("DotZLib")] +[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Henrik Ravn")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/tests/scancode/data/resource/samples/zlib/dotzlib/ChecksumImpl.cs b/tests/scancode/data/resource/samples/zlib/dotzlib/ChecksumImpl.cs new file mode 100644 index 00000000000..788b2fceced --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/dotzlib/ChecksumImpl.cs @@ -0,0 +1,202 @@ +// +// Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Runtime.InteropServices; +using System.Text; + + +namespace DotZLib +{ + #region ChecksumGeneratorBase + ///

+ /// Implements the common functionality needed for all s + /// + /// + public abstract class ChecksumGeneratorBase : ChecksumGenerator + { + /// + /// The value of the current checksum + /// + protected uint _current; + + /// + /// Initializes a new instance of the checksum generator base - the current checksum is + /// set to zero + /// + public ChecksumGeneratorBase() + { + _current = 0; + } + + /// + /// Initializes a new instance of the checksum generator basewith a specified value + /// + /// The value to set the current checksum to + public ChecksumGeneratorBase(uint initialValue) + { + _current = initialValue; + } + + /// + /// Resets the current checksum to zero + /// + public void Reset() { _current = 0; } + + /// + /// Gets the current checksum value + /// + public uint Value { get { return _current; } } + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + /// All the other Update methods are implmeneted in terms of this one. + /// This is therefore the only method a derived class has to implement + public abstract void Update(byte[] data, int offset, int count); + + /// + /// Updates the current checksum with an array of bytes. + /// + /// The data to update the checksum with + public void Update(byte[] data) + { + Update(data, 0, data.Length); + } + + /// + /// Updates the current checksum with the data from a string + /// + /// The string to update the checksum with + /// The characters in the string are converted by the UTF-8 encoding + public void Update(string data) + { + Update(Encoding.UTF8.GetBytes(data)); + } + + /// + /// Updates the current checksum with the data from a string, using a specific encoding + /// + /// The string to update the checksum with + /// The encoding to use + public void Update(string data, Encoding encoding) + { + Update(encoding.GetBytes(data)); + } + + } + #endregion + + #region CRC32 + /// + /// Implements a CRC32 checksum generator + /// + public sealed class CRC32Checksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint crc32(uint crc, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the CRC32 checksum generator + /// + public CRC32Checksum() : base() {} + + /// + /// Initializes a new instance of the CRC32 checksum generator with a specified value + /// + /// The value to set the current checksum to + public CRC32Checksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = crc32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + + #region Adler + /// + /// Implements a checksum generator that computes the Adler checksum on data + /// + public sealed class AdlerChecksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint adler32(uint adler, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the Adler checksum generator + /// + public AdlerChecksum() : base() {} + + /// + /// Initializes a new instance of the Adler checksum generator with a specified value + /// + /// The value to set the current checksum to + public AdlerChecksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = adler32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + +} \ No newline at end of file diff --git a/tests/scancode/data/resource/samples/zlib/dotzlib/LICENSE_1_0.txt b/tests/scancode/data/resource/samples/zlib/dotzlib/LICENSE_1_0.txt new file mode 100644 index 00000000000..30aac2cf479 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/dotzlib/LICENSE_1_0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/data/resource/samples/zlib/dotzlib/readme.txt b/tests/scancode/data/resource/samples/zlib/dotzlib/readme.txt new file mode 100644 index 00000000000..b2395720d4c --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/dotzlib/readme.txt @@ -0,0 +1,58 @@ +This directory contains a .Net wrapper class library for the ZLib1.dll + +The wrapper includes support for inflating/deflating memory buffers, +.Net streaming wrappers for the gz streams part of zlib, and wrappers +for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. + +Directory structure: +-------------------- + +LICENSE_1_0.txt - License file. +readme.txt - This file. +DotZLib.chm - Class library documentation +DotZLib.build - NAnt build file +DotZLib.sln - Microsoft Visual Studio 2003 solution file + +DotZLib\*.cs - Source files for the class library + +Unit tests: +----------- +The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher. +To include unit tests in the build, define nunit before building. + + +Build instructions: +------------------- + +1. Using Visual Studio.Net 2003: + Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) + will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on + you are building the release or debug version of the library. Check + DotZLib/UnitTests.cs for instructions on how to include unit tests in the + build. + +2. Using NAnt: + Open a command prompt with access to the build environment and run nant + in the same directory as the DotZLib.build file. + You can define 2 properties on the nant command-line to control the build: + debug={true|false} to toggle between release/debug builds (default=true). + nunit={true|false} to include or esclude unit tests (default=true). + Also the target clean will remove binaries. + Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release + or ./DotZLib/bin/debug, depending on whether you are building the release + or debug version of the library. + + Examples: + nant -D:debug=false -D:nunit=false + will build a release mode version of the library without unit tests. + nant + will build a debug version of the library with unit tests + nant clean + will remove all previously built files. + + +--------------------------------- +Copyright (c) Henrik Ravn 2004 + +Use, modification and distribution are subject to the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/tests/scancode/data/resource/samples/zlib/gcc_gvmat64/gvmat64.S b/tests/scancode/data/resource/samples/zlib/gcc_gvmat64/gvmat64.S new file mode 100644 index 00000000000..dd858ddbd16 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/gcc_gvmat64/gvmat64.S @@ -0,0 +1,574 @@ +/* +;uInt longest_match_x64( +; deflate_state *s, +; IPos cur_match); // current match + +; gvmat64.S -- Asm portion of the optimized longest_match for 32 bits x86_64 +; (AMD64 on Athlon 64, Opteron, Phenom +; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) +; this file is translation from gvmat64.asm to GCC 4.x (for Linux, Mac XCode) +; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; +; File written by Gilles Vollant, by converting to assembly the longest_match +; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. +; and by taking inspiration on asm686 with masm, optimised assembly code +; from Brian Raiter, written 1998 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software +; 3. This notice may not be removed or altered from any source distribution. +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; to compile this file for zLib, I use option: +; gcc -c -arch x86_64 gvmat64.S + + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; // current match / +; +; with XCode for Mac, I had strange error with some jump on intel syntax +; this is why BEFORE_JMP and AFTER_JMP are used + */ + + +#define BEFORE_JMP .att_syntax +#define AFTER_JMP .intel_syntax noprefix + +#ifndef NO_UNDERLINE +# define match_init _match_init +# define longest_match _longest_match +#endif + +.intel_syntax noprefix + +.globl match_init, longest_match +.text +longest_match: + + + +#define LocalVarsSize 96 +/* +; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 +; free register : r14,r15 +; register can be saved : rsp +*/ + +#define chainlenwmask (rsp + 8 - LocalVarsSize) +#define nicematch (rsp + 16 - LocalVarsSize) + +#define save_rdi (rsp + 24 - LocalVarsSize) +#define save_rsi (rsp + 32 - LocalVarsSize) +#define save_rbx (rsp + 40 - LocalVarsSize) +#define save_rbp (rsp + 48 - LocalVarsSize) +#define save_r12 (rsp + 56 - LocalVarsSize) +#define save_r13 (rsp + 64 - LocalVarsSize) +#define save_r14 (rsp + 72 - LocalVarsSize) +#define save_r15 (rsp + 80 - LocalVarsSize) + + +/* +; all the +4 offsets are due to the addition of pending_buf_size (in zlib +; in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, remove the +4). +; Note : these value are good with a 8 bytes boundary pack structure +*/ + +#define MAX_MATCH 258 +#define MIN_MATCH 3 +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) + +/* +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). +*/ + + + +/* you can check the structure offset by running + +#include +#include +#include "deflate.h" + +void print_depl() +{ +deflate_state ds; +deflate_state *s=&ds; +printf("size pointer=%u\n",(int)sizeof(void*)); + +printf("#define dsWSize %u\n",(int)(((char*)&(s->w_size))-((char*)s))); +printf("#define dsWMask %u\n",(int)(((char*)&(s->w_mask))-((char*)s))); +printf("#define dsWindow %u\n",(int)(((char*)&(s->window))-((char*)s))); +printf("#define dsPrev %u\n",(int)(((char*)&(s->prev))-((char*)s))); +printf("#define dsMatchLen %u\n",(int)(((char*)&(s->match_length))-((char*)s))); +printf("#define dsPrevMatch %u\n",(int)(((char*)&(s->prev_match))-((char*)s))); +printf("#define dsStrStart %u\n",(int)(((char*)&(s->strstart))-((char*)s))); +printf("#define dsMatchStart %u\n",(int)(((char*)&(s->match_start))-((char*)s))); +printf("#define dsLookahead %u\n",(int)(((char*)&(s->lookahead))-((char*)s))); +printf("#define dsPrevLen %u\n",(int)(((char*)&(s->prev_length))-((char*)s))); +printf("#define dsMaxChainLen %u\n",(int)(((char*)&(s->max_chain_length))-((char*)s))); +printf("#define dsGoodMatch %u\n",(int)(((char*)&(s->good_match))-((char*)s))); +printf("#define dsNiceMatch %u\n",(int)(((char*)&(s->nice_match))-((char*)s))); +} +*/ + +#define dsWSize 68 +#define dsWMask 76 +#define dsWindow 80 +#define dsPrev 96 +#define dsMatchLen 144 +#define dsPrevMatch 148 +#define dsStrStart 156 +#define dsMatchStart 160 +#define dsLookahead 164 +#define dsPrevLen 168 +#define dsMaxChainLen 172 +#define dsGoodMatch 188 +#define dsNiceMatch 192 + +#define window_size [ rcx + dsWSize] +#define WMask [ rcx + dsWMask] +#define window_ad [ rcx + dsWindow] +#define prev_ad [ rcx + dsPrev] +#define strstart [ rcx + dsStrStart] +#define match_start [ rcx + dsMatchStart] +#define Lookahead [ rcx + dsLookahead] //; 0ffffffffh on infozip +#define prev_length [ rcx + dsPrevLen] +#define max_chain_length [ rcx + dsMaxChainLen] +#define good_match [ rcx + dsGoodMatch] +#define nice_match [ rcx + dsNiceMatch] + +/* +; windows: +; parameter 1 in rcx(deflate state s), param 2 in rdx (cur match) + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. + +; +; gcc on macosx-linux: +; see http://www.x86-64.org/documentation/abi-0.99.pdf +; param 1 in rdi, param 2 in rsi +; rbx, rsp, rbp, r12 to r15 must be preserved + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + +;;; Retrieve the function arguments. r8d will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + +; ms: parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) +; mac: param 1 in rdi, param 2 rsi +; this clear high 32 bits of r8, which can be garbage in both r8 and rdx +*/ + mov [save_rbx],rbx + mov [save_rbp],rbp + + + mov rcx,rdi + + mov r8d,esi + + + mov [save_r12],r12 + mov [save_r13],r13 + mov [save_r14],r14 + mov [save_r15],r15 + + +//;;; uInt wmask = s->w_mask; +//;;; unsigned chain_length = s->max_chain_length; +//;;; if (s->prev_length >= s->good_match) { +//;;; chain_length >>= 2; +//;;; } + + + mov edi, prev_length + mov esi, good_match + mov eax, WMask + mov ebx, max_chain_length + cmp edi, esi + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +//;;; chainlen is decremented once beforehand so that the function can +//;;; use the sign flag instead of the zero flag for the exit test. +//;;; It is then shifted into the high word, to make room for the wmask +//;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + +//;;; on zlib only +//;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + + + mov eax, nice_match + mov [chainlenwmask], ebx + mov r10d, Lookahead + cmp r10d, eax + cmovnl r10d, eax + mov [nicematch],r10d + + + +//;;; register Bytef *scan = s->window + s->strstart; + mov r10, window_ad + mov ebp, strstart + lea r13, [r10 + rbp] + +//;;; Determine how many bytes the scan ptr is off from being +//;;; dword-aligned. + + mov r9,r13 + neg r13 + and r13,3 + +//;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +//;;; s->strstart - (IPos)MAX_DIST(s) : NIL; + + + mov eax, window_size + sub eax, MIN_LOOKAHEAD + + + xor edi,edi + sub ebp, eax + + mov r11d, prev_length + + cmovng ebp,edi + +//;;; int best_len = s->prev_length; + + +//;;; Store the sum of s->window + best_len in esi locally, and in esi. + + lea rsi,[r10+r11] + +//;;; register ush scan_start = *(ushf*)scan; +//;;; register ush scan_end = *(ushf*)(scan+best_len-1); +//;;; Posf *prev = s->prev; + + movzx r12d,word ptr [r9] + movzx ebx, word ptr [r9 + r11 - 1] + + mov rdi, prev_ad + +//;;; Jump into the main loop. + + mov edx, [chainlenwmask] + + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + + + +LookupLoop1: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + + + + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry1: + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jz LookupLoopIsZero + AFTER_JMP + +LookupLoop2: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry2: + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jz LookupLoopIsZero + AFTER_JMP + +LookupLoop4: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry4: + + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jnz LookupLoop1 + jmp LookupLoopIsZero + AFTER_JMP +/* +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; r8d = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit +*/ +.balign 16 +LookupLoop: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry: + + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jnz LookupLoop1 + AFTER_JMP +LookupLoopIsZero: + cmp r12w, word ptr [r10 + r8] + BEFORE_JMP + jnz LookupLoop1 + AFTER_JMP + + +//;;; Store the current value of chainlen. + mov [chainlenwmask], edx +/* +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). +*/ + lea rsi,[r8+r10] + mov rdx, 0xfffffffffffffef8 //; -(MAX_MATCH_8) + lea rsi, [rsi + r13 + 0x0108] //;MAX_MATCH_8] + lea rdi, [r9 + r13 + 0x0108] //;MAX_MATCH_8] + + prefetcht1 [rsi+rdx] + prefetcht1 [rdi+rdx] + +/* +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust rdx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (rsi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. +*/ + +LoopCmps: + mov rax, [rsi + rdx] + xor rax, [rdi + rdx] + jnz LeaveLoopCmps + + mov rax, [rsi + rdx + 8] + xor rax, [rdi + rdx + 8] + jnz LeaveLoopCmps8 + + + mov rax, [rsi + rdx + 8+8] + xor rax, [rdi + rdx + 8+8] + jnz LeaveLoopCmps16 + + add rdx,8+8+8 + + BEFORE_JMP + jnz LoopCmps + jmp LenMaximum + AFTER_JMP + +LeaveLoopCmps16: add rdx,8 +LeaveLoopCmps8: add rdx,8 +LeaveLoopCmps: + + test eax, 0x0000FFFF + jnz LenLower + + test eax,0xffffffff + + jnz LenLower32 + + add rdx,4 + shr rax,32 + or ax,ax + BEFORE_JMP + jnz LenLower + AFTER_JMP + +LenLower32: + shr eax,16 + add rdx,2 + +LenLower: + sub al, 1 + adc rdx, 0 +//;;; Calculate the length of the match. If it is longer than MAX_MATCH, +//;;; then automatically accept it as the best possible match and leave. + + lea rax, [rdi + rdx] + sub rax, r9 + cmp eax, MAX_MATCH + BEFORE_JMP + jge LenMaximum + AFTER_JMP +/* +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. +;/////////////////////////////////// +*/ + cmp eax, r11d + jg LongerMatch + + lea rsi,[r10+r11] + + mov rdi, prev_ad + mov edx, [chainlenwmask] + BEFORE_JMP + jmp LookupLoop + AFTER_JMP +/* +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); +*/ +LongerMatch: + mov r11d, eax + mov match_start, r8d + cmp eax, [nicematch] + BEFORE_JMP + jge LeaveNow + AFTER_JMP + + lea rsi,[r10+rax] + + movzx ebx, word ptr [r9 + rax - 1] + mov rdi, prev_ad + mov edx, [chainlenwmask] + BEFORE_JMP + jmp LookupLoop + AFTER_JMP + +//;;; Accept the current string, with the maximum possible length. + +LenMaximum: + mov r11d,MAX_MATCH + mov match_start, r8d + +//;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +//;;; return s->lookahead; + +LeaveNow: + mov eax, Lookahead + cmp r11d, eax + cmovng eax, r11d + + + +//;;; Restore the stack and return from whence we came. + + +// mov rsi,[save_rsi] +// mov rdi,[save_rdi] + mov rbx,[save_rbx] + mov rbp,[save_rbp] + mov r12,[save_r12] + mov r13,[save_r13] + mov r14,[save_r14] + mov r15,[save_r15] + + + ret 0 +//; please don't remove this string ! +//; Your can freely use gvmat64 in any free or commercial app +//; but it is far better don't remove the string in the binary! + // db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 + + +match_init: + ret 0 + + diff --git a/tests/scancode/data/resource/samples/zlib/infback9/infback9.c b/tests/scancode/data/resource/samples/zlib/infback9/infback9.c new file mode 100644 index 00000000000..05fb3e33807 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/infback9/infback9.c @@ -0,0 +1,615 @@ +/* infback9.c -- inflate deflate64 data using a call-back interface + * Copyright (C) 1995-2008 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infback9.h" +#include "inftree9.h" +#include "inflate9.h" + +#define WSIZE 65536UL + +/* + strm provides memory allocation functions in zalloc and zfree, or + Z_NULL to use the library memory allocation functions. + + window is a user-supplied window and output buffer that is 64K bytes. + */ +int ZEXPORT inflateBack9Init_(strm, window, version, stream_size) +z_stream FAR *strm; +unsigned char FAR *window; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL || window == Z_NULL) + return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *)ZALLOC(strm, 1, + sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (voidpf)state; + state->window = window; + return Z_OK; +} + +/* + Build and output length and distance decoding tables for fixed code + decoding. + */ +#ifdef MAKEFIXED +#include + +void makefixed9(void) +{ + unsigned sym, bits, low, size; + code *next, *lenfix, *distfix; + struct inflate_state state; + code fixed[544]; + + /* literal/length table */ + sym = 0; + while (sym < 144) state.lens[sym++] = 8; + while (sym < 256) state.lens[sym++] = 9; + while (sym < 280) state.lens[sym++] = 7; + while (sym < 288) state.lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table9(LENS, state.lens, 288, &(next), &(bits), state.work); + + /* distance table */ + sym = 0; + while (sym < 32) state.lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table9(DISTS, state.lens, 32, &(next), &(bits), state.work); + + /* write tables */ + puts(" /* inffix9.h -- table for decoding deflate64 fixed codes"); + puts(" * Generated automatically by makefixed9()."); + puts(" */"); + puts(""); + puts(" /* WARNING: this file should *not* be used by applications."); + puts(" It is part of the implementation of this library and is"); + puts(" subject to change. Applications should only use zlib.h."); + puts(" */"); + puts(""); + size = 1U << 9; + printf(" static const code lenfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 6) == 0) printf("\n "); + printf("{%u,%u,%d}", lenfix[low].op, lenfix[low].bits, + lenfix[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); + size = 1U << 5; + printf("\n static const code distfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 5) == 0) printf("\n "); + printf("{%u,%u,%d}", distfix[low].op, distfix[low].bits, + distfix[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); +} +#endif /* MAKEFIXED */ + +/* Macros for inflateBack(): */ + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Assure that some input is available. If input is requested, but denied, + then return a Z_BUF_ERROR from inflateBack(). */ +#define PULL() \ + do { \ + if (have == 0) { \ + have = in(in_desc, &next); \ + if (have == 0) { \ + next = Z_NULL; \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflateBack() + with an error if there is no input available. */ +#define PULLBYTE() \ + do { \ + PULL(); \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflateBack() with + an error. */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n <= 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Assure that some output space is available, by writing out the window + if it's full. If the write fails, return from inflateBack() with a + Z_BUF_ERROR. */ +#define ROOM() \ + do { \ + if (left == 0) { \ + put = window; \ + left = WSIZE; \ + wrap = 1; \ + if (out(out_desc, put, (unsigned)left)) { \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* + strm provides the memory allocation functions and window buffer on input, + and provides information on the unused input on return. For Z_DATA_ERROR + returns, strm will also provide an error message. + + in() and out() are the call-back input and output functions. When + inflateBack() needs more input, it calls in(). When inflateBack() has + filled the window with output, or when it completes with data in the + window, it calls out() to write out the data. The application must not + change the provided input until in() is called again or inflateBack() + returns. The application must not change the window/output buffer until + inflateBack() returns. + + in() and out() are called with a descriptor parameter provided in the + inflateBack() call. This parameter can be a structure that provides the + information required to do the read or write, as well as accumulated + information on the input and output such as totals and check values. + + in() should return zero on failure. out() should return non-zero on + failure. If either in() or out() fails, than inflateBack() returns a + Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it + was in() or out() that caused in the error. Otherwise, inflateBack() + returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format + error, or Z_MEM_ERROR if it could not allocate memory for the state. + inflateBack() can also return Z_STREAM_ERROR if the input parameters + are not correct, i.e. strm is Z_NULL or the state was not initialized. + */ +int ZEXPORT inflateBack9(strm, in, in_desc, out, out_desc) +z_stream FAR *strm; +in_func in; +void FAR *in_desc; +out_func out; +void FAR *out_desc; +{ + struct inflate_state FAR *state; + z_const unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have; /* available input */ + unsigned long left; /* available output */ + inflate_mode mode; /* current inflate mode */ + int lastblock; /* true if processing last block */ + int wrap; /* true if the window has wrapped */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned extra; /* extra bits needed */ + unsigned long length; /* literal or length of data to copy */ + unsigned long offset; /* distance back to copy string from */ + unsigned long copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + code here; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +#include "inffix9.h" + + /* Check that the strm exists and that the state was initialized */ + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* Reset the state */ + strm->msg = Z_NULL; + mode = TYPE; + lastblock = 0; + wrap = 0; + window = state->window; + next = strm->next_in; + have = next != Z_NULL ? strm->avail_in : 0; + hold = 0; + bits = 0; + put = window; + left = WSIZE; + lencode = Z_NULL; + distcode = Z_NULL; + + /* Inflate until end of block marked as last */ + for (;;) + switch (mode) { + case TYPE: + /* determine and dispatch block type */ + if (lastblock) { + BYTEBITS(); + mode = DONE; + break; + } + NEEDBITS(3); + lastblock = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + lastblock ? " (last)" : "")); + mode = STORED; + break; + case 1: /* fixed block */ + lencode = lenfix; + lenbits = 9; + distcode = distfix; + distbits = 5; + Tracev((stderr, "inflate: fixed codes block%s\n", + lastblock ? " (last)" : "")); + mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + lastblock ? " (last)" : "")); + mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + mode = BAD; + } + DROPBITS(2); + break; + + case STORED: + /* get and verify stored block length */ + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + mode = BAD; + break; + } + length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %lu\n", + length)); + INITBITS(); + + /* copy stored block from input to output */ + while (length != 0) { + copy = length; + PULL(); + ROOM(); + if (copy > have) copy = have; + if (copy > left) copy = left; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + length -= copy; + } + Tracev((stderr, "inflate: stored end\n")); + mode = TYPE; + break; + + case TABLE: + /* get dynamic table entries descriptor */ + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); + if (state->nlen > 286) { + strm->msg = (char *)"too many length symbols"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: table sizes ok\n")); + + /* get code length code lengths (not a typo) */ + state->have = 0; + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + lencode = (code const FAR *)(state->next); + lenbits = 7; + ret = inflate_table9(CODES, state->lens, 19, &(state->next), + &(lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + + /* get length and distance code code lengths */ + state->have = 0; + while (state->have < state->nlen + state->ndist) { + for (;;) { + here = lencode[BITS(lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.val < 16) { + NEEDBITS(here.bits); + DROPBITS(here.bits); + state->lens[state->have++] = here.val; + } + else { + if (here.val == 16) { + NEEDBITS(here.bits + 2); + DROPBITS(here.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + mode = BAD; + break; + } + len = (unsigned)(state->lens[state->have - 1]); + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (here.val == 17) { + NEEDBITS(here.bits + 3); + DROPBITS(here.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(here.bits + 7); + DROPBITS(here.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (mode == BAD) break; + + /* check for end-of-block code (better have one) */ + if (state->lens[256] == 0) { + strm->msg = (char *)"invalid code -- missing end-of-block"; + mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftree9.h + concerning the ENOUGH constants, which depend on those values */ + state->next = state->codes; + lencode = (code const FAR *)(state->next); + lenbits = 9; + ret = inflate_table9(LENS, state->lens, state->nlen, + &(state->next), &(lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + mode = BAD; + break; + } + distcode = (code const FAR *)(state->next); + distbits = 6; + ret = inflate_table9(DISTS, state->lens + state->nlen, + state->ndist, &(state->next), &(distbits), + state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + mode = LEN; + + case LEN: + /* get a literal, length, or end-of-block code */ + for (;;) { + here = lencode[BITS(lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.op && (here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + length = (unsigned)here.val; + + /* process literal */ + if (here.op == 0) { + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", here.val)); + ROOM(); + *put++ = (unsigned char)(length); + left--; + mode = LEN; + break; + } + + /* process end of block */ + if (here.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + mode = TYPE; + break; + } + + /* invalid code */ + if (here.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + mode = BAD; + break; + } + + /* length code -- get extra bits, if any */ + extra = (unsigned)(here.op) & 31; + if (extra != 0) { + NEEDBITS(extra); + length += BITS(extra); + DROPBITS(extra); + } + Tracevv((stderr, "inflate: length %lu\n", length)); + + /* get distance code */ + for (;;) { + here = distcode[BITS(distbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if ((here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + if (here.op & 64) { + strm->msg = (char *)"invalid distance code"; + mode = BAD; + break; + } + offset = (unsigned)here.val; + + /* get distance extra bits, if any */ + extra = (unsigned)(here.op) & 15; + if (extra != 0) { + NEEDBITS(extra); + offset += BITS(extra); + DROPBITS(extra); + } + if (offset > WSIZE - (wrap ? 0: left)) { + strm->msg = (char *)"invalid distance too far back"; + mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %lu\n", offset)); + + /* copy match from window to output */ + do { + ROOM(); + copy = WSIZE - offset; + if (copy < left) { + from = put + copy; + copy = left - copy; + } + else { + from = put - offset; + copy = left; + } + if (copy > length) copy = length; + length -= copy; + left -= copy; + do { + *put++ = *from++; + } while (--copy); + } while (length != 0); + break; + + case DONE: + /* inflate stream terminated properly -- write leftover output */ + ret = Z_STREAM_END; + if (left < WSIZE) { + if (out(out_desc, window, (unsigned)(WSIZE - left))) + ret = Z_BUF_ERROR; + } + goto inf_leave; + + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + + default: /* can't happen, but makes compilers happy */ + ret = Z_STREAM_ERROR; + goto inf_leave; + } + + /* Return unused input */ + inf_leave: + strm->next_in = next; + strm->avail_in = have; + return ret; +} + +int ZEXPORT inflateBack9End(strm) +z_stream FAR *strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} diff --git a/tests/scancode/data/resource/samples/zlib/infback9/infback9.h b/tests/scancode/data/resource/samples/zlib/infback9/infback9.h new file mode 100644 index 00000000000..1073c0a38e6 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/infback9/infback9.h @@ -0,0 +1,37 @@ +/* infback9.h -- header for using inflateBack9 functions + * Copyright (C) 2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * This header file and associated patches provide a decoder for PKWare's + * undocumented deflate64 compression method (method 9). Use with infback9.c, + * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported. + * This should be compiled with zlib, since it uses zutil.h and zutil.o. + * This code has not yet been tested on 16-bit architectures. See the + * comments in zlib.h for inflateBack() usage. These functions are used + * identically, except that there is no windowBits parameter, and a 64K + * window must be provided. Also if int's are 16 bits, then a zero for + * the third parameter of the "out" function actually means 65536UL. + * zlib.h must be included before this header file. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); +ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define inflateBack9Init(strm, window) \ + inflateBack9Init_((strm), (window), \ + ZLIB_VERSION, sizeof(z_stream)) + +#ifdef __cplusplus +} +#endif diff --git a/tests/scancode/data/resource/samples/zlib/iostream2/zstream.h b/tests/scancode/data/resource/samples/zlib/iostream2/zstream.h new file mode 100644 index 00000000000..43d2332b79b --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/iostream2/zstream.h @@ -0,0 +1,307 @@ +/* + * + * Copyright (c) 1997 + * Christian Michelsen Research AS + * Advanced Computing + * Fantoftvegen 38, 5036 BERGEN, Norway + * http://www.cmr.no + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Christian Michelsen Research AS makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +#ifndef ZSTREAM__H +#define ZSTREAM__H + +/* + * zstream.h - C++ interface to the 'zlib' general purpose compression library + * $Id: zstream.h 1.1 1997-06-25 12:00:56+02 tyge Exp tyge $ + */ + +#include +#include +#include +#include "zlib.h" + +#if defined(_WIN32) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +class zstringlen { +public: + zstringlen(class izstream&); + zstringlen(class ozstream&, const char*); + size_t value() const { return val.word; } +private: + struct Val { unsigned char byte; size_t word; } val; +}; + +// ----------------------------- izstream ----------------------------- + +class izstream +{ + public: + izstream() : m_fp(0) {} + izstream(FILE* fp) : m_fp(0) { open(fp); } + izstream(const char* name) : m_fp(0) { open(name); } + ~izstream() { close(); } + + /* Opens a gzip (.gz) file for reading. + * open() can be used to read a file which is not in gzip format; + * in this case read() will directly read from the file without + * decompression. errno can be checked to distinguish two error + * cases (if errno is zero, the zlib error is Z_MEM_ERROR). + */ + void open(const char* name) { + if (m_fp) close(); + m_fp = ::gzopen(name, "rb"); + } + + void open(FILE* fp) { + SET_BINARY_MODE(fp); + if (m_fp) close(); + m_fp = ::gzdopen(fileno(fp), "rb"); + } + + /* Flushes all pending input if necessary, closes the compressed file + * and deallocates all the (de)compression state. The return value is + * the zlib error number (see function error() below). + */ + int close() { + int r = ::gzclose(m_fp); + m_fp = 0; return r; + } + + /* Binary read the given number of bytes from the compressed file. + */ + int read(void* buf, size_t len) { + return ::gzread(m_fp, buf, len); + } + + /* Returns the error message for the last error which occurred on the + * given compressed file. errnum is set to zlib error number. If an + * error occurred in the file system and not in the compression library, + * errnum is set to Z_ERRNO and the application may consult errno + * to get the exact error code. + */ + const char* error(int* errnum) { + return ::gzerror(m_fp, errnum); + } + + gzFile fp() { return m_fp; } + + private: + gzFile m_fp; +}; + +/* + * Binary read the given (array of) object(s) from the compressed file. + * If the input file was not in gzip format, read() copies the objects number + * of bytes into the buffer. + * returns the number of uncompressed bytes actually read + * (0 for end of file, -1 for error). + */ +template +inline int read(izstream& zs, T* x, Items items) { + return ::gzread(zs.fp(), x, items*sizeof(T)); +} + +/* + * Binary input with the '>' operator. + */ +template +inline izstream& operator>(izstream& zs, T& x) { + ::gzread(zs.fp(), &x, sizeof(T)); + return zs; +} + + +inline zstringlen::zstringlen(izstream& zs) { + zs > val.byte; + if (val.byte == 255) zs > val.word; + else val.word = val.byte; +} + +/* + * Read length of string + the string with the '>' operator. + */ +inline izstream& operator>(izstream& zs, char* x) { + zstringlen len(zs); + ::gzread(zs.fp(), x, len.value()); + x[len.value()] = '\0'; + return zs; +} + +inline char* read_string(izstream& zs) { + zstringlen len(zs); + char* x = new char[len.value()+1]; + ::gzread(zs.fp(), x, len.value()); + x[len.value()] = '\0'; + return x; +} + +// ----------------------------- ozstream ----------------------------- + +class ozstream +{ + public: + ozstream() : m_fp(0), m_os(0) { + } + ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION) + : m_fp(0), m_os(0) { + open(fp, level); + } + ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION) + : m_fp(0), m_os(0) { + open(name, level); + } + ~ozstream() { + close(); + } + + /* Opens a gzip (.gz) file for writing. + * The compression level parameter should be in 0..9 + * errno can be checked to distinguish two error cases + * (if errno is zero, the zlib error is Z_MEM_ERROR). + */ + void open(const char* name, int level = Z_DEFAULT_COMPRESSION) { + char mode[4] = "wb\0"; + if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level; + if (m_fp) close(); + m_fp = ::gzopen(name, mode); + } + + /* open from a FILE pointer. + */ + void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) { + SET_BINARY_MODE(fp); + char mode[4] = "wb\0"; + if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level; + if (m_fp) close(); + m_fp = ::gzdopen(fileno(fp), mode); + } + + /* Flushes all pending output if necessary, closes the compressed file + * and deallocates all the (de)compression state. The return value is + * the zlib error number (see function error() below). + */ + int close() { + if (m_os) { + ::gzwrite(m_fp, m_os->str(), m_os->pcount()); + delete[] m_os->str(); delete m_os; m_os = 0; + } + int r = ::gzclose(m_fp); m_fp = 0; return r; + } + + /* Binary write the given number of bytes into the compressed file. + */ + int write(const void* buf, size_t len) { + return ::gzwrite(m_fp, (voidp) buf, len); + } + + /* Flushes all pending output into the compressed file. The parameter + * _flush is as in the deflate() function. The return value is the zlib + * error number (see function gzerror below). flush() returns Z_OK if + * the flush_ parameter is Z_FINISH and all output could be flushed. + * flush() should be called only when strictly necessary because it can + * degrade compression. + */ + int flush(int _flush) { + os_flush(); + return ::gzflush(m_fp, _flush); + } + + /* Returns the error message for the last error which occurred on the + * given compressed file. errnum is set to zlib error number. If an + * error occurred in the file system and not in the compression library, + * errnum is set to Z_ERRNO and the application may consult errno + * to get the exact error code. + */ + const char* error(int* errnum) { + return ::gzerror(m_fp, errnum); + } + + gzFile fp() { return m_fp; } + + ostream& os() { + if (m_os == 0) m_os = new ostrstream; + return *m_os; + } + + void os_flush() { + if (m_os && m_os->pcount()>0) { + ostrstream* oss = new ostrstream; + oss->fill(m_os->fill()); + oss->flags(m_os->flags()); + oss->precision(m_os->precision()); + oss->width(m_os->width()); + ::gzwrite(m_fp, m_os->str(), m_os->pcount()); + delete[] m_os->str(); delete m_os; m_os = oss; + } + } + + private: + gzFile m_fp; + ostrstream* m_os; +}; + +/* + * Binary write the given (array of) object(s) into the compressed file. + * returns the number of uncompressed bytes actually written + * (0 in case of error). + */ +template +inline int write(ozstream& zs, const T* x, Items items) { + return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T)); +} + +/* + * Binary output with the '<' operator. + */ +template +inline ozstream& operator<(ozstream& zs, const T& x) { + ::gzwrite(zs.fp(), (voidp) &x, sizeof(T)); + return zs; +} + +inline zstringlen::zstringlen(ozstream& zs, const char* x) { + val.byte = 255; val.word = ::strlen(x); + if (val.word < 255) zs < (val.byte = val.word); + else zs < val; +} + +/* + * Write length of string + the string with the '<' operator. + */ +inline ozstream& operator<(ozstream& zs, const char* x) { + zstringlen len(zs, x); + ::gzwrite(zs.fp(), (voidp) x, len.value()); + return zs; +} + +#ifdef _MSC_VER +inline ozstream& operator<(ozstream& zs, char* const& x) { + return zs < (const char*) x; +} +#endif + +/* + * Ascii write with the << operator; + */ +template +inline ostream& operator<<(ozstream& zs, const T& x) { + zs.os_flush(); + return zs.os() << x; +} + +#endif diff --git a/tests/scancode/data/resource/samples/zlib/iostream2/zstream_test.cpp b/tests/scancode/data/resource/samples/zlib/iostream2/zstream_test.cpp new file mode 100644 index 00000000000..6273f62d62a --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/iostream2/zstream_test.cpp @@ -0,0 +1,25 @@ +#include "zstream.h" +#include +#include +#include + +void main() { + char h[256] = "Hello"; + char* g = "Goodbye"; + ozstream out("temp.gz"); + out < "This works well" < h < g; + out.close(); + + izstream in("temp.gz"); // read it back + char *x = read_string(in), *y = new char[256], z[256]; + in > y > z; + in.close(); + cout << x << endl << y << endl << z << endl; + + out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results + out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; + out << z << endl << y << endl << x << endl; + out << 1.1234567890123456789 << endl; + + delete[] x; delete[] y; +} diff --git a/tests/scancode/data/resource/samples/zlib/zlib.h b/tests/scancode/data/resource/samples/zlib/zlib.h new file mode 100644 index 00000000000..3e0c7672ac5 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/zlib.h @@ -0,0 +1,1768 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.8, April 28th, 2013 + + Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.8" +#define ZLIB_VERNUM 0x1280 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 8 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use in the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). Some + output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed code + block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the stream + are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least the + value returned by deflateBound (see below). Then deflate is guaranteed to + return Z_STREAM_END. If not enough output space is provided, deflate will + not return Z_STREAM_END, and it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered + binary. This field is only for information purposes and does not affect the + compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not + fatal, and deflate() can be called again with more input and more output + space to continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the + exact value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit() does not process any header information -- that is deferred + until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing will + resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + Also to assist in this, on return inflate() will set strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed adler32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained, so applications that need that information should + instead use raw inflate, see inflateInit2() below, or inflateBack() and + perform their own processing of the gzip header and trailer. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + producted so far. The CRC-32 is checked against the gzip trailer. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, + Z_BUF_ERROR if no progress is possible or if there was not enough room in the + output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is desired. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by the + caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute an adler32 check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + adler32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. The + stream will keep the same compression level and any other attributes that + may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression level is changed, the input available so far is + compressed with the old level (and may be flushed); the new level will take + effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to be + compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if + strm->avail_out was zero. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an adler32 or a crc32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + crc32 instead of an adler32. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the adler32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurrences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above or -1 << 16 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is potentially more efficient than + inflate() for file i/o applications, in that it avoids copying between the + output and the sliding window by simply making the window itself the output + buffer. inflate() can be faster on modern CPUs when used with large + buffers. inflateBack() trusts the application to not change the output + buffer passed by the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the normal + behavior of inflate(), which expects either a zlib or gzip header and + trailer around the deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero--buf is ignored in that + case--and inflateBack() will return a buffer error. inflateBack() will call + out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() + should return zero on success, or non-zero on failure. If out() returns + non-zero, inflateBack() will return with an error. Neither in() nor out() + are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed buffer. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Opens a gzip (.gz) file for reading or writing. The mode parameter is as + in fopen ("rb" or "wb") but can also include a compression level ("wb9") or + a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only + compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' + for fixed code compression as in "wb9F". (See the description of + deflateInit2 for more information about the strategy parameter.) 'T' will + request transparent writing or appending with no compression and not using + the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen associates a gzFile with the file descriptor fd. File descriptors + are obtained from calls like open, dup, creat, pipe or fileno (if the file + has been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions. The + default buffer size is 8192 bytes. This function must be called after + gzopen() or gzdopen(), and before any other calls that read or write the + file. The buffer memory allocation is always deferred to the first read or + write. Two buffers are allocated, either both of the specified size when + writing, or one of the specified size and the other twice that size when + reading. A larger buffer size of, for example, 64K or 128K bytes will + noticeably increase the speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + voidpc buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes written or 0 in case of + error. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the arguments to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or 0 in case of error. The number of + uncompressed bytes written is limited to 8191, or one less than the buffer + size given to gzbuffer(). The caller should assure that this limit is not + exceeded. If it is exceeded, then gzprintf() will return an error (0) with + nothing written. In this case, there may also be a buffer overflow with + unpredictable consequences, which is possible only if zlib was compiled with + the insecure functions sprintf() or vsprintf() because the secure snprintf() + or vsnprintf() functions were not available. This can be determined using + zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or a + newline character is read and transferred to buf, or an end-of-file + condition is encountered. If any characters are read or if len == 1, the + string is terminated with a null character. If no characters are read due + to an end-of-file or len < 1, then the buffer is left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push one character back onto the stream to be read as the first character + on the next read. At least one character of push-back is allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter flush + is as in the deflate() function. The return value is the zlib error number + (see function gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatented gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Sets the starting position for the next gzread or gzwrite on the given + compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Returns the starting position for the next gzread or gzwrite on the given + compressed file. This position represents a number of bytes in the + uncompressed data stream, and is zero when starting, even if appending or + reading a gzip stream from the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Returns the current offset in the file being read or written. This offset + includes the count of bytes that precede the gzip stream, for example when + appending or when using gzdopen() for reading. When reading, the offset + does not include as yet unused buffered input. This information can be used + for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns true (1) if the end-of-file indicator has been set while reading, + false (0) otherwise. Note that the end-of-file indicator is set only if the + read tried to go past the end of the input, but came up short. Therefore, + just like feof(), gzeof() may return false even if there is no more data to + read, in the event that the last read request was for the exact number of + bytes remaining in the input file. This will happen if the input file size + is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Returns true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file and + deallocates the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the given + compressed file. errnum is set to zlib error number. If an error occurred + in the file system and not in the compression library, errnum is set to + Z_ERRNO and the application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clears the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is Z_NULL, this function returns the + required initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. If buf is Z_NULL, this function returns the required + initial value for the crc. Pre- and post-conditioning (one's complement) is + performed within this function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +#define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + +#endif /* !Z_SOLO */ + +/* hack for buggy compilers */ +#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; +#endif + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, + const char *format, + va_list va)); +# endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/tests/scancode/data/resource/samples/zlib/zutil.c b/tests/scancode/data/resource/samples/zlib/zutil.c new file mode 100644 index 00000000000..23d2ebef008 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/zutil.c @@ -0,0 +1,324 @@ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zutil.h" +#ifndef Z_SOLO +# include "gzguts.h" +#endif + +#ifndef NO_DUMMY_DECL +struct internal_state {int dummy;}; /* for buggy compilers */ +#endif + +z_const char * const z_errmsg[10] = { +"need dictionary", /* Z_NEED_DICT 2 */ +"stream end", /* Z_STREAM_END 1 */ +"", /* Z_OK 0 */ +"file error", /* Z_ERRNO (-1) */ +"stream error", /* Z_STREAM_ERROR (-2) */ +"data error", /* Z_DATA_ERROR (-3) */ +"insufficient memory", /* Z_MEM_ERROR (-4) */ +"buffer error", /* Z_BUF_ERROR (-5) */ +"incompatible version",/* Z_VERSION_ERROR (-6) */ +""}; + + +const char * ZEXPORT zlibVersion() +{ + return ZLIB_VERSION; +} + +uLong ZEXPORT zlibCompileFlags() +{ + uLong flags; + + flags = 0; + switch ((int)(sizeof(uInt))) { + case 2: break; + case 4: flags += 1; break; + case 8: flags += 2; break; + default: flags += 3; + } + switch ((int)(sizeof(uLong))) { + case 2: break; + case 4: flags += 1 << 2; break; + case 8: flags += 2 << 2; break; + default: flags += 3 << 2; + } + switch ((int)(sizeof(voidpf))) { + case 2: break; + case 4: flags += 1 << 4; break; + case 8: flags += 2 << 4; break; + default: flags += 3 << 4; + } + switch ((int)(sizeof(z_off_t))) { + case 2: break; + case 4: flags += 1 << 6; break; + case 8: flags += 2 << 6; break; + default: flags += 3 << 6; + } +#ifdef DEBUG + flags += 1 << 8; +#endif +#if defined(ASMV) || defined(ASMINF) + flags += 1 << 9; +#endif +#ifdef ZLIB_WINAPI + flags += 1 << 10; +#endif +#ifdef BUILDFIXED + flags += 1 << 12; +#endif +#ifdef DYNAMIC_CRC_TABLE + flags += 1 << 13; +#endif +#ifdef NO_GZCOMPRESS + flags += 1L << 16; +#endif +#ifdef NO_GZIP + flags += 1L << 17; +#endif +#ifdef PKZIP_BUG_WORKAROUND + flags += 1L << 20; +#endif +#ifdef FASTEST + flags += 1L << 21; +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifdef NO_vsnprintf + flags += 1L << 25; +# ifdef HAS_vsprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_vsnprintf_void + flags += 1L << 26; +# endif +# endif +#else + flags += 1L << 24; +# ifdef NO_snprintf + flags += 1L << 25; +# ifdef HAS_sprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_snprintf_void + flags += 1L << 26; +# endif +# endif +#endif + return flags; +} + +#ifdef DEBUG + +# ifndef verbose +# define verbose 0 +# endif +int ZLIB_INTERNAL z_verbose = verbose; + +void ZLIB_INTERNAL z_error (m) + char *m; +{ + fprintf(stderr, "%s\n", m); + exit(1); +} +#endif + +/* exported to allow conversion of error code to string for compress() and + * uncompress() + */ +const char * ZEXPORT zError(err) + int err; +{ + return ERR_MSG(err); +} + +#if defined(_WIN32_WCE) + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. + */ + int errno = 0; +#endif + +#ifndef HAVE_MEMCPY + +void ZLIB_INTERNAL zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int ZLIB_INTERNAL zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void ZLIB_INTERNAL zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + +#ifndef Z_SOLO + +#ifdef SYS16BIT + +#ifdef __TURBOC__ +/* Turbo C in 16-bit mode */ + +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} + +#endif /* __TURBOC__ */ + + +#ifdef M_I86 +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* M_I86 */ + +#endif /* SYS16BIT */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif + +voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + (voidpf)calloc(items, size); +} + +void ZLIB_INTERNAL zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ + +#endif /* !Z_SOLO */ diff --git a/tests/scancode/data/resource/samples/zlib/zutil.h b/tests/scancode/data/resource/samples/zlib/zutil.h new file mode 100644 index 00000000000..24ab06b1cf6 --- /dev/null +++ b/tests/scancode/data/resource/samples/zlib/zutil.h @@ -0,0 +1,253 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2013 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef ZUTIL_H +#define ZUTIL_H + +#ifdef HAVE_HIDDEN +# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +#else +# define ZLIB_INTERNAL +#endif + +#include "zlib.h" + +#if defined(STDC) && !defined(Z_SOLO) +# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) +# include +# endif +# include +# include +#endif + +#ifdef Z_SOLO + typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) +# define OS_CODE 0x00 +# ifndef Z_SOLO +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +# endif +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +# if defined(M_I86) && !defined(Z_SOLO) +# include +# endif +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# ifndef Z_SOLO +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +# endif +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#ifdef WIN32 +# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ +# define OS_CODE 0x0b +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0f +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX +# if defined(_WIN32_WCE) +# define fdopen(fd,mode) NULL /* No fdopen() */ +# ifndef _PTRDIFF_T_DEFINED + typedef int ptrdiff_t; +# define _PTRDIFF_T_DEFINED +# endif +# else +# define fdopen(fd,type) _fdopen(fd,type) +# endif +#endif + +#if defined(__BORLANDC__) && !defined(MSDOS) + #pragma warn -8004 + #pragma warn -8008 + #pragma warn -8066 +#endif + +/* provide prototypes for these when building zlib without LFS */ +#if !defined(_WIN32) && \ + (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +#endif + + /* common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#if defined(pyr) || defined(Z_SOLO) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int ZLIB_INTERNAL z_verbose; + extern void ZLIB_INTERNAL z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + +#ifndef Z_SOLO + voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, + unsigned size)); + void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); +#endif + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +/* Reverse the bytes in a 32-bit value */ +#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +#endif /* ZUTIL_H */ diff --git a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json index 99048ea6301..30c2f68cb21 100644 --- a/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json +++ b/tests/scancode/data/rpm/fping-2.4-0.b2.rhfc1.dag.i386.rpm.expected.json @@ -9,7 +9,6 @@ "files": [ { "path": "fping-2.4-0.b2.rhfc1.dag.i386.rpm", - "scan_errors": [], "packages": [ { "type": "RPM", @@ -83,7 +82,8 @@ } ] } - ] + ], + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index 28aaa76b8a8..2f9a4e33c56 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -17,9 +17,6 @@ "size": 469, "sha1": "f0f352c14a8d0b0510cbbeae056542ae7f252151", "md5": "b8e7112a6e82921687fd1e008e72058f", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": "C", @@ -29,6 +26,9 @@ "is_media": false, "is_source": true, "is_script": false, + "files_count": 0, + "dirs_count": 0, + "size_count": 0, "scan_errors": [] } ] diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json index ed205e707c1..b1b13ee36c3 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json @@ -22,9 +22,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -34,12 +31,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -50,9 +50,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -62,12 +59,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -78,9 +78,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -90,12 +87,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -106,9 +106,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -118,12 +115,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet index 09e60ff2009..6bd0f547d37 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--quiet @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -51,9 +51,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -63,12 +60,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -79,9 +79,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -91,12 +88,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -107,9 +107,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -119,12 +116,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose index 749e6d3e4ea..02f1c4763ce 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose +++ b/tests/scancode/data/unicodepath/unicodepath.expected-linux.json--verbose @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -51,9 +51,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -63,12 +60,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -79,9 +79,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -91,12 +88,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -107,9 +107,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -119,12 +116,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json index 2ce6074370d..56e70c6d551 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json @@ -22,9 +22,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -34,12 +31,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328", @@ -51,9 +51,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -63,12 +60,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328a", @@ -80,9 +80,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -92,12 +89,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", @@ -109,9 +109,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -121,12 +118,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet index 3ccd9d9f2a8..2675c516b33 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--quiet @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328", @@ -52,9 +52,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -64,12 +61,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328a", @@ -81,9 +81,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -93,12 +90,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", @@ -110,9 +110,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -122,12 +119,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose index 4c9354fb8b7..872d3f42f8a 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose +++ b/tests/scancode/data/unicodepath/unicodepath.expected-mac.json--verbose @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328", @@ -52,9 +52,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -64,12 +61,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u03bf\u0313\u2328a", @@ -81,9 +81,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -93,12 +90,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja koris\u030ctenjem Ka\u0308rkka\u0308inen \u2013 Sandersovog algoritma.pdf", @@ -110,9 +110,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -122,12 +119,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json b/tests/scancode/data/unicodepath/unicodepath.expected-win.json index ed205e707c1..b1b13ee36c3 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json @@ -22,9 +22,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -34,12 +31,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -50,9 +50,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -62,12 +59,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -78,9 +78,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -90,12 +87,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -106,9 +106,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -118,12 +115,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet index 09e60ff2009..6bd0f547d37 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--quiet @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -51,9 +51,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -63,12 +60,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -79,9 +79,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -91,12 +88,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -107,9 +107,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -119,12 +116,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose index 749e6d3e4ea..02f1c4763ce 100644 --- a/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose +++ b/tests/scancode/data/unicodepath/unicodepath.expected-win.json--verbose @@ -23,9 +23,6 @@ "size": 0, "sha1": null, "md5": null, - "files_count": 3, - "dirs_count": 0, - "size_count": 20, "mime_type": null, "file_type": null, "programming_language": null, @@ -35,12 +32,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 3, + "dirs_count": 0, + "size_count": 20, + "scan_errors": [] }, { "path": "unicodepath/Izgradnja sufiksnog polja kori\u0161tenjem K\u00e4rkk\u00e4inen \u2013 Sandersovog algoritma.pdf", @@ -51,9 +51,6 @@ "size": 2, "sha1": "71853c6197a6a7f222db0f1978c7cb232b87c5ee", "md5": "e1c06d85ae7b8b032bef47e42e4c08f9", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text", "programming_language": null, @@ -63,12 +60,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328", @@ -79,9 +79,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -91,12 +88,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "unicodepath/\u03e8\u1f40\u2328a", @@ -107,9 +107,6 @@ "size": 9, "sha1": "37aa63c77398d954473262e1a0057c1e632eda77", "md5": "552e21cd4cd9918678e3c1a0df491bc3", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "ASCII text, with no line terminators", "programming_language": null, @@ -119,12 +116,15 @@ "is_media": false, "is_source": false, "is_script": false, - "scan_errors": [], "licenses": [], "copyrights": [], "packages": [], "emails": [], - "urls": [] + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index ea6cd36210d..c1d6372274e 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -15,13 +15,10 @@ "name": "some 'file", "base_name": "some 'file", "extension": "", - "date": "2016-12-21", "size": 20, + "date": "2016-12-21", "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -31,22 +28,22 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some /file", "type": "file", "name": "some \\file", - "base_name": "some \\file", + "base_name": "file", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -56,8 +53,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some file", @@ -65,13 +65,10 @@ "name": "some file", "base_name": "some file", "extension": "", - "date": "2016-12-21", "size": 38, + "date": "2016-12-21", "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -81,8 +78,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some\"file", @@ -90,13 +90,10 @@ "name": "some\"file", "base_name": "some\"file", "extension": "", - "date": "2016-12-21", "size": 39, + "date": "2016-12-21", "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -106,22 +103,22 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some/\"file", "type": "file", "name": "some\\\"file", - "base_name": "some\\\"file", + "base_name": "\"file", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -131,8 +128,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/weird_file_name/expected-mac.json b/tests/scancode/data/weird_file_name/expected-mac.json index f90c93144e5..df7d6f029df 100644 --- a/tests/scancode/data/weird_file_name/expected-mac.json +++ b/tests/scancode/data/weird_file_name/expected-mac.json @@ -15,13 +15,10 @@ "name": "some 'file", "base_name": "some 'file", "extension": "", - "date": "2016-12-21", "size": 20, + "date": "2016-12-21", "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -31,8 +28,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some /file", @@ -40,13 +40,10 @@ "name": "some \\file", "base_name": "some \\file", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -56,8 +53,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some file", @@ -65,13 +65,10 @@ "name": "some file", "base_name": "some file", "extension": "", - "date": "2016-12-21", "size": 38, + "date": "2016-12-21", "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -81,8 +78,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some\"file", @@ -90,13 +90,10 @@ "name": "some\"file", "base_name": "some\"file", "extension": "", - "date": "2016-12-21", "size": 39, + "date": "2016-12-21", "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/plain", "file_type": "a /usr/bin/env node script, ASCII text executable", "programming_language": null, @@ -106,8 +103,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some/\"file", @@ -115,13 +115,10 @@ "name": "some\\\"file", "base_name": "some\\\"file", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -131,8 +128,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/data/weird_file_name/expected-win.json b/tests/scancode/data/weird_file_name/expected-win.json index 16a8764c062..0de4ba42fcf 100644 --- a/tests/scancode/data/weird_file_name/expected-win.json +++ b/tests/scancode/data/weird_file_name/expected-win.json @@ -14,13 +14,10 @@ "type": "file", "name": "some%22file", "extension": "", - "date": "2016-12-21", "size": 39, + "date": "2016-12-21", "sha1": "b2016984d073f405f9788fbf6ae270b452ab73b0", "md5": "9153a386e70bd1713fef91121fb9cbbf", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -30,21 +27,21 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some+%27file", "type": "file", "name": "some+%27file", "extension": "", - "date": "2016-12-21", "size": 20, + "date": "2016-12-21", "sha1": "715037088f2582f3fbb7e9492f819987f713a332", "md5": "62c4cdf80d860c09f215ffff0a9ed020", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -54,21 +51,21 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some+/file", "type": "file", "name": "some+%5Cfile", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -78,21 +75,21 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some+file", "type": "file", "name": "some+file", "extension": "", - "date": "2016-12-21", "size": 38, + "date": "2016-12-21", "sha1": "5fbba80b758b93a311369979d8a68f22c4817d37", "md5": "41ac81497162f2ff48a0442847238ad7", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "application/javascript", "file_type": "Node.js script, ASCII text executable", "programming_language": null, @@ -102,21 +99,21 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] }, { "path": "some/%22file", "type": "file", "name": "some%5C%22file", "extension": "", - "date": "2016-12-21", "size": 21, + "date": "2016-12-21", "sha1": "73e029b07257966106d79d35271bf400e3543cea", "md5": "e99c06d03836700154f01778ac782d50", - "files_count": 0, - "dirs_count": 0, - "size_count": 0, "mime_type": "text/x-shellscript", "file_type": "POSIX shell script, ASCII text executable", "programming_language": "Bash", @@ -126,8 +123,11 @@ "is_media": false, "is_source": true, "is_script": true, - "scan_errors": [], - "copyrights": [] + "copyrights": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] } ] } \ No newline at end of file diff --git a/tests/scancode/test_api.py b/tests/scancode/test_api.py index 1c048031819..b96330b41c1 100644 --- a/tests/scancode/test_api.py +++ b/tests/scancode/test_api.py @@ -54,37 +54,60 @@ def test_get_package_info_can_pickle(self): def test_get_file_info_flag_are_not_null(self): # note the test file is EMPTY on purpose to generate all False is_* flags test_dir = self.get_test_loc('api/info') - infos = api.get_file_info(test_dir) - assert len(infos) == 1 - for info in infos: - is_key_values = [v for k, v in info.items() if k.startswith('is_')] - assert all(v is not None for v in is_key_values) + info = api.get_file_info(test_dir) + expected = [ + (u'date', None), + (u'size', 4096), + (u'sha1', None), + (u'md5', None), + (u'mime_type', None), + (u'file_type', None), + (u'programming_language', None), + (u'is_binary', False), + (u'is_text', False), + (u'is_archive', False), + (u'is_media', False), + (u'is_source', False), + (u'is_script', False) + ] + assert expected == info.items() def test_get_package_info_works_for_maven_dot_pom(self): test_file = self.get_test_loc('api/package/p6spy-1.3.pom') packages = api.get_package_info(test_file) assert len(packages) == 1 - for package in packages: - assert package['version'] == '1.3' + assert packages['packages'][0]['version'] == '1.3' def test_get_package_info_works_for_maven_pom_dot_xml(self): test_file = self.get_test_loc('api/package/pom.xml') packages = api.get_package_info(test_file) assert len(packages) == 1 - for package in packages: - assert package['version'] == '1.3' + assert packages['packages'][0]['version'] == '1.3' - def test_get_file_info_include_base_name(self): + def test_get_file_info_include_size(self): test_dir = self.get_test_loc('api/info/test.txt') - infos = api.get_file_info(test_dir) - assert len(infos) == 1 - for info in infos: - assert 'test' == info['base_name'] + info = api.get_file_info(test_dir) + expected = [ + (u'date', '2017-10-03'), + (u'size', 0), + (u'sha1', None), + (u'md5', None), + (u'mime_type', + u'inode/x-empty'), + (u'file_type', u'empty'), + (u'programming_language', None), + (u'is_binary', False), + (u'is_text', True), + (u'is_archive', False), + (u'is_media', False), + (u'is_source', False), + (u'is_script', False)] + assert expected == info.items() def test_get_copyrights_include_copyrights_and_authors(self): test_file = self.get_test_loc('api/copyright/iproute.c') cops = api.get_copyrights(test_file) - expected = [ + expected = dict(copyrights=[ OrderedDict([ (u'statements', [u'Copyright (c) 2010 Patrick McHardy']), (u'holders', [u'Patrick McHardy']), @@ -95,5 +118,5 @@ def test_get_copyrights_include_copyrights_and_authors(self): (u'holders', []), (u'authors', [u'Patrick McHardy ']), (u'start_line', 11), (u'end_line', 11)]) - ] + ]) assert expected == cops diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index ec7416e35db..2ca3e213161 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -122,7 +122,7 @@ def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): assert 'scancode-script.py' not in result.output -def test_scan_info_does_collect_infos(): +def test_scan_info_does_collect_info(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') args = ['--info', '--strip-root', test_dir, '--json', result_file] @@ -130,7 +130,7 @@ def test_scan_info_does_collect_infos(): check_json_scan(test_env.get_test_loc('info/basic.expected.json'), result_file) -def test_scan_info_does_collect_infos_with_root(): +def test_scan_info_does_collect_info_with_root(): test_dir = test_env.extract_test_tar('info/basic.tgz') result_file = test_env.get_temp_file('json') run_scan_click(['--info', test_dir, '--json', result_file]) @@ -318,20 +318,14 @@ def test_scan_works_with_multiple_processes_and_timeouts(): expected = [ [(u'path', u'test1.txt'), - (u'scan_errors', - [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), - (u'copyrights', []) - ], + (u'copyrights', []), + (u'scan_errors', [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.'])], [(u'path', u'test2.txt'), - (u'scan_errors', - [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), - (u'copyrights', []) - ], + (u'copyrights', []), + (u'scan_errors', [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.'])], [(u'path', u'test3.txt'), - (u'scan_errors', - [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.']), - (u'copyrights', []) - ], + (u'copyrights', []), + (u'scan_errors', [u'ERROR: for scanner: copyrights:\nERROR: Processing interrupted: timeout after 0 seconds.'])] ] result_json = json.loads(open(result_file).read(), object_pairs_hook=OrderedDict) @@ -346,8 +340,8 @@ def check_scan_does_not_fail_when_scanning_unicode_files_and_paths(verbosity): test_dir = fsencode(test_dir) result_file = fsencode(result_file) - args = ['--info', '--license', '--copyright', '--package', - '--email', '--url', '--strip-root', test_dir , '--json', + args = ['--info', '--license', '--copyright', '--package', + '--email', '--url', '--strip-root', test_dir , '--json', result_file] + ([verbosity] if verbosity else []) results = run_scan_click(args) @@ -649,29 +643,32 @@ def test_scan_with_timing_json_return_timings_for_each_scanner(): run_scan_click(args) file_results = load_json_result(result_file)['files'] - expected = set(['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) - - for res in file_results: - scan_timings = res['scan_timings'] - assert scan_timings - for scanner, timing in scan_timings.items(): - assert scanner in expected - assert timing + expected = set(['emails', 'urls', 'licenses', 'copyrights', 'info', 'packages']) + check_timings(expected, file_results) def test_scan_with_timing_jsonpp_return_timings_for_each_scanner(): test_dir = test_env.extract_test_tar('timing/basic.tgz') result_file = test_env.get_temp_file('json') args = ['--email', '--url', '--license', '--copyright', '--info', - '--package', '--timing', '--json-pp', result_file, test_dir] + '--package', '--timing', '--verbose', '--json-pp', result_file, test_dir] run_scan_click(args) file_results = load_json_result(result_file)['files'] + expected = set(['emails', 'urls', 'licenses', 'copyrights', 'info', 'packages']) + check_timings(expected, file_results) - expected = set(['emails', 'urls', 'licenses', 'copyrights', 'infos', 'packages']) +def check_timings(expected, file_results): for res in file_results: scan_timings = res['scan_timings'] + + if not res['type'] == 'file': + # should be an empty dict for dirs + assert not scan_timings + continue + assert scan_timings + for scanner, timing in scan_timings.items(): assert scanner in expected assert timing diff --git a/tests/scancode/test_extract_cli.py b/tests/scancode/test_extract_cli.py index fff78697554..78c162dd789 100644 --- a/tests/scancode/test_extract_cli.py +++ b/tests/scancode/test_extract_cli.py @@ -40,7 +40,6 @@ from commoncode.system import on_windows from scancode import extract_cli - test_env = FileDrivenTesting() test_env.test_data_dir = os.path.join(os.path.dirname(__file__), 'data') diff --git a/tests/scancode/test_plugin_ignore.py b/tests/scancode/test_plugin_ignore.py index 0729e44b9de..203edf642fb 100644 --- a/tests/scancode/test_plugin_ignore.py +++ b/tests/scancode/test_plugin_ignore.py @@ -66,11 +66,10 @@ def test_is_ignored_glob_file(self): assert is_ignored(location=location, ignores=ignores) def check_ProcessIgnore(self, test_dir, expected, ignore): - codebase = Codebase(test_dir) + codebase = Codebase(test_dir, strip_root=True) test_plugin = ProcessIgnore() test_plugin.process_codebase(codebase, ignore=ignore) - resources = [res.get_path(strip_root=True, decode=True, posix=True) - for res in codebase.walk(skip_root=True)] + resources = [res.path for res in codebase.walk(skip_root=True)] assert expected == sorted(resources) def test_ProcessIgnore_with_single_file(self): diff --git a/tests/scancode/test_plugin_mark_source.py b/tests/scancode/test_plugin_mark_source.py index b087da45869..ac644c893b1 100644 --- a/tests/scancode/test_plugin_mark_source.py +++ b/tests/scancode/test_plugin_mark_source.py @@ -50,10 +50,9 @@ def test_is_source_directory_below_threshold(self): def test_scan_mark_source_without_info(self): test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') - result_file = self.get_temp_file('json') - expected_file = self.get_test_loc('plugin_mark_source/without_info.expected.json') - run_scan_click(['--mark-source', test_dir, '--json', result_file]) - check_json_scan(expected_file, result_file, regen=False) + result = run_scan_click(['--mark-source', test_dir, '--json', '-'], + expected_rc=2) + assert 'Error: The option --mark-source requires the option(s) --info and is missing --info.' in result.output def test_scan_mark_source_with_info(self): test_dir = self.extract_test_tar('plugin_mark_source/JGroups.tgz') diff --git a/tests/scancode/test_plugin_only_findings.py b/tests/scancode/test_plugin_only_findings.py index 86181f02821..94c7d70c18d 100644 --- a/tests/scancode/test_plugin_only_findings.py +++ b/tests/scancode/test_plugin_only_findings.py @@ -31,34 +31,30 @@ from commoncode.testcase import FileDrivenTesting from scancode.cli_test_utils import run_scan_click from scancode.cli_test_utils import check_json_scan -from scancode.plugin_only_findings import has_findings -from scancode.resource import Resource class TestHasFindings(FileDrivenTesting): test_data_dir = join(dirname(__file__), 'data') - def test_has_findings(self): - resource = Resource('name', 1, 2, 3, use_cache=False) - resource.put_scans({'licenses': ['MIT']}) - assert has_findings(resource) - - def test_has_findings_with_children(self): - resource = Resource('name', 1, 2, 3, use_cache=False) - resource.children_rids.append(1) - assert not has_findings(resource) - - def test_has_findings_includes_errors(self): - resource = Resource('name', 1, 2, 3, use_cache=False) - resource.errors = [ - 'ERROR: Processing interrupted: timeout after 10 seconds.' - ] - assert has_findings(resource) - def test_scan_only_findings(self): test_dir = self.extract_test_tar('plugin_only_findings/basic.tgz') result_file = self.get_temp_file('json') expected_file = self.get_test_loc('plugin_only_findings/expected.json') run_scan_click(['-clip', '--only-findings', '--json', result_file, test_dir]) check_json_scan(expected_file, result_file, strip_dates=True) + + def test_scan_only_findings_with_errors(self): + test_dir = self.get_test_loc('plugin_only_findings/errors') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_only_findings/errors.expected.json') + run_scan_click(['-pi', '--only-findings', '--json-pp', + result_file, test_dir], expected_rc=1) + check_json_scan(expected_file, result_file, strip_dates=True) + + def test_scan_only_findings_with_only_info(self): + test_dir = self.extract_test_tar('plugin_only_findings/basic.tgz') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_only_findings/info.expected.json') + run_scan_click(['--info', '--only-findings', '--json', result_file, test_dir]) + check_json_scan(expected_file, result_file, strip_dates=True) diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index c0b62347cca..7a472143845 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -27,7 +27,6 @@ from __future__ import print_function from __future__ import unicode_literals -from collections import OrderedDict from os.path import dirname from os.path import exists from os.path import join @@ -36,6 +35,7 @@ from scancode.resource import Codebase from commoncode.fileutils import parent_directory +from scancode.resource import get_path class TestCodebase(FileBasedTesting): @@ -43,7 +43,7 @@ class TestCodebase(FileBasedTesting): def test_walk_defaults(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = list(codebase.walk()) expected = [ ('codebase', False), @@ -59,7 +59,7 @@ def test_walk_defaults(self): def test_walk_topdown(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = list(codebase.walk(topdown=True)) expected = [ ('codebase', False), @@ -75,7 +75,7 @@ def test_walk_topdown(self): def test_walk_bottomup(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = list(codebase.walk(topdown=False)) expected = [ ('abc', True), @@ -91,7 +91,7 @@ def test_walk_bottomup(self): def test_walk_skip_root_basic(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = list(codebase.walk(skip_root=True)) expected = [ ('abc', True), @@ -104,11 +104,11 @@ def test_walk_skip_root_basic(self): ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_filtered_root(self): + def test_walk_filtered_with_filtered_root(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) codebase.root.is_filtered = True - results = list(codebase.walk(skip_filtered=True)) + results = list(codebase.walk_filtered()) expected = [ ('abc', True), ('et131x.h', True), @@ -120,25 +120,25 @@ def test_walk_skip_filtered_root(self): ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_filtered_all(self): + def test_walk_filtered_with_all_filtered(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): res.is_filtered = True - results = list(codebase.walk(skip_filtered=True)) + results = list(codebase.walk_filtered()) expected = [] assert expected == [(r.name, r.is_file) for r in results] def test_compute_counts_filtered_None(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = codebase.compute_counts(skip_filtered=True) expected = (5, 3, 0) assert expected == results def test_compute_counts_filtered_None_with_size(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) for res in codebase.walk(): if res.is_file: res.size = 10 @@ -149,15 +149,15 @@ def test_compute_counts_filtered_None_with_size(self): def test_compute_counts_filtered_None_with_cache(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=True) + codebase = Codebase(test_codebase) results = codebase.compute_counts(skip_filtered=True) expected = (5, 3, 0) assert expected == results def test_compute_counts_filtered_all(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) expected = (0, 0, 0) @@ -165,8 +165,8 @@ def test_compute_counts_filtered_all(self): def test_compute_counts_filtered_all_with_cache(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=True) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) expected = (0, 0, 0) @@ -174,8 +174,8 @@ def test_compute_counts_filtered_all_with_cache(self): def test_compute_counts_filtered_files(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): if res.is_file: res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) @@ -184,8 +184,8 @@ def test_compute_counts_filtered_files(self): def test_compute_counts_filtered_dirs(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): if not res.is_file: res.is_filtered = True results = codebase.compute_counts(skip_filtered=True) @@ -194,12 +194,12 @@ def test_compute_counts_filtered_dirs(self): def test_walk_filtered_dirs(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): if not res.is_file: res.is_filtered = True - results = list(codebase.walk(topdown=True, skip_filtered=True)) + results = list(codebase.walk_filtered(topdown=True)) expected = [ ('abc', True), ('et131x.h', True), @@ -209,11 +209,11 @@ def test_walk_filtered_dirs(self): ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_filtered_skip_root(self): + def test_walk_filtered_skip_root(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) codebase.root.is_filtered = True - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + results = list(codebase.walk_filtered(skip_root=True)) expected = [ ('abc', True), ('et131x.h', True), @@ -225,216 +225,228 @@ def test_walk_skip_filtered_skip_root(self): ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_filtered_all_skip_root(self): + def test_walk_filtered_all_skip_root(self): test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - for res in codebase.get_resources(None): + codebase = Codebase(test_codebase) + for res in codebase.walk(): res.is_filtered = True - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + results = list(codebase.walk_filtered(skip_root=True)) expected = [] assert expected == [(r.name, r.is_file) for r in results] def test_walk_skip_root_single_file(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) results = list(codebase.walk(skip_root=True)) expected = [ ('et131x.h', True) ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_root_not_filtered_single_file(self): + def test_walk_filtered_with_skip_root_and_single_file_not_filtered(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + codebase = Codebase(test_codebase) + results = list(codebase.walk_filtered(skip_root=True)) expected = [ ('et131x.h', True) ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_root_filtered_single_file(self): + def test_walk_filtered__with_skip_root_and_filtered_single_file(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) codebase.root.is_filtered = True - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + results = list(codebase.walk_filtered(skip_root=True)) expected = [ ] assert expected == [(r.name, r.is_file) for r in results] def test_walk_skip_root_single_file_with_children(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) - c1 = codebase.root.add_child('some child', is_file=True) - _c2 = c1.add_child('some child2', is_file=False) + codebase = Codebase(test_codebase, strip_root=True) + + c1 = codebase.create_resource('some child', parent=codebase.root, is_file=True) + _c2 = codebase.create_resource('some child2', parent=c1, is_file=False) results = list(codebase.walk(skip_root=True)) expected = [ (u'some child', True), (u'some child2', False) ] assert expected == [(r.name, r.is_file) for r in results] - def test_walk_skip_root_skip_filtered_single_file_with_children(self): + def test_walk_filtered_with_skip_root_and_single_file_with_children(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase, strip_root=True) - c1 = codebase.root.add_child('some child', is_file=True) - c2 = c1.add_child('some child2', is_file=False) + c1 = codebase.create_resource('some child', parent=codebase.root, is_file=True) + c2 = codebase.create_resource('some child2', parent=c1, is_file=False) c2.is_filtered = True - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + codebase.save_resource(c2) + + results = list(codebase.walk_filtered(skip_root=True)) expected = [(u'some child', True)] assert expected == [(r.name, r.is_file) for r in results] c1.is_filtered = True - results = list(codebase.walk(skip_root=True, skip_filtered=True)) + codebase.save_resource(c1) + results = list(codebase.walk_filtered(skip_root=True)) expected = [] assert expected == [(r.name, r.is_file) for r in results] def test_walk_skip_root_single_dir(self): test_codebase = self.get_temp_dir('walk') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase, strip_root=True) + results = list(codebase.walk(skip_root=True)) expected = [ ('walk', False) ] assert expected == [(r.name, r.is_file) for r in results] - def test_add_child_can_add_child_to_file(self): + def test_create_resource_can_add_child_to_file(self): test_codebase = self.get_test_loc('resource/codebase/et131x.h') - codebase = Codebase(test_codebase, use_cache=False) - codebase.root.add_child('some child', is_file=True) + codebase = Codebase(test_codebase) + codebase.create_resource('some child', codebase.root, is_file=True) results = list(codebase.walk()) expected = [('et131x.h', True), (u'some child', True)] assert expected == [(r.name, r.is_file) for r in results] - def test_add_child_can_add_child_to_dir(self): + def test_create_resource_can_add_child_to_dir(self): test_codebase = self.get_temp_dir('resource') - codebase = Codebase(test_codebase, use_cache=False) - codebase.root.add_child('some child', is_file=False) + codebase = Codebase(test_codebase) + codebase.create_resource('some child', codebase.root, is_file=False) results = list(codebase.walk()) expected = [('resource', False), (u'some child', False)] assert expected == [(r.name, r.is_file) for r in results] def test_get_resource(self): test_codebase = self.get_temp_dir('resource') - codebase = Codebase(test_codebase, use_cache=False) + codebase = Codebase(test_codebase) assert codebase.root is codebase.get_resource(0) - def test_get_resources(self): - test_codebase = self.get_test_loc('resource/codebase') - codebase = Codebase(test_codebase, use_cache=False) - expected = [ - ('codebase', False), - ('abc', True), - ('et131x.h', True), - ('dir', False), - ('other dir', False), - ('that', True), - ('this', True), - ('file', True), - ] - assert expected == [(r.name, r.is_file) for r in codebase.get_resources(None)] - - expected = [ - ('codebase', False), - ('abc', True), - ('dir', False), - ('this', True), - ] - - assert expected == [(r.name, r.is_file) for r in codebase.get_resources([0, 1, 3, 6])] + def test_get_path(self): + import os + from commoncode.fileutils import fsdecode + from commoncode.fileutils import fsencode + from commoncode.system import on_linux + + test_dir = self.get_test_loc('resource/samples') + locations = [] + for top, dirs, files in os.walk(test_dir): + for x in dirs: + locations.append(os.path.join(top, x)) + for x in files: + locations.append(os.path.join(top, x)) + transcoder = fsencode if on_linux else fsdecode + locations = [transcoder(p) for p in locations] + root_location = transcoder(test_dir) + + expected_default = [ + u'samples/JGroups', u'samples/zlib', u'samples/arch', + u'samples/README', u'samples/screenshot.png', + u'samples/JGroups/src', u'samples/JGroups/licenses', + u'samples/JGroups/LICENSE', u'samples/JGroups/EULA', + u'samples/JGroups/src/GuardedBy.java', + u'samples/JGroups/src/ImmutableReference.java', + u'samples/JGroups/src/RouterStub.java', + u'samples/JGroups/src/S3_PING.java', + u'samples/JGroups/src/FixedMembershipToken.java', + u'samples/JGroups/src/RouterStubManager.java', + u'samples/JGroups/src/RATE_LIMITER.java', + u'samples/JGroups/licenses/cpl-1.0.txt', + u'samples/JGroups/licenses/bouncycastle.txt', + u'samples/JGroups/licenses/lgpl.txt', + u'samples/JGroups/licenses/apache-2.0.txt', + u'samples/JGroups/licenses/apache-1.1.txt', u'samples/zlib/dotzlib', + u'samples/zlib/iostream2', u'samples/zlib/infback9', + u'samples/zlib/gcc_gvmat64', u'samples/zlib/ada', + u'samples/zlib/deflate.h', u'samples/zlib/zutil.c', + u'samples/zlib/zlib.h', u'samples/zlib/deflate.c', + u'samples/zlib/zutil.h', u'samples/zlib/adler32.c', + u'samples/zlib/dotzlib/AssemblyInfo.cs', + u'samples/zlib/dotzlib/LICENSE_1_0.txt', + u'samples/zlib/dotzlib/readme.txt', + u'samples/zlib/dotzlib/ChecksumImpl.cs', + u'samples/zlib/iostream2/zstream_test.cpp', + u'samples/zlib/iostream2/zstream.h', + u'samples/zlib/infback9/infback9.c', + u'samples/zlib/infback9/infback9.h', + u'samples/zlib/gcc_gvmat64/gvmat64.S', u'samples/zlib/ada/zlib.ads', + u'samples/arch/zlib.tar.gz'] + + default = sorted(get_path(root_location, loc) for loc in locations) + assert sorted(expected_default) == default + + expected_strip_root = [ + u'JGroups', u'zlib', u'arch', u'README', u'screenshot.png', + u'JGroups/src', u'JGroups/licenses', u'JGroups/LICENSE', + u'JGroups/EULA', u'JGroups/src/GuardedBy.java', + u'JGroups/src/ImmutableReference.java', + u'JGroups/src/RouterStub.java', u'JGroups/src/S3_PING.java', + u'JGroups/src/FixedMembershipToken.java', + u'JGroups/src/RouterStubManager.java', + u'JGroups/src/RATE_LIMITER.java', u'JGroups/licenses/cpl-1.0.txt', + u'JGroups/licenses/bouncycastle.txt', u'JGroups/licenses/lgpl.txt', + u'JGroups/licenses/apache-2.0.txt', + u'JGroups/licenses/apache-1.1.txt', u'zlib/dotzlib', + u'zlib/iostream2', u'zlib/infback9', u'zlib/gcc_gvmat64', + u'zlib/ada', u'zlib/deflate.h', u'zlib/zutil.c', u'zlib/zlib.h', + u'zlib/deflate.c', u'zlib/zutil.h', u'zlib/adler32.c', + u'zlib/dotzlib/AssemblyInfo.cs', u'zlib/dotzlib/LICENSE_1_0.txt', + u'zlib/dotzlib/readme.txt', u'zlib/dotzlib/ChecksumImpl.cs', + u'zlib/iostream2/zstream_test.cpp', u'zlib/iostream2/zstream.h', + u'zlib/infback9/infback9.c', u'zlib/infback9/infback9.h', + u'zlib/gcc_gvmat64/gvmat64.S', u'zlib/ada/zlib.ads', + u'arch/zlib.tar.gz'] + + skipped = sorted(get_path(root_location, loc, strip_root=True) for loc in locations) + assert sorted(expected_strip_root) == skipped + + expected_full_ends = sorted(expected_default) + full = sorted(get_path(root_location, loc, full_root=True) for loc in locations) + for full_loc, ending in zip(full, expected_full_ends): + assert full_loc.endswith((ending)) + + full_skipped = sorted(get_path(root_location, loc, full_root=True, strip_root=True) for loc in locations) + assert full == full_skipped class TestCodebaseCache(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') - def test_codebase_with_use_cache(self): + def test_codebase_cache_memory(self): test_codebase = self.get_test_loc('resource/cache/package') - codebase = Codebase(test_codebase, use_cache=True) + codebase = Codebase(test_codebase) assert codebase.temp_dir assert codebase.cache_dir codebase.cache_dir root = codebase.root - assert ('00', '00000000') == root.cache_keys - cp = root._get_cached_path(create=False) + cp = codebase._get_resource_cache_location(root.rid, create=False) assert not exists(cp) - cp = root._get_cached_path(create=True) + cp = codebase._get_resource_cache_location(root.rid, create=True) assert not exists(cp) assert exists(parent_directory(cp)) - assert not root._scans - - scans = OrderedDict(this='that') - scans_put = root.put_scans(scans) - assert scans == scans_put - assert scans == root.get_scans() - assert not root._scans - assert exists (root._get_cached_path(create=False)) - - scans_put = root.put_scans(scans) - assert scans == scans_put - assert not root._scans - assert scans == root.get_scans() - assert scans is not root.get_scans() - assert exists (root._get_cached_path(create=False)) - - scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False) - assert scans == scans_put - assert not root._scans - assert scans == root.get_scans() - assert scans is not root.get_scans() - - scans2 = OrderedDict(this='that') - scans_put = root.put_scans(scans2, update=True) - expected = OrderedDict(this='that', food='bar') - assert expected == root.get_scans() - assert expected is not root.get_scans() - - scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False) - assert scans == scans_put - assert scans == root.get_scans() - assert not root._scans - assert scans is not root.get_scans() - assert exists (root._get_cached_path(create=False)) - - def test_codebase_without_use_cache(self): - test_codebase = self.get_test_loc('resource/cache/package') - codebase = Codebase(test_codebase, use_cache=False) - assert not codebase.cache_dir + child = codebase.create_resource('child', root, is_file=True) + child.size = 12 + codebase.save_resource(child) + child_2 = codebase.get_resource(child.rid) + assert child == child_2 + def test_codebase_cache_disk(self): + test_codebase = self.get_test_loc('resource/cache/package') + codebase = Codebase(test_codebase, max_in_memory=-1) + assert codebase.temp_dir + assert codebase.cache_dir + codebase.cache_dir root = codebase.root - - assert ('00', '00000000') == root.cache_keys - assert root._get_cached_path(create=False) is None - - assert not root._scans - - scans = OrderedDict(this='that') - scans_put = root.put_scans(scans) - assert scans == scans_put - assert scans == root.get_scans() - assert scans_put is root.get_scans() - - scans_put = root.put_scans(scans) - assert scans == scans_put - assert scans_put is root.get_scans() - - scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False) - assert scans == scans_put - assert scans == root.get_scans() - assert scans_put is root.get_scans() - - scans2 = OrderedDict(this='that') - scans_put = root.put_scans(scans2, update=True) - expected = OrderedDict(this='that', food='bar') - assert expected == root.get_scans() - assert expected is not root.get_scans() - - scans = OrderedDict(food='bar') - scans_put = root.put_scans(scans, update=False) - assert scans == scans_put - assert scans == root.get_scans() - assert scans_put is root.get_scans() - assert scans is not root.get_scans() + cp = codebase._get_resource_cache_location(root.rid, create=False) + assert not exists(cp) + cp = codebase._get_resource_cache_location(root.rid, create=True) + assert not exists(cp) + assert exists(parent_directory(cp)) + child = codebase.create_resource('child', root, is_file=True) + child.size = 12 + codebase.save_resource(child) + child_2 = codebase.get_resource(child.rid) + assert child == child_2 From 29d289bd502cc8885b9e9b8cd88a627ab6d290fe Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 20:05:00 +0100 Subject: [PATCH 109/122] Correct formatting of CSV outputs Signed-off-by: Philippe Ombredanne --- src/formattedcode/output_csv.py | 7 +- .../data/csv/flatten_scan/full.json-expected | 2358 ++++++----------- .../csv/flatten_scan/minimal.json-expected | 24 +- .../package_license_value_null.json-expected | 12 +- .../data/csv/livescan/expected.csv | 8 +- tests/formattedcode/test_output_csv.py | 6 +- 6 files changed, 804 insertions(+), 1611 deletions(-) diff --git a/src/formattedcode/output_csv.py b/src/formattedcode/output_csv.py index 75c1a6a6a31..f9d6f4a5aa3 100644 --- a/src/formattedcode/output_csv.py +++ b/src/formattedcode/output_csv.py @@ -128,16 +128,19 @@ def collect_keys(mapping, key_group): # do not include matched text for now. if k == 'matched_text': continue + if k == 'matched_rule': + is_choice = val.get('license_choice', False) for mrk, mrv in val.items(): - mrk = 'matched_rule__' + mrk if mrk == 'license_choice': mrv = 'y' if mrv else '' if mrk == 'licenses': - mrv = ' '.join(mrv) + sep = ' OR ' if is_choice else ' AND ' + mrv = sep.join(mrv) if mrk in ('match_coverage', 'rule_relevance'): # normalize the string representation of this number mrv = '{:.2f}'.format(mrv) + mrk = 'matched_rule__' + mrk lic[mrk] = mrv continue diff --git a/tests/formattedcode/data/csv/flatten_scan/full.json-expected b/tests/formattedcode/data/csv/flatten_scan/full.json-expected index 73ec2b55d2d..3ee87b68b6c 100644 --- a/tests/formattedcode/data/csv/flatten_scan/full.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/full.json-expected @@ -35,11 +35,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_sevenzip.py", @@ -56,11 +53,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_sevenzip.py", @@ -164,11 +158,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_tar.py", @@ -185,11 +176,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_tar.py", @@ -269,11 +257,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_patch.py", @@ -290,11 +275,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_patch.py", @@ -362,11 +344,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_extract.py", @@ -383,11 +362,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_extract.py", @@ -455,11 +431,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/extractcode_assert_utils.py", @@ -476,11 +449,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/extractcode_assert_utils.py", @@ -548,11 +518,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_extractcode.py", @@ -569,11 +536,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_extractcode.py", @@ -641,11 +605,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_archive.py", @@ -662,11 +623,8 @@ "start_line": 4, "end_line": 23, "matched_rule__identifier": "apache-2.0_scancode.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0", - "scancode-acknowledgment" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0 AND scancode-acknowledgment" }, { "Resource": "/test_archive.py", @@ -1597,10 +1555,8 @@ "start_line": 386, "end_line": 386, "matched_rule__identifier": "apache-2.0_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0" }, { "Resource": "/data/extract/TODO/org-jvnet-glassfish-comms-sipagent_1530.jar", @@ -1617,10 +1573,8 @@ "start_line": 386, "end_line": 386, "matched_rule__identifier": "cddl-1.0_6.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "cddl-1.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "cddl-1.0" }, { "Resource": "/data/extract/TODO/org-jvnet-glassfish-comms-sipagent_1530.jar", @@ -4525,10 +4479,8 @@ "start_line": 1141, "end_line": 1149, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff.expected", @@ -4545,10 +4497,8 @@ "start_line": 1151, "end_line": 1151, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff.expected", @@ -4565,10 +4515,8 @@ "start_line": 1152, "end_line": 1152, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff.expected", @@ -4585,10 +4533,8 @@ "start_line": 1153, "end_line": 1153, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff.expected", @@ -4605,10 +4551,8 @@ "start_line": 1770, "end_line": 1770, "matched_rule__identifier": "gpl_71.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff.expected", @@ -4907,10 +4851,8 @@ "start_line": 1118, "end_line": 1126, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff", @@ -4927,10 +4869,8 @@ "start_line": 1128, "end_line": 1128, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff", @@ -4947,10 +4887,8 @@ "start_line": 1129, "end_line": 1129, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff", @@ -4967,10 +4905,8 @@ "start_line": 1130, "end_line": 1130, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff", @@ -4987,10 +4923,8 @@ "start_line": 1681, "end_line": 1681, "matched_rule__identifier": "gpl_71.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/dnsmasq_2.63-1.diff", @@ -6504,10 +6438,8 @@ "start_line": 160, "end_line": 173, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6524,10 +6456,8 @@ "start_line": 405, "end_line": 418, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6544,10 +6474,8 @@ "start_line": 564, "end_line": 577, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6564,10 +6492,8 @@ "start_line": 652, "end_line": 665, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6584,10 +6510,8 @@ "start_line": 735, "end_line": 748, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6604,10 +6528,8 @@ "start_line": 824, "end_line": 837, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6624,10 +6546,8 @@ "start_line": 887, "end_line": 900, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -6644,10 +6564,8 @@ "start_line": 984, "end_line": 997, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected", @@ -7381,10 +7299,8 @@ "start_line": 131, "end_line": 144, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7401,10 +7317,8 @@ "start_line": 370, "end_line": 383, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7421,10 +7335,8 @@ "start_line": 505, "end_line": 518, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7441,10 +7353,8 @@ "start_line": 587, "end_line": 600, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7461,10 +7371,8 @@ "start_line": 658, "end_line": 671, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7481,10 +7389,8 @@ "start_line": 741, "end_line": 754, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7501,10 +7407,8 @@ "start_line": 798, "end_line": 811, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -7521,10 +7425,8 @@ "start_line": 889, "end_line": 902, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch", @@ -8210,10 +8112,8 @@ "start_line": 69, "end_line": 82, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch.expected", @@ -8362,10 +8262,8 @@ "start_line": 58, "end_line": 71, "matched_rule__identifier": "lgpl-2.0-plus_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch", @@ -8925,10 +8823,8 @@ "start_line": 102, "end_line": 114, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -8945,10 +8841,8 @@ "start_line": 2287, "end_line": 2287, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -8965,10 +8859,8 @@ "start_line": 2305, "end_line": 2313, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -8985,10 +8877,8 @@ "start_line": 2315, "end_line": 2315, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9005,10 +8895,8 @@ "start_line": 2402, "end_line": 2410, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9025,10 +8913,8 @@ "start_line": 2412, "end_line": 2412, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9045,10 +8931,8 @@ "start_line": 3174, "end_line": 3182, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9065,10 +8949,8 @@ "start_line": 3184, "end_line": 3184, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9085,10 +8967,8 @@ "start_line": 4119, "end_line": 4127, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9105,10 +8985,8 @@ "start_line": 4129, "end_line": 4129, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9125,10 +9003,8 @@ "start_line": 4175, "end_line": 4183, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9145,10 +9021,8 @@ "start_line": 4185, "end_line": 4185, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected", @@ -9381,10 +9255,8 @@ "start_line": 772, "end_line": 772, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9401,10 +9273,8 @@ "start_line": 801, "end_line": 801, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9421,10 +9291,8 @@ "start_line": 819, "end_line": 819, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9441,10 +9309,8 @@ "start_line": 876, "end_line": 878, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9461,10 +9327,8 @@ "start_line": 946, "end_line": 946, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9481,10 +9345,8 @@ "start_line": 974, "end_line": 974, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9501,10 +9363,8 @@ "start_line": 1029, "end_line": 1031, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9521,10 +9381,8 @@ "start_line": 1920, "end_line": 1922, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9541,10 +9399,8 @@ "start_line": 2814, "end_line": 2816, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9561,10 +9417,8 @@ "start_line": 3370, "end_line": 3372, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9581,10 +9435,8 @@ "start_line": 3779, "end_line": 3781, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9601,10 +9453,8 @@ "start_line": 4093, "end_line": 4095, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9621,10 +9471,8 @@ "start_line": 4262, "end_line": 4264, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9641,10 +9489,8 @@ "start_line": 4682, "end_line": 4684, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9661,10 +9507,8 @@ "start_line": 5058, "end_line": 5060, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9681,10 +9525,8 @@ "start_line": 6100, "end_line": 6102, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9701,10 +9543,8 @@ "start_line": 6684, "end_line": 6686, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9721,10 +9561,8 @@ "start_line": 7445, "end_line": 7445, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9741,10 +9579,8 @@ "start_line": 7475, "end_line": 7477, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9761,10 +9597,8 @@ "start_line": 7575, "end_line": 7577, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9781,10 +9615,8 @@ "start_line": 7872, "end_line": 7874, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9801,10 +9633,8 @@ "start_line": 8400, "end_line": 8402, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9821,10 +9651,8 @@ "start_line": 8513, "end_line": 8515, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9841,10 +9669,8 @@ "start_line": 8621, "end_line": 8623, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9861,10 +9687,8 @@ "start_line": 8728, "end_line": 8730, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9881,10 +9705,8 @@ "start_line": 9787, "end_line": 9789, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9901,10 +9723,8 @@ "start_line": 10453, "end_line": 10455, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9921,10 +9741,8 @@ "start_line": 10747, "end_line": 10749, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9941,10 +9759,8 @@ "start_line": 11336, "end_line": 11338, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9961,10 +9777,8 @@ "start_line": 11513, "end_line": 11515, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -9981,10 +9795,8 @@ "start_line": 11632, "end_line": 11634, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected", @@ -12422,10 +12234,8 @@ "start_line": 695, "end_line": 695, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12442,10 +12252,8 @@ "start_line": 718, "end_line": 718, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12462,10 +12270,8 @@ "start_line": 736, "end_line": 736, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12482,10 +12288,8 @@ "start_line": 787, "end_line": 789, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12502,10 +12306,8 @@ "start_line": 857, "end_line": 857, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12522,10 +12324,8 @@ "start_line": 885, "end_line": 885, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12542,10 +12342,8 @@ "start_line": 928, "end_line": 930, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12562,10 +12360,8 @@ "start_line": 1813, "end_line": 1815, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12582,10 +12378,8 @@ "start_line": 2701, "end_line": 2703, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12602,10 +12396,8 @@ "start_line": 3251, "end_line": 3253, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12622,10 +12414,8 @@ "start_line": 3654, "end_line": 3656, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12642,10 +12432,8 @@ "start_line": 3962, "end_line": 3964, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12662,10 +12450,8 @@ "start_line": 4125, "end_line": 4127, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12682,10 +12468,8 @@ "start_line": 4539, "end_line": 4541, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12702,10 +12486,8 @@ "start_line": 4909, "end_line": 4911, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12722,10 +12504,8 @@ "start_line": 5945, "end_line": 5947, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12742,10 +12522,8 @@ "start_line": 6523, "end_line": 6525, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12762,10 +12540,8 @@ "start_line": 7284, "end_line": 7284, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12782,10 +12558,8 @@ "start_line": 7308, "end_line": 7310, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12802,10 +12576,8 @@ "start_line": 7402, "end_line": 7404, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12822,10 +12594,8 @@ "start_line": 7693, "end_line": 7695, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12842,10 +12612,8 @@ "start_line": 8215, "end_line": 8217, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12862,10 +12630,8 @@ "start_line": 8322, "end_line": 8324, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12882,10 +12648,8 @@ "start_line": 8424, "end_line": 8426, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12902,10 +12666,8 @@ "start_line": 8525, "end_line": 8527, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12922,10 +12684,8 @@ "start_line": 9578, "end_line": 9580, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12942,10 +12702,8 @@ "start_line": 10238, "end_line": 10240, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12962,10 +12720,8 @@ "start_line": 10526, "end_line": 10528, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -12982,10 +12738,8 @@ "start_line": 11109, "end_line": 11111, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -13002,10 +12756,8 @@ "start_line": 11280, "end_line": 11282, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -13022,10 +12774,8 @@ "start_line": 11375, "end_line": 11377, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff", @@ -16120,10 +15870,8 @@ "start_line": 34, "end_line": 35, "matched_rule__identifier": "curl.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "curl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "curl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19x3_board.patch", @@ -16140,10 +15888,8 @@ "start_line": 34, "end_line": 35, "matched_rule__identifier": "gpl-2.0-plus_6.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19x3_board.patch", @@ -16244,10 +15990,8 @@ "start_line": 99, "end_line": 111, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16264,10 +16008,8 @@ "start_line": 2239, "end_line": 2239, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16284,10 +16026,8 @@ "start_line": 2273, "end_line": 2281, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16304,10 +16044,8 @@ "start_line": 2283, "end_line": 2283, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16324,10 +16062,8 @@ "start_line": 3023, "end_line": 3031, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16344,10 +16080,8 @@ "start_line": 3033, "end_line": 3033, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16364,10 +16098,8 @@ "start_line": 3122, "end_line": 3130, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16384,10 +16116,8 @@ "start_line": 3132, "end_line": 3132, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16404,10 +16134,8 @@ "start_line": 4066, "end_line": 4074, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16424,10 +16152,8 @@ "start_line": 4076, "end_line": 4076, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16444,10 +16170,8 @@ "start_line": 4121, "end_line": 4129, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16464,10 +16188,8 @@ "start_line": 4131, "end_line": 4131, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected", @@ -16610,10 +16332,8 @@ "start_line": 42, "end_line": 66, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch", @@ -16630,10 +16350,8 @@ "start_line": 204, "end_line": 204, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch", @@ -16821,10 +16539,8 @@ "start_line": 101, "end_line": 125, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/fan_ctrl.patch.expected", @@ -16841,10 +16557,8 @@ "start_line": 138, "end_line": 138, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/fan_ctrl.patch.expected", @@ -16888,10 +16602,8 @@ "start_line": 42, "end_line": 66, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch", @@ -16908,10 +16620,8 @@ "start_line": 364, "end_line": 364, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch", @@ -16988,10 +16698,8 @@ "start_line": 104, "end_line": 116, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17008,10 +16716,8 @@ "start_line": 2289, "end_line": 2289, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17028,10 +16734,8 @@ "start_line": 2308, "end_line": 2316, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17048,10 +16752,8 @@ "start_line": 2318, "end_line": 2318, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17068,10 +16770,8 @@ "start_line": 2406, "end_line": 2414, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17088,10 +16788,8 @@ "start_line": 2416, "end_line": 2416, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17108,10 +16806,8 @@ "start_line": 3180, "end_line": 3188, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17128,10 +16824,8 @@ "start_line": 3190, "end_line": 3190, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17148,10 +16842,8 @@ "start_line": 4126, "end_line": 4134, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17168,10 +16860,8 @@ "start_line": 4136, "end_line": 4136, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17188,10 +16878,8 @@ "start_line": 4183, "end_line": 4191, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17208,10 +16896,8 @@ "start_line": 4193, "end_line": 4193, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected", @@ -17687,10 +17373,8 @@ "start_line": 51, "end_line": 52, "matched_rule__identifier": "curl.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "curl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "curl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19x3_board.patch.expected", @@ -17707,10 +17391,8 @@ "start_line": 51, "end_line": 52, "matched_rule__identifier": "gpl-2.0-plus_6.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19x3_board.patch.expected", @@ -17985,10 +17667,8 @@ "start_line": 72, "end_line": 96, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/fan_ctrl.patch", @@ -18005,10 +17685,8 @@ "start_line": 109, "end_line": 109, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/fan_ctrl.patch", @@ -18079,10 +17757,8 @@ "start_line": 1569, "end_line": 1569, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected", @@ -18099,10 +17775,8 @@ "start_line": 3001, "end_line": 3001, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected", @@ -18119,10 +17793,8 @@ "start_line": 3592, "end_line": 3592, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected", @@ -18139,10 +17811,8 @@ "start_line": 4625, "end_line": 4625, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected", @@ -18282,10 +17952,8 @@ "start_line": 88, "end_line": 100, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18302,10 +17970,8 @@ "start_line": 2273, "end_line": 2273, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18322,10 +17988,8 @@ "start_line": 2286, "end_line": 2294, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18342,10 +18006,8 @@ "start_line": 2296, "end_line": 2296, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18362,10 +18024,8 @@ "start_line": 2378, "end_line": 2386, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18382,10 +18042,8 @@ "start_line": 2388, "end_line": 2388, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18402,10 +18060,8 @@ "start_line": 3141, "end_line": 3149, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18422,10 +18078,8 @@ "start_line": 3151, "end_line": 3151, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18442,10 +18096,8 @@ "start_line": 4081, "end_line": 4089, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18462,10 +18114,8 @@ "start_line": 4091, "end_line": 4091, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18482,10 +18132,8 @@ "start_line": 4132, "end_line": 4140, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18502,10 +18150,8 @@ "start_line": 4142, "end_line": 4142, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch", @@ -18834,10 +18480,8 @@ "start_line": 1438, "end_line": 1438, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch", @@ -18854,10 +18498,8 @@ "start_line": 2870, "end_line": 2870, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch", @@ -18874,10 +18516,8 @@ "start_line": 3461, "end_line": 3461, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch", @@ -18894,10 +18534,8 @@ "start_line": 4494, "end_line": 4494, "matched_rule__identifier": "gpl_62.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch", @@ -18968,10 +18606,8 @@ "start_line": 77, "end_line": 77, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/localversion.patch", @@ -19135,10 +18771,8 @@ "start_line": 59, "end_line": 83, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch.expected", @@ -19155,10 +18789,8 @@ "start_line": 381, "end_line": 381, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch.expected", @@ -19229,10 +18861,8 @@ "start_line": 82, "end_line": 94, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19249,10 +18879,8 @@ "start_line": 2222, "end_line": 2222, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19269,10 +18897,8 @@ "start_line": 2244, "end_line": 2252, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19289,10 +18915,8 @@ "start_line": 2254, "end_line": 2254, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19309,10 +18933,8 @@ "start_line": 2988, "end_line": 2996, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19329,10 +18951,8 @@ "start_line": 2998, "end_line": 2998, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19349,10 +18969,8 @@ "start_line": 3081, "end_line": 3089, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19369,10 +18987,8 @@ "start_line": 3091, "end_line": 3091, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19389,10 +19005,8 @@ "start_line": 4019, "end_line": 4027, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19409,10 +19023,8 @@ "start_line": 4029, "end_line": 4029, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19429,10 +19041,8 @@ "start_line": 4068, "end_line": 4076, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19449,10 +19059,8 @@ "start_line": 4078, "end_line": 4078, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.4.patch", @@ -19811,10 +19419,8 @@ "start_line": 10, "end_line": 22, "matched_rule__identifier": "gpl-2.0_34.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx.h.patch", @@ -19969,10 +19575,8 @@ "start_line": 85, "end_line": 97, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -19989,10 +19593,8 @@ "start_line": 2270, "end_line": 2270, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20009,10 +19611,8 @@ "start_line": 2282, "end_line": 2290, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20029,10 +19629,8 @@ "start_line": 2292, "end_line": 2292, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20049,10 +19647,8 @@ "start_line": 2373, "end_line": 2381, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20069,10 +19665,8 @@ "start_line": 2383, "end_line": 2383, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20089,10 +19683,8 @@ "start_line": 3133, "end_line": 3141, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20109,10 +19701,8 @@ "start_line": 3143, "end_line": 3143, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20129,10 +19719,8 @@ "start_line": 4072, "end_line": 4080, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20149,10 +19737,8 @@ "start_line": 4082, "end_line": 4082, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20169,10 +19755,8 @@ "start_line": 4122, "end_line": 4130, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20189,10 +19773,8 @@ "start_line": 4132, "end_line": 4132, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch", @@ -20335,10 +19917,8 @@ "start_line": 15, "end_line": 27, "matched_rule__identifier": "gpl-2.0_34.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx.h.patch.expected", @@ -20445,10 +20025,8 @@ "start_line": 105, "end_line": 117, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20465,10 +20043,8 @@ "start_line": 2290, "end_line": 2290, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20485,10 +20061,8 @@ "start_line": 2309, "end_line": 2317, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20505,10 +20079,8 @@ "start_line": 2319, "end_line": 2319, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20525,10 +20097,8 @@ "start_line": 2407, "end_line": 2415, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20545,10 +20115,8 @@ "start_line": 2417, "end_line": 2417, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20565,10 +20133,8 @@ "start_line": 3182, "end_line": 3190, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20585,10 +20151,8 @@ "start_line": 3192, "end_line": 3192, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20605,10 +20169,8 @@ "start_line": 4128, "end_line": 4136, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20625,10 +20187,8 @@ "start_line": 4138, "end_line": 4138, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20645,10 +20205,8 @@ "start_line": 4185, "end_line": 4193, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20665,10 +20223,8 @@ "start_line": 4195, "end_line": 4195, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected", @@ -20811,10 +20367,8 @@ "start_line": 85, "end_line": 85, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch2.expected", @@ -20915,10 +20469,8 @@ "start_line": 82, "end_line": 82, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/pmb.c.patch", @@ -21019,10 +20571,8 @@ "start_line": 56, "end_line": 80, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch.expected", @@ -21039,10 +20589,8 @@ "start_line": 219, "end_line": 219, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch.expected", @@ -21560,10 +21108,8 @@ "start_line": 39, "end_line": 63, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch", @@ -21580,10 +21126,8 @@ "start_line": 202, "end_line": 202, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch", @@ -21702,10 +21246,8 @@ "start_line": 2317, "end_line": 2319, "matched_rule__identifier": "gpl_15.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21722,11 +21264,8 @@ "start_line": 2318, "end_line": 2318, "matched_rule__identifier": "lgpl-2.1_released.RULE", - "matched_rule__license_choice": true, - "matched_rule__licenses": [ - "gpl-2.0", - "lgpl-2.1" - ] + "matched_rule__license_choice": "y", + "matched_rule__licenses": "gpl-2.0 OR lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21743,11 +21282,8 @@ "start_line": 2318, "end_line": 2318, "matched_rule__identifier": "lgpl-2.1_released.RULE", - "matched_rule__license_choice": true, - "matched_rule__licenses": [ - "gpl-2.0", - "lgpl-2.1" - ] + "matched_rule__license_choice": "y", + "matched_rule__licenses": "gpl-2.0 OR lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21764,10 +21300,8 @@ "start_line": 2321, "end_line": 2321, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21784,10 +21318,8 @@ "start_line": 2321, "end_line": 2321, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21804,10 +21336,8 @@ "start_line": 2712, "end_line": 2714, "matched_rule__identifier": "lgpl-2.1_22.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21824,10 +21354,8 @@ "start_line": 2716, "end_line": 2716, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21844,10 +21372,8 @@ "start_line": 2716, "end_line": 2716, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21864,10 +21390,8 @@ "start_line": 2787, "end_line": 2789, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21884,10 +21408,8 @@ "start_line": 3202, "end_line": 3202, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21904,10 +21426,8 @@ "start_line": 3205, "end_line": 3205, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21924,10 +21444,8 @@ "start_line": 3205, "end_line": 3205, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21944,10 +21462,8 @@ "start_line": 3246, "end_line": 3248, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21964,10 +21480,8 @@ "start_line": 3588, "end_line": 3588, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -21984,10 +21498,8 @@ "start_line": 3591, "end_line": 3591, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22004,10 +21516,8 @@ "start_line": 3591, "end_line": 3591, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22024,10 +21534,8 @@ "start_line": 3648, "end_line": 3650, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22044,10 +21552,8 @@ "start_line": 6004, "end_line": 6004, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22064,10 +21570,8 @@ "start_line": 6024, "end_line": 6024, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22084,10 +21588,8 @@ "start_line": 6027, "end_line": 6027, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22104,10 +21606,8 @@ "start_line": 6027, "end_line": 6027, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22124,10 +21624,8 @@ "start_line": 6067, "end_line": 6069, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22144,10 +21642,8 @@ "start_line": 13609, "end_line": 13609, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22164,10 +21660,8 @@ "start_line": 13612, "end_line": 13612, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22184,10 +21678,8 @@ "start_line": 13612, "end_line": 13612, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22204,10 +21696,8 @@ "start_line": 14520, "end_line": 14520, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22224,10 +21714,8 @@ "start_line": 14523, "end_line": 14523, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22244,10 +21732,8 @@ "start_line": 14523, "end_line": 14523, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22264,10 +21750,8 @@ "start_line": 14549, "end_line": 14551, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22284,10 +21768,8 @@ "start_line": 14928, "end_line": 14928, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22304,10 +21786,8 @@ "start_line": 14931, "end_line": 14931, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22324,10 +21804,8 @@ "start_line": 14931, "end_line": 14931, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22344,10 +21822,8 @@ "start_line": 14967, "end_line": 14969, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22364,10 +21840,8 @@ "start_line": 15226, "end_line": 15226, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22384,10 +21858,8 @@ "start_line": 15229, "end_line": 15229, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22404,10 +21876,8 @@ "start_line": 15229, "end_line": 15229, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22424,10 +21894,8 @@ "start_line": 15264, "end_line": 15266, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22444,10 +21912,8 @@ "start_line": 15516, "end_line": 15516, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22464,10 +21930,8 @@ "start_line": 15519, "end_line": 15519, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22484,10 +21948,8 @@ "start_line": 15519, "end_line": 15519, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22504,10 +21966,8 @@ "start_line": 15557, "end_line": 15559, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22524,10 +21984,8 @@ "start_line": 15703, "end_line": 15703, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22544,10 +22002,8 @@ "start_line": 15706, "end_line": 15706, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22564,10 +22020,8 @@ "start_line": 15706, "end_line": 15706, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22584,10 +22038,8 @@ "start_line": 15752, "end_line": 15752, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22604,10 +22056,8 @@ "start_line": 15755, "end_line": 15755, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22624,10 +22074,8 @@ "start_line": 15755, "end_line": 15755, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22644,10 +22092,8 @@ "start_line": 15805, "end_line": 15807, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22664,10 +22110,8 @@ "start_line": 15868, "end_line": 15868, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22684,10 +22128,8 @@ "start_line": 15871, "end_line": 15871, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22704,10 +22146,8 @@ "start_line": 15871, "end_line": 15871, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22724,10 +22164,8 @@ "start_line": 15914, "end_line": 15916, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22744,10 +22182,8 @@ "start_line": 16133, "end_line": 16133, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22764,10 +22200,8 @@ "start_line": 16136, "end_line": 16136, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22784,10 +22218,8 @@ "start_line": 16136, "end_line": 16136, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22804,10 +22236,8 @@ "start_line": 16181, "end_line": 16203, "matched_rule__identifier": "bsd-new_19.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "bsd-new" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "bsd-new" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22824,10 +22254,8 @@ "start_line": 16356, "end_line": 16356, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22844,10 +22272,8 @@ "start_line": 16359, "end_line": 16359, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22864,10 +22290,8 @@ "start_line": 16359, "end_line": 16359, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22884,10 +22308,8 @@ "start_line": 16388, "end_line": 16390, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22904,10 +22326,8 @@ "start_line": 16933, "end_line": 16933, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22924,10 +22344,8 @@ "start_line": 16936, "end_line": 16936, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22944,10 +22362,8 @@ "start_line": 16936, "end_line": 16936, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22964,10 +22380,8 @@ "start_line": 16983, "end_line": 16985, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -22984,10 +22398,8 @@ "start_line": 17022, "end_line": 17022, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23004,10 +22416,8 @@ "start_line": 17025, "end_line": 17025, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23024,10 +22434,8 @@ "start_line": 17025, "end_line": 17025, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23044,10 +22452,8 @@ "start_line": 17056, "end_line": 17056, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23064,10 +22470,8 @@ "start_line": 17059, "end_line": 17059, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23084,10 +22488,8 @@ "start_line": 17059, "end_line": 17059, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected", @@ -23938,10 +23340,8 @@ "start_line": 87, "end_line": 99, "matched_rule__identifier": "gpl-2.0-plus_49.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -23958,10 +23358,8 @@ "start_line": 2272, "end_line": 2272, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -23978,10 +23376,8 @@ "start_line": 2285, "end_line": 2293, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -23998,10 +23394,8 @@ "start_line": 2295, "end_line": 2295, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24018,10 +23412,8 @@ "start_line": 2377, "end_line": 2385, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24038,10 +23430,8 @@ "start_line": 2387, "end_line": 2387, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24058,10 +23448,8 @@ "start_line": 3139, "end_line": 3147, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24078,10 +23466,8 @@ "start_line": 3149, "end_line": 3149, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24098,10 +23484,8 @@ "start_line": 4079, "end_line": 4087, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24118,10 +23502,8 @@ "start_line": 4089, "end_line": 4089, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24138,10 +23520,8 @@ "start_line": 4130, "end_line": 4138, "matched_rule__identifier": "gpl-2.0-plus_3.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0-plus" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0-plus" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24158,10 +23538,8 @@ "start_line": 4140, "end_line": 4140, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch", @@ -24367,10 +23745,8 @@ "start_line": 80, "end_line": 80, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24408,10 +23784,8 @@ "start_line": 2288, "end_line": 2290, "matched_rule__identifier": "gpl_15.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24428,11 +23802,8 @@ "start_line": 2289, "end_line": 2289, "matched_rule__identifier": "lgpl-2.1_released.RULE", - "matched_rule__license_choice": true, - "matched_rule__licenses": [ - "gpl-2.0", - "lgpl-2.1" - ] + "matched_rule__license_choice": "y", + "matched_rule__licenses": "gpl-2.0 OR lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24449,11 +23820,8 @@ "start_line": 2289, "end_line": 2289, "matched_rule__identifier": "lgpl-2.1_released.RULE", - "matched_rule__license_choice": true, - "matched_rule__licenses": [ - "gpl-2.0", - "lgpl-2.1" - ] + "matched_rule__license_choice": "y", + "matched_rule__licenses": "gpl-2.0 OR lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24470,10 +23838,8 @@ "start_line": 2292, "end_line": 2292, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24490,10 +23856,8 @@ "start_line": 2292, "end_line": 2292, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24510,10 +23874,8 @@ "start_line": 2665, "end_line": 2667, "matched_rule__identifier": "lgpl-2.1_22.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24530,10 +23892,8 @@ "start_line": 2669, "end_line": 2669, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24550,10 +23910,8 @@ "start_line": 2669, "end_line": 2669, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24570,10 +23928,8 @@ "start_line": 2734, "end_line": 2736, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24590,10 +23946,8 @@ "start_line": 3143, "end_line": 3143, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24610,10 +23964,8 @@ "start_line": 3146, "end_line": 3146, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24630,10 +23982,8 @@ "start_line": 3146, "end_line": 3146, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24650,10 +24000,8 @@ "start_line": 3181, "end_line": 3183, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24670,10 +24018,8 @@ "start_line": 3517, "end_line": 3517, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24690,10 +24036,8 @@ "start_line": 3520, "end_line": 3520, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24710,10 +24054,8 @@ "start_line": 3520, "end_line": 3520, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24730,10 +24072,8 @@ "start_line": 3571, "end_line": 3573, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24750,10 +24090,8 @@ "start_line": 5927, "end_line": 5927, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24770,10 +24108,8 @@ "start_line": 5941, "end_line": 5941, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24790,10 +24126,8 @@ "start_line": 5944, "end_line": 5944, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24810,10 +24144,8 @@ "start_line": 5944, "end_line": 5944, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24830,10 +24162,8 @@ "start_line": 5978, "end_line": 5980, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24850,10 +24180,8 @@ "start_line": 13514, "end_line": 13514, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24870,10 +24198,8 @@ "start_line": 13517, "end_line": 13517, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24890,10 +24216,8 @@ "start_line": 13517, "end_line": 13517, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24910,10 +24234,8 @@ "start_line": 14419, "end_line": 14419, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24930,10 +24252,8 @@ "start_line": 14422, "end_line": 14422, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24950,10 +24270,8 @@ "start_line": 14422, "end_line": 14422, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24970,10 +24288,8 @@ "start_line": 14442, "end_line": 14444, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -24990,10 +24306,8 @@ "start_line": 14815, "end_line": 14815, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25010,10 +24324,8 @@ "start_line": 14818, "end_line": 14818, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25030,10 +24342,8 @@ "start_line": 14818, "end_line": 14818, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25050,10 +24360,8 @@ "start_line": 14848, "end_line": 14850, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25070,10 +24378,8 @@ "start_line": 15101, "end_line": 15101, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25090,10 +24396,8 @@ "start_line": 15104, "end_line": 15104, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25110,10 +24414,8 @@ "start_line": 15104, "end_line": 15104, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25130,10 +24432,8 @@ "start_line": 15133, "end_line": 15135, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25150,10 +24450,8 @@ "start_line": 15379, "end_line": 15379, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25170,10 +24468,8 @@ "start_line": 15382, "end_line": 15382, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25190,10 +24486,8 @@ "start_line": 15382, "end_line": 15382, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25210,10 +24504,8 @@ "start_line": 15414, "end_line": 15416, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25230,10 +24522,8 @@ "start_line": 15554, "end_line": 15554, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25250,10 +24540,8 @@ "start_line": 15557, "end_line": 15557, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25270,10 +24558,8 @@ "start_line": 15557, "end_line": 15557, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25290,10 +24576,8 @@ "start_line": 15597, "end_line": 15597, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25310,10 +24594,8 @@ "start_line": 15600, "end_line": 15600, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25330,10 +24612,8 @@ "start_line": 15600, "end_line": 15600, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25350,10 +24630,8 @@ "start_line": 15644, "end_line": 15646, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25370,10 +24648,8 @@ "start_line": 15701, "end_line": 15701, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25390,10 +24666,8 @@ "start_line": 15704, "end_line": 15704, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25410,10 +24684,8 @@ "start_line": 15704, "end_line": 15704, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25430,10 +24702,8 @@ "start_line": 15741, "end_line": 15743, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25450,10 +24720,8 @@ "start_line": 15954, "end_line": 15954, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25470,10 +24738,8 @@ "start_line": 15957, "end_line": 15957, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25490,10 +24756,8 @@ "start_line": 15957, "end_line": 15957, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25510,10 +24774,8 @@ "start_line": 15996, "end_line": 16018, "matched_rule__identifier": "bsd-new_19.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "bsd-new" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "bsd-new" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25530,10 +24792,8 @@ "start_line": 16165, "end_line": 16165, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25550,10 +24810,8 @@ "start_line": 16168, "end_line": 16168, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25570,10 +24828,8 @@ "start_line": 16168, "end_line": 16168, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25590,10 +24846,8 @@ "start_line": 16191, "end_line": 16193, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25610,10 +24864,8 @@ "start_line": 16730, "end_line": 16730, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25630,10 +24882,8 @@ "start_line": 16733, "end_line": 16733, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25650,10 +24900,8 @@ "start_line": 16733, "end_line": 16733, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25670,10 +24918,8 @@ "start_line": 16774, "end_line": 16776, "matched_rule__identifier": "gpl-2.0_8.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25690,10 +24936,8 @@ "start_line": 16807, "end_line": 16807, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25710,10 +24954,8 @@ "start_line": 16810, "end_line": 16810, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25730,10 +24972,8 @@ "start_line": 16810, "end_line": 16810, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25750,10 +24990,8 @@ "start_line": 16835, "end_line": 16835, "matched_rule__identifier": "lgpl-2.1_36.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl-2.1" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl-2.1" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25770,10 +25008,8 @@ "start_line": 16838, "end_line": 16838, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -25790,10 +25026,8 @@ "start_line": 16838, "end_line": 16838, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch", @@ -26476,10 +25710,8 @@ "start_line": 59, "end_line": 83, "matched_rule__identifier": "dual-bsd-gpl.LICENSE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "dual-bsd-gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "dual-bsd-gpl" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch.expected", @@ -26496,10 +25728,8 @@ "start_line": 221, "end_line": 221, "matched_rule__identifier": "gpl-2.0_43.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch.expected", @@ -29427,10 +28657,8 @@ "start_line": 10, "end_line": 10, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/archive/TODO/rpmticket_6327/gettext-runtime-32bit-0.17-61.40.x86_64.rpm", @@ -29447,10 +28675,8 @@ "start_line": 10, "end_line": 10, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/archive/TODO/rpmticket_6327/gettext-runtime-32bit-0.17-61.40.x86_64.rpm", @@ -29467,10 +28693,8 @@ "start_line": 98, "end_line": 98, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/archive/TODO/rpmticket_6327/gettext-runtime-32bit-0.17-61.40.x86_64.rpm", @@ -29487,10 +28711,8 @@ "start_line": 98, "end_line": 98, "matched_rule__identifier": "gpl_61.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/archive/TODO/rpmticket_6327/gettext-runtime-32bit-0.17-61.40.x86_64.rpm", @@ -30529,10 +29751,8 @@ "start_line": 135, "end_line": 135, "matched_rule__identifier": "gpl-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/archive/cpio/elfinfo-1.0-1.fc9.src.cpio", @@ -30588,10 +29808,8 @@ "start_line": 135, "end_line": 135, "matched_rule__identifier": "gpl-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/archive/cpio/cpio_trailing.cpio", @@ -30689,10 +29907,8 @@ "start_line": 138, "end_line": 138, "matched_rule__identifier": "gpl-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/archive/cpio/cpio_broken.cpio", @@ -35135,10 +34351,8 @@ "start_line": 9, "end_line": 9, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/archive/rpm/broken.rpm", @@ -35273,10 +34487,8 @@ "start_line": 9, "end_line": 9, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/archive/rpm/renamed.rpm", @@ -35340,10 +34552,8 @@ "start_line": 9, "end_line": 9, "matched_rule__identifier": "lgpl_20.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "lgpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "lgpl" }, { "Resource": "/data/archive/rpm/python-glc-0.7.1-1.src.rpm", @@ -35407,10 +34617,8 @@ "start_line": 8, "end_line": 8, "matched_rule__identifier": "gpl-2.0_75.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/archive/rpm/elfinfo-1.0-1.fc9.src.rpm", @@ -35474,10 +34682,8 @@ "start_line": 8, "end_line": 8, "matched_rule__identifier": "gpl-2.0_75.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl-2.0" }, { "Resource": "/data/archive/rpm/rpm_trailing.rpm", @@ -36792,10 +35998,8 @@ "start_line": 1619, "end_line": 1619, "matched_rule__identifier": "gpl_63.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "gpl" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "gpl" }, { "Resource": "/data/archive/bz2/bzip2_with_gentoo_trailing_data/sys-libs%253Azlib-1.2.3-r1%7E1.tbz2", @@ -36812,10 +36016,8 @@ "start_line": 2139, "end_line": 2139, "matched_rule__identifier": "zlib_10.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "zlib" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "zlib" }, { "Resource": "/data/archive/bz2/bzip2_with_gentoo_trailing_data/sys-libs%253Azlib-1.2.3-r1%7E1.tbz2", diff --git a/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected b/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected index 0d33ece20da..d8a72a7d78d 100644 --- a/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected @@ -18,10 +18,8 @@ "start_line": 4, "end_line": 5, "matched_rule__identifier": "apache-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0" }, { "Resource": "/srp_vfy.c", @@ -38,10 +36,8 @@ "start_line": 4, "end_line": 4, "matched_rule__identifier": "openssl-ssleay_2.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "openssl-ssleay" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "openssl-ssleay" }, { "Resource": "/srp_vfy.c", @@ -74,10 +70,8 @@ "start_line": 4, "end_line": 5, "matched_rule__identifier": "apache-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0" }, { "Resource": "/srp_lib.c", @@ -94,10 +88,8 @@ "start_line": 4, "end_line": 4, "matched_rule__identifier": "openssl-ssleay_2.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "openssl-ssleay" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "openssl-ssleay" }, { "Resource": "/srp_lib.c", diff --git a/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected b/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected index 1955d928eed..e9968fb1e4b 100644 --- a/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected @@ -18,10 +18,8 @@ "start_line": 4, "end_line": 5, "matched_rule__identifier": "apache-2.0_23.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "apache-2.0" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "apache-2.0" }, { "Resource": "/srp_vfy.c", @@ -38,10 +36,8 @@ "start_line": 4, "end_line": 4, "matched_rule__identifier": "openssl-ssleay_2.RULE", - "matched_rule__license_choice": false, - "matched_rule__licenses": [ - "openssl-ssleay" - ] + "matched_rule__license_choice": "", + "matched_rule__licenses": "openssl-ssleay" }, { "Resource": "/srp_vfy.c", diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index e38066deeab..ed8e9c06718 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,16 +1,16 @@ Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license__key,license__score,license__short_name,license__category,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_choice,matched_rule__licenses,copyright,copyright_holder,email,url,package__type,package__name,package__version,package__primary_language,package__summary,package__description,package__size,package__release_date,package__authors,package__homepage_url,package__notes,package__download_urls,package__bug_tracking_url,package__vcs_repository,package__copyright_top_level /json2csv.rb,file,json2csv.rb,json2csv,.rb,1014,2017-10-03,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,False,[u'apache-2.0'],,,,,,,,,,,,,,,,,,, +/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache 2.0,Permissive,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,,apache-2.0,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,http://nexb.com/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,, /license,file,license,license,,679,2017-10-03,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,False,['gpl-2.0-plus'],,,,,,,,,,,,,,,,,,, +/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GPL 2.0 or later,Copyleft,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0+,https://spdx.org/licenses/GPL-2.0,1,12,gpl-2.0-plus.LICENSE,,gpl-2.0-plus,,,,,,,,,,,,,,,,,,, /package.json,file,package.json,package,.json,2200,2017-10-03,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,False,[u'mit'],,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,False,['mit'],,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,15.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,,mit,,,,,,,,,,,,,,,,,,, +/package.json,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,Permissive,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,,mit,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,Copyright (c) 2012 LearnBoost < tj@learnboost.com>,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,26,,,,,LearnBoost <,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,, diff --git a/tests/formattedcode/test_output_csv.py b/tests/formattedcode/test_output_csv.py index 054e76e2c90..931a6d2d54c 100644 --- a/tests/formattedcode/test_output_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -57,7 +57,7 @@ def load_scan(json_input): return scan_results -def check_json(result, expected_file, regen=False): +def check_json(result, expected_file, regen=True): if regen: with codecs.open(expected_file, 'wb', encoding='utf-8') as reg: reg.write(json.dumps(result, indent=4, separators=(',', ': '))) @@ -68,7 +68,7 @@ def check_json(result, expected_file, regen=False): def check_csvs(result_file, expected_file, ignore_keys=('date', 'file_type', 'mime_type',), - regen=False): + regen=True): """ Load and compare two CSVs. `ignore_keys` is a tuple of keys that will be ignored in the comparisons. @@ -212,4 +212,4 @@ def test_can_process_live_scan_with_all_options(): args = ['-clip', '--email', '--url', '--strip-root', test_dir, '--output-csv', result_file] run_scan_plain(args) expected_file = test_env.get_test_loc('csv/livescan/expected.csv') - check_csvs(result_file, expected_file, regen=False) + check_csvs(result_file, expected_file) From 01c635f68ac640fb7139e5e9d7df4203e388bf46 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 20:06:35 +0100 Subject: [PATCH 110/122] Do not regen in tests Signed-off-by: Philippe Ombredanne --- tests/formattedcode/test_output_csv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/formattedcode/test_output_csv.py b/tests/formattedcode/test_output_csv.py index 931a6d2d54c..63fbbd88128 100644 --- a/tests/formattedcode/test_output_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -57,7 +57,7 @@ def load_scan(json_input): return scan_results -def check_json(result, expected_file, regen=True): +def check_json(result, expected_file, regen=False): if regen: with codecs.open(expected_file, 'wb', encoding='utf-8') as reg: reg.write(json.dumps(result, indent=4, separators=(',', ': '))) @@ -68,7 +68,7 @@ def check_json(result, expected_file, regen=True): def check_csvs(result_file, expected_file, ignore_keys=('date', 'file_type', 'mime_type',), - regen=True): + regen=False): """ Load and compare two CSVs. `ignore_keys` is a tuple of keys that will be ignored in the comparisons. From cfa3f5611a159c6794013a342d6666df3ff12995 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 20:17:55 +0100 Subject: [PATCH 111/122] Correct API tests Signed-off-by: Philippe Ombredanne --- tests/scancode/test_api.py | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/tests/scancode/test_api.py b/tests/scancode/test_api.py index b96330b41c1..ff93cbe7478 100644 --- a/tests/scancode/test_api.py +++ b/tests/scancode/test_api.py @@ -51,26 +51,25 @@ def test_get_package_info_can_pickle(self): _pickled = pickle.dumps(package) _cpickled = cPickle.dumps(package) - def test_get_file_info_flag_are_not_null(self): + def test_get_file_info_include_size(self): # note the test file is EMPTY on purpose to generate all False is_* flags - test_dir = self.get_test_loc('api/info') + test_dir = self.get_test_loc('api/info/test.txt') info = api.get_file_info(test_dir) expected = [ - (u'date', None), - (u'size', 4096), + (u'size', 0), (u'sha1', None), (u'md5', None), - (u'mime_type', None), - (u'file_type', None), + (u'mime_type', u'inode/x-empty'), + (u'file_type', u'empty'), (u'programming_language', None), (u'is_binary', False), - (u'is_text', False), + (u'is_text', True), (u'is_archive', False), (u'is_media', False), (u'is_source', False), (u'is_script', False) ] - assert expected == info.items() + assert expected == [(k, v) for k, v in info.items() if k != 'date'] def test_get_package_info_works_for_maven_dot_pom(self): test_file = self.get_test_loc('api/package/p6spy-1.3.pom') @@ -84,26 +83,6 @@ def test_get_package_info_works_for_maven_pom_dot_xml(self): assert len(packages) == 1 assert packages['packages'][0]['version'] == '1.3' - def test_get_file_info_include_size(self): - test_dir = self.get_test_loc('api/info/test.txt') - info = api.get_file_info(test_dir) - expected = [ - (u'date', '2017-10-03'), - (u'size', 0), - (u'sha1', None), - (u'md5', None), - (u'mime_type', - u'inode/x-empty'), - (u'file_type', u'empty'), - (u'programming_language', None), - (u'is_binary', False), - (u'is_text', True), - (u'is_archive', False), - (u'is_media', False), - (u'is_source', False), - (u'is_script', False)] - assert expected == info.items() - def test_get_copyrights_include_copyrights_and_authors(self): test_file = self.get_test_loc('api/copyright/iproute.c') cops = api.get_copyrights(test_file) From 37fc25d38eb7a2f86c84b7e2a0158d5c37dcd071 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 23:20:40 +0100 Subject: [PATCH 112/122] Fix comment grammar Signed-off-by: Philippe Ombredanne --- src/scancode/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 4a93979a013..9ddc6dd65aa 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -725,7 +725,7 @@ def scancode(ctx, input, # NOQA # TODO: add progress indicator # note: inventory timing collection is built in Codebase initialization - # TODO: this should also compute the basic base_name/ext and collect size/dates + # TODO: this should also collect the basic size/dates try: codebase = Codebase( location=input, From dc1c99780c57238619eb1879bdf04e4727fb3eb5 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 1 Feb 2018 23:43:04 +0100 Subject: [PATCH 113/122] Add new simple splitext function working from a name * correct the base_name reported for weird names. Some failures and quirks still expected Signed-off-by: Philippe Ombredanne --- src/commoncode/fileutils.py | 47 +++++++++++++++++++ src/scancode/resource.py | 10 ++-- .../data/weird_file_name/expected-linux.json | 4 +- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index dea5e94cb19..5b6a738fa25 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -315,6 +315,53 @@ def file_extension(path, force_posix=False): return splitext(path, force_posix)[1] +def splitext_name(file_name, is_file=True): + """ + Return a tuple of Unicode strings (basename, extension) for a file name. The + basename is the file name minus its extension. Return an empty extension + string for a directory. Not the same as os.path.splitext_simple. + + For example: + >>> expected = 'path', '.ext' + >>> assert expected == splitext_simple('path.ext') + + Directories even with dotted names have no extension: + >>> expected = 'path.ext', '' + >>> assert expected == splitext_simple('path.ext', is_file=False) + + >>> expected = 'file', '.txt' + >>> assert expected == splitext_simple('file.txt') + + Composite extensions for tarballs are properly handled: + >>> expected = 'archive', '.tar.gz' + >>> assert expected == splitext_simple('archive.tar.gz') + + dotfile are properly handled: + >>> expected = '.dotfile', '' + >>> assert expected == splitext_simple('.dotfile') + >>> expected = '.dotfile', '.this' + >>> assert expected == splitext_simple('.dotfile.this') + """ + + if not file_name: + return '', '' + file_name = fsdecode(file_name) + + if not is_file: + return file_name, '' + + if file_name.startswith('.') and '.' not in file_name[1:]: + # .dot files base name is the full name and they do not have an extension + return file_name, '' + + base_name, extension = posixpath.splitext(file_name) + # handle composed extensions of tar.gz, bz, zx,etc + if base_name.endswith('.tar'): + base_name, extension2 = posixpath.splitext(base_name) + extension = extension2 + extension + return base_name, extension + +# TODO: FIXME: this is badly broken!!!! def splitext(path, force_posix=False): """ Return a tuple of strings (basename, extension) for a path. The basename is diff --git a/src/scancode/resource.py b/src/scancode/resource.py index db9f6b1aaa0..78dd86efc5f 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -59,7 +59,7 @@ from commoncode.fileutils import fsdecode from commoncode.fileutils import fsencode from commoncode.fileutils import parent_directory -from commoncode.fileutils import splitext +from commoncode.fileutils import splitext_name from commoncode import ignore from commoncode.system import on_linux @@ -712,16 +712,12 @@ def type(self): @property def base_name(self): - if not self.is_file: - return self.name - base_name, _extension = splitext(self.name) + base_name, _extension = splitext_name(self.name, is_file=self.is_file) return base_name @property def extension(self): - if not self.is_file: - return b'' if on_linux else '' - _base_name, extension = splitext(self.name) + _base_name, extension = splitext_name(self.name, is_file=self.is_file) return extension def _compute_children_counts(self, codebase, skip_filtered=False): diff --git a/tests/scancode/data/weird_file_name/expected-linux.json b/tests/scancode/data/weird_file_name/expected-linux.json index c1d6372274e..a799c2d6229 100644 --- a/tests/scancode/data/weird_file_name/expected-linux.json +++ b/tests/scancode/data/weird_file_name/expected-linux.json @@ -38,7 +38,7 @@ "path": "some /file", "type": "file", "name": "some \\file", - "base_name": "file", + "base_name": "some \\file", "extension": "", "size": 21, "date": "2016-12-21", @@ -113,7 +113,7 @@ "path": "some/\"file", "type": "file", "name": "some\\\"file", - "base_name": "\"file", + "base_name": "some\\\"file", "extension": "", "size": 21, "date": "2016-12-21", From fc2176a08ce53c14c8092e92e6062fe538b737ff Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 2 Feb 2018 07:16:36 +0100 Subject: [PATCH 114/122] Correct splitext_name function name in doctests Signed-off-by: Philippe Ombredanne --- src/commoncode/fileutils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commoncode/fileutils.py b/src/commoncode/fileutils.py index 5b6a738fa25..9f45aee8b4a 100644 --- a/src/commoncode/fileutils.py +++ b/src/commoncode/fileutils.py @@ -319,28 +319,28 @@ def splitext_name(file_name, is_file=True): """ Return a tuple of Unicode strings (basename, extension) for a file name. The basename is the file name minus its extension. Return an empty extension - string for a directory. Not the same as os.path.splitext_simple. + string for a directory. Not the same as os.path.splitext_name. For example: >>> expected = 'path', '.ext' - >>> assert expected == splitext_simple('path.ext') + >>> assert expected == splitext_name('path.ext') Directories even with dotted names have no extension: >>> expected = 'path.ext', '' - >>> assert expected == splitext_simple('path.ext', is_file=False) + >>> assert expected == splitext_name('path.ext', is_file=False) >>> expected = 'file', '.txt' - >>> assert expected == splitext_simple('file.txt') + >>> assert expected == splitext_name('file.txt') Composite extensions for tarballs are properly handled: >>> expected = 'archive', '.tar.gz' - >>> assert expected == splitext_simple('archive.tar.gz') + >>> assert expected == splitext_name('archive.tar.gz') dotfile are properly handled: >>> expected = '.dotfile', '' - >>> assert expected == splitext_simple('.dotfile') + >>> assert expected == splitext_name('.dotfile') >>> expected = '.dotfile', '.this' - >>> assert expected == splitext_simple('.dotfile.this') + >>> assert expected == splitext_name('.dotfile.this') """ if not file_name: From 8b4e46d96a08eb48faa03f50556c949f0d7cebc5 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Mon, 5 Feb 2018 16:12:45 +0100 Subject: [PATCH 115/122] Remove obsolete TODO Signed-off-by: Philippe Ombredanne --- src/scancode/plugin_mark_source.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scancode/plugin_mark_source.py b/src/scancode/plugin_mark_source.py index 2a9faf3e071..f1810793ea8 100644 --- a/src/scancode/plugin_mark_source.py +++ b/src/scancode/plugin_mark_source.py @@ -68,7 +68,6 @@ def process_codebase(self, codebase, mark_source, **kwargs): if not mark_source: return - # FIXME: TODO: these two nested walk() calls are not super efficient for resource in codebase.walk(topdown=False): if resource.is_file: continue From b8faffd42dec6fcd7b407b052ecb7bcdeeb6f73d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 12:19:39 +0100 Subject: [PATCH 116/122] Correct codebasse cache handling at boundaries * when using a mixed disk/memory caching things were not working Signed-off-by: Philippe Ombredanne --- src/scancode/resource.py | 170 ++++++++++++------ tests/scancode/data/resource/cache2/abc | 0 tests/scancode/data/resource/cache2/dir/that | 0 tests/scancode/data/resource/cache2/dir/this | 0 tests/scancode/data/resource/cache2/et131x.h | 47 +++++ .../data/resource/cache2/other dir/file | 0 tests/scancode/test_resource.py | 63 +++++-- ...nctools_lru_cache-1.4-py2.py3-none-any.whl | Bin 0 -> 5964 bytes .../prod/backports.functools_lru_cache.ABOUT | 11 ++ .../backports.functools_lru_cache.LICENSE | 18 ++ 10 files changed, 235 insertions(+), 74 deletions(-) create mode 100644 tests/scancode/data/resource/cache2/abc create mode 100644 tests/scancode/data/resource/cache2/dir/that create mode 100644 tests/scancode/data/resource/cache2/dir/this create mode 100644 tests/scancode/data/resource/cache2/et131x.h create mode 100644 tests/scancode/data/resource/cache2/other dir/file create mode 100644 thirdparty/prod/backports.functools_lru_cache-1.4-py2.py3-none-any.whl create mode 100644 thirdparty/prod/backports.functools_lru_cache.ABOUT create mode 100644 thirdparty/prod/backports.functools_lru_cache.LICENSE diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 78dd86efc5f..037815c9d89 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -147,7 +147,23 @@ def __init__(self, location, resource_class=None, no memory is used and 0 means unlimited memory is used. """ self.original_location = location + self.full_root = full_root + self.strip_root = strip_root + + # Resourse sub-class to use. Configured with plugin attributes attached. + self.resource_class = resource_class or Resource + + # dir used for caching and other temp files + self.temp_dir = temp_dir + # maximmum number of Resource objects kept in memory cached in this + # Codebase. When the number of in-memory Resources exceed this number, + # the next Resource instances are saved to disk instead and re-loaded + # from disk when used/needed. + self.max_in_memory = max_in_memory + + # setup location + ######################################################################## if on_linux: location = fsencode(location) else: @@ -159,41 +175,38 @@ def __init__(self, location, resource_class=None, # TODO: we should also accept to create "virtual" codebase without a # backing filesystem location assert exists(location) - # FIXME: what if is_special(location)??? self.location = location - self.is_file = filetype_is_file(location) - # True if this codebase root is a file or an empty directory. - self.has_single_resource = bool(self.is_file or not os.listdir(location)) - - self.resource_class = resource_class or Resource - - # maximmum number of Resource objects kept in memory cached in this - # Codebase. When the number of in-memory Resources exceed this number, - # the next Resource instances are saved to disk instead and re-loaded - # from disk when used/needed. - self.max_in_memory = max_in_memory - # use only memory - self.all_in_memory = max_in_memory == 0 - # use only disk - self.all_on_disk = max_in_memory == -1 + # setup Resources + ######################################################################## + # root resource, never cached on disk + self.root = None # set index of existing resource ids ints, initially allocated with # 10000 positions (this will grow as needed) self.resource_ids = intbitset(10000) - # root resource, never cached on disk - self.root = None + # True if this codebase root is a file or an empty directory. + self.has_single_resource = bool(self.is_file or not os.listdir(location)) + # setup caching + ######################################################################## # map of {rid: resource} for resources that are kept in memory self.resources = {} - - # list of errors from collecting the codebase details (such as - # unreadable file, etc). - self.errors = [] - + # use only memory + self.all_in_memory = max_in_memory == 0 + # use only disk + self.all_on_disk = max_in_memory == -1 + # dir where the on-disk cache is stored + self.cache_dir = None + if not self.all_in_memory: + # this is unique to this codebase instance + self.cache_dir = get_codebase_cache_dir(temp_dir=temp_dir) + + # setup extra misc attributes + ######################################################################## # mapping of scan summary data and statistics at the codebase level such # as ScanCode version, notice, command options, etc. # This is populated automatically. @@ -203,14 +216,12 @@ def __init__(self, location, resource_class=None, # This is populated automatically. self.timings = OrderedDict() - # setup cache - self.temp_dir = temp_dir - - # this is unique to this codebase instance - self.cache_dir = get_codebase_cache_dir(temp_dir=temp_dir) + # list of errors from collecting the codebase details (such as + # unreadable file, etc). + self.errors = [] - self.full_root = full_root - self.strip_root = strip_root + # finally walk the location and populate + ######################################################################## self._populate() def _get_next_rid(self): @@ -224,6 +235,8 @@ def _get_resource_cache_location(self, rid, create=False): Return the location where to get/put a Resource in the cache given a Resource `rid`. Create the directories if requested. """ + if not self.cache_dir: + return resid = (b'%08x'if on_linux else '%08x') % rid cache_sub_dir, cache_file_name = resid[-2:], resid parent = join(self.cache_dir, cache_sub_dir) @@ -254,6 +267,7 @@ def skip_ignored(_loc): ignored = partial(ignore.is_ignored, ignores=ignore.ignores_VCS) if TRACE_DEEP: + logger_debug() logger_debug('Codebase.populate: walk: ignored loc:', _loc, 'ignored:', ignored(_loc), 'is_special:', is_special(_loc)) @@ -320,7 +334,7 @@ def create_root_resource(self): path = get_path(location, location, full_root=self.full_root, strip_root=self.strip_root) if TRACE: - logger_debug('Codebase.create_resource: root:', path) + logger_debug(' Codebase.create_root_resource:', path) logger_debug() root = self.resource_class(name=name, location=location, path=path, @@ -343,7 +357,7 @@ def create_resource(self, name, parent, is_file=False): rid = self._get_next_rid() - if self._must_use_disk_cache(rid): + if self._use_disk_cache_for_resource(rid): cache_location = self._get_resource_cache_location(rid, create=True) else: cache_location = None @@ -351,9 +365,7 @@ def create_resource(self, name, parent, is_file=False): location = join(parent.location, name) path = posixpath.join(parent.path, fsdecode(name)) if TRACE: - logger_debug('Codebase.create_resource: non-root: parent.path', parent.path) - logger_debug('Codebase.create_resource: non-root: path', path) - logger_debug() + logger_debug(' Codebase.create_resource: parent.path:', parent.path, 'path:', path) child = self.resource_class( name=name, @@ -378,20 +390,38 @@ def exists(self, resource): """ return resource.rid in self.resource_ids - def _must_use_disk_cache(self, rid): + def _use_disk_cache_for_resource(self, rid): """ - Return True if Resource `rid` should be cached in on disk or False if it - should be cached in memory. + Return True if Resource `rid` should be cached on-disk or False if it + should be cached in-memory. """ + if TRACE: + msg = [' Codebase._use_disk_cache_for_resource:, rid:', rid, 'mode:'] + if rid == 0: + msg.append('root') + elif self.all_on_disk: + msg.append('all_on_disk') + elif self.all_in_memory: + msg.append('all_in_memory') + else: + msg.extend(['mixed:', 'self.max_in_memory:', self.max_in_memory]) + if rid < self.max_in_memory: + msg.append('from memory') + else: + msg.append('from disk') + logger_debug(*msg) + if rid == 0: return False - if self.all_on_disk: + elif self.all_on_disk: return True - if self.all_in_memory: + elif self.all_in_memory: return False # mixed case where some are in memory and some on disk - if rid < self.max_in_memory: + elif rid < self.max_in_memory: return False + else: + return True def _exists_in_memory(self, rid): """ @@ -404,30 +434,55 @@ def _exists_on_disk(self, rid): Return True if Resource `rid` exists in the codebase disk cache. """ cache_location = self._get_resource_cache_location(rid) - return exists(cache_location) + if cache_location: + return exists(cache_location) def get_resource(self, rid): """ Return the Resource with `rid` or None if it does not exists. """ - if rid == 0: - return self.root - - if not rid or rid not in self.resource_ids: - return - - if self.all_on_disk: - return self._load_resource(rid) + if TRACE: + msg = [' Codebase.get_resource:', 'rid:', rid] + if rid == 0: + msg.append('root') + elif not rid or rid not in self.resource_ids: + msg.append('not in resources!') + elif self._use_disk_cache_for_resource(rid): + msg.extend(['from disk', 'exists:', self._exists_on_disk(rid)]) + else: + msg.extend(['from memory', 'exists:', self._exists_in_memory(rid)]) + logger_debug(*msg) - if self.all_in_memory or rid < self.max_in_memory: - return self.resources.get(rid) + if rid == 0: + res = self.root + elif not rid or rid not in self.resource_ids: + res = None + if self._use_disk_cache_for_resource(rid): + res = self._load_resource(rid) + else: + res = self.resources.get(rid) - return self._load_resource(rid) + if TRACE: + logger_debug(' Resource:', res) + return res def save_resource(self, resource): """ Save the `resource` Resource to cache (in memory or disk). """ + if TRACE: + msg = [' Codebase.save_resource:', resource] + rid = resource.rid + if resource.is_root: + msg.append('root') + elif rid not in self.resource_ids: + msg.append('missing resource') + elif self._use_disk_cache_for_resource(rid): + msg.extend(['to disk:', 'exists:', self._exists_on_disk(rid)]) + else: + msg.extend(['to memory:', 'exists:', self._exists_in_memory(rid)]) + logger_debug(*msg) + if not resource: return @@ -436,10 +491,10 @@ def save_resource(self, resource): raise UnknownResource('Not part of codebase: %(resource)r' % resource) if resource.is_root: - # we dot nothing for the root at all - return + # this can possibly damage things badly + self.root = resource - if self._must_use_disk_cache(rid): + if self._use_disk_cache_for_resource(rid): self._dump_resource(resource) else: self.resources[rid] = resource @@ -465,6 +520,9 @@ def _load_resource(self, rid): """ cache_location = self._get_resource_cache_location(rid, create=False) + if TRACE: + logger_debug(' Codebase._load_resource: exists:', exists(cache_location), 'cache_location:', cache_location) + if not exists(cache_location): raise ResourceNotInCache( 'Failed to load Resource: %(rid)d from %(cache_location)r' % locals()) diff --git a/tests/scancode/data/resource/cache2/abc b/tests/scancode/data/resource/cache2/abc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/cache2/dir/that b/tests/scancode/data/resource/cache2/dir/that new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/cache2/dir/this b/tests/scancode/data/resource/cache2/dir/this new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/data/resource/cache2/et131x.h b/tests/scancode/data/resource/cache2/et131x.h new file mode 100644 index 00000000000..4ffb839292b --- /dev/null +++ b/tests/scancode/data/resource/cache2/et131x.h @@ -0,0 +1,47 @@ +/* Copyright © 2005 Agere Systems Inc. + * All rights reserved. + * http://www.agere.com + * + * SOFTWARE LICENSE + * + * This software is provided subject to the following terms and conditions, + * which you should read carefully before using the software. Using this + * software indicates your acceptance of these terms and conditions. If you do + * not agree with these terms and conditions, do not use the software. + * + * Copyright © 2005 Agere Systems Inc. + * All rights reserved. + * + * Redistribution and use in source or binary forms, with or without + * modifications, are permitted provided that the following conditions are met: + * + * . Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following Disclaimer as comments in the code as + * well as in the documentation and/or other materials provided with the + * distribution. + * + * . Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following Disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * . Neither the name of Agere Systems Inc. nor the names of the contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * Disclaimer + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY + * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN + * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + */ + diff --git a/tests/scancode/data/resource/cache2/other dir/file b/tests/scancode/data/resource/cache2/other dir/file new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/scancode/test_resource.py b/tests/scancode/test_resource.py index 7a472143845..f72a9ccd48f 100644 --- a/tests/scancode/test_resource.py +++ b/tests/scancode/test_resource.py @@ -413,8 +413,8 @@ def test_get_path(self): class TestCodebaseCache(FileBasedTesting): test_data_dir = join(dirname(__file__), 'data') - def test_codebase_cache_memory(self): - test_codebase = self.get_test_loc('resource/cache/package') + def test_codebase_cache_default(self): + test_codebase = self.get_test_loc('resource/cache2') codebase = Codebase(test_codebase) assert codebase.temp_dir assert codebase.cache_dir @@ -433,20 +433,47 @@ def test_codebase_cache_memory(self): child_2 = codebase.get_resource(child.rid) assert child == child_2 - def test_codebase_cache_disk(self): - test_codebase = self.get_test_loc('resource/cache/package') + def test_codebase_cache_all_in_memory(self): + test_codebase = self.get_test_loc('resource/cache2') + codebase = Codebase(test_codebase, max_in_memory=0) + for rid in codebase.resource_ids: + if rid == 0: + assert codebase.root == codebase.get_resource(rid) + assert codebase._exists_in_memory(rid) + assert not codebase._exists_on_disk(rid) + else: + assert codebase._exists_in_memory(rid) + assert not codebase._exists_on_disk(rid) + + assert len(codebase.resource_ids) == len(list(codebase.walk())) + + def test_codebase_cache_all_on_disk(self): + test_codebase = self.get_test_loc('resource/cache2') codebase = Codebase(test_codebase, max_in_memory=-1) - assert codebase.temp_dir - assert codebase.cache_dir - codebase.cache_dir - root = codebase.root - cp = codebase._get_resource_cache_location(root.rid, create=False) - assert not exists(cp) - cp = codebase._get_resource_cache_location(root.rid, create=True) - assert not exists(cp) - assert exists(parent_directory(cp)) - child = codebase.create_resource('child', root, is_file=True) - child.size = 12 - codebase.save_resource(child) - child_2 = codebase.get_resource(child.rid) - assert child == child_2 + for rid in codebase.resource_ids: + if rid == 0: + assert codebase.root == codebase.get_resource(rid) + assert codebase._exists_in_memory(rid) + assert not codebase._exists_on_disk(rid) + else: + assert not codebase._exists_in_memory(rid) + assert codebase._exists_on_disk(rid) + + assert len(codebase.resource_ids) == len(list(codebase.walk())) + + def test_codebase_cache_mixed_two_in_memory(self): + test_codebase = self.get_test_loc('resource/cache2') + codebase = Codebase(test_codebase, max_in_memory=2) + for rid in codebase.resource_ids: + if rid == 0: + assert codebase.root == codebase.get_resource(rid) + assert codebase._exists_in_memory(rid) + assert not codebase._exists_on_disk(rid) + elif rid < 2: + assert codebase._exists_in_memory(rid) + assert not codebase._exists_on_disk(rid) + else: + assert not codebase._exists_in_memory(rid) + assert codebase._exists_on_disk(rid) + + assert len(codebase.resource_ids) == len(list(codebase.walk())) \ No newline at end of file diff --git a/thirdparty/prod/backports.functools_lru_cache-1.4-py2.py3-none-any.whl b/thirdparty/prod/backports.functools_lru_cache-1.4-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..12e6f65d056bd770840b9e030a2602a738b21441 GIT binary patch literal 5964 zcmb7IbyQUS+8q?>?vl9M9hK5}B9#OF%d5*sDSnUeU@Yult&R!5OB6d;*)C&c1_6?{`jzLOU z6%Y`l;*sz$-~>_;0y3Z!9Xq-D0HE>@vNh6TGD>s+Ac+b9p#2A#xeMIH+0M?^$3H61-s-_;yt&mQB{EbNE}F@}7@3xZlq!OwVG4b1pld4& zq2Kf3sN5&AvkJ125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L*5wK zZuy&GlIbZFVGA%RtQ@;eqi$UgiEl9PfAt1q+T236MOXB;f@!Zr6w7=F$NK@TALa-dSPf=&- zA2Sk{VnM1p`R%0(75Ze`6p@Xc^ps9;!*EaLLcV0KdT1|b^opU>gCJ@Lg+zzi@~GV= z8Wx<>u&a-D^}S@7risw)X~<9Pe@e;pcq3K8ofToUa z&Ix(^9`JQZg?4e^;o%bn5PVURIUHFoQ~@F;2M0Q039yh+6p3F<>P#n^ zWGcQ_O@->A9EkfWf9B6Jw^Z?(*0G)J-XYYoU@4xp$(;YRcS)b!B&ty9s_ZC-Pp^5_ z{tl^itjp_D+gNj(QOdd6;SAsWWMH#OwWxW}?ze@Su(@wU8x`TpfOnl-@+FW1vf4LXvLB45n9lo)M^Tj}?O~&?AI(EG(G_L2VY@ z1~wfF(fIkp_L65AW`DJwzLDSpJa zcZ!Mhfau}>y-vLQ^Z#|_2K@E&AHDzka`8UI{UzbQ0RVv90N6hu{!6mGTN(Zx?Y|}C z-)P-;i^%^R=>K6r_j2-mqWkgdH_=zjKO_1_7`sn%-=%-kVBq{2%|AT*KFxin{!Ih> zLz;j2_I>#K*7_Ts68F#E;(v|yKEr(p`puw8@MjGF79 Date: Tue, 6 Feb 2018 12:57:52 +0100 Subject: [PATCH 117/122] Add convenience methods to Resource Signed-off-by: Philippe Ombredanne --- src/scancode/resource.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/scancode/resource.py b/src/scancode/resource.py index 037815c9d89..68be015faa9 100644 --- a/src/scancode/resource.py +++ b/src/scancode/resource.py @@ -551,7 +551,7 @@ def _remove_resource(self, resource): def remove_resource(self, resource): """ Remove the `resource` Resource object and all its children from the - resource tree. + resource tree. Return a set of removed Resource ids. """ if TRACE: logger_debug('Codebase.remove_resource') @@ -778,6 +778,35 @@ def extension(self): _base_name, extension = splitext_name(self.name, is_file=self.is_file) return extension + @classmethod + def get(cls, codebase, rid): + """ + Return the Resource with `rid` in `codebase` or None if it does not + exists. + """ + return codebase.get_resource(rid) + + def save(self, codebase): + """ + Save this resource in `codebase` (in memory or disk). + """ + return codebase.save_resource(self) + + def remove(self, codebase): + """ + Remove this resource and all its children from the codebase. + Return a set of removed Resource ids. + """ + return codebase.remove_resource(self) + + def create_child(self, codebase, name, is_file=False): + """ + Create and return a new child Resource of this resource in `codebase` + with `name`. `name` is always in native OS-preferred encoding (e.g. byte + on Linux, unicode elsewhere). + """ + return codebase.create_resource(name, self, is_file) + def _compute_children_counts(self, codebase, skip_filtered=False): """ Compute counts and update self with these counts from direct children. From 5c9f9631709fd749d5b27f57e51da722850b9fe7 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 12:58:20 +0100 Subject: [PATCH 118/122] Do not trace copyrights with nltk by default Signed-off-by: Philippe Ombredanne --- src/cluecode/copyrights.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluecode/copyrights.py b/src/cluecode/copyrights.py index 296ef0a4a68..a7bce5f9f99 100644 --- a/src/cluecode/copyrights.py +++ b/src/cluecode/copyrights.py @@ -1072,7 +1072,7 @@ def __init__(self): from nltk import RegexpTagger from nltk import RegexpParser self.tagger = RegexpTagger(patterns) - self.chunker = RegexpParser(grammar, trace=TRACE) + self.chunker = RegexpParser(grammar, trace=0) @classmethod def as_str(cls, node, ignores=()): From 439ad76654bc1b19b74105650b8ffbc42e93c346 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 14:35:40 +0100 Subject: [PATCH 119/122] Correct brokrn archives error reporting * somehow there were cases where handling errors Signed-off-by: Philippe Ombredanne --- src/extractcode/extract.py | 19 ++- src/extractcode/libarchive2.py | 115 +++++++++----- .../weird_names.ar_libarch_linux.expected | 39 ----- .../weird_names.ar_libarch_mac.expected | 39 ----- .../weird_names.ar_libarch_win.expected | 39 ----- tests/extractcode/test_archive.py | 148 +++++++++++------- tests/extractcode/test_tar.py | 2 +- 7 files changed, 181 insertions(+), 220 deletions(-) diff --git a/src/extractcode/extract.py b/src/extractcode/extract.py index 88ae9e5d57e..619a71ddb47 100644 --- a/src/extractcode/extract.py +++ b/src/extractcode/extract.py @@ -32,6 +32,7 @@ from os.path import abspath from os.path import expanduser from os.path import join +import traceback from commoncode import fileutils from commoncode import ignore @@ -164,7 +165,7 @@ def extract(location, kinds=extractcode.default_kinds, recurse=False): yield xevent -def extract_file(location, target, kinds=extractcode.default_kinds): +def extract_file(location, target, kinds=extractcode.default_kinds, verbose=False): """ Extract a single archive at `location` in the `target` directory if it is of a kind supported in the `kinds` kind tuple. @@ -179,17 +180,21 @@ def extract_file(location, target, kinds=extractcode.default_kinds): if extractor: yield ExtractEvent(location, target, done=False, warnings=[], errors=[]) try: - # extract first to a temp directory. - # if there is an error, the extracted files will not be moved - # to target + # extract first to a temp directory: if there is an error, the + # extracted files will not be moved to target tmp_tgt = fileutils.get_temp_dir(prefix='scancode-extract-') abs_location = abspath(expanduser(location)) - warnings.extend(extractor(abs_location, tmp_tgt)) + warns = extractor(abs_location, tmp_tgt) or [] + warnings.extend(warns) fileutils.copytree(tmp_tgt, target) fileutils.delete(tmp_tgt) except Exception, e: - if TRACE: - logger.debug('extract_file: ERROR: %(location)r: %(errors)r, %(e)r.\n' % locals()) errors = [str(e).strip(' \'"')] + if verbose: + errors.append(traceback.format_exc()) + if TRACE: + tb = traceback.format_exc() + logger.debug('extract_file: ERROR: %(location)r: %(errors)r\n%(e)r\n%(tb)s' % locals()) + finally: yield ExtractEvent(location, target, done=True, warnings=warnings, errors=errors) diff --git a/src/extractcode/libarchive2.py b/src/extractcode/libarchive2.py index 424b41315dc..aeb480fc7b4 100644 --- a/src/extractcode/libarchive2.py +++ b/src/extractcode/libarchive2.py @@ -138,17 +138,25 @@ def extract(location, target_dir): warnings = [] for entry in list_entries(abs_location): - if not (entry.isdir or entry.isfile): - # skip special files and links - continue - - _target_path = entry.write(abs_target_dir, transform_path=paths.safe_path) - if entry.warnings: - msgs = [w.strip('"\' ') for w in entry.warnings if w and w.strip('"\' ')] - msgs = msgs or ['No message provided'] - formatted = entry.path + ': ' + '\n'.join(msgs) - if formatted not in warnings: - warnings.append(formatted) + + if entry and entry.warnings: + if not entry.is_empty(): + entry_path = entry.path + msgs = ['%(entry_path)r: ' % locals()] + else: + msgs = ['No path available: '] + + msgs.extend([w.strip('"\' ') for w in entry.warnings if w and w.strip('"\' ')]) + msgs = '\n'.join(msgs) or 'No message provided' + + if msgs not in warnings: + warnings.append(msgs) + + if not entry.is_empty(): + if not (entry.isdir or entry.isfile): + # skip special files and links + continue + _target_path = entry.write(abs_target_dir, transform_path=paths.safe_path) return warnings @@ -228,23 +236,37 @@ def close(self): free_archive(self.archive_struct) self.archive_struct = None - def iter(self): + def iter(self, verbose=False): """ Yield Entry for this archive. """ assert self.archive_struct, 'Archive must be used as a context manager.' entry_struct = new_entry() try: - while 1: + while True: + entry = None + warnings = [] try: r = next_entry(self.archive_struct, entry_struct) if r == ARCHIVE_EOF: return - e = Entry(self, entry_struct) + entry = Entry(self, entry_struct) except ArchiveWarning, aw: - if aw.msg and aw.msg not in e.warnings: - e.warnings.append(aw.msg) - yield e + if not entry: + entry = Entry(self, entry_struct) + if aw.msg and aw.msg not in entry.warnings: + entry.warnings.append(aw.msg) + +# msg = 'WARNING: ' +# if aw.msg and aw.msg not in entry.warnings: +# msg += repr(aw.msg) + '\n' +# if verbose: +# msg += traceback.format_exc() +# warnings.append(msg % locals()) + finally: + if entry: + entry.warnings.extend(warnings) + yield entry finally: if entry_struct: free_entry(entry_struct) @@ -274,32 +296,55 @@ def __init__(self, archive, entry_struct): self.archive = archive self.entry_struct = entry_struct - self.filetype = entry_type(self.entry_struct) - self.isfile = self.filetype & AE_IFMT == AE_IFREG - self.isdir = self.filetype & AE_IFMT == AE_IFDIR - self.isblk = self.filetype & AE_IFMT == AE_IFBLK - self.ischr = self.filetype & AE_IFMT == AE_IFCHR - self.isfifo = self.filetype & AE_IFMT == AE_IFIFO - self.issock = self.filetype & AE_IFMT == AE_IFSOCK - self.isspecial = self.ischr or self.isblk or self.isfifo or self.issock + self.filetype = None + self.isfile = None + self.isdir = None + self.isblk = None + self.ischr = None + self.isfifo = None + self.issock = None + self.isspecial = None # bytes - self.size = entry_size(self.entry_struct) or 0 + self.size = None # sec since epoch - self.time = entry_time(self.entry_struct) or 0 + self.time = None # all paths are byte strings not unicode - self.path = self._path_bytes(entry_path, entry_path_w) - self.issym = self.filetype & AE_IFMT == AE_IFLNK - # FIXME: could there be cases with link path and symlink is False? - if self.issym: - self.symlink_path = self._path_bytes(symlink_path, symlink_path_w) - self.hardlink_path = self._path_bytes(hardlink_path, hardlink_path_w) - # hardlinks do not have a filetype: we test the path instead - self.islnk = bool(self.hardlink_path) + self.path = None + self.issym = None + self.symlink_path = None + + self.islnk = None + self.hardlink_path = None + + # list of strings self.warnings = [] + if self.entry_struct: + self.filetype = entry_type(self.entry_struct) + self.isfile = self.filetype & AE_IFMT == AE_IFREG + self.isdir = self.filetype & AE_IFMT == AE_IFDIR + self.isblk = self.filetype & AE_IFMT == AE_IFBLK + self.ischr = self.filetype & AE_IFMT == AE_IFCHR + self.isfifo = self.filetype & AE_IFMT == AE_IFIFO + self.issock = self.filetype & AE_IFMT == AE_IFSOCK + self.isspecial = self.ischr or self.isblk or self.isfifo or self.issock + self.size = entry_size(self.entry_struct) or 0 + self.time = entry_time(self.entry_struct) or 0 + self.path = self._path_bytes(entry_path, entry_path_w) + self.issym = self.filetype & AE_IFMT == AE_IFLNK + # FIXME: could there be cases with link path and symlink is False? + if self.issym: + self.symlink_path = self._path_bytes(symlink_path, symlink_path_w) + self.hardlink_path = self._path_bytes(hardlink_path, hardlink_path_w) + # hardlinks do not have a filetype: we test the path instead + self.islnk = bool(self.hardlink_path) + + def is_empty(self): + return not self.archive or not self.entry_struct + def _path_bytes(self, func, func_w): """ Return a path as a byte string converted to UTF-8-encoded bytes if this is diff --git a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_linux.expected b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_linux.expected index 8e2233ea35b..3e8da5fa945 100644 --- a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_linux.expected +++ b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_linux.expected @@ -3,38 +3,6 @@ "/COM2__1.txt", "/COM3_", "/COM3__1.txt", - "/COM3__10.txt", - "/COM3__11.txt", - "/COM3__12.txt", - "/COM3__13.txt", - "/COM3__14.txt", - "/COM3__15.txt", - "/COM3__16.txt", - "/COM3__17.txt", - "/COM3__18.txt", - "/COM3__19.txt", - "/COM3__2.txt", - "/COM3__20.txt", - "/COM3__21.txt", - "/COM3__22.txt", - "/COM3__23.txt", - "/COM3__24.txt", - "/COM3__25.txt", - "/COM3__26.txt", - "/COM3__27.txt", - "/COM3__28.txt", - "/COM3__29.txt", - "/COM3__3.txt", - "/COM3__30.txt", - "/COM3__31.txt", - "/COM3__32.txt", - "/COM3__33.txt", - "/COM3__4.txt", - "/COM3__5.txt", - "/COM3__6.txt", - "/COM3__7.txt", - "/COM3__8.txt", - "/COM3__9.txt", "/COM4_", "/COM5_", "/COM7_", @@ -78,13 +46,6 @@ "/com3_.txt", "/com4_.txt", "/com4__1", - "/com4__2", - "/com4__3", - "/com4__4", - "/com4__5", - "/com4__6", - "/com4__7", - "/com4__8", "/com5_.txt", "/com6_", "/com6_.txt", diff --git a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_mac.expected b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_mac.expected index 8e2233ea35b..3e8da5fa945 100644 --- a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_mac.expected +++ b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_mac.expected @@ -3,38 +3,6 @@ "/COM2__1.txt", "/COM3_", "/COM3__1.txt", - "/COM3__10.txt", - "/COM3__11.txt", - "/COM3__12.txt", - "/COM3__13.txt", - "/COM3__14.txt", - "/COM3__15.txt", - "/COM3__16.txt", - "/COM3__17.txt", - "/COM3__18.txt", - "/COM3__19.txt", - "/COM3__2.txt", - "/COM3__20.txt", - "/COM3__21.txt", - "/COM3__22.txt", - "/COM3__23.txt", - "/COM3__24.txt", - "/COM3__25.txt", - "/COM3__26.txt", - "/COM3__27.txt", - "/COM3__28.txt", - "/COM3__29.txt", - "/COM3__3.txt", - "/COM3__30.txt", - "/COM3__31.txt", - "/COM3__32.txt", - "/COM3__33.txt", - "/COM3__4.txt", - "/COM3__5.txt", - "/COM3__6.txt", - "/COM3__7.txt", - "/COM3__8.txt", - "/COM3__9.txt", "/COM4_", "/COM5_", "/COM7_", @@ -78,13 +46,6 @@ "/com3_.txt", "/com4_.txt", "/com4__1", - "/com4__2", - "/com4__3", - "/com4__4", - "/com4__5", - "/com4__6", - "/com4__7", - "/com4__8", "/com5_.txt", "/com6_", "/com6_.txt", diff --git a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_win.expected b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_win.expected index 8e2233ea35b..3e8da5fa945 100644 --- a/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_win.expected +++ b/tests/extractcode/data/archive/weird_names/weird_names.ar_libarch_win.expected @@ -3,38 +3,6 @@ "/COM2__1.txt", "/COM3_", "/COM3__1.txt", - "/COM3__10.txt", - "/COM3__11.txt", - "/COM3__12.txt", - "/COM3__13.txt", - "/COM3__14.txt", - "/COM3__15.txt", - "/COM3__16.txt", - "/COM3__17.txt", - "/COM3__18.txt", - "/COM3__19.txt", - "/COM3__2.txt", - "/COM3__20.txt", - "/COM3__21.txt", - "/COM3__22.txt", - "/COM3__23.txt", - "/COM3__24.txt", - "/COM3__25.txt", - "/COM3__26.txt", - "/COM3__27.txt", - "/COM3__28.txt", - "/COM3__29.txt", - "/COM3__3.txt", - "/COM3__30.txt", - "/COM3__31.txt", - "/COM3__32.txt", - "/COM3__33.txt", - "/COM3__4.txt", - "/COM3__5.txt", - "/COM3__6.txt", - "/COM3__7.txt", - "/COM3__8.txt", - "/COM3__9.txt", "/COM4_", "/COM5_", "/COM7_", @@ -78,13 +46,6 @@ "/com3_.txt", "/com4_.txt", "/com4__1", - "/com4__2", - "/com4__3", - "/com4__4", - "/com4__5", - "/com4__6", - "/com4__7", - "/com4__8", "/com5_.txt", "/com6_", "/com6_.txt", diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index bc9a4460f8a..1ba104e7a8a 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -1015,7 +1015,7 @@ def test_extract_python_testtar_tar_archive_with_special_files(self): # https://hg.python.org/cpython/raw-file/bff88c866886/Lib/test/testtar.tar test_dir = self.get_temp_dir() result = archive.extract_tar(test_file, test_dir) - expected_warnings = ["pax/regtype4: Pathname can't be converted from UTF-8 to current locale."] + expected_warnings = ["'pax/bad-pax-\\xe4\\xf6\\xfc': \nPathname can't be converted from UTF-8 to current locale."] assert sorted(expected_warnings) == sorted(result) expected = [ @@ -1032,12 +1032,12 @@ def test_extract_python_testtar_tar_archive_with_special_files(self): 'misc/regtype-suntar', 'misc/regtype-xstar', 'pax/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longname', + 'pax/bad-pax-aou', 'pax/hdrcharset-aou', 'pax/regtype1', 'pax/regtype2', 'pax/regtype3', 'pax/regtype4', - 'pax/regtype4_1', 'pax/umlauts-AOUaouss', 'ustar/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/1234567/longname', 'ustar/conttype', @@ -1046,6 +1046,8 @@ def test_extract_python_testtar_tar_archive_with_special_files(self): 'ustar/sparse', 'ustar/umlauts-AOUaouss' ] + if on_linux: + expected = [bytes(e) for e in expected] check_files(test_dir, expected) @@ -1118,23 +1120,9 @@ def test_extract_ar_broken(self): test_file = self.get_test_loc('archive/ar/liby-corrupted.a') test_dir = self.get_temp_dir() result = archive.extract_ar(test_file, test_dir) - expected = [ - '__.SYMDEF', - 'main.o', - 'main_1.o', - 'main_10.o', - 'main_11.o', - 'main_2.o', - 'main_3.o', - 'main_4.o', - 'main_5.o', - 'main_6.o', - 'main_7.o', - 'main_8.o', - 'main_9.o' - ] + expected = ['__.SYMDEF', 'main.o'] check_files(test_dir, expected) - assert ['main.o: Incorrect file header signature'] == result + assert ['None: \nIncorrect file header signature'] == result def test_extract_ar_with_invalid_path(self): test_file = self.get_test_loc('archive/ar/ar_invalidpath.ar') @@ -1161,12 +1149,12 @@ def test_extract_ar_with_relative_path_libarch(self): test_dir = self.get_temp_dir() result = archive.libarchive2.extract(test_file, test_dir) expected_warns = [ - '/: Invalid string table', - "/: Invalid string table\nCan't find long filename for entry" + "'//': \nInvalid string table", + "'/0': \nCan't find long filename for entry" ] assert expected_warns == result # inccorrect for now: need this: ['__.SYMDEF', 'release/init.obj'] - expected = ['dot', 'dot_1', 'dot_2', 'dot_3'] + expected = ['0', 'dot', 'dot_1', 'dot_2'] check_files(test_dir, expected) def test_extract_ar_with_relative_path_and_backslashes_in_names_libarch(self): @@ -1174,50 +1162,86 @@ def test_extract_ar_with_relative_path_and_backslashes_in_names_libarch(self): test_dir = self.get_temp_dir() result = archive.libarchive2.extract(test_file, test_dir) expected_warns = [ - '/: Invalid string table', - "/: Invalid string table\nCan't find long filename for entry" + u"'//': \nInvalid string table", + u"'/0': \nCan't find long filename for entry", + u"'/34': \nCan't find long filename for entry", + u"'/68': \nCan't find long filename for entry", + u"'/104': \nCan't find long filename for entry", + u"'/137': \nCan't find long filename for entry", + u"'/173': \nCan't find long filename for entry", + u"'/205': \nCan't find long filename for entry", + u"'/239': \nCan't find long filename for entry", + u"'/275': \nCan't find long filename for entry", + u"'/311': \nCan't find long filename for entry", + u"'/344': \nCan't find long filename for entry", + u"'/375': \nCan't find long filename for entry", + u"'/406': \nCan't find long filename for entry", + u"'/442': \nCan't find long filename for entry", + u"'/477': \nCan't find long filename for entry", + u"'/512': \nCan't find long filename for entry", + u"'/545': \nCan't find long filename for entry", + u"'/577': \nCan't find long filename for entry", + u"'/611': \nCan't find long filename for entry", + u"'/645': \nCan't find long filename for entry", + u"'/681': \nCan't find long filename for entry", + u"'/717': \nCan't find long filename for entry", + u"'/750': \nCan't find long filename for entry", + u"'/784': \nCan't find long filename for entry", + u"'/818': \nCan't find long filename for entry", + u"'/853': \nCan't find long filename for entry", + u"'/888': \nCan't find long filename for entry", + u"'/923': \nCan't find long filename for entry", + u"'/957': \nCan't find long filename for entry", + u"'/993': \nCan't find long filename for entry", + u"'/1027': \nCan't find long filename for entry", + u"'/1058': \nCan't find long filename for entry", + u"'/1089': \nCan't find long filename for entry" ] assert expected_warns == result # 7zip is better, but has a security bug for now + # GNU ar works fine otherwise, but there are portability issues expected = [ + '0', + '1027', + '104', + '1058', + '1089', + '137', + '173', + '205', + '239', + '275', + '311', + '34', + '344', + '375', + '406', + '442', + '477', + '512', + '545', + '577', + '611', + '645', + '68', + '681', + '717', + '750', + '784', + '818', + '853', + '888', + '923', + '957', + '993', 'dot', 'dot_1', - 'dot_10', - 'dot_11', - 'dot_12', - 'dot_13', - 'dot_14', - 'dot_15', - 'dot_16', - 'dot_17', - 'dot_18', - 'dot_19', - 'dot_2', - 'dot_20', - 'dot_21', - 'dot_22', - 'dot_23', - 'dot_24', - 'dot_25', - 'dot_26', - 'dot_27', - 'dot_28', - 'dot_29', - 'dot_3', - 'dot_30', - 'dot_31', - 'dot_32', - 'dot_33', - 'dot_34', - 'dot_35', - 'dot_4', - 'dot_5', - 'dot_6', - 'dot_7', - 'dot_8', - 'dot_9' + 'dot_2' ] + if on_linux: + expected = [bytes(e) for e in expected] + check_files(test_dir, expected) def test_extract_ar_with_relative_path_and_backslashes_in_names_7z(self): @@ -1333,8 +1357,12 @@ def test_extract_cpio_broken2(self): test_file = self.get_test_loc('archive/cpio/cpio_broken.cpio') test_dir = self.get_temp_dir() result = archive.extract_cpio(test_file, test_dir) - assert ['elfinfo-1.0.tar.gz', 'elfinfo-1_1.0.tar.gz'] == sorted(os.listdir(test_dir)) - assert ['elfinfo-1.0.tar.gz: Skipped 72 bytes before finding valid header'] == result + expected = sorted(['elfinfo-1.0.tar.gz', 'elfinfo.spec']) + if on_linux: + expected = [bytes(e) for e in expected] + + assert expected == sorted(os.listdir(test_dir)) + assert ["'elfinfo.spec': \nSkipped 72 bytes before finding valid header"] == result def test_extract_cpio_with_absolute_path(self): assert not os.path.exists('/tmp/subdir') @@ -2169,7 +2197,7 @@ def test_extract_7zip_with_weird_filenames_with_libarchive(self): def test_extract_ar_with_weird_filenames_with_libarchive(self): test_file = self.get_test_loc('archive/weird_names/weird_names.ar') - warns = ['COM3.txt: Incorrect file header signature', 'com4: Incorrect file header signature'] + warns = ['None: \nIncorrect file header signature'] self.check_extract(libarchive2.extract, test_file, expected_warnings=warns, expected_suffix='libarch') def test_extract_cpio_with_weird_filenames_with_libarchive(self): diff --git a/tests/extractcode/test_tar.py b/tests/extractcode/test_tar.py index c1a79d1e2e6..9bab4c43559 100644 --- a/tests/extractcode/test_tar.py +++ b/tests/extractcode/test_tar.py @@ -306,7 +306,7 @@ def test_extract_tar_archive_with_special_files(self): assert sorted(expected_warnings) == sorted(result) @skipIf(True, 'Unicode tar paths are not handled well yet: we use libarchive instead') - def test_extract_python_testtar_tar_archive_with_special_files(self): + def test_tar_extract_python_testtar_tar_archive_with_special_files(self): test_file = self.get_test_loc('archive/tar/testtar.tar') # this is from: # https://hg.python.org/cpython/raw-file/bff88c866886/Lib/test/testtar.tar From 141f445e39b609bcb4836807ce1b4044a3b9f568 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 15:40:26 +0100 Subject: [PATCH 120/122] Improve user feedback for missing plugins #787 * also ensure that the extractcode cli does not depend on scancode cli. Signed-off-by: Philippe Ombredanne --- src/plugincode/__init__.py | 13 +++++++--- src/scancode/__init__.py | 31 ++++++++++++++++++++++++ src/scancode/cli.py | 48 +++++++++++-------------------------- src/scancode/extract_cli.py | 4 ++-- 4 files changed, 57 insertions(+), 39 deletions(-) diff --git a/src/plugincode/__init__.py b/src/plugincode/__init__.py index f5757b6b81b..1ef5f285eb2 100644 --- a/src/plugincode/__init__.py +++ b/src/plugincode/__init__.py @@ -171,8 +171,12 @@ def load_plugins(cls): """ plugin_classes = [] plugin_options = [] - for _stage, manager in cls.managers.items(): - mplugin_classes, mplugin_options = manager.setup() + for stage, manager in cls.managers.items(): + mgr_setup = manager.setup() + if not mgr_setup: + msg = 'Cannot load ScanCode plugins for stage: %(stage)s' % locals() + raise Exception(msg) + mplugin_classes, mplugin_options = mgr_setup plugin_classes.extend(mplugin_classes) plugin_options.extend(mplugin_options) return plugin_classes, plugin_options @@ -191,7 +195,10 @@ def setup(self): return entrypoint = self.entrypoint - self.manager.load_setuptools_entrypoints(entrypoint) + try: + self.manager.load_setuptools_entrypoints(entrypoint) + except ImportError, e: + raise e stage = self.stage plugin_options = [] diff --git a/src/scancode/__init__.py b/src/scancode/__init__.py index a691742f4d1..8d96cabaa22 100644 --- a/src/scancode/__init__.py +++ b/src/scancode/__init__.py @@ -279,3 +279,34 @@ def convert(self, value, param, ctx): % (click.types.filename_to_ui(value), ), param, ctx) return click.File.convert(self, value, param, ctx) + + +info_text = ''' +ScanCode scans code and other files for origin and license. +Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +''' + +notice_path = join(abspath(dirname(__file__)), 'NOTICE') +notice_text = open(notice_path).read() + +delimiter = '\n\n\n' +[notice_text, extra_notice_text] = notice_text.split(delimiter, 1) +extra_notice_text = delimiter + extra_notice_text + +delimiter = '\n\n ' +[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1) +acknowledgment_text = delimiter + acknowledgment_text + +notice = acknowledgment_text.strip().replace(' ', '') + + +def print_about(ctx, param, value): + """ + Click callback to print a notice. + """ + if not value or ctx.resilient_parsing: + return + click.echo(info_text + notice_text + acknowledgment_text + extra_notice_text) + ctx.exit() + diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 9ddc6dd65aa..161f15f92cd 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -33,16 +33,12 @@ from collections import OrderedDict from functools import partial from itertools import imap -from os.path import abspath -from os.path import dirname -from os.path import join import sys from time import time import traceback import attr import click -from scancode.resource import Resource click.disable_unicode_literals_warning = True # import early @@ -74,12 +70,15 @@ from scancode import PRE_SCAN_GROUP from scancode import SCAN_GROUP from scancode import SCAN_OPTIONS_GROUP +from scancode import notice +from scancode import print_about from scancode import Scanner from scancode import validate_option_dependencies from scancode.interrupt import DEFAULT_TIMEOUT from scancode.interrupt import fake_interruptible from scancode.interrupt import interruptible from scancode.resource import Codebase +from scancode.resource import Resource from scancode.utils import BaseCommand from scancode.utils import path_progress_message from scancode.utils import progressmanager @@ -117,33 +116,6 @@ def logger_debug(*args): echo_stderr = partial(click.secho, err=True) -info_text = ''' -ScanCode scans code and other files for origin and license. -Visit https://github.com/nexB/scancode-toolkit/ for support and download. - -''' - -notice_path = join(abspath(dirname(__file__)), 'NOTICE') -notice_text = open(notice_path).read() - -delimiter = '\n\n\n' -[notice_text, extra_notice_text] = notice_text.split(delimiter, 1) -extra_notice_text = delimiter + extra_notice_text - -delimiter = '\n\n ' -[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1) -acknowledgment_text = delimiter + acknowledgment_text - -notice = acknowledgment_text.strip().replace(' ', '') - - -def print_about(ctx, param, value): - if not value or ctx.resilient_parsing: - return - click.echo(info_text + notice_text + acknowledgment_text + extra_notice_text) - ctx.exit() - - # FIXME: this should be pushed out in some external help or pushed down in plugins. # FIXME: the glob story is very weird!!! examples_text = ''' @@ -314,8 +286,17 @@ def format_options(self, ctx, formatter): formatter.write_dl(sorted_records) -# IMPORTANT: this discovers, loads and validates all available plugins -plugin_classes, plugin_options = PluginManager.load_plugins() +try: + # IMPORTANT: this discovers, loads and validates all available plugins + plugin_classes, plugin_options = PluginManager.load_plugins() +except ImportError, e: + echo_stderr('========================================================================') + echo_stderr('ERROR: Unable to import ScanCode plugins.'.upper()) + echo_stderr('Check your installation configuration (setup.py) or re-install/re-configure ScanCode.') + echo_stderr('The following plugin(s) are referenced and cannot be loaded/imported:') + echo_stderr(str(e), color='red') + echo_stderr('========================================================================') + raise e def print_plugins(ctx, param, value): @@ -478,7 +459,6 @@ def print_plugins(ctx, param, value): hidden=True, help='Run ScanCode in a special "test mode". Only for testing.', help_group=MISC_GROUP, sort_order=1000, cls=CommandLineOption) - def scancode(ctx, input, # NOQA strip_root, full_root, processes, timeout, diff --git a/src/scancode/extract_cli.py b/src/scancode/extract_cli.py index df4d12f1bbc..92887218e0e 100644 --- a/src/scancode/extract_cli.py +++ b/src/scancode/extract_cli.py @@ -36,9 +36,9 @@ from commoncode import filetype from commoncode.text import toascii -from scancode.api import extract_archives -from scancode.cli import print_about from scancode_config import __version__ +from scancode.api import extract_archives +from scancode import print_about from scancode import utils # Python 2 and 3 support From cf315642f11a152778eb4fe69667bebc67cc1406 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 16:21:33 +0100 Subject: [PATCH 121/122] Update test expectation for Windows Signed-off-by: Philippe Ombredanne --- tests/extractcode/test_archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index 1ba104e7a8a..b7bf3e83232 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -2259,7 +2259,7 @@ def test_extract_7zip_with_weird_filenames_with_libarchive(self): def test_extract_ar_with_weird_filenames_with_libarchive(self): test_file = self.get_test_loc('archive/weird_names/weird_names.ar') - warns = ['COM3.txt: Incorrect file header signature', 'com4: Incorrect file header signature'] + warns = [u'None: \nIncorrect file header signature'] self.check_extract(libarchive2.extract, test_file, expected_warnings=warns, expected_suffix='libarch') def test_extract_cpio_with_weird_filenames_with_libarchive(self): From 5784b20a5c4263a55b8efae0509767aca30caeea Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 6 Feb 2018 16:54:58 +0100 Subject: [PATCH 122/122] Update test expectation for macOS Signed-off-by: Philippe Ombredanne --- tests/extractcode/test_archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/extractcode/test_archive.py b/tests/extractcode/test_archive.py index b7bf3e83232..42b02f0dec4 100644 --- a/tests/extractcode/test_archive.py +++ b/tests/extractcode/test_archive.py @@ -2228,7 +2228,7 @@ def test_extract_7zip_with_weird_filenames_with_libarchive(self): def test_extract_ar_with_weird_filenames_with_libarchive(self): test_file = self.get_test_loc('archive/weird_names/weird_names.ar') - warns = ['COM3.txt: Incorrect file header signature', 'com4: Incorrect file header signature'] + warns = ['None: \nIncorrect file header signature'] self.check_extract(libarchive2.extract, test_file, expected_warnings=warns, expected_suffix='libarch') def test_extract_cpio_with_weird_filenames_with_libarchive(self):