aboutsummaryrefslogtreecommitdiffstats
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-15 00:45:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-15 00:45:10 +0000
commite5e558e7632241554bf0ddd285c98990efbca44e (patch)
tree81647a049c9cee930fc1f2c536ddf61362644a47 /tool/rbinstall.rb
parent28c13f3ba5f2f22fb9a38a76657e71dae4bc7b2c (diff)
downloadruby-e5e558e7632241554bf0ddd285c98990efbca44e.tar.gz
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
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 12e8463abc..490f5f3281 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -695,6 +695,25 @@ module RbInstall
first_line = File.open(path, "rb") {|file| file.gets}
$script_installer.prolog(first_line)
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