Skip to content

Commit

Permalink
Removed several fields that is not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
another-rex committed Sep 30, 2024
1 parent ccda35c commit 116969b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions extractor/filesystem/language/cpp/conanlock/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ type conanReference struct {
TimeStamp string
}

// conanGraphNode contains a subset of a graph entry that includes inventory information
type conanGraphNode struct {
Pref string `json:"pref"`
Ref string `json:"ref"`
Options string `json:"options"`
PackageID string `json:"package_id"`
Prev string `json:"prev"`
Path string `json:"path"`
Context string `json:"context"`
Pref string `json:"pref"`
Ref string `json:"ref"`
Path string `json:"path"`
}

type conanGraphLock struct {
Expand All @@ -44,9 +41,7 @@ type conanGraphLock struct {
type conanLockFile struct {
Version string `json:"version"`
// conan v0.4- lockfiles use "graph_lock", "profile_host" and "profile_build"
GraphLock conanGraphLock `json:"graph_lock,omitempty"`
ProfileHost string `json:"profile_host,omitempty"`
ProfileBuild string `json:"profile_build,omitempty"`
GraphLock conanGraphLock `json:"graph_lock,omitempty"`
// conan v0.5+ lockfiles use "requires", "build_requires" and "python_requires"
Requires []string `json:"requires,omitempty"`
BuildRequires []string `json:"build_requires,omitempty"`
Expand Down Expand Up @@ -84,9 +79,9 @@ func parseConanRenference(ref string) conanReference {
parts = strings.SplitN(ref, "@", 2)
if len(parts) == 2 {
ref = parts[0]
UsernameChannel := parts[1]
usernameChannel := parts[1]

parts = strings.SplitN(UsernameChannel, "/", 2)
parts = strings.SplitN(usernameChannel, "/", 2)
reference.Username = parts[0]
if len(parts) == 2 {
reference.Channel = parts[1]
Expand Down Expand Up @@ -129,6 +124,7 @@ func parseConanV1Lock(lockfile conanLockFile) []*extractor.Inventory {
if reference.Name == "" {
continue
}

packages = append(packages, &extractor.Inventory{
Name: reference.Name,
Version: reference.Version,
Expand Down

0 comments on commit 116969b

Please sign in to comment.