Loading tools/compliance/cmd/sbom/sbom.go +4 −4 Original line number Diff line number Diff line Loading @@ -343,9 +343,9 @@ func sbomGenerator(ctx *context, files ...string) ([]string, error) { if isMainPackage { mainPackage = getDocumentName(ctx, tn, pm) fmt.Fprintf(ctx.stdout, "SPDXVersion: SPDX-2.2\n") fmt.Fprintf(ctx.stdout, "DataLicense: CC-1.0\n") fmt.Fprintf(ctx.stdout, "DataLicense: CC0-1.0\n") fmt.Fprintf(ctx.stdout, "DocumentName: %s\n", mainPackage) fmt.Fprintf(ctx.stdout, "SPDXID: SPDXRef-DOCUMENT-%s\n", mainPackage) fmt.Fprintf(ctx.stdout, "SPDXID: SPDXRef-DOCUMENT\n") fmt.Fprintf(ctx.stdout, "DocumentNamespace: Android\n") fmt.Fprintf(ctx.stdout, "Creator: Organization: Google LLC\n") fmt.Fprintf(ctx.stdout, "Created: %s\n", ctx.creationTime().Format("2006-01-02T15:04:05Z")) Loading @@ -363,8 +363,8 @@ func sbomGenerator(ctx *context, files ...string) ([]string, error) { }() if len(path) == 0 { relationships = append(relationships, fmt.Sprintf("Relationship: SPDXRef-DOCUMENT-%s DESCRIBES SPDXRef-Package-%s", mainPackage, getPackageName(ctx, tn))) fmt.Sprintf("Relationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-Package-%s", getPackageName(ctx, tn))) } else { // Check parent and identify annotation parent := path[len(path)-1] Loading tools/compliance/cmd/sbom/sbom_test.go +54 −60 Original line number Diff line number Diff line Loading @@ -30,9 +30,9 @@ import ( var ( spdxVersionTag = regexp.MustCompile(`^\s*SPDXVersion: SPDX-2.2\s*$`) spdxDataLicenseTag = regexp.MustCompile(`^\s*DataLicense: CC-1.0\s*$`) spdxDataLicenseTag = regexp.MustCompile(`^\s*DataLicense: CC0-1.0\s*$`) spdxDocumentNameTag = regexp.MustCompile(`^\s*DocumentName:\s*Android*\s*$`) spdxIDTag = regexp.MustCompile(`^\s*SPDXID:\s*SPDXRef-DOCUMENT-(.*)\s*$`) spdxIDTag = regexp.MustCompile(`^\s*SPDXID:\s*SPDXRef-DOCUMENT\s*$`) spdxDocumentNameSpaceTag = regexp.MustCompile(`^\s*DocumentNamespace:\s*Android\s*$`) spdxCreatorOrganizationTag = regexp.MustCompile(`^\s*Creator:\s*Organization:\s*Google LLC\s*$`) spdxCreatedTimeTag = regexp.MustCompile(`^\s*Created: 1970-01-01T00:00:00Z\s*$`) Loading Loading @@ -76,7 +76,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -85,7 +85,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata-firstparty-highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata-firstparty-highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin1.meta_lic"}, packageName{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, Loading Loading @@ -148,7 +148,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -157,7 +157,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin3.meta_lic"}, packageName{"testdata/firstparty/bin/bin3.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin3.meta_lic"}, Loading Loading @@ -197,7 +197,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -206,7 +206,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin1.meta_lic"}, packageName{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, Loading Loading @@ -269,7 +269,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -278,7 +278,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/lib/liba.so.meta_lic"}, packageName{"testdata/firstparty/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/firstparty/lib/liba.so.meta_lic"}, Loading Loading @@ -311,7 +311,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -320,7 +320,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxExtractedText{"&&&First Party License&&&"}, Loading @@ -339,7 +339,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -348,7 +348,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin1.meta_lic"}, packageName{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, Loading Loading @@ -415,7 +415,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -424,7 +424,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin1.meta_lic"}, packageName{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, Loading Loading @@ -491,7 +491,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -500,7 +500,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata-notice-application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata-notice-application.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin3.meta_lic"}, packageName{"testdata/notice/bin/bin3.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin3.meta_lic"}, Loading Loading @@ -544,7 +544,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -553,7 +553,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/lib/liba.so.meta_lic"}, packageName{"testdata/notice/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/notice/lib/liba.so.meta_lic"}, Loading Loading @@ -590,7 +590,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -599,7 +599,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -618,7 +618,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -627,7 +627,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin1.meta_lic"}, packageName{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, Loading Loading @@ -698,7 +698,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -707,7 +707,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin1.meta_lic"}, packageName{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, Loading Loading @@ -778,7 +778,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -787,7 +787,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin3.meta_lic"}, packageName{"testdata/reciprocal/bin/bin3.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin3.meta_lic"}, Loading Loading @@ -835,7 +835,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -844,7 +844,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/lib/liba.so.meta_lic"}, packageName{"testdata/reciprocal/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/reciprocal/lib/liba.so.meta_lic"}, Loading Loading @@ -881,7 +881,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -890,7 +890,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -910,7 +910,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -919,7 +919,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/bin/bin1.meta_lic"}, packageName{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, Loading Loading @@ -995,7 +995,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1004,7 +1004,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/bin/bin1.meta_lic"}, packageName{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, Loading Loading @@ -1079,7 +1079,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1088,7 +1088,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/lib/liba.so.meta_lic"}, packageName{"testdata/restricted/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/restricted/lib/liba.so.meta_lic"}, Loading Loading @@ -1129,7 +1129,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1138,7 +1138,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -1157,7 +1157,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1166,7 +1166,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin1.meta_lic"}, packageName{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, Loading Loading @@ -1241,7 +1241,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1250,7 +1250,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin1.meta_lic"}, packageName{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, Loading Loading @@ -1325,7 +1325,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1334,7 +1334,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin3.meta_lic"}, packageName{"testdata/proprietary/bin/bin3.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin3.meta_lic"}, Loading Loading @@ -1382,7 +1382,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1391,7 +1391,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/lib/liba.so.meta_lic"}, packageName{"testdata/proprietary/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/proprietary/lib/liba.so.meta_lic"}, Loading Loading @@ -1428,7 +1428,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1437,7 +1437,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading Loading @@ -1541,20 +1541,14 @@ func (m packageName) String() string { return "PackageName: " + replaceSlashes(m.name) } type spdxID struct { name string } type spdxID struct {} func (m spdxID) isMatch(line string) bool { groups := spdxIDTag.FindStringSubmatch(line) if len(groups) != 2 { return false } return groups[1] == replaceSlashes(m.name) return spdxIDTag.MatchString(line) } func (m spdxID) String() string { return "SPDXID: SPDXRef-DOCUMENT-" + replaceSlashes(m.name) return "SPDXID: SPDXRef-DOCUMENT" } type spdxPkgID struct { Loading Loading @@ -1590,7 +1584,7 @@ func (m spdxDataLicense) isMatch(line string) bool { } func (m spdxDataLicense) String() string { return "DataLicense: CC-1.0" return "DataLicense: CC0-1.0" } type spdxDocumentName struct { Loading Loading
tools/compliance/cmd/sbom/sbom.go +4 −4 Original line number Diff line number Diff line Loading @@ -343,9 +343,9 @@ func sbomGenerator(ctx *context, files ...string) ([]string, error) { if isMainPackage { mainPackage = getDocumentName(ctx, tn, pm) fmt.Fprintf(ctx.stdout, "SPDXVersion: SPDX-2.2\n") fmt.Fprintf(ctx.stdout, "DataLicense: CC-1.0\n") fmt.Fprintf(ctx.stdout, "DataLicense: CC0-1.0\n") fmt.Fprintf(ctx.stdout, "DocumentName: %s\n", mainPackage) fmt.Fprintf(ctx.stdout, "SPDXID: SPDXRef-DOCUMENT-%s\n", mainPackage) fmt.Fprintf(ctx.stdout, "SPDXID: SPDXRef-DOCUMENT\n") fmt.Fprintf(ctx.stdout, "DocumentNamespace: Android\n") fmt.Fprintf(ctx.stdout, "Creator: Organization: Google LLC\n") fmt.Fprintf(ctx.stdout, "Created: %s\n", ctx.creationTime().Format("2006-01-02T15:04:05Z")) Loading @@ -363,8 +363,8 @@ func sbomGenerator(ctx *context, files ...string) ([]string, error) { }() if len(path) == 0 { relationships = append(relationships, fmt.Sprintf("Relationship: SPDXRef-DOCUMENT-%s DESCRIBES SPDXRef-Package-%s", mainPackage, getPackageName(ctx, tn))) fmt.Sprintf("Relationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-Package-%s", getPackageName(ctx, tn))) } else { // Check parent and identify annotation parent := path[len(path)-1] Loading
tools/compliance/cmd/sbom/sbom_test.go +54 −60 Original line number Diff line number Diff line Loading @@ -30,9 +30,9 @@ import ( var ( spdxVersionTag = regexp.MustCompile(`^\s*SPDXVersion: SPDX-2.2\s*$`) spdxDataLicenseTag = regexp.MustCompile(`^\s*DataLicense: CC-1.0\s*$`) spdxDataLicenseTag = regexp.MustCompile(`^\s*DataLicense: CC0-1.0\s*$`) spdxDocumentNameTag = regexp.MustCompile(`^\s*DocumentName:\s*Android*\s*$`) spdxIDTag = regexp.MustCompile(`^\s*SPDXID:\s*SPDXRef-DOCUMENT-(.*)\s*$`) spdxIDTag = regexp.MustCompile(`^\s*SPDXID:\s*SPDXRef-DOCUMENT\s*$`) spdxDocumentNameSpaceTag = regexp.MustCompile(`^\s*DocumentNamespace:\s*Android\s*$`) spdxCreatorOrganizationTag = regexp.MustCompile(`^\s*Creator:\s*Organization:\s*Google LLC\s*$`) spdxCreatedTimeTag = regexp.MustCompile(`^\s*Created: 1970-01-01T00:00:00Z\s*$`) Loading Loading @@ -76,7 +76,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -85,7 +85,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata-firstparty-highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata-firstparty-highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin1.meta_lic"}, packageName{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, Loading Loading @@ -148,7 +148,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -157,7 +157,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin3.meta_lic"}, packageName{"testdata/firstparty/bin/bin3.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin3.meta_lic"}, Loading Loading @@ -197,7 +197,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -206,7 +206,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/bin/bin1.meta_lic"}, packageName{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, Loading Loading @@ -269,7 +269,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -278,7 +278,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/firstparty/lib/liba.so.meta_lic"}, packageName{"testdata/firstparty/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/firstparty/lib/liba.so.meta_lic"}, Loading Loading @@ -311,7 +311,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -320,7 +320,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/firstparty/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/firstparty/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/firstparty/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxExtractedText{"&&&First Party License&&&"}, Loading @@ -339,7 +339,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -348,7 +348,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin1.meta_lic"}, packageName{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, Loading Loading @@ -415,7 +415,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -424,7 +424,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin1.meta_lic"}, packageName{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, Loading Loading @@ -491,7 +491,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -500,7 +500,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata-notice-application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata-notice-application.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/bin/bin3.meta_lic"}, packageName{"testdata/notice/bin/bin3.meta_lic"}, spdxPkgID{"testdata/notice/bin/bin3.meta_lic"}, Loading Loading @@ -544,7 +544,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -553,7 +553,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/notice/lib/liba.so.meta_lic"}, packageName{"testdata/notice/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/notice/lib/liba.so.meta_lic"}, Loading Loading @@ -590,7 +590,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -599,7 +599,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/notice/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/notice/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/notice/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -618,7 +618,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -627,7 +627,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin1.meta_lic"}, packageName{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, Loading Loading @@ -698,7 +698,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -707,7 +707,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin1.meta_lic"}, packageName{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, Loading Loading @@ -778,7 +778,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -787,7 +787,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/bin/bin3.meta_lic"}, packageName{"testdata/reciprocal/bin/bin3.meta_lic"}, spdxPkgID{"testdata/reciprocal/bin/bin3.meta_lic"}, Loading Loading @@ -835,7 +835,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -844,7 +844,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/reciprocal/lib/liba.so.meta_lic"}, packageName{"testdata/reciprocal/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/reciprocal/lib/liba.so.meta_lic"}, Loading Loading @@ -881,7 +881,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -890,7 +890,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/reciprocal/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/reciprocal/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/reciprocal/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -910,7 +910,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -919,7 +919,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/bin/bin1.meta_lic"}, packageName{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, Loading Loading @@ -995,7 +995,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1004,7 +1004,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/bin/bin1.meta_lic"}, packageName{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, Loading Loading @@ -1079,7 +1079,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1088,7 +1088,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/restricted/lib/liba.so.meta_lic"}, packageName{"testdata/restricted/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/restricted/lib/liba.so.meta_lic"}, Loading Loading @@ -1129,7 +1129,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1138,7 +1138,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/restricted/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/restricted/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/restricted/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading @@ -1157,7 +1157,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1166,7 +1166,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/highest.apex.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/highest.apex.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/highest.apex.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin1.meta_lic"}, packageName{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, Loading Loading @@ -1241,7 +1241,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1250,7 +1250,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/container.zip.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/container.zip.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/container.zip.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin1.meta_lic"}, packageName{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, Loading Loading @@ -1325,7 +1325,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1334,7 +1334,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/application.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/application.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/application.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/bin/bin3.meta_lic"}, packageName{"testdata/proprietary/bin/bin3.meta_lic"}, spdxPkgID{"testdata/proprietary/bin/bin3.meta_lic"}, Loading Loading @@ -1382,7 +1382,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1391,7 +1391,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/bin/bin1.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-firstparty-FIRST_PARTY_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/bin/bin1.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/bin/bin1.meta_lic", "DESCRIBES"}, packageTag{"testdata/proprietary/lib/liba.so.meta_lic"}, packageName{"testdata/proprietary/lib/liba.so.meta_lic"}, spdxPkgID{"testdata/proprietary/lib/liba.so.meta_lic"}, Loading Loading @@ -1428,7 +1428,7 @@ func Test(t *testing.T) { spdxVersion{}, spdxDataLicense{}, spdxDocumentName{"Android"}, spdxID{"Android"}, spdxID{}, spdxDocumentNameSpace{}, spdxCreatorOrganization{}, spdxCreatedTime{}, Loading @@ -1437,7 +1437,7 @@ func Test(t *testing.T) { spdxPkgID{"testdata/proprietary/lib/libd.so.meta_lic"}, spdxPkgDownloadLocation{"NOASSERTION"}, spdxPkgLicenseDeclared{"testdata-notice-NOTICE_LICENSE"}, spdxRelationship{"DOCUMENT-Android ", "testdata/proprietary/lib/libd.so.meta_lic", "DESCRIBES"}, spdxRelationship{"DOCUMENT ", "testdata/proprietary/lib/libd.so.meta_lic", "DESCRIBES"}, spdxLicense{}, spdxLicenseID{"testdata-notice-NOTICE_LICENSE"}, spdxExtractedText{"%%%Notice License%%%"}, Loading Loading @@ -1541,20 +1541,14 @@ func (m packageName) String() string { return "PackageName: " + replaceSlashes(m.name) } type spdxID struct { name string } type spdxID struct {} func (m spdxID) isMatch(line string) bool { groups := spdxIDTag.FindStringSubmatch(line) if len(groups) != 2 { return false } return groups[1] == replaceSlashes(m.name) return spdxIDTag.MatchString(line) } func (m spdxID) String() string { return "SPDXID: SPDXRef-DOCUMENT-" + replaceSlashes(m.name) return "SPDXID: SPDXRef-DOCUMENT" } type spdxPkgID struct { Loading Loading @@ -1590,7 +1584,7 @@ func (m spdxDataLicense) isMatch(line string) bool { } func (m spdxDataLicense) String() string { return "DataLicense: CC-1.0" return "DataLicense: CC0-1.0" } type spdxDocumentName struct { Loading