This repository has been archived on 2022-01-17. You can view files and clone it, but cannot push or open issues/pull-requests.
2019-09-06 00:39:11 +02:00
|
|
|
|
|
|
|
abstract class Package::Backend::Packaging
|
|
|
|
getter name : String
|
|
|
|
|
|
|
|
def initialize(@name)
|
|
|
|
end
|
|
|
|
|
|
|
|
abstract def package(context : Context, package : Package) : Bool
|
2021-02-28 20:56:51 +01:00
|
|
|
def self.install(packages : Array(String))
|
|
|
|
raise "'install' unimplemented for this backend, yet"
|
|
|
|
end
|
|
|
|
def install(packages : Array(String))
|
|
|
|
self.install packages
|
|
|
|
end
|
2019-09-06 00:39:11 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
class Package::Backend::Splitter
|
|
|
|
def initialize(&block : Proc(Recipe, Package))
|
|
|
|
@callback = block
|
|
|
|
end
|
|
|
|
|
|
|
|
def create_split(recipe : Recipe) : Package
|
|
|
|
@callback.call recipe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|