From a3264642b56db2a18b966b12ce8b21806796df0d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 26 Mar 2014 16:24:20 -0500 Subject: [PATCH] openssl: use atomic_write to install cert file --- Formula/openssl.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Formula/openssl.rb b/Formula/openssl.rb index d53b8196b44..854be71cf81 100644 --- a/Formula/openssl.rb +++ b/Formula/openssl.rb @@ -59,9 +59,12 @@ class Openssl < Formula 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