aboutsummaryrefslogtreecommitdiff
path: root/spdx
diff options
context:
space:
mode:
authorSteve Winslow <steve@swinslow.net>2020-05-09 18:24:20 -0400
committerSteve Winslow <steve@swinslow.net>2020-05-09 18:24:20 -0400
commit1500a6e983917e450f8da95b86418d8db3af926f (patch)
treed10dd12102f2f11e115b726865fda86ea27982e0 /spdx
parent4a8bcf1883c3547f2efb6af5a2f002293117c45b (diff)
downloadspdx-tools-1500a6e983917e450f8da95b86418d8db3af926f.tar.gz
Refactor parser to handle element ID maps
Signed-off-by: Steve Winslow <steve@swinslow.net>
Diffstat (limited to 'spdx')
-rw-r--r--spdx/document.go11
-rw-r--r--spdx/file.go6
-rw-r--r--spdx/package.go5
3 files changed, 10 insertions, 12 deletions
diff --git a/spdx/document.go b/spdx/document.go
index d2e9e13..2541ec4 100644
--- a/spdx/document.go
+++ b/spdx/document.go
@@ -6,11 +6,12 @@ package spdx
// Document2_1 is an SPDX Document for version 2.1 of the spec.
// See https://spdx.org/sites/cpstandard/files/pages/files/spdxversion2.1.pdf
type Document2_1 struct {
- CreationInfo *CreationInfo2_1
- Packages map[ElementID]*Package2_1
- OtherLicenses []*OtherLicense2_1
- Relationships []*Relationship2_1
- Annotations []*Annotation2_1
+ CreationInfo *CreationInfo2_1
+ Packages map[ElementID]*Package2_1
+ UnpackagedFiles map[ElementID]*File2_1
+ OtherLicenses []*OtherLicense2_1
+ Relationships []*Relationship2_1
+ Annotations []*Annotation2_1
// DEPRECATED in version 2.0 of spec
Reviews []*Review2_1
diff --git a/spdx/file.go b/spdx/file.go
index 91e40d1..f7c1b42 100644
--- a/spdx/file.go
+++ b/spdx/file.go
@@ -62,8 +62,10 @@ type File2_1 struct {
FileDependencies []string
// Snippets contained in this File
- // Note that Snippets could be defined in a different Document!
- Snippets map[DocElementID]*Snippet2_1
+ // Note that Snippets could be defined in a different Document! However,
+ // the only ones that _THIS_ document can contain are this ones that are
+ // defined here -- so this should just be an ElementID.
+ Snippets map[ElementID]*Snippet2_1
}
// ArtifactOfProject2_1 is a DEPRECATED collection of data regarding
diff --git a/spdx/package.go b/spdx/package.go
index 989e2de..40d0c3c 100644
--- a/spdx/package.go
+++ b/spdx/package.go
@@ -5,11 +5,6 @@ package spdx
// Package2_1 is a Package section of an SPDX Document for version 2.1 of the spec.
type Package2_1 struct {
- // NOT PART OF SPEC
- // flag: does this "package" contain files that were in fact "unpackaged",
- // e.g. included directly in the Document without being in a Package?
- IsUnpackaged bool
-
// 3.1: Package Name
// Cardinality: mandatory, one
PackageName string