aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/diagnostics.cxx2
-rw-r--r--bpkg/diagnostics.hxx3
-rw-r--r--bpkg/pkg-build.cxx20
-rw-r--r--bpkg/system-package-manager-debian.cxx95
-rw-r--r--bpkg/system-package-manager-debian.test.cxx30
-rw-r--r--bpkg/system-package-manager-debian.test.testscript472
6 files changed, 565 insertions, 57 deletions
diff --git a/bpkg/diagnostics.cxx b/bpkg/diagnostics.cxx
index ef87cab..9232d93 100644
--- a/bpkg/diagnostics.cxx
+++ b/bpkg/diagnostics.cxx
@@ -129,7 +129,7 @@ namespace bpkg
const basic_mark error ("error");
const basic_mark warn ("warning");
const basic_mark info ("info");
- const basic_mark text (nullptr);
+ const basic_mark text (nullptr, nullptr, nullptr, nullptr); // No frame.
const fail_mark fail ("error");
const fail_end endf;
}
diff --git a/bpkg/diagnostics.hxx b/bpkg/diagnostics.hxx
index 79dc384..a01d90c 100644
--- a/bpkg/diagnostics.hxx
+++ b/bpkg/diagnostics.hxx
@@ -122,6 +122,9 @@ namespace bpkg
// Diagnostic facility, project specifics.
//
+
+ // Note: diag frames are not applied to text/trace diagnostics.
+ //
template <typename F>
struct diag_frame_impl: diag_frame
{
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 0628f6f..07e23be 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -1705,12 +1705,13 @@ namespace bpkg
optional<const system_package_status*> os (
spm.pkg_status (nm, nullptr));
+ available_packages aps;
if (!os)
{
// If no cache hit, then collect the available packages for the
// mapping information.
//
- available_packages aps (find_available_all (current_configs, nm));
+ aps = find_available_all (current_configs, nm);
// If no source/stub for the package (and thus no mapping), issue
// diagnostics consistent with other such places.
@@ -1718,9 +1719,24 @@ namespace bpkg
if (aps.empty ())
fail << "unknown package " << nm <<
info << "consider specifying " << nm << "/*";
+ }
- os = spm.pkg_status (nm, &aps);
+ // This covers both our diagnostics below as well as anything that
+ // might be issued by pkg_status().
+ //
+ auto df = make_diag_frame (
+ [&nm] (diag_record& dr)
+ {
+ dr << info << "specify " << nm << "/* if package is not "
+ << "installed with system package manager";
+ dr << info << "specify --sys-no-query to disable system "
+ << "package manager interaction";
+ });
+
+ if (!os)
+ {
+ os = spm.pkg_status (nm, &aps);
assert (os);
}
diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx
index 1219ebf..8bf575c 100644
--- a/bpkg/system-package-manager-debian.cxx
+++ b/bpkg/system-package-manager-debian.cxx
@@ -254,8 +254,6 @@ namespace bpkg
evars);
else
{
- print_process (pe, args);
-
strings k;
for (size_t i (0); i != n; ++i)
k.push_back (pps[i].name);
@@ -280,6 +278,10 @@ namespace bpkg
f = &i->second;
}
+ diag_record dr (text);
+ print_process (dr, pe, args);
+ dr << " <" << (f == nullptr || f->empty () ? "/dev/null" : f->string ());
+
pr = process (process_exit (0));
pr.in_ofd = f == nullptr || f->empty ()
? fdopen_null ()
@@ -406,7 +408,7 @@ namespace bpkg
if (verb < 3)
{
- dr << "command line: ";
+ dr << info << "command line: ";
print_process (dr, pe, args);
}
}
@@ -472,8 +474,6 @@ namespace bpkg
evars);
else
{
- print_process (pe, args);
-
pair<string, string> k (name, ver);
const path* f (nullptr);
@@ -490,6 +490,10 @@ namespace bpkg
f = &i->second;
}
+ diag_record dr (text);
+ print_process (dr, pe, args);
+ dr << " <" << (f == nullptr || f->empty () ? "/dev/null" : f->string ());
+
if (f == nullptr || f->empty ())
{
text << "E: No packages found";
@@ -626,7 +630,7 @@ namespace bpkg
if (verb < 3)
{
- dr << "command line: ";
+ dr << info << "command line: ";
print_process (dr, pe, args);
}
}
@@ -746,8 +750,8 @@ namespace bpkg
{
if (verb >= 2)
print_process (args);
- else if (verb)
- text << "updating Debian package index...";
+ else if (verb == 1)
+ text << "updating " << os_release_.name_id << " package index...";
process pr;
if (!simulate_)
@@ -765,10 +769,13 @@ namespace bpkg
if (verb < 2)
{
- dr << "command line: ";
+ dr << info << "command line: ";
print_process (dr, args);
}
}
+
+ if (verb == 1)
+ text << "updated " << os_release_.name_id << " package index";
}
catch (const process_error& e)
{
@@ -803,8 +810,8 @@ namespace bpkg
{
if (verb >= 2)
print_process (args);
- else if (verb)
- text << "installing Debian packages...";
+ else if (verb == 1)
+ text << "installing " << os_release_.name_id << " packages...";
process pr;
if (!simulate_)
@@ -822,13 +829,16 @@ namespace bpkg
if (verb < 2)
{
- dr << "command line: ";
+ dr << info << "command line: ";
print_process (dr, args);
}
- dr << "consider resolving the issue manually and retrying the "
- << "bpkg command";
+ dr << info << "consider resolving the issue manually and retrying "
+ << "the bpkg command";
}
+
+ if (verb == 1)
+ text << "installed " << os_release_.name_id << " packages";
}
catch (const process_error& e)
{
@@ -869,9 +879,10 @@ namespace bpkg
//
{
auto df = make_diag_frame (
- [&pn] (diag_record& dr)
+ [this, &pn] (diag_record& dr)
{
- dr << info << "while mapping " << pn << " to Debian package name";
+ dr << info << "while mapping " << pn << " to "
+ << os_release_.name_id << " package name";
});
strings ns (system_package_names (*aps,
@@ -938,8 +949,8 @@ namespace bpkg
if (s.main.empty ())
{
- fail << "unable to guess main Debian package for " << s.dev << ' '
- << ver <<
+ fail << "unable to guess main " << os_release_.name_id
+ << " package for " << s.dev << ' ' << ver <<
info << s.dev << " Depends value: " << depends <<
info << "consider specifying explicit mapping in " << pn
<< " package manifest";
@@ -1031,7 +1042,8 @@ namespace bpkg
if (r)
{
- fail << "multiple installed Debian packages for " << pn <<
+ fail << "multiple 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";
@@ -1110,7 +1122,8 @@ namespace bpkg
{
if (r)
{
- fail << "multiple partially installed Debian packages for " << pn <<
+ 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";
@@ -1127,11 +1140,12 @@ namespace bpkg
if (ps.main.empty ())
continue;
- assert (ps.status != package_status::not_installed); // Sanity check.
+ assert (ps.status == package_status::not_installed); // Sanity check.
if (r)
{
- fail << "multiple available Debian packages for " << pn <<
+ fail << "multiple available " << 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 installing the desired package manually";
@@ -1176,12 +1190,13 @@ namespace bpkg
}
catch (const invalid_argument& e)
{
- fail << "unable to map Debian package " << r->system_name
- << " version " << sv << " to bpkg package " << pn
- << " version" <<
- info << "Debian version is not a valid bpkg version: " << e.what () <<
+ fail << "unable to map " << os_release_.name_id << " package "
+ << r->system_name << " version " << sv << " to bpkg package "
+ << pn << " version" <<
+ info << os_release_.name_id << " version is not a valid bpkg "
+ << "version: " << e.what () <<
info << "consider specifying explicit mapping in " << pn
- << " package manifest";
+ << " package manifest";
}
}
@@ -1288,23 +1303,41 @@ namespace bpkg
{
vector<package_policy> pps;
+ // Here we just check the main package component of each package.
+ //
for (const package_name& pn: pns)
{
const package_status& ps (*status_cache_.find (pn)->second);
- pps.push_back (package_policy (ps.system_name));
+
+ if (find_if (pps.begin (), pps.end (),
+ [&ps] (const package_policy& pp)
+ {
+ return pp.name == ps.system_name;
+ }) == pps.end ())
+ {
+ pps.push_back (package_policy (ps.system_name));
+ }
}
apt_cache_policy (pps);
- auto i (pps.begin ());
for (const package_name& pn: pns)
{
const package_status& ps (*status_cache_.find (pn)->second);
- const package_policy& pp (*i++);
+
+ auto i (find_if (pps.begin (), pps.end (),
+ [&ps] (const package_policy& pp)
+ {
+ return pp.name == ps.system_name;
+ }));
+ assert (i != pps.end ());
+
+ const package_policy& pp (*i);
if (pp.installed_version != ps.system_version)
{
- fail << "unexpected Debian package version for " << ps.system_name <<
+ fail << "unexpected " << os_release_.name_id << " package version "
+ << "for " << ps.system_name <<
info << "expected: " << ps.system_version <<
info << "installed: " << pp.installed_version <<
info << "consider retrying the bpkg command";
diff --git a/bpkg/system-package-manager-debian.test.cxx b/bpkg/system-package-manager-debian.test.cxx
index bdf6245..0b1e1c8 100644
--- a/bpkg/system-package-manager-debian.test.cxx
+++ b/bpkg/system-package-manager-debian.test.cxx
@@ -312,26 +312,17 @@ namespace bpkg
{
if (p.second.empty ())
{
- try
- {
- package_name n (p.first);
-
- shared_ptr<available_package> ap (
- make_shared<available_package> (move (n)));
+ shared_ptr<available_package> ap (
+ make_shared<available_package> (package_name (p.first)));
- lazy_shared_ptr<repository_fragment> af (
- make_shared<repository_fragment> (
- repository_location ("https://example.com/" + p.first,
- repository_type::git)));
+ lazy_shared_ptr<repository_fragment> af (
+ make_shared<repository_fragment> (
+ repository_location ("https://example.com/" + p.first,
+ repository_type::git)));
- ap->locations.push_back (package_location {af, current_dir});
+ ap->locations.push_back (package_location {af, current_dir});
- p.second.push_back (make_pair (move (ap), move (af)));
- }
- catch (const invalid_argument& e)
- {
- fail << "invalid package name '" << p.first << "': " << e;
- }
+ p.second.push_back (make_pair (move (ap), move (af)));
}
}
@@ -351,8 +342,11 @@ namespace bpkg
const system_package_status* s (*m.pkg_status (pn, &aps[n]));
+ assert (*m.pkg_status (pn, nullptr) == s); // Test caching.
+
if (s == nullptr)
- fail << "no system package for " << pn;
+ fail << "no installed " << (install ? "or available " : "")
+ << "system package for " << pn;
cout << pn << ' ' << s->version
<< " (" << s->system_name << ' ' << s->system_version << ") ";
diff --git a/bpkg/system-package-manager-debian.test.testscript b/bpkg/system-package-manager-debian.test.testscript
index b2cb933..bdfdf4d 100644
--- a/bpkg/system-package-manager-debian.test.testscript
+++ b/bpkg/system-package-manager-debian.test.testscript
@@ -38,7 +38,7 @@
3.2.4+debian-1 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages
EOI
- LC_ALL=C apt-cache policy --quiet libssl3 libssl1.1 libssl-dev libsqlite5 libxerces-c-dev
+ LC_ALL=C apt-cache policy --quiet libssl3 libssl1.1 libssl-dev libsqlite5 libxerces-c-dev <-
EOE
libssl3 '3.0.7-1' '3.0.7-2'
libssl1.1 '1.1.1n-0+deb11u3' '1.1.1n-0+deb11u3'
@@ -50,7 +50,7 @@
: empty
:
$* libsqlite5 <:'' 2>>EOE >>EOO
- LC_ALL=C apt-cache policy --quiet libsqlite5
+ LC_ALL=C apt-cache policy --quiet libsqlite5 <-
EOE
libsqlite5 '' ''
EOO
@@ -67,7 +67,7 @@
1:11.1-1ubuntu7 -1
500 http://au.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
EOI
- LC_ALL=C apt-cache policy --quiet pulseaudio
+ LC_ALL=C apt-cache policy --quiet pulseaudio <-
EOE
pulseaudio '' ''
EOO
@@ -105,7 +105,7 @@
Depends: libc6 (>= 2.25), debconf (>= 0.5) | debconf-2.0
EOI
- LC_ALL=C apt-cache show --quiet libssl1.1=1.1.1n-0+deb11u3
+ LC_ALL=C apt-cache show --quiet libssl1.1=1.1.1n-0+deb11u3 <-
EOE
libc6 (>= 2.25), debconf (>= 0.5) | debconf-2.0
EOO
@@ -134,7 +134,7 @@
Homepage: https://www.openssl.org/
EOI
- LC_ALL=C apt-cache show --quiet libssl1.1=1.1.1n-0+deb11u3
+ LC_ALL=C apt-cache show --quiet libssl1.1=1.1.1n-0+deb11u3 <-
EOE
}
@@ -221,3 +221,465 @@
libcurl4 (= 7.87.0-2)
EOI
}
+
+: build
+:
+{
+ test.arguments += build
+
+ : libsqlite3
+ :
+ {
+ : installed
+ :
+ cat <<EOI >=libsqlite3-dev.policy;
+ libsqlite3-dev:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ cat <<EOI >=libsqlite3-dev.show;
+ Package: libsqlite3-dev
+ Version: 3.40.1-1
+ Depends: libsqlite3-0 (= 3.40.1-1), libc-dev
+ EOI
+ cat <<EOI >=libsqlite3-0.policy;
+ libsqlite3-0:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libsqlite3 --install libsqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: libsqlite3-dev libsqlite3-dev.policy
+ apt-cache-show: libsqlite3-dev 3.40.1-1 libsqlite3-dev.show
+ apt-cache-policy: libsqlite3-0 libsqlite3-0.policy
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ LC_ALL=C apt-cache show --quiet libsqlite3-dev=3.40.1-1 <libsqlite3-dev.show
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy
+ sudo apt-get install --quiet --assume-no libsqlite3-0=3.40.1-1 libsqlite3-dev=3.40.1-1
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy
+ EOE
+ libsqlite3 3.40.1 (libsqlite3-0 3.40.1-1) installed
+ EOO
+
+
+ : part-installed
+ :
+ cat <<EOI >=libsqlite3-dev.policy;
+ libsqlite3-dev:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libsqlite3-dev.show;
+ Package: libsqlite3-dev
+ Version: 3.40.1-1
+ Depends: libsqlite3-0 (= 3.40.1-1), libc-dev
+ EOI
+ cat <<EOI >=libsqlite3-0.policy;
+ libsqlite3-0:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libsqlite3 --install libsqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: libsqlite3-dev libsqlite3-dev.policy
+ apt-cache-show: libsqlite3-dev 3.40.1-1 libsqlite3-dev.show
+ apt-cache-policy: libsqlite3-0 libsqlite3-0.policy
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ LC_ALL=C apt-cache show --quiet libsqlite3-dev=3.40.1-1 <libsqlite3-dev.show
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy
+ sudo apt-get install --quiet --assume-no libsqlite3-0 libsqlite3-dev
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy
+ EOE
+ libsqlite3 3.40.1 (libsqlite3-0 3.40.1-1) part installed
+ EOO
+
+
+ : part-installed-upgrade
+ :
+ cat <<EOI >=libsqlite3-dev.policy;
+ libsqlite3-dev:
+ Installed: (none)
+ Candidate: 3.39.4-1
+ Version table:
+ 3.39.4-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libsqlite3-dev.policy-fetched;
+ libsqlite3-dev:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libsqlite3-dev.show-fetched;
+ Package: libsqlite3-dev
+ Version: 3.40.1-1
+ Depends: libsqlite3-0 (= 3.40.1-1), libc-dev
+ EOI
+ cat <<EOI >=libsqlite3-0.policy-fetched;
+ libsqlite3-0:
+ Installed: 3.39.4-1
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ *** 3.39.4-1 100
+ 100 /var/lib/dpkg/status
+ EOI
+ cat <<EOI >=libsqlite3-0.policy-installed;
+ libsqlite3-0:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libsqlite3 --install libsqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: libsqlite3-dev libsqlite3-dev.policy
+ apt-cache-policy-fetched: libsqlite3-dev libsqlite3-dev.policy-fetched
+ apt-cache-show: libsqlite3-dev 3.40.1-1 libsqlite3-dev.show-fetched
+ apt-cache-policy-fetched: libsqlite3-0 libsqlite3-0.policy-fetched
+ apt-cache-policy-installed: libsqlite3-0 libsqlite3-0.policy-installed
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy-fetched
+ LC_ALL=C apt-cache show --quiet libsqlite3-dev=3.40.1-1 <libsqlite3-dev.show-fetched
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy-fetched
+ sudo apt-get install --quiet --assume-no libsqlite3-0 libsqlite3-dev
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy-installed
+ EOE
+ libsqlite3 3.40.1 (libsqlite3-0 3.40.1-1) part installed
+ EOO
+
+
+ : not-installed
+ :
+ cat <<EOI >=libsqlite3-dev.policy;
+ libsqlite3-dev:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libsqlite3-dev.show;
+ Package: libsqlite3-dev
+ Version: 3.40.1-1
+ Depends: libsqlite3-0 (= 3.40.1-1), libc-dev
+ EOI
+ cat <<EOI >=libsqlite3-0.policy;
+ libsqlite3-0:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libsqlite3-0.policy-installed;
+ libsqlite3-0:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libsqlite3 --install libsqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: libsqlite3-dev libsqlite3-dev.policy
+ apt-cache-show: libsqlite3-dev 3.40.1-1 libsqlite3-dev.show
+ apt-cache-policy: libsqlite3-0 libsqlite3-0.policy
+ apt-cache-policy-installed: libsqlite3-0 libsqlite3-0.policy-installed
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ LC_ALL=C apt-cache show --quiet libsqlite3-dev=3.40.1-1 <libsqlite3-dev.show
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy
+ sudo apt-get install --quiet --assume-no libsqlite3-0 libsqlite3-dev
+ LC_ALL=C apt-cache policy --quiet libsqlite3-0 <libsqlite3-0.policy-installed
+ EOE
+ libsqlite3 3.40.1 (libsqlite3-0 3.40.1-1) not installed
+ EOO
+
+
+ : no-install
+ :
+ cat <<EOI >=libsqlite3-dev.policy;
+ libsqlite3-dev:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ $* libsqlite3 <<EOI 2>>EOE != 0
+ apt-cache-policy: libsqlite3-dev libsqlite3-dev.policy
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev <libsqlite3-dev.policy
+ error: no installed system package for libsqlite3
+ EOE
+
+
+ : not-available
+ :
+ $* libsqlite3 --install libsqlite3 <<EOI 2>>EOE != 0
+ apt-cache-policy: libsqlite3-dev !
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev </dev/null
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev </dev/null
+ error: no installed or available system package for libsqlite3
+ EOE
+
+
+ : not-available-no-fetch
+ :
+ $* libsqlite3 --install --no-fetch libsqlite3 <<EOI 2>>EOE != 0
+ apt-cache-policy: libsqlite3-dev !
+ EOI
+ LC_ALL=C apt-cache policy --quiet libsqlite3-dev </dev/null
+ error: no installed or available system package for libsqlite3
+ EOE
+ }
+
+ : sqlite3
+ :
+ {
+ : installed
+ :
+ cat <<EOI >=sqlite3.policy;
+ sqlite3:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* sqlite3 --install sqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: sqlite3 sqlite3.policy
+ EOI
+ LC_ALL=C apt-cache policy --quiet sqlite3 <sqlite3.policy
+ sudo apt-get install --quiet --assume-no sqlite3=3.40.1-1
+ LC_ALL=C apt-cache policy --quiet sqlite3 <sqlite3.policy
+ EOE
+ sqlite3 3.40.1 (sqlite3 3.40.1-1) installed
+ EOO
+
+ : not-installed
+ :
+ cat <<EOI >=sqlite3.policy;
+ sqlite3:
+ Installed: (none)
+ Candidate: 3.39.4-1
+ Version table:
+ 3.39.4-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=sqlite3.policy-fetched;
+ sqlite3:
+ Installed: (none)
+ Candidate: 3.40.1-1
+ Version table:
+ 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=sqlite3.policy-installed;
+ sqlite3:
+ Installed: 3.40.1-1
+ Candidate: 3.40.1-1
+ Version table:
+ *** 3.40.1-1 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ 100 /var/lib/dpkg/status
+ EOI
+ $* sqlite3 --install sqlite3 <<EOI 2>>EOE >>EOO
+ apt-cache-policy: sqlite3 sqlite3.policy
+ apt-cache-policy-fetched: sqlite3 sqlite3.policy-fetched
+ apt-cache-policy-installed: sqlite3 sqlite3.policy-installed
+ EOI
+ LC_ALL=C apt-cache policy --quiet sqlite3 <sqlite3.policy
+ sudo apt-get update --quiet --assume-no
+ LC_ALL=C apt-cache policy --quiet sqlite3 <sqlite3.policy-fetched
+ sudo apt-get install --quiet --assume-no sqlite3
+ LC_ALL=C apt-cache policy --quiet sqlite3 <sqlite3.policy-installed
+ EOE
+ sqlite3 3.40.1 (sqlite3 3.40.1-1) not installed
+ EOO
+ }
+
+ : libssl
+ :
+ {
+ +cat <<EOI >=libcrypto.manifest
+ : 1
+ name: libcrypto
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ debian-name: libssl1.1 libssl-dev
+ debian-to-downstream-version: /1\.1\.1[a-z]/1.1.1/
+ summary: OpenSSL libcrypto
+ license: OpenSSL
+ EOI
+ +cat <<EOI >=libssl.manifest
+ : 1
+ name: libssl
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ debian-name: libssl1.1 libssl-dev
+ debian-to-downstream-version: /1\.1\.1[a-z]/1.1.1/
+ summary: OpenSSL libssl
+ license: OpenSSL
+ EOI
+
+ : installed
+ :
+ ln -s ../libcrypto.manifest ./;
+ ln -s ../libssl.manifest ./;
+ cat <<EOI >=libssl1.1+libssl-dev.policy;
+ libssl1.1:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ libssl-dev:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ EOI
+ cat <<EOI >=libssl1.1.policy-installed;
+ libssl1.1:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libcrypto libssl --install libcrypto libssl <<EOI 2>>EOE >>EOO
+ 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
+ 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
+ sudo apt-get install --quiet --assume-no libssl1.1=1.1.1n-0+deb11u3 libssl-dev=1.1.1n-0+deb11u3
+ LC_ALL=C apt-cache policy --quiet libssl1.1 <libssl1.1.policy-installed
+ EOE
+ libcrypto 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) installed
+ libssl 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) installed
+ EOO
+
+ : part-installed
+ :
+ ln -s ../libcrypto.manifest ./;
+ ln -s ../libssl.manifest ./;
+ cat <<EOI >=libssl1.1+libssl-dev.policy;
+ libssl1.1:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ libssl-dev:
+ Installed: (none)
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ 1.1.1n-0+deb11u3 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libssl1.1.policy-installed;
+ libssl1.1:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libcrypto libssl --install libcrypto libssl <<EOI 2>>EOE >>EOO
+ 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
+ EOI
+ LC_ALL=C apt-cache policy --quiet libssl1.1 libssl-dev <libssl1.1+libssl-dev.policy
+ sudo apt-get update --quiet --assume-no
+ 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
+ sudo apt-get install --quiet --assume-no libssl1.1 libssl-dev
+ LC_ALL=C apt-cache policy --quiet libssl1.1 <libssl1.1.policy-installed
+ EOE
+ libcrypto 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) part installed
+ libssl 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) part installed
+ EOO
+
+ : not-installed
+ :
+ ln -s ../libcrypto.manifest ./;
+ ln -s ../libssl.manifest ./;
+ cat <<EOI >=libssl1.1+libssl-dev.policy;
+ libssl1.1:
+ Installed: (none)
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ libssl-dev:
+ Installed: (none)
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ 1.1.1n-0+deb11u3 500
+ 500 http://deb.debian.org/debian bookworm/main amd64 Packages
+ EOI
+ cat <<EOI >=libssl1.1.policy-installed;
+ libssl1.1:
+ Installed: 1.1.1n-0+deb11u3
+ Candidate: 1.1.1n-0+deb11u3
+ Version table:
+ *** 1.1.1n-0+deb11u3 100
+ 100 /var/lib/dpkg/status
+ EOI
+ $* libcrypto libssl --install libcrypto libssl <<EOI 2>>EOE >>EOO
+ 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
+ EOI
+ LC_ALL=C apt-cache policy --quiet libssl1.1 libssl-dev <libssl1.1+libssl-dev.policy
+ sudo apt-get update --quiet --assume-no
+ 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
+ sudo apt-get install --quiet --assume-no libssl1.1 libssl-dev
+ LC_ALL=C apt-cache policy --quiet libssl1.1 <libssl1.1.policy-installed
+ EOE
+ libcrypto 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) not installed
+ libssl 1.1.1 (libssl1.1 1.1.1n-0+deb11u3) not installed
+ EOO
+ }
+}