diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-08-26 12:28:46 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-08-26 12:28:46 +0000 |
| commit | 8b67bde9a04fce5fbf155f8918de44264cc37086 (patch) | |
| tree | 17a7faafbe11f19a89fd846ecdbde943241bd625 | |
| parent | 28591b9ca76f5bf62942fea0b32fc6adac1f1318 (diff) | |
| parent | 171c469927b1b7c5a4f81f113081985e7dc84597 (diff) | |
Merge branch 'edsp-architectures' into 'main'
edsp: Bug fixes for architecture reading and dumping solver errors
See merge request apt-team/apt!483
| -rw-r--r-- | apt-pkg/edsp.cc | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 02e8d4ef4..6c9c3f3ee 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -595,42 +595,46 @@ bool EDSP::ReadRequest(int const input, std::list<std::string> &install, continue; // The first Tag must be a request, so search for it if (LineStartsWithAndStrip(line, "Request:")) - continue; + break; + } - while (ReadLine(input, line) == true) + while (ReadLine(input, line)) + { + // empty lines are the end of the request + if (line.empty() == true) { - // empty lines are the end of the request - if (line.empty() == true) - return true; + // Clear the architecture cache, since we may have set different ones + APT::Configuration::getArchitectures(false); + return true; + } - std::list<std::string> *request = NULL; - if (LineStartsWithAndStrip(line, "Install:")) - request = &install; - else if (LineStartsWithAndStrip(line, "Remove:")) - request = &remove; - else if (ReadFlag(flags, line, "Upgrade:", (Request::UPGRADE_ALL | Request::FORBID_REMOVE | Request::FORBID_NEW_INSTALL)) || + std::list<std::string> *request = NULL; + if (LineStartsWithAndStrip(line, "Install:")) + request = &install; + else if (LineStartsWithAndStrip(line, "Remove:")) + request = &remove; + else if (ReadFlag(flags, line, "Upgrade:", (Request::UPGRADE_ALL | Request::FORBID_REMOVE | Request::FORBID_NEW_INSTALL)) || ReadFlag(flags, line, "Dist-Upgrade:", Request::UPGRADE_ALL) || ReadFlag(flags, line, "Upgrade-All:", Request::UPGRADE_ALL) || ReadFlag(flags, line, "Forbid-New-Install:", Request::FORBID_NEW_INSTALL) || ReadFlag(flags, line, "Forbid-Remove:", Request::FORBID_REMOVE) || ReadFlag(flags, line, "Autoremove:", Request::AUTOREMOVE)) - ; - else if (LineStartsWithAndStrip(line, "Architecture:")) - _config->Set("APT::Architecture", line); - else if (LineStartsWithAndStrip(line, "Architectures:")) - _config->Set("APT::Architectures", SubstVar(line, " ", ",")); - else if (LineStartsWithAndStrip(line, "Machine-ID")) - _config->Set("APT::Machine-ID", line); - else if (LineStartsWithAndStrip(line, "Solver:")) - ; // purely informational line - else - _error->Warning("Unknown line in EDSP Request stanza: %s", line.c_str()); + ; + else if (LineStartsWithAndStrip(line, "Architecture:")) + _config->Set("APT::Architecture", line); + else if (LineStartsWithAndStrip(line, "Architectures:")) + _config->Set("APT::Architectures", SubstVar(line, " ", ",")); + else if (LineStartsWithAndStrip(line, "Machine-ID")) + _config->Set("APT::Machine-ID", line); + else if (LineStartsWithAndStrip(line, "Solver:")) + ; // purely informational line + else + _error->Warning("Unknown line in EDSP Request stanza: %s", line.c_str()); - if (request == NULL) - continue; - auto const pkgs = VectorizeString(line, ' '); - std::move(pkgs.begin(), pkgs.end(), std::back_inserter(*request)); - } + if (request == NULL) + continue; + auto const pkgs = VectorizeString(line, ' '); + std::move(pkgs.begin(), pkgs.end(), std::back_inserter(*request)); } return false; } /*}}}*/ |
