diff options
| author | Jack Nagel | 2014-07-26 20:11:53 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-26 20:11:53 -0500 |
| commit | 2b90995c3edd8dad43b31169e71618feb6486833 (patch) | |
| tree | 25dd500aff90506d20976f9944ab7d3d8af46160 /Library/Homebrew/cmd | |
| parent | 197a12c900bc9c034e71140390727a0c8f7b5579 (diff) | |
| download | brew-2b90995c3edd8dad43b31169e71618feb6486833.tar.bz2 | |
Only populate the report with formula paths
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/update.rb | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index d788bced6..ccb458e32 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -173,8 +173,18 @@ class Updater if initial_revision && initial_revision != current_revision diff.each_line do |line| - status, path = line.split - map[status.to_sym] << repository.join(path) + status, *paths = line.split + + next unless File.extname(paths.last) == ".rb" + next unless File.dirname(paths.last) == formula_directory + + case status + when "A", "M", "D" + map[status.to_sym] << repository.join(paths.first) + when /^R\d{0,3}/ + map[:D] << repository.join(paths.first) + map[:A] << repository.join(paths.last) + end end end @@ -183,12 +193,27 @@ class Updater private + def formula_directory + if repository == HOMEBREW_REPOSITORY + "Library/Formula" + elsif repository.join("Formula").directory? + "Formula" + elsif repository.join("HomebrewFormula").directory? + "HomebrewFormula" + else + "." + end + end + def read_current_revision `git rev-parse -q --verify HEAD`.chomp end def diff - Utils.popen_read("git", "diff-tree", "-r", "--name-status", "--diff-filter=AMD", initial_revision, current_revision) + Utils.popen_read( + "git", "diff-tree", "-r", "--name-status", "--diff-filter=AMDR", + "-M85%", initial_revision, current_revision + ) end def `(cmd) |
