aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb21
1 files changed, 15 insertions, 6 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 001b54e4f..207c0467f 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -208,18 +208,27 @@ class Keg < Pathname
def make_relative_symlink dst, src, mode=OpenStruct.new
if dst.exist? and dst.realpath == src.realpath
puts "Skipping; already exists: #{dst}" if ARGV.verbose?
+ return
+ end
+
# cf. git-clean -n: list files to delete, don't really link or delete
- elsif mode.dry_run and mode.overwrite
- puts dst if dst.exist? or dst.symlink?
+ if mode.dry_run and mode.overwrite
+ if dst.symlink?
+ puts "#{dst} -> #{dst.resolved_path}"
+ elsif dst.exist?
+ puts dst
+ end
return
+ end
+
# list all link targets
- elsif mode.dry_run
+ if mode.dry_run
puts dst
return
- else
- dst.delete if mode.overwrite && (dst.exist? or dst.symlink?)
- dst.make_relative_symlink src
end
+
+ dst.delete if mode.overwrite && (dst.exist? or dst.symlink?)
+ dst.make_relative_symlink src
end
# symlinks the contents of self+foo recursively into #{HOMEBREW_PREFIX}/foo