aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-01-30 09:37:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-01-30 09:37:47 +0200
commitde428a3197ce75539eb01b47ddc2e2105488d4aa (patch)
tree624ead0ed7dd3f4ccac553aa9b8f9ee32291be88
parent8da486bf54453c092ac99fd1c352b0f0d98dcc6f (diff)
Test Debian implementation some more
-rw-r--r--bpkg/system-package-manager-debian.cxx17
-rw-r--r--bpkg/system-package-manager-debian.test.testscript258
-rw-r--r--bpkg/system-package-manager.hxx7
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 <libssl1.1+libssl-dev.policy
LC_ALL=C apt-cache policy --quiet libssl1.1 libssl-dev <libssl1.1+libssl-dev.policy
@@ -624,8 +624,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 <libssl1.1+libssl-dev.policy
sudo apt-get update --quiet --assume-no
@@ -668,8 +668,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 <libssl1.1+libssl-dev.policy
sudo apt-get update --quiet --assume-no
@@ -682,4 +682,250 @@
libssl 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) not installed
EOO
}
+
+ : libcurl
+ :
+ {
+ # Note that libcurl3-gnutls libcurl4-gnutls-dev is not a mistake.
+ #
+ # Note also that there is a third flavor, libcurl3-nss libcurl4-nss-dev,
+ # but we omit it to keep the tests manageable.
+ #
+ #
+ +cat <<EOI >=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 <<EOI >=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 <<EOI >=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 <<EOI >=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 <<EOI 2>>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
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ sudo apt-get install --quiet --assume-no libcurl4=7.85.0-1 libcurl4-openssl-dev=7.85.0-1
+ LC_ALL=C apt-cache policy --quiet libcurl4 <libcurl4.policy-installed
+ EOE
+ libcurl 7.85.0 (libcurl4 7.85.0-1) installed
+ EOO
+
+
+ : one-part-installed
+ :
+ ln -s ../libcurl.manifest ./;
+ cat <<EOI >=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 <<EOI >=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 <<EOI >=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 <<EOI 2>>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
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev <libcurl4+libcurl4-openssl-dev.policy
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ sudo apt-get install --quiet --assume-no libcurl4 libcurl4-openssl-dev
+ LC_ALL=C apt-cache policy --quiet libcurl4 <libcurl4.policy-installed
+ EOE
+ libcurl 7.87.0 (libcurl4 7.87.0-2) part installed
+ EOO
+
+
+ : none-installed
+ :
+ ln -s ../libcurl.manifest ./;
+ cat <<EOI >=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 <<EOI >=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 <<EOI 2>>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
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev <libcurl4+libcurl4-openssl-dev.policy
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ error: multiple available debian packages for libcurl
+ info: first package: libcurl4 7.87.0-2
+ info: second package: libcurl3-gnutls 7.87.0-2
+ info: consider installing the desired package manually and retrying the bpkg command
+ EOE
+
+
+ : both-part-installed
+ :
+ ln -s ../libcurl.manifest ./;
+ cat <<EOI >=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 <<EOI >=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 <<EOI 2>>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
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libcurl4 libcurl4-openssl-dev <libcurl4+libcurl4-openssl-dev.policy
+ LC_ALL=C apt-cache policy --quiet libcurl3-gnutls libcurl4-gnutls-dev <libcurl3-gnutls+libcurl4-gnutls-dev.policy
+ error: multiple partially installed debian packages for libcurl
+ info: first package: libcurl4 7.87.0-2
+ info: second package: libcurl3-gnutls 7.87.0-2
+ info: consider fully installing the desired package manually and retrying the bpkg command
+ EOE
+ }
}
diff --git a/bpkg/system-package-manager.hxx b/bpkg/system-package-manager.hxx
index a47608a..e872f3e 100644
--- a/bpkg/system-package-manager.hxx
+++ b/bpkg/system-package-manager.hxx
@@ -202,10 +202,9 @@ namespace bpkg
// debian_10-name: libcurl4 libcurl4-doc libcurl4-openssl-dev
// debian_10-name: libcurl3-gnutls libcurl4-gnutls-dev (yes, 3 and 4)
//
- // @@ TODO: But they will have the same available version, how will we
- // deal with that? How will we pick one? Perhaps this should all be
- // handled by the system package manager (conceptually, this is
- // configuration negotiation).
+ // Note also that the value are returned in the "override order", that is
+ // from the newest package version to oldest and then from the highest
+ // distribution version to oldest. @@ Is the latter actually the case?
//
static strings
system_package_names (const available_packages&,