bew install --interactive now works
Also mkpath only in normal install route, thus we don't "create" a keg when exiting --interactive
This commit is contained in:
parent
bcc7c19e85
commit
67d418f71d
12
bin/brew
12
bin/brew
@ -232,16 +232,22 @@ begin
|
|||||||
o=__obj(name)
|
o=__obj(name)
|
||||||
begin
|
begin
|
||||||
raise "#{o.prefix} already exists!" if o.prefix.exist?
|
raise "#{o.prefix} already exists!" if o.prefix.exist?
|
||||||
o.prefix.mkpath
|
|
||||||
o.brew do
|
o.brew do
|
||||||
if ARGV.include? '--interactive'
|
if ARGV.include? '--interactive'
|
||||||
ohai "Entering interactive mode, type `exit' to return to this shell"
|
ohai "Entering interactive mode, type `exit' to return to this shell"
|
||||||
exec "bash" # exec() because system() didn't work :(
|
puts "Install to this prefix: #{o.prefix}"
|
||||||
|
pid=fork
|
||||||
|
if pid.nil?
|
||||||
|
exec 'bash'
|
||||||
|
else
|
||||||
|
Process.wait pid
|
||||||
|
end
|
||||||
elsif ARGV.include? '--help'
|
elsif ARGV.include? '--help'
|
||||||
ohai './configure --help'
|
ohai './configure --help'
|
||||||
puts `./configure --help`
|
puts `./configure --help`
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
|
o.prefix.mkpath
|
||||||
o.install
|
o.install
|
||||||
['README','ChangeLog','COPYING','COPYRIGHT','AUTHORS'].each do |file|
|
['README','ChangeLog','COPYING','COPYRIGHT','AUTHORS'].each do |file|
|
||||||
FileUtils.cp file, o.prefix if File.file? file
|
FileUtils.cp file, o.prefix if File.file? file
|
||||||
@ -277,7 +283,7 @@ begin
|
|||||||
version=extract_version File.basename(url, Pathname.new(url).extname)
|
version=extract_version File.basename(url, Pathname.new(url).extname)
|
||||||
|
|
||||||
/(.*?)[-_.]?#{version}/.match File.basename(url)
|
/(.*?)[-_.]?#{version}/.match File.basename(url)
|
||||||
raise "Couldn't parse name from #{url}" if $1.nil?
|
raise "Couldn't parse name from #{url}" if $1.nil? or $1.empty?
|
||||||
|
|
||||||
path=$formula+($1.downcase+'.rb')
|
path=$formula+($1.downcase+'.rb')
|
||||||
raise "#{path} already exists!" if File.exist? path
|
raise "#{path} already exists!" if File.exist? path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user