From 9d6d531527f8ca0d2f40ab99f6a5989934b9bd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 15 Oct 2019 15:15:25 +0200 Subject: Cache destination dir. It is not necessary to strip the `destdir` prefix every iteration, when it can be done just once. --- tool/rbinstall.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tool') diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 5423920da7..333369293a 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -722,9 +722,10 @@ module RbInstall return if @src_dir == destination_dir File.chmod(0700, destination_dir) mode = pattern == File.join(spec.bindir, '*') ? prog_mode : data_mode + destdir = without_destdir(destination_dir) spec.files.each do |f| src = File.join(@src_dir, f) - dest = File.join(without_destdir(destination_dir), f) + dest = File.join(destdir, f) makedirs(dest[/.*(?=\/)/m]) install src, dest, :mode => mode end -- cgit v1.2.3