Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tern parsing #54

Open
Tracked by #48
meretp opened this issue May 25, 2023 · 2 comments
Open
Tracked by #48

Tern parsing #54

meretp opened this issue May 25, 2023 · 2 comments

Comments

@meretp
Copy link
Contributor

meretp commented May 25, 2023

No description provided.

@abraemer
Copy link
Contributor

There is a private repo with a JS script that does this conversion:
https://github.com/opossum-tool/TERN-to-opossum-converter/blob/main/convertTern.js
Should be pretty straight-forward to translate.

@abraemer
Copy link
Contributor

abraemer commented Feb 5, 2025

https://github.com/tern-tools/tern

Format

Examples: https://github.com/tern-tools/tern/tree/main/docs/examples
JSON is default and has most information
Image -> [ImageLayer] -> [Package]
Image is a root. It can have multiple layers if things like OverlayFS are used (which we might be able to ignore...). The layer then contains packages and files. Packages also contain files.
A file has its full path and attached information.
In the example only the packages have license information but no files while all files have no information.
-> Need real-world example

Tooling

https://github.com/tern-tools/tern
There is a converter written in JS

Summary

Should be straight-forward. Just iterate all files (those directly in a Layer and those that are contained in the packages of the layers). See JS code for a possible mapping.
Maybe need a decision for handling the layers. If a file where to appear twice, then we could just merge the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants