Skip to content
Snippets Groups Projects
Commit 13141de0 authored by Xu Cheng's avatar Xu Cheng
Browse files

update-report: update for core/formula separation

Update the report logic, since now all formulae are in the taps.
parent 56cb3325
No related branches found
No related tags found
No related merge requests found
......@@ -8,19 +8,17 @@ module Homebrew
install_core_tap_if_necessary
hub = ReporterHub.new
updated = false
begin
master_reporter = Reporter.new(CoreTap.instance)
rescue Reporter::ReporterRevisionUnsetError => e
raise e if ARGV.homebrew_developer?
initial_revision = ENV["HOMEBREW_UPDATE_BEFORE"].to_s
current_revision = ENV["HOMEBREW_UPDATE_AFTER"].to_s
if initial_revision.empty? || current_revision.empty?
odie "update-report should not be called directly!"
end
if master_reporter.updated?
initial_short = shorten_revision(master_reporter.initial_revision)
current_short = shorten_revision(master_reporter.current_revision)
puts "Updated Homebrew from #{initial_short} to #{current_short}."
hub.add(master_reporter)
if initial_revision != current_revision
puts "Updated Homebrew from #{shorten_revision(initial_revision)} to #{shorten_revision(current_revision)}."
updated = true
end
updated_taps = []
......@@ -37,12 +35,14 @@ module Homebrew
hub.add(reporter)
end
end
unless updated_taps.empty?
puts "Updated #{updated_taps.size} tap#{plural(updated_taps.size)} " \
"(#{updated_taps.join(", ")})."
updated = true
end
if hub.reporters.empty?
if !updated
puts "Already up-to-date."
elsif hub.empty?
puts "No changes to formulae."
......@@ -194,14 +194,10 @@ class Reporter
private
def repo_var
@repo_var ||= if tap.path == HOMEBREW_REPOSITORY
""
else
tap.path.to_s.
@repo_var ||= tap.path.to_s.
strip_prefix(Tap::TAP_DIRECTORY.to_s).
tr("^A-Za-z0-9", "_").
upcase
end
end
def diff
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment