aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-01-31 07:14:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-01-31 07:14:57 +0200
commit62c0e19e31f485433118daf1712a6f8157b61c3c (patch)
tree00a79099abde9ea968dca84a4a34332491a90def
parentd137d3b52c0374d11561ffb9f1f5bae20ae01f98 (diff)
Assign and handle package manager names
-rw-r--r--bpkg/system-package-manager.cxx6
-rw-r--r--bpkg/system-package-manager.hxx10
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<system_package_manager>
make_system_package_manager (const common_options&,