diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 9d876ddb18860..1c027380f1537 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2387,6 +2387,7 @@ def devel(&block) @devel ||= SoftwareSpec.new return @devel unless block_given? + odeprecated "'devel' blocks in formulae", "'head' blocks or @-versioned formulae" @devel.instance_eval(&block) end diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index f9d84f586158a..e198291e1952f 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -303,18 +303,11 @@ formula do url "foo" version "1.9" - head "foo" - - devel do - url "foo" - version "2.1-devel" - end end end let(:stable_prefix) { HOMEBREW_CELLAR/f.name/f.version } - let(:devel_prefix) { HOMEBREW_CELLAR/f.name/f.devel.version } let(:head_prefix) { HOMEBREW_CELLAR/f.name/f.head.version } it "is the same as #prefix by default" do @@ -326,11 +319,6 @@ expect(f.installed_prefix).to eq(stable_prefix) end - it "returns the devel prefix if it is installed" do - devel_prefix.mkpath - expect(f.installed_prefix).to eq(devel_prefix) - end - it "returns the head prefix if it is installed" do head_prefix.mkpath expect(f.installed_prefix).to eq(head_prefix) @@ -347,22 +335,6 @@ expect(f.installed_prefix).to eq(stable_prefix) end - it "returns the stable prefix if head and devel are outdated" do - head_prefix.mkpath - - tab = Tab.empty - tab.tabfile = head_prefix/Tab::FILENAME - tab.source["versions"] = { "stable" => "1.9", "devel" => "2.0" } - tab.write - - expect(f.installed_prefix).to eq(stable_prefix) - end - - it "returns the devel prefix if the active specification is :devel" do - f.active_spec = :devel - expect(f.installed_prefix).to eq(devel_prefix) - end - it "returns the head prefix if the active specification is :head" do f.active_spec = :head expect(f.installed_prefix).to eq(head_prefix) @@ -519,19 +491,12 @@ sha256 TEST_SHA256 head "https://brew.sh/test.git", tag: "foo" - - devel do - url "https://brew.sh/test-0.2.tbz" - mirror "https://example.org/test-0.2.tbz" - sha256 TEST_SHA256 - end end expect(f.homepage).to eq("https://brew.sh") expect(f.version).to eq(Version.create("0.1")) expect(f).to be_stable expect(f.stable.version).to eq(Version.create("0.1")) - expect(f.devel.version).to eq(Version.create("0.2")) expect(f.head.version).to eq(Version.create("HEAD")) end @@ -540,22 +505,12 @@ url "foo" version "1.0" revision 1 - - devel do - url "foo" - version "1.0beta" - end end expect(f.active_spec_sym).to eq(:stable) expect(f.send(:active_spec)).to eq(f.stable) expect(f.pkg_version.to_s).to eq("1.0_1") - f.active_spec = :devel - - expect(f.active_spec_sym).to eq(:devel) - expect(f.send(:active_spec)).to eq(f.devel) - expect(f.pkg_version.to_s).to eq("1.0beta_1") expect { f.active_spec = :head }.to raise_error(FormulaSpecificationError) end @@ -565,7 +520,6 @@ end expect(f.class.stable).to be_kind_of(SoftwareSpec) - expect(f.class.devel).to be_kind_of(SoftwareSpec) expect(f.class.head).to be_kind_of(SoftwareSpec) end @@ -574,7 +528,6 @@ url "foo-1.0" end - expect(f.devel).to be nil expect(f.head).to be nil end @@ -583,14 +536,9 @@ url "foo-1.0" depends_on "foo" - - devel do - url "foo-1.1" - end end expect(f.class.stable.deps.first.name).to eq("foo") - expect(f.class.devel.deps.first.name).to eq("foo") expect(f.class.head.deps.first.name).to eq("foo") end diff --git a/Library/Homebrew/test/formula_spec_selection_spec.rb b/Library/Homebrew/test/formula_spec_selection_spec.rb index 98fb3617180d1..bdaed0ddd105c 100644 --- a/Library/Homebrew/test/formula_spec_selection_spec.rb +++ b/Library/Homebrew/test/formula_spec_selection_spec.rb @@ -7,7 +7,6 @@ it "selects stable by default" do f = formula do url "foo-1.0" - devel { url "foo-1.1a" } head "foo" end @@ -19,20 +18,6 @@ expect(f).to be_stable end - it "selects devel before HEAD" do - f = formula do - devel { url "foo-1.1a" } - head "foo" - end - - expect(f).to be_devel - end - - it "selects devel when exclusive" do - f = formula { devel { url "foo-1.1a" } } - expect(f).to be_devel - end - it "selects HEAD when exclusive" do f = formula { head "foo" } expect(f).to be_head @@ -51,49 +36,25 @@ it "does not set an incomplete stable spec" do f = formula do sha256 TEST_SHA256 - devel { url "foo-1.1a" } head "foo" end expect(f.stable).to be nil - expect(f).to be_devel + expect(f).to be_head end it "selects HEAD when requested" do f = formula("test", spec: :head) do url "foo-1.0" - devel { url "foo-1.1a" } head "foo" end expect(f).to be_head end - it "selects devel when requested" do - f = formula("test", spec: :devel) do - url "foo-1.0" - devel { url "foo-1.1a" } - head "foo" - end - - expect(f).to be_devel - end - - it "does not set an incomplete devel spec" do - f = formula do - url "foo-1.0" - devel { version "1.1a" } - head "foo" - end - - expect(f.devel).to be nil - expect(f).to be_stable - end - it "does not raise an error for a missing spec" do - f = formula("test", spec: :devel) do + f = formula("test", spec: :head) do url "foo-1.0" - head "foo" end expect(f).to be_stable diff --git a/Library/Homebrew/test/formula_validation_spec.rb b/Library/Homebrew/test/formula_validation_spec.rb index 0bf4a195237b4..c1782015850d5 100644 --- a/Library/Homebrew/test/formula_validation_spec.rb +++ b/Library/Homebrew/test/formula_validation_spec.rb @@ -70,17 +70,6 @@ def brew; end }.to fail_with_invalid :version end - specify "devel-only is valid" do - f = formula do - devel do - url "foo" - version "1.0" - end - end - - expect(f).to be_devel - end - specify "head-only is valid" do f = formula do head "foo"