mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
remove "package-of" relationship (in favor of "contains")
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
d52894ce86
commit
d20f1010db
@ -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)
|
||||
}
|
||||
|
||||
@ -7,9 +7,8 @@ const (
|
||||
// has been completed.
|
||||
OwnershipByFileOverlapRelationship RelationshipType = "ownership-by-file-overlap"
|
||||
|
||||
// PackageOfRelationship (supports any-to-package linkages) is a proxy for the SPDX 2.2 PACKAGE_OF
|
||||
// relationship which is defined as: "to be used when artifact X is used as a package as part of package Y"
|
||||
PackageOfRelationship RelationshipType = "package-of"
|
||||
// ContainsRelationship (supports any-to-any linkages) is a proxy for the SPDX 2.2 CONTAINS relationship.
|
||||
ContainsRelationship RelationshipType = "contains"
|
||||
)
|
||||
|
||||
type RelationshipType string
|
||||
|
||||
@ -119,9 +119,9 @@ func packageFileOwnershipRelationships(p pkg.Package, resolver source.FilePathRe
|
||||
|
||||
for _, l := range locations {
|
||||
relationships = append(relationships, artifact.Relationship{
|
||||
From: l.Coordinates,
|
||||
To: p,
|
||||
Type: artifact.PackageOfRelationship,
|
||||
From: p,
|
||||
To: l.Coordinates,
|
||||
Type: artifact.ContainsRelationship,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user