diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-03-26 16:24:17 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-03-26 16:24:17 +0000 |
| commit | 75b9d167825be0d6f22884ce4a8b8392bdd12d63 (patch) | |
| tree | 401af4400996089a79c4ad61277538fdf90d8ad9 | |
| parent | 823ff724d013dbe484e3da91bd54ae972f85629c (diff) | |
| parent | 6e5d8929c06cb645e639022477a14ca65d483e32 (diff) | |
Merge branch 'solver3-crash-escape' into 'main'
solver3: Correctly deb822-escape error message in evaluation report
See merge request apt-team/apt!469
| -rw-r--r-- | apt-private/private-install.cc | 4 | ||||
| -rwxr-xr-x | test/integration/test-solver3-evaluation | 35 |
2 files changed, 38 insertions, 1 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index f1211d25e..7103c6dc7 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -128,7 +128,9 @@ static void WriteApportReport(pkgCacheFile &Cache, std::string &title, std::vect { crash << "ErrorMessage:\n"; for (auto &error : errors) - crash << " " << error << "\n"; + { + crash << " " << SubstVar(SubstVar(APT::String::Strip(error), "\n\n", "\n.\n"), "\n", "\n ") << "\n"; + } } std::ifstream toCopy(edspDump.Name()); diff --git a/test/integration/test-solver3-evaluation b/test/integration/test-solver3-evaluation index c01ec9608..71d117f7d 100755 --- a/test/integration/test-solver3-evaluation +++ b/test/integration/test-solver3-evaluation @@ -145,3 +145,38 @@ E: The following information from --solver 3.0 may provide additional context: 2. a:amd64 Depends c but none of the choices are installable: - c:amd64 is not selected for install" apt install -s a c- --solver internal + + +rm rootdir/var/crash/apt-edsp.$(id -u).crash + +testsuccessequal "Reading package lists... +Building dependency tree... +Solving dependencies... +Writing error report... +The following additional packages will be installed: + c +The following NEW packages will be installed: + a c +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst c (3 unstable [all]) +Inst a (3 unstable [all]) +Conf c (3 unstable [all]) +Conf a (3 unstable [all])" aptget install a --solver internal -s -o Dir::Apport=var/crash -o APT::Solver::Install=false + +testsuccess sed -i "s/^Date:.*/Date: Sun Mar 9 00:08:41 2025/" rootdir/var/crash/apt-edsp.$(id -u).crash + +testsuccessequal "ProblemType: AptSolver +Architecture: amd64 +Date: Sun Mar 9 00:08:41 2025 +Package: apt +Title: Failure: The 3.0 solver did not find a result +SourcePackage: apt +ErrorMessage: + Unable to satisfy dependencies. Reached two conflicting decisions: + 1. a:amd64=3 is selected for install + . + 2. a:amd64 Depends c + but none of the choices are installable: + - c:amd64 is not selected for install +AptSolverDump: +$(cat rootdir/var/log/apt/edsp.log.zst | base64 | sed 's#^# #')" cat rootdir/var/crash/apt-edsp.$(id -u).crash |
