From d290839a9d9c8bb9992f71bcc1d1f564e1854e9d Mon Sep 17 00:00:00 2001 From: commitay Date: Sun, 22 Oct 2017 18:40:36 +1000 Subject: [PATCH] Update 4 adobe cs6 Casks: preflight / uninstall_preflight (#4643) * adobe-cs6-design-standard * adobe-cs6-design-web-premium * adobe-cs6-master-collection * adobe-cs6-production-premium --- Casks/adobe-cs6-design-standard.rb | 16 ++++++++++++---- Casks/adobe-cs6-design-web-premium.rb | 16 ++++++++++++---- Casks/adobe-cs6-master-collection.rb | 16 ++++++++++++---- Casks/adobe-cs6-production-premium.rb | 16 ++++++++++++---- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/Casks/adobe-cs6-design-standard.rb b/Casks/adobe-cs6-design-standard.rb index 400353a03..87b73b682 100644 --- a/Casks/adobe-cs6-design-standard.rb +++ b/Casks/adobe-cs6-design-standard.rb @@ -19,6 +19,12 @@ cask 'adobe-cs6-design-standard' do # and https://github.com/caskroom/homebrew-versions/pull/296 preflight do + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + language = case MacOS.language when %r{^de} then 'de_DE' when 'en-GB' then 'en_GB' @@ -31,8 +37,6 @@ cask 'adobe-cs6-design-standard' do 'en_US' end - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] system_command "#{staged_path}/Adobe CS6 Design Standard/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/Adobe CS6 Design Standard/deploy/install-#{language}.xml" @@ -43,8 +47,12 @@ cask 'adobe-cs6-design-standard' do end uninstall_preflight do - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + system_command "#{staged_path}/Adobe CS6 Design Standard/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" diff --git a/Casks/adobe-cs6-design-web-premium.rb b/Casks/adobe-cs6-design-web-premium.rb index 0185446b9..be557e611 100644 --- a/Casks/adobe-cs6-design-web-premium.rb +++ b/Casks/adobe-cs6-design-web-premium.rb @@ -19,6 +19,12 @@ cask 'adobe-cs6-design-web-premium' do # and https://github.com/caskroom/homebrew-versions/pull/296 preflight do + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + language = case MacOS.language when %r{^de} then 'de_DE' when 'en-GB' then 'en_GB' @@ -31,8 +37,6 @@ cask 'adobe-cs6-design-web-premium' do 'en_US' end - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] system_command "#{staged_path}/Adobe CS6 Design and Web Premium/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/Adobe CS6 Design and Web Premium/deploy/install-#{language}.xml" @@ -43,8 +47,12 @@ cask 'adobe-cs6-design-web-premium' do end uninstall_preflight do - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + system_command "#{staged_path}/Adobe CS6 Design and Web Premium/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" diff --git a/Casks/adobe-cs6-master-collection.rb b/Casks/adobe-cs6-master-collection.rb index f60c21a94..63165b658 100644 --- a/Casks/adobe-cs6-master-collection.rb +++ b/Casks/adobe-cs6-master-collection.rb @@ -19,6 +19,12 @@ cask 'adobe-cs6-master-collection' do # and https://github.com/caskroom/homebrew-versions/pull/296 preflight do + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + language = case MacOS.language when %r{^de} then 'de_DE' when 'en-GB' then 'en_GB' @@ -31,8 +37,6 @@ cask 'adobe-cs6-master-collection' do 'en_US' end - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] system_command "#{staged_path}/Adobe CS6 Master Collection/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/Adobe CS6 Master Collection/deploy/install-#{language}.xml" @@ -43,8 +47,12 @@ cask 'adobe-cs6-master-collection' do end uninstall_preflight do - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + system_command "#{staged_path}/Adobe CS6 Master Collection/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/Adobe CS6 Master Collection/deploy/uninstall-en_US.xml" diff --git a/Casks/adobe-cs6-production-premium.rb b/Casks/adobe-cs6-production-premium.rb index d9b7d82f2..34f6facff 100644 --- a/Casks/adobe-cs6-production-premium.rb +++ b/Casks/adobe-cs6-production-premium.rb @@ -19,6 +19,12 @@ cask 'adobe-cs6-production-premium' do # and https://github.com/caskroom/homebrew-versions/pull/296 preflight do + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + language = case MacOS.language when %r{^de} then 'de_DE' when 'en-GB' then 'en_GB' @@ -31,8 +37,6 @@ cask 'adobe-cs6-production-premium' do 'en_US' end - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] system_command "#{staged_path}/Adobe CS6 Production Premium/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/Adobe CS6 Production Premium/deploy/install-#{language}.xml" @@ -43,8 +47,12 @@ cask 'adobe-cs6-production-premium' do end uninstall_preflight do - system_command '/usr/bin/killall', - args: ['-kill', 'SafariNotificationAgent'] + processes = system_command '/bin/launchctl', args: ['list'] + + if processes.stdout.lines.any? { |line| line =~ %r{^\d+\t\d\tcom.apple.SafariNotificationAgent$} } + system_command '/usr/bin/killall', args: ['-kill', 'SafariNotificationAgent'] + end + system_command "#{staged_path}/Adobe CS6 Production Premium/Install.app/Contents/MacOS/Install", args: [ '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml"