Merge pull request #9112 from samford/livecheck-skip-disabled-formulae

livecheck: skip disabled formulae
This commit is contained in:
Sam Ford 2020-11-13 22:57:23 -05:00 committed by GitHub
commit c5fea1b719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -233,6 +233,13 @@ module Homebrew
return
end
if formula.disabled? && !formula.livecheckable?
return status_hash(formula, "disabled", args: args) if args.json?
puts "#{Tty.red}#{formula_name(formula, args: args)}#{Tty.reset} : disabled" unless args.quiet?
return
end
if formula.versioned_formula? && !formula.livecheckable?
return status_hash(formula, "versioned", args: args) if args.json?

View File

@ -29,6 +29,15 @@ describe Homebrew::Livecheck do
end
end
let(:f_disabled) do
formula("test_disabled") do
desc "Disabled test formula"
homepage "https://brew.sh"
url "https://brew.sh/test-0.0.1.tgz"
disable! because: :unmaintained
end
end
let(:f_gist) do
formula("test_gist") do
desc "Gist test formula"
@ -100,6 +109,12 @@ describe Homebrew::Livecheck do
.and not_to_output.to_stderr
end
it "skips a disabled formula without a livecheckable" do
expect { livecheck.skip_conditions(f_disabled, args: args) }
.to output("test_disabled : disabled\n").to_stdout
.and not_to_output.to_stderr
end
it "skips a versioned formula without a livecheckable" do
expect { livecheck.skip_conditions(f_versioned, args: args) }
.to output("test@0.0.1 : versioned\n").to_stdout