Skip to content

Commit 9b3cf12

Browse files
Merge pull request #3894 from aboutcode-org/detect-go-binary-packages
Detect go binary packages
2 parents defe3a6 + 585a166 commit 9b3cf12

File tree

9 files changed

+1134
-2
lines changed

9 files changed

+1134
-2
lines changed

CHANGELOG.rst

+3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ v33.0.0 (next next, roadmap)
99
- OpenWRT packages.
1010
- Yocto/BitBake .bb recipes.
1111

12+
1213
- Fallback packages for non-native dependencies of SCTK.
1314
- Dependencies for
1415
- Support for copyright detection objects.
1516

17+
- We can now collect packages from a Go binary using go-inspector (Linux-only)
18+
1619
- A new field in packages with the license category for the
1720
detected license expression and also an API function to
1821
compute license categories from license expressions.

requirements-linux.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
packagedcode-msitools==0.101.210706
22
regipy==3.1.0
33
rpm-inspector-rpm==4.16.1.3.210404
4+
go-inspector==0.3.1

setup-mini.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ packages =
150150
rpm_inspector_rpm >= 4.16.1.3; platform_system == 'Linux'
151151
regipy >= 3.1.0; platform_system == 'Linux'
152152
packagedcode_msitools >= 0.101.210706; platform_system == 'Linux'
153+
go-inspector >= 0.3.1; platform_system == 'Linux'
153154

154155

155156
[options.entry_points]

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ packages =
150150
rpm_inspector_rpm >= 4.16.1.3; platform_system == 'Linux'
151151
regipy >= 3.1.0; platform_system == 'Linux'
152152
packagedcode_msitools >= 0.101.210706; platform_system == 'Linux'
153+
go-inspector >= 0.3.1; platform_system == 'Linux'
153154

154155

155156
[options.entry_points]

src/packagedcode/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@
247247
win_reg.InstalledProgramFromDockerUtilityvmSoftwareHandler,
248248
]
249249

250+
try:
251+
from go_inspector.binary import get_go_binary_handler
252+
APPLICATION_PACKAGE_DATAFILE_HANDLERS.append(get_go_binary_handler())
253+
except ImportError:
254+
pass
255+
250256
ALL_DATAFILE_HANDLERS = (
251257
APPLICATION_PACKAGE_DATAFILE_HANDLERS + [
252258
p for p in SYSTEM_PACKAGE_DATAFILE_HANDLERS

0 commit comments

Comments
 (0)