Archived
3
0

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

This commit is contained in:
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
def initialize
@name = "baguette"
@name = "package"
end
def package(context : Package::Context, package : Package::Package) : Bool

View File

@ -283,7 +283,17 @@ class Package::Context
end
when "package-manager"
# 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