cask/audit.rb: update signing checks for app, binary, and pkg
This commit is contained in:
parent
fcc190b5c6
commit
344a5021d8
@ -482,13 +482,25 @@ module Cask
|
|||||||
odebug "Auditing signing"
|
odebug "Auditing signing"
|
||||||
|
|
||||||
extract_artifacts do |artifacts, tmpdir|
|
extract_artifacts do |artifacts, tmpdir|
|
||||||
|
is_container = artifacts.any? { |a| a.is_a?(Artifact::App) || a.is_a?(Artifact::Pkg) }
|
||||||
|
|
||||||
artifacts.each do |artifact|
|
artifacts.each do |artifact|
|
||||||
|
next if artifact.is_a?(Artifact::Binary) && is_container == true
|
||||||
|
|
||||||
artifact_path = artifact.is_a?(Artifact::Pkg) ? artifact.path : artifact.source
|
artifact_path = artifact.is_a?(Artifact::Pkg) ? artifact.path : artifact.source
|
||||||
|
|
||||||
path = tmpdir/artifact_path.relative_path_from(cask.staged_path)
|
path = tmpdir/artifact_path.relative_path_from(cask.staged_path)
|
||||||
|
|
||||||
next unless path.exist?
|
result = case artifact
|
||||||
|
when Artifact::Pkg
|
||||||
result = system_command("spctl", args: ["--assess", "--type", "install", path], print_stderr: false)
|
system_command("spctl", args: ["--assess", "--type", "install", path], print_stderr: false)
|
||||||
|
when Artifact::App
|
||||||
|
system_command("spctl", args: ["--assess", "--type", "execute", path], print_stderr: false)
|
||||||
|
when Artifact::Binary
|
||||||
|
system_command("codesign", args: ["--verify", path], print_stderr: false)
|
||||||
|
else
|
||||||
|
add_error "Unknown artifact type: #{artifact.class}", location: cask.url.location
|
||||||
|
end
|
||||||
|
|
||||||
next if result.success?
|
next if result.success?
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ module UnpackStrategy
|
|||||||
|
|
||||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||||
def extract_to_dir(unpack_dir, basename:, verbose: false)
|
def extract_to_dir(unpack_dir, basename:, verbose: false)
|
||||||
FileUtils.cp path, unpack_dir/basename, preserve: true, verbose:
|
FileUtils.cp path, unpack_dir/basename.sub(/^[\da-f]{64}--/, ""), preserve: true, verbose:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user