1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Quiet if the target is already linked the same source

This commit is contained in:
Nobuyoshi Nakada 2022-09-20 12:54:08 +09:00
parent 55e540f7ab
commit 9de11fe796
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 7 additions and 1 deletions

View file

@ -607,7 +607,7 @@ CP_R = #{config_string('CP')} -r
gemlib = $(TARGET_TOPDIR)/gems/$(gem)/lib
gemlib:#{%{ $(gemlib)\n$(gemlib): $(gem_srcdir)/lib} if $nmake}
$(Q) #{@inplace ? '$(NULLCMD) ' : ''}$(RUBY) $(top_srcdir)/tool/ln_sr.rb -f -T $(gem_srcdir)/lib $(gemlib)
$(Q) #{@inplace ? '$(NULLCMD) ' : ''}$(RUBY) $(top_srcdir)/tool/ln_sr.rb -q -f -T $(gem_srcdir)/lib $(gemlib)
clean-gemlib:
$(Q) $(#{@inplace ? 'NULLCMD' : 'RM_RF'}) $(gemlib)

View file

@ -3,6 +3,7 @@
target_directory = true
noop = false
force = false
quiet = false
until ARGV.empty?
case ARGV[0]
@ -12,6 +13,8 @@ until ARGV.empty?
force = true
when '-T'
target_directory = false
when '-q'
quiet = true
else
break
end
@ -114,6 +117,9 @@ unless respond_to?(:ln_sr)
end
if File.respond_to?(:symlink)
if quiet and File.identical?(src, dest)
exit
end
begin
ln_sr(src, dest, verbose: true, target_directory: target_directory, force: force, noop: noop)
rescue NotImplementedError, Errno::EPERM, Errno::EACCES