rbinstall.rb: do nothing if bin script is same

* tool/rbinstall.rb (check_executable_overwrite): do nothing if
  the existing file equals to the wrapper script to be generated.

* tool/rbinstall.rb (generate_bin_script): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-01-15 00:45:10 +00:00
parent 0255bac7b9
commit 37a8a2a26e

View File

@ -695,6 +695,25 @@ module RbInstall
first_line = File.open(path, "rb") {|file| file.gets} first_line = File.open(path, "rb") {|file| file.gets}
$script_installer.prolog(first_line) $script_installer.prolog(first_line)
end end
def check_executable_overwrite(filename)
return if @wrappers and same_bin_script?(filename, @bin_dir)
super
end
def generate_bin_script(filename, bindir)
return if same_bin_script?(filename, bindir)
super
end
def same_bin_script?(filename, bindir)
path = File.join(bindir, formatted_program_filename(filename))
begin
return true if File.binread(path) == app_script_text(filename)
rescue
end
false
end
end end
end end