remove "package-of" relationship (in favor of "contains")

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-11-22 14:36:53 -05:00
parent d52894ce86
commit d20f1010db
3 changed files with 8 additions and 9 deletions
@@ -129,7 +129,7 @@ func toPackages(catalog *pkg.Catalog, relationships []artifact.Relationship) []m
func fileIDsForPackage(packageSpdxID string, relationships []artifact.Relationship) (fileIDs []string) {
for _, relationship := range relationships {
if relationship.Type != artifact.PackageOfRelationship {
if relationship.Type != artifact.ContainsRelationship {
continue
}
@@ -252,8 +252,8 @@ func toRelationships(relationships []artifact.Relationship) (result []model.Rela
func lookupRelationship(ty artifact.RelationshipType) (bool, model.RelationshipType, string) {
switch ty {
case artifact.PackageOfRelationship:
return true, model.PackageOfRelationship, ""
case artifact.ContainsRelationship:
return true, model.ContainsRelationship, ""
case artifact.OwnershipByFileOverlapRelationship:
return true, model.OtherRelationship, fmt.Sprintf("%s: indicates that the parent package claims ownership of a child package since the parent metadata indicates overlap with a location that a cataloger found the child package by", ty)
}