From de428a3197ce75539eb01b47ddc2e2105488d4aa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Jan 2023 09:37:47 +0200 Subject: Test Debian implementation some more --- bpkg/system-package-manager-debian.cxx | 17 +- bpkg/system-package-manager-debian.test.testscript | 258 ++++++++++++++++++++- bpkg/system-package-manager.hxx | 7 +- 3 files changed, 269 insertions(+), 13 deletions(-) diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx index 8bf575c..44a3aef 100644 --- a/bpkg/system-package-manager-debian.cxx +++ b/bpkg/system-package-manager-debian.cxx @@ -933,7 +933,14 @@ namespace bpkg candidates.push_back (move (s)); else { - // @@ Should we verify the rest matches for good measure? + // Should we verify the rest matches for good measure? But what if + // we need to override, as in: + // + // debian_10-name: libcurl4 libcurl4-openssl-dev + // debian_9-name: libcurl4 libcurl4-dev + // + // Note that for this to work we must get debian_10 values before + // debian_9, which is the semantics of parse_name_value(). } } } @@ -1122,11 +1129,14 @@ namespace bpkg { if (r) { + // @@ TODO show missing components (like -dev, etc). + fail << "multiple partially installed " << os_release_.name_id << " packages for " << pn << info << "first package: " << r->main << " " << r->system_version << info << "second package: " << ps.main << " " << ps.system_version << - info << "consider specifying the desired version manually"; + info << "consider fully installing the desired package manually " + << "and retrying the bpkg command"; } r = move (ps); @@ -1148,7 +1158,8 @@ namespace bpkg << " packages for " << pn << info << "first package: " << r->main << " " << r->system_version << info << "second package: " << ps.main << " " << ps.system_version << - info << "consider installing the desired package manually"; + info << "consider installing the desired package manually " + << "and retrying the bpkg command"; } r = move (ps); diff --git a/bpkg/system-package-manager-debian.test.testscript b/bpkg/system-package-manager-debian.test.testscript index bdfdf4d..180fa5f 100644 --- a/bpkg/system-package-manager-debian.test.testscript +++ b/bpkg/system-package-manager-debian.test.testscript @@ -582,8 +582,8 @@ manifest: libcrypto libcrypto.manifest manifest: libssl libssl.manifest - apt-cache-policy: libssl1.1 libssl-dev libssl1.1+libssl-dev.policy - apt-cache-policy: libssl1.1 libssl1.1.policy-installed + apt-cache-policy: libssl1.1 libssl-dev libssl1.1+libssl-dev.policy + apt-cache-policy-installed: libssl1.1 libssl1.1.policy-installed EOI LC_ALL=C apt-cache policy --quiet libssl1.1 libssl-dev =libcurl.manifest + : 1 + name: libcurl + version: 7.84.0 + debian-name: libcurl4 libcurl4-openssl-dev libcurl4-doc + debian-name: libcurl3-gnutls libcurl4-gnutls-dev libcurl4-doc + summary: C library for transferring data with URLs + license: curl + EOI + + + : one-full-installed + : + ln -s ../libcurl.manifest ./; + cat <=libcurl4+libcurl4-openssl-dev.policy; + libcurl4: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + libcurl4-openssl-dev: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + EOI + cat <=libcurl3-gnutls+libcurl4-gnutls-dev.policy; + libcurl3-gnutls: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + libcurl4-gnutls-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + cat <=libcurl4.policy-installed; + libcurl4: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + EOI + $* libcurl --install libcurl <>EOE >>EOO + manifest: libcurl libcurl.manifest + + apt-cache-policy: libcurl4 libcurl4-openssl-dev libcurl4+libcurl4-openssl-dev.policy + apt-cache-policy: libcurl3-gnutls libcurl4-gnutls-dev libcurl3-gnutls+libcurl4-gnutls-dev.policy + apt-cache-policy-installed: libcurl4 libcurl4.policy-installed + EOI + LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev =libcurl4+libcurl4-openssl-dev.policy; + libcurl4: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + libcurl4-openssl-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + cat <=libcurl3-gnutls+libcurl4-gnutls-dev.policy; + libcurl3-gnutls: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + libcurl4-gnutls-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + cat <=libcurl4.policy-installed; + libcurl4: + Installed: 7.87.0-2 + Candidate: 7.87.0-2 + Version table: + *** 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + 100 /var/lib/dpkg/status + EOI + $* libcurl --install libcurl <>EOE >>EOO + manifest: libcurl libcurl.manifest + + apt-cache-policy: libcurl4 libcurl4-openssl-dev libcurl4+libcurl4-openssl-dev.policy + apt-cache-policy: libcurl3-gnutls libcurl4-gnutls-dev libcurl3-gnutls+libcurl4-gnutls-dev.policy + apt-cache-policy-installed: libcurl4 libcurl4.policy-installed + EOI + LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev =libcurl4+libcurl4-openssl-dev.policy; + libcurl4: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + libcurl4-openssl-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + cat <=libcurl3-gnutls+libcurl4-gnutls-dev.policy; + libcurl3-gnutls: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + libcurl4-gnutls-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + $* libcurl --install libcurl <>EOE != 0 + manifest: libcurl libcurl.manifest + + apt-cache-policy: libcurl4 libcurl4-openssl-dev libcurl4+libcurl4-openssl-dev.policy + apt-cache-policy: libcurl3-gnutls libcurl4-gnutls-dev libcurl3-gnutls+libcurl4-gnutls-dev.policy + EOI + LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev =libcurl4+libcurl4-openssl-dev.policy; + libcurl4: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + libcurl4-openssl-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + cat <=libcurl3-gnutls+libcurl4-gnutls-dev.policy; + libcurl3-gnutls: + Installed: 7.85.0-1 + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + *** 7.85.0-1 100 + 100 /var/lib/dpkg/status + libcurl4-gnutls-dev: + Installed: (none) + Candidate: 7.87.0-2 + Version table: + 7.87.0-2 500 + 500 http://deb.debian.org/debian bookworm/main amd64 Packages + EOI + $* libcurl --install libcurl <>EOE != 0 + manifest: libcurl libcurl.manifest + + apt-cache-policy: libcurl4 libcurl4-openssl-dev libcurl4+libcurl4-openssl-dev.policy + apt-cache-policy: libcurl3-gnutls libcurl4-gnutls-dev libcurl3-gnutls+libcurl4-gnutls-dev.policy + EOI + LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev