aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2014-07-03 19:28:09 +0800
committerMike McQuaid2014-08-31 19:18:11 +0100
commitddf22735db7241f6388bd7048e4702e78eab66b2 (patch)
tree9df1e62584f09ce9716f6c1be14797c1b08ebbad /Library
parent369de0a05d50fafc9f0bf0d56b1521989970744f (diff)
downloadbrew-ddf22735db7241f6388bd7048e4702e78eab66b2.tar.bz2
plist_caveats: remove `launchctl list` as it requires sudo for root services
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/caveats.rb37
1 files changed, 17 insertions, 20 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index cd03952ee..1973dff42 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -104,33 +104,30 @@ class Caveats
else
s << " launchctl load #{plist_link}"
end
- if f.plist_manual
- s << "Or, if you don't want/need launchctl, you can just run:"
- s << " #{f.plist_manual}"
- end
- elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
- s << "To reload #{f.name} after an upgrade:"
+ else
if f.plist_startup
+ s << "To reload #{f.name} after an upgrade:"
s << " sudo launchctl unload #{plist_link}"
s << " sudo cp -fv #{f.opt_prefix}/*.plist #{destination}"
s << " sudo launchctl load #{plist_link}"
else
- s << " launchctl unload #{plist_link}"
- s << " launchctl load #{plist_link}"
- end
- else
- s << "To load #{f.name}:"
- if f.plist_startup
- s << " sudo launchctl load #{plist_link}"
- else
- s << " launchctl load #{plist_link}"
- end
- if f.plist_manual
- s << "Or, if you don't want/need launchctl, you can just run:"
- s << " #{f.plist_manual}"
+ if Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
+ s << "To reload #{f.name} after an upgrade:"
+ s << " launchctl unload #{plist_link}"
+ s << " launchctl load #{plist_link}"
+ else
+ s << "To load #{f.name}:"
+ s << " launchctl load #{plist_link}"
+ end
end
end
- s << '' << "WARNING: launchctl will fail when run under tmux." if ENV['TMUX']
+
+ if f.plist_manual
+ s << "Or, if you don't want/need launchctl, you can just run:"
+ s << " #{f.plist_manual}"
+ end
+
+ s << "" << "WARNING: launchctl will fail when run under tmux." if ENV['TMUX']
end
s.join("\n") unless s.empty?
end