aboutsummaryrefslogtreecommitdiff
path: root/builder/builder2v2/build_package.go
diff options
context:
space:
mode:
Diffstat (limited to 'builder/builder2v2/build_package.go')
-rw-r--r--builder/builder2v2/build_package.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/builder/builder2v2/build_package.go b/builder/builder2v2/build_package.go
index 9c460da..7cccf63 100644
--- a/builder/builder2v2/build_package.go
+++ b/builder/builder2v2/build_package.go
@@ -4,11 +4,13 @@ package builder2v2
import (
"fmt"
- "github.com/spdx/tools-golang/spdx"
- "github.com/spdx/tools-golang/utils"
"path/filepath"
"regexp"
"runtime"
+
+ "github.com/spdx/tools-golang/spdx/common"
+ "github.com/spdx/tools-golang/spdx/v2_2"
+ "github.com/spdx/tools-golang/utils"
)
// BuildPackageSection2_2 creates an SPDX Package (version 2.2), returning
@@ -16,7 +18,7 @@ import (
// - packageName: name of package / directory
// - dirRoot: path to directory to be analyzed
// - pathsIgnore: slice of strings for filepaths to ignore
-func BuildPackageSection2_2(packageName string, dirRoot string, pathsIgnore []string) (*spdx.Package2_2, error) {
+func BuildPackageSection2_2(packageName string, dirRoot string, pathsIgnore []string) (*v2_2.Package, error) {
// build the file section first, so we'll have it available
// for calculating the package verification code
filepaths, err := utils.GetAllFilePaths(dirRoot, pathsIgnore)
@@ -35,7 +37,7 @@ func BuildPackageSection2_2(packageName string, dirRoot string, pathsIgnore []st
dirRootLen = len(dirRoot)
}
- files := []*spdx.File2_2{}
+ files := []*v2_2.File{}
fileNumber := 0
for _, fp := range filepaths {
newFilePatch := ""
@@ -59,9 +61,9 @@ func BuildPackageSection2_2(packageName string, dirRoot string, pathsIgnore []st
}
// now build the package section
- pkg := &spdx.Package2_2{
+ pkg := &v2_2.Package{
PackageName: packageName,
- PackageSPDXIdentifier: spdx.ElementID(fmt.Sprintf("Package-%s", packageName)),
+ PackageSPDXIdentifier: common.ElementID(fmt.Sprintf("Package-%s", packageName)),
PackageDownloadLocation: "NOASSERTION",
FilesAnalyzed: true,
IsFilesAnalyzedTagPresent: true,