From 62c0e19e31f485433118daf1712a6f8157b61c3c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 31 Jan 2023 07:14:57 +0200 Subject: Assign and handle package manager names --- bpkg/system-package-manager.cxx | 6 ++++-- bpkg/system-package-manager.hxx | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bpkg/system-package-manager.cxx b/bpkg/system-package-manager.cxx index b5fa333..77265b3 100644 --- a/bpkg/system-package-manager.cxx +++ b/bpkg/system-package-manager.cxx @@ -58,14 +58,16 @@ namespace bpkg if (is_or_like ("debian") || is_or_like ("ubuntu")) { + if (!name.empty () && name != "debian") + fail << "unsupported package manager '" << name << "' for " + << osr->name_id << " host"; + // If we recognized this as Debian-like in an ad hoc manner, then // add debian to like_ids. // if (osr->name_id != "debian" && !is_or_like ("debian")) osr->like_ids.push_back ("debian"); - // @@ TODO: verify name if specified. - r.reset (new system_package_manager_debian ( move (*osr), host, install, fetch, progress, yes, sudo)); } diff --git a/bpkg/system-package-manager.hxx b/bpkg/system-package-manager.hxx index a52e9cb..a6b8299 100644 --- a/bpkg/system-package-manager.hxx +++ b/bpkg/system-package-manager.hxx @@ -250,13 +250,13 @@ namespace bpkg // Create a package manager instance corresponding to the specified host // target and optional manager name. If name is empty, return NULL if there - // is no support for this platform. + // is no support for this platform. Currently recognized names: // - // @@ TODO: need to assign names. Ideas: + // debian -- Debian and alike (Ubuntu, etc) using the APT frontend. + // fedora -- Fedora and alike (RHEL, Centos, etc) using the DNF frontend. // - // dpkg-apt, rpm-dnf - // deb, rpm - // debian, fedora (i.e., follow /etc/os-release ID_LIKE lead) + // Note: the name will be used to select an alternative package manager + // implementation on platforms that support multiple. // unique_ptr make_system_package_manager (const common_options&, -- cgit v1.1