dependency: consider bounds when comparing macOS deps

This commit is contained in:
Eric Knibbe 2023-08-28 17:33:01 -04:00
parent 1d136be229
commit df38dcc3d1
No known key found for this signature in database
GPG Key ID: 179D9CDDDB814168
2 changed files with 8 additions and 2 deletions

View File

@ -231,6 +231,14 @@ class UsesFromMacOSDependency < Dependency
@bounds = bounds @bounds = bounds
end end
def ==(other)
instance_of?(other.class) && name == other.name && tags == other.tags && bounds == other.bounds
end
def hash
[name, tags, bounds].hash
end
def installed? def installed?
use_macos_install? || super use_macos_install? || super
end end

View File

@ -65,8 +65,6 @@ class DependencyCollector
def cache_key(spec) def cache_key(spec)
if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy
File.extname(spec.url) File.extname(spec.url)
elsif spec.is_a?(UsesFromMacOSDependency)
"#{spec.name}-#{spec.bounds}"
else else
spec spec
end end