Commit c13d32ae authored by Eloy Durán's avatar Eloy Durán

[Sandbox] Remove doc generation related rules and allow for more prefixes. (E.g. MacPorts.)

parent 625779ee
...@@ -35,17 +35,19 @@ require 'rbconfig' ...@@ -35,17 +35,19 @@ require 'rbconfig'
ruby_bin = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) ruby_bin = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
ruby_prefix = RbConfig::CONFIG['prefix'] ruby_prefix = RbConfig::CONFIG['prefix']
homebrew_prefix = `brew --prefix`.strip prefixes = ['/bin', '/usr/bin']
prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
developer_prefix = `xcode-select --print-path`.strip developer_prefix = `xcode-select --print-path`.strip
xcode_app_path = File.expand_path('../..', developer_prefix) xcode_app_path = File.expand_path('../..', developer_prefix)
require 'erb' require 'erb'
profile = ERB.new(DATA.read).result(TOPLEVEL_BINDING) profile = ERB.new(DATA.read, 0, '>').result(TOPLEVEL_BINDING)
puts profile puts profile
command = ['/usr/bin/sandbox-exec', '-p', profile, pod_bin, *ARGV] command = ['/usr/bin/sandbox-exec', '-p', profile, pod_bin, *ARGV]
puts command
exec *command exec *command
...@@ -65,19 +67,15 @@ __END__ ...@@ -65,19 +67,15 @@ __END__
; TODO make this stricter if possible ; TODO make this stricter if possible
(allow network-outbound) (allow network-outbound)
; TODO: Needed for appldoc to install a docset
; (allow appleevent-send)
(allow process-exec (allow process-exec
(regex (regex
#"^<%= pod_bin %>" #"^<%= pod_bin %>"
#"^<%= ruby_bin %>" #"^<%= ruby_bin %>"
#"^<%= homebrew_prefix %>"
#"^<%= File.join(developer_prefix, 'usr/bin/xcrun') %>" #"^<%= File.join(developer_prefix, 'usr/bin/xcrun') %>"
#"^<%= File.join(developer_prefix, 'usr/bin/xcodebuild') %>" #"^<%= File.join(developer_prefix, 'usr/bin/xcodebuild') %>"
#"^<%= File.join(developer_prefix, 'usr/bin/docsetutil') %>" ; Needed for appledoc <% prefixes.each do |prefix| %>
#"^/bin/*" #"^<%= prefix %>/*"
#"^/usr/bin/*" <% end %>
) )
) )
...@@ -96,7 +94,6 @@ __END__ ...@@ -96,7 +94,6 @@ __END__
#"^/usr/share/*" #"^/usr/share/*"
#"^/private/*" #"^/private/*"
#"^/dev/*" #"^/dev/*"
#"^<%= homebrew_prefix %>"
#"^<%= ruby_prefix %>" #"^<%= ruby_prefix %>"
#"^<%= pod_prefix %>" #"^<%= pod_prefix %>"
#"^<%= xcode_app_path %>" #"^<%= xcode_app_path %>"
...@@ -109,7 +106,6 @@ __END__ ...@@ -109,7 +106,6 @@ __END__
#"^<%= Pod::Config.instance.project_root %>" #"^<%= Pod::Config.instance.project_root %>"
#"^<%= Pod::Config.instance.repos_dir %>" #"^<%= Pod::Config.instance.repos_dir %>"
#"^/Users/[^.]+/Library/Caches/CocoaPods/*" #"^/Users/[^.]+/Library/Caches/CocoaPods/*"
#"^/Users/[^.]+/Library/Developer/Shared/Documentation/DocSets"
#"^/dev/dtracehelper" #"^/dev/dtracehelper"
#"^/dev/tty" #"^/dev/tty"
#"^/dev/null" #"^/dev/null"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment