Obsolete
/
packaging
Archived
3
0
Fork 0

backend name is now package manager name, error if incorrect in conf file

master
Karchnu 2021-02-22 00:52:38 +01:00
parent 492ce2f9cc
commit 72aceb035d
2 changed files with 12 additions and 2 deletions

View File

@ -5,7 +5,7 @@ require "../backends.cr"
class BaguetteBackend < Package::Backend::Packaging class BaguetteBackend < Package::Backend::Packaging
def initialize def initialize
@name = "baguette" @name = "package"
end end
def package(context : Package::Context, package : Package::Package) : Bool def package(context : Package::Context, package : Package::Package) : Bool

View File

@ -283,7 +283,17 @@ class Package::Context
end end
when "package-manager" when "package-manager"
# Targeted package manager (default: package, for BaguetteOS). # Targeted package manager (default: package, for BaguetteOS).
self.packaging_backend = value.as_s begin
self.packaging_backend = value.as_s
rescue e
STDERR.puts "Error during selecting packaging backend: #{e}"
STDERR.puts "#{value.as_s} seems not to be a valid backend"
STDERR.puts "valid backends:"
@packaging_backends.each do |backend|
STDERR.puts "- #{backend.name}"
end
exit 1
end
end end
end end
end end