Archived
3
0

Recipe#auto_split -> Recipe#auto_splits

That particular method has no side-effect anymore, and is called
internally automatically by #package and #build (through #do_splits).
This commit is contained in:
Luka Vandervelden 2019-07-20 13:52:24 +02:00
parent 132b3751ce
commit f921798fd9
2 changed files with 5 additions and 7 deletions

View File

@ -27,8 +27,6 @@ recipes << Recipe.new(context, "hello", "2.10").tap do |recipe|
recipe.description = "The GNU Hello program produces a familiar, friendly greeting."
recipe.dependencies << "gettext"
recipe.auto_split
# Should be automatic now.
#recipe.packages << Package::Package.new(recipe).tap do |package|
# package.name = "#{recipe.name}-man"

View File

@ -132,7 +132,7 @@ class Package::Recipe
end
private def do_splits
@packages.each do |package|
(@packages + auto_splits).each do |package|
next if package == @packages[0]
files = package.files
@ -162,9 +162,9 @@ class Package::Recipe
end
end
def auto_split
@context.splitter_backends.each do |backend|
@packages << backend.create_split self
def auto_splits : Array(Package)
@context.splitter_backends.compact_map do |backend|
backend.create_split self
end
end
@ -174,7 +174,7 @@ class Package::Recipe
def package : Bool
# This tries to build them all and stops at the first failure
# (failures are currently reported by Context#package)
@packages
(@packages + auto_splits)
.find do |package|
if package.automatic && ! File.exists? package.fake_root_directory
next