MCPcopy Index your code
hub / github.com/jetify-com/devbox / Equals

Method Equals

internal/devpkg/package.go:477–496  ·  view source on GitHub ↗

Equals compares two Packages. This may be an expensive operation since it may have to normalize a Package's attribute path, which may require a network call.

(other *Package)

Source from the content-addressed store, hash-verified

475// may have to normalize a Package's attribute path, which may require a network
476// call.
477func (p *Package) Equals(other *Package) bool {
478 if p.Raw == other.Raw || p.installable == other.installable {
479 return true
480 }
481
482 // check inputs without fragments as optimization. Next step is expensive
483 if p.URLForFlakeInput() != other.URLForFlakeInput() {
484 return false
485 }
486
487 name, err := p.NormalizedPackageAttributePath()
488 if err != nil {
489 return false
490 }
491 otherName, err := other.NormalizedPackageAttributePath()
492 if err != nil {
493 return false
494 }
495 return name == otherName
496}
497
498// CanonicalName returns the name of the package without the version
499// it only applies to devbox packages

Callers 2

MatchesMethod · 0.45

Calls 2

URLForFlakeInputMethod · 0.95

Tested by

no test coverage detected