Teach audit about new patches implementation
This commit is contained in:
parent
86cdd812a2
commit
4f051abc3e
@ -292,19 +292,24 @@ class FormulaAuditor
|
|||||||
"#{name} resource #{resource.name.inspect}: #{problem}"
|
"#{name} resource #{resource.name.inspect}: #{problem}"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
spec.patches.select(&:external?).each { |p| audit_patch(p) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def audit_patches
|
def audit_patches
|
||||||
Patches.new(f.patches).select(&:external?).each do |p|
|
patches = Patch.normalize_legacy_patches(f.patches)
|
||||||
case p.url
|
patches.grep(LegacyPatch).each { |p| audit_patch(p) }
|
||||||
when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$]
|
end
|
||||||
unless p.url =~ /[a-fA-F0-9]{40}/
|
|
||||||
problem "GitHub/Gist patches should specify a revision:\n#{p.url}"
|
def audit_patch(patch)
|
||||||
end
|
case patch.url
|
||||||
when %r[macports/trunk]
|
when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$]
|
||||||
problem "MacPorts patches should specify a revision instead of trunk:\n#{p.url}"
|
unless patch.url =~ /[a-fA-F0-9]{40}/
|
||||||
|
problem "GitHub/Gist patches should specify a revision:\n#{patch.url}"
|
||||||
end
|
end
|
||||||
|
when %r[macports/trunk]
|
||||||
|
problem "MacPorts patches should specify a revision instead of trunk:\n#{patch.url}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class ExternalPatch < Patch
|
|||||||
attr_reader :resource, :strip
|
attr_reader :resource, :strip
|
||||||
|
|
||||||
def_delegators :@resource, :fetch, :verify_download_integrity,
|
def_delegators :@resource, :fetch, :verify_download_integrity,
|
||||||
:cached_download, :clear_cache
|
:cached_download, :clear_cache, :url
|
||||||
|
|
||||||
def initialize(strip, &block)
|
def initialize(strip, &block)
|
||||||
@strip = strip
|
@strip = strip
|
||||||
@ -94,10 +94,6 @@ class ExternalPatch < Patch
|
|||||||
@whence = :resource
|
@whence = :resource
|
||||||
end
|
end
|
||||||
|
|
||||||
def url
|
|
||||||
resource.url
|
|
||||||
end
|
|
||||||
|
|
||||||
def owner= owner
|
def owner= owner
|
||||||
resource.owner = owner
|
resource.owner = owner
|
||||||
resource.name = "patch-#{resource.checksum}"
|
resource.name = "patch-#{resource.checksum}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user