Skip to content

Commit 674651f

Browse files
authored
Merge pull request #8 from nexB/rpm-4.16.1.3
Bump RPM to 4.16.1.3 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2 parents c3715c6 + a42c24f commit 674651f

53 files changed

Lines changed: 165 additions & 323 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

binary-analysis/scancode-compiledcode/src/cppincludes/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@
2222
# ScanCode is a free software code scanning tool from nexB Inc. and others.
2323
# Visit https://github.com/nexB/scancode-toolkit/ for support and download.
2424

25-
from __future__ import absolute_import
26-
from __future__ import unicode_literals
27-
2825
import re
29-
from collections import OrderedDict
3026
from functools import partial
3127
from itertools import chain
3228

@@ -45,7 +41,7 @@ class CPPIncludesScanner(ScanPlugin):
4541
"""
4642
Collect the #includes statements in a C/C++ file.
4743
"""
48-
resource_attributes = OrderedDict(
44+
resource_attributes = dict(
4945
cpp_includes=attr.ib(default=attr.Factory(list), repr=False),
5046
)
5147

binary-analysis/scancode-compiledcode/src/dwarf/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import os
2929

30-
from collections import OrderedDict
3130
from functools import partial
3231
from itertools import chain
3332

binary-analysis/scancode-compiledcode/src/dwarf/dwarf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from __future__ import absolute_import
3232
from __future__ import print_function
3333

34-
from collections import OrderedDict
3534
import posixpath
3635
import re
3736

@@ -141,7 +140,7 @@ def cleanup(self):
141140
if x not in self.original_source_files)
142141

143142
def asdict(self):
144-
return OrderedDict([
143+
return dict([
145144
('original_source_files', self.original_source_files),
146145
('included_source_files', self.included_source_files)
147146
])

binary-analysis/scancode-compiledcode/src/elf/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from __future__ import absolute_import
2626
from __future__ import unicode_literals
2727

28-
from collections import OrderedDict
2928
from functools import partial
3029
from itertools import chain
3130

@@ -46,7 +45,7 @@ class ELFScanner(ScanPlugin):
4645
"""
4746
Collect the names of shared objects/libraries needed by an Elf binary file.
4847
"""
49-
resource_attributes = OrderedDict(
48+
resource_attributes = dict(
5049
elf_needed_library=attr.ib(default=attr.Factory(list), repr=False),
5150
)
5251

binary-analysis/scancode-compiledcode/src/generatedcode/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from __future__ import unicode_literals
2727

2828

29-
from collections import OrderedDict
3029
from collections import namedtuple
3130
from functools import partial
3231
from itertools import chain
@@ -50,7 +49,7 @@ class GeneratedCodeScanner(ScanPlugin):
5049
"""
5150
Parse the snippet that is possibly generated code.
5251
"""
53-
resource_attributes = OrderedDict(
52+
resource_attributes = dict(
5453
generatedcode=attr.ib(default=attr.Factory(list), repr=False),
5554
)
5655

binary-analysis/scancode-compiledcode/src/gwt/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from __future__ import absolute_import
2626
from __future__ import unicode_literals
2727

28-
from collections import OrderedDict
2928
from collections import namedtuple
3029
from functools import partial
3130
from itertools import chain
@@ -48,7 +47,7 @@ class GWTScanner(ScanPlugin):
4847
symbols. Used to infer the relationship between the compiled JavaScript and
4948
the original Java Source code.
5049
"""
51-
resource_attributes = OrderedDict(
50+
resource_attributes = dict(
5251
gwt=attr.ib(default=attr.Factory(list), repr=False),
5352
)
5453

binary-analysis/scancode-compiledcode/src/javaclass/__init__.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
from __future__ import absolute_import
2626
from __future__ import unicode_literals
2727

28-
from StringIO import StringIO
28+
from io import StringIO
2929

30-
from collections import OrderedDict
3130
from functools import partial
3231
from itertools import chain
3332
from struct import unpack
@@ -36,11 +35,12 @@
3635

3736
import attr
3837

38+
from commoncode.cliutils import PluggableCommandLineOption as CommandLineOption
39+
from commoncode.cliutils import SCAN_GROUP
3940
from commoncode import fileutils
4041
from plugincode.scan import ScanPlugin
4142
from plugincode.scan import scan_impl
42-
from scancode import CommandLineOption
43-
from scancode import SCAN_GROUP
43+
4444
from typecode import contenttype
4545

4646
from sourcecode import kernel
@@ -54,8 +54,8 @@ class JavaClassScanner(ScanPlugin):
5454
"""
5555
Scan java class information from the resource.
5656
"""
57-
resource_attributes = OrderedDict(
58-
javaclass=attr.ib(default=attr.Factory(OrderedDict), repr=False),
57+
resource_attributes = dict(
58+
javaclass=attr.ib(default=attr.Factory(dict), repr=False),
5959
)
6060

6161
options = [
@@ -81,17 +81,17 @@ def scan_javaclass(location, **kwargs):
8181
if not T.is_java_class:
8282
return
8383

84-
javaclass_data = OrderedDict()
84+
javaclass_data = dict()
8585
SHOW_CONSTS = 1
8686
data = open(location, 'rb').read()
8787
f = StringIO(data)
8888
c = javaclass.Class(f)
89-
90-
javaclass_data['Version'] = 'Version: %i.%i (%s)' % ( c.version[1], c.version[0], getJavacVersion(c.version))
89+
90+
javaclass_data['Version'] = 'Version: %i.%i (%s)' % (c.version[1], c.version[0], getJavacVersion(c.version))
9191

9292
if SHOW_CONSTS:
9393
javaclass_data['Constants Pool'] = str(len(c.constants))
94-
constants = OrderedDict()
94+
constants = dict()
9595
for i in range(1, len(c.constants)):
9696
const = c.constants[i]
9797

@@ -100,7 +100,7 @@ def scan_javaclass(location, **kwargs):
100100
# double and long constants take 2 slots, we must skip the 'None' one
101101
if not const: continue
102102

103-
constant_data = OrderedDict()
103+
constant_data = dict()
104104
if const[0] == CONSTANT_Fieldref:
105105
constant_data['Field'] = str(c.constants[const[1]][1])
106106

@@ -111,40 +111,39 @@ def scan_javaclass(location, **kwargs):
111111
constant_data['InterfaceMethod'] = str(c.constants[const[1]][1])
112112

113113
elif const[0] == CONSTANT_String:
114-
constant_data['String'] = str(const[1])
114+
constant_data['String'] = str(const[1])
115115

116116
elif const[0] == CONSTANT_Float:
117-
constant_data['Float'] = str(const[1])
117+
constant_data['Float'] = str(const[1])
118118

119119
elif const[0] == CONSTANT_Integer:
120-
constant_data['Integer'] = str(const[1])
120+
constant_data['Integer'] = str(const[1])
121121

122122
elif const[0] == CONSTANT_Double:
123-
constant_data['Double'] = str(const[1])
123+
constant_data['Double'] = str(const[1])
124124

125125
elif const[0] == CONSTANT_Long:
126-
constant_data['Long'] = str(const[1])
126+
constant_data['Long'] = str(const[1])
127127

128128
# elif const[0] == CONSTANT_NameAndType:
129129
# print 'NameAndType\t\t FIXME!!!'
130130

131131
elif const[0] == CONSTANT_Utf8:
132-
constant_data['Utf8'] = str(const[1])
132+
constant_data['Utf8'] = str(const[1])
133133

134134
elif const[0] == CONSTANT_Class:
135-
constant_data['Class'] = str(c.constants[const[1]][1])
135+
constant_data['Class'] = str(c.constants[const[1]][1])
136136

137137
elif const[0] == CONSTANT_NameAndType:
138-
constant_data['NameAndType'] = str(const[1]) + ', ' + str(const[2])
138+
constant_data['NameAndType'] = str(const[1]) + ', ' + str(const[2])
139139
else:
140140
constant_data['Unknown(' + str(const[0]) + ')'] = str(const[1])
141-
141+
142142
constants[i] = constant_data
143-
144-
javaclass_data['Constants'] = constants
145143

144+
javaclass_data['Constants'] = constants
146145

147-
access =[]
146+
access = []
148147
if c.access & ACC_INTERFACE:
149148
access.append('Interface ')
150149
if c.access & ACC_SUPER_OR_SYNCHRONIZED:
@@ -173,7 +172,7 @@ def scan_javaclass(location, **kwargs):
173172
interfaces.append(str(inter))
174173
if interfaces:
175174
javaclass_data['Interfaces'] = interfaces
176-
177-
return OrderedDict(
175+
176+
return dict(
178177
javaclass=javaclass_data,
179178
)

0 commit comments

Comments
 (0)