From 5c595097000d31ce1aa016e0d376bddc30a8e746 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 26 Sep 2023 11:47:01 +0300 Subject: Improve 'unable to upgrade package' diagnostics in pkg-build --- bpkg/pkg-build-collect.cxx | 10 +++++----- tests/pkg-build.testscript | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx index c7180d2..47e097f 100644 --- a/bpkg/pkg-build-collect.cxx +++ b/bpkg/pkg-build-collect.cxx @@ -499,11 +499,11 @@ namespace bpkg dr << info << "package " << p.available_name_version () << " required by" << rb; - dr << info << "explicitly request up/downgrade of package " - << dk.name; - - dr << info << "or explicitly specify package " << n - << " version to manually satisfy these constraints" << endf; + dr << info << "consider re-trying with --upgrade|-u potentially combined " + << "with --recursive|-r" << + info << "or explicitly request up/downgrade of package " << dk.name << + info << "or explicitly specify package " << n << " version to " + << "manually satisfy these constraints" << endf; } // postponed_configuration diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index 34b0663..1c0480d 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -1271,7 +1271,8 @@ test.arguments += --sys-no-query $* libfoo/1.0.0 2>>EOE != 0; error: unable to downgrade package libfoo/1.1.0 to 1.0.0 info: because package libbar depends on (libfoo == 1.1.0) - info: explicitly request up/downgrade of package libbar + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package libbar info: or explicitly specify package libfoo version to manually satisfy these constraints EOE @@ -1306,7 +1307,8 @@ test.arguments += --sys-no-query $* libfoo/1.0.0 +{ --config-id 1 } 2>>~%EOE% != 0; %error: unable to downgrade package libfoo/1.1.0 \[cfg.\] to 1.0.0% % info: because package libbar \[cfg.\] depends on \(libfoo == 1.1.0\)% - info: explicitly request up/downgrade of package libbar + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package libbar info: or explicitly specify package libfoo version to manually satisfy these constraints EOE @@ -2112,7 +2114,8 @@ test.arguments += --sys-no-query error: unable to upgrade package libbar/1.0.0 to 2.0.0 info: because package libbox depends on (libbar ^1.0.0) info: package libbar/2.0.0 required by libbaz - info: explicitly request up/downgrade of package libbox + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package libbox info: or explicitly specify package libbar version to manually satisfy these constraints EOE @@ -2206,7 +2209,8 @@ test.arguments += --sys-no-query error: unable to upgrade package libbar/1.0.0 to 2.0.0 info: because package libbox depends on (libbar ^1.0.0) info: package libbar/2.0.0 required by libbaz - info: explicitly request up/downgrade of package libbox + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package libbox info: or explicitly specify package libbar version to manually satisfy these constraints EOE @@ -5463,7 +5467,8 @@ test.arguments += --sys-no-query error: unable to downgrade package libfoo/2.0.0 to 1.0.0 info: because package tpx depends on (libfoo >= 2.0.0) info: package libfoo/1.0.0 required by tax - info: explicitly request up/downgrade of package tpx + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package tpx info: or explicitly specify package libfoo version to manually satisfy these constraints EOE @@ -5475,7 +5480,8 @@ test.arguments += --sys-no-query $* tax tpx ?libfoo/1.0.0 2>>EOE != 0; error: unable to downgrade package libfoo/2.0.0 to 1.0.0 info: because package tpx depends on (libfoo >= 2.0.0) - info: explicitly request up/downgrade of package tpx + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package tpx info: or explicitly specify package libfoo version to manually satisfy these constraints EOE @@ -24079,7 +24085,8 @@ else $* ?libbaz/1.0.0 +{ --config-name h2 } 2>>~%EOE% != 0; %error: unable to downgrade package libbaz/1.1.0 \[h2.\] to 1.0.0% % info: because package foo \[h2.\] depends on \(libbaz \^1.1.0\)% - info: explicitly request up/downgrade of package foo + info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r + info: or explicitly request up/downgrade of package foo info: or explicitly specify package libbaz version to manually satisfy these constraints EOE -- cgit v1.1