Skip to content

Commit

Permalink
openssl: use atomic_write to install cert file
Browse files Browse the repository at this point in the history
  • Loading branch information
jacknagel committed Mar 26, 2014
1 parent d3333dc commit a326464
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Formula/openssl.rb
Expand Up @@ -59,9 +59,12 @@ def osx_cert_pem
end

def write_pem_file
system "security find-certificate -a -p /Library/Keychains/System.keychain > '#{osx_cert_pem}.tmp'"
system "security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> '#{osx_cert_pem}.tmp'"
system "mv", "-f", "#{osx_cert_pem}.tmp", osx_cert_pem
keychains = %w[
/Library/Keychains/System.keychain
/System/Library/Keychains/SystemRootCertificates.keychain
]

osx_cert_pem.atomic_write `security find-certificate -a -p #{keychains.join(" ")}`
end

def post_install
Expand Down

0 comments on commit a326464

Please sign in to comment.