diff options
| author | Julian Andres Klode <jak@debian.org> | 2022-09-28 15:13:12 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2022-09-28 15:13:12 +0000 |
| commit | f8497bb5e443ef196e5d1bee43cc82ee57a8e3dd (patch) | |
| tree | fbac0c4a04ca633431b69f59f62c655780627c50 /apt-pkg | |
| parent | 8d3540402799860eb76cd112d82efb4275f19e46 (diff) | |
| parent | 5f5a8deedffac3cdeeb2f178d910d3759d366e8e (diff) | |
Merge branch 'pu/phased-updates-fixes-2022-09-23' into 'main'
phased update improvements
See merge request apt-team/apt!262
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/algorithms.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/edsp.cc | 7 | ||||
| -rw-r--r-- | apt-pkg/upgrade.cc | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 09fd78329..26d8c71c2 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1359,8 +1359,8 @@ bool pkgProblemResolver::ResolveByKeepInternal() if (Cache[Pkg].InstallVer == 0 || Pkg->CurrentVer == 0) continue; - - if (not Cache[I].Protect()) + + if (not Cache[Pkg].Protect()) { if (Debug == true) clog << " Keeping Package " << Pkg.FullName(false) << " due to " << Start.DepType() << endl; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 6493a4595..9d196eed3 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -83,6 +83,8 @@ static bool WriteScenarioVersion(FileFd &output, pkgCache::PkgIterator const &Pk "\nArchitecture: ", Ver.Arch(), "\nVersion: ", Ver.VerStr()); WriteOkay(Okay, output, "\nAPT-ID: ", Ver->ID); + if (Ver.PhasedUpdatePercentage() != 100) + WriteOkay(Okay, output, "\nPhased-Update-Percentage: ", Ver.PhasedUpdatePercentage()); if ((Pkg->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) WriteOkay(Okay, output, "\nEssential: yes"); if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) @@ -361,6 +363,9 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FileFd &output, } bool Okay = WriteGenericRequestHeaders(output, "Request: EDSP 0.5\n"); + string machineID = APT::Configuration::getMachineID(); + if (not machineID.empty()) + WriteOkay(Okay, output, "Machine-ID: ", machineID, "\n"); if (del.empty() == false) WriteOkay(Okay, output, "Remove:", del, "\n"); if (inst.empty() == false) @@ -589,6 +594,8 @@ bool EDSP::ReadRequest(int const input, std::list<std::string> &install, _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 diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc index a7e18026b..e3e98e5c6 100644 --- a/apt-pkg/upgrade.cc +++ b/apt-pkg/upgrade.cc @@ -107,6 +107,7 @@ struct PhasedUpgrader continue; Cache.MarkKeep(I, false, false); + Cache.MarkProtected(I); if (Fix != nullptr) Fix->Protect(I); } @@ -133,6 +134,8 @@ static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress) pkgDepCache::ActionGroup group(Cache); + PhasedUpgrader().HoldBackIgnoredPhasedUpdates(Cache, nullptr); + /* Upgrade all installed packages first without autoinst to help the resolver in versioned or-groups to upgrade the old solver instead of installing a new one (if the old solver is not the first one [anymore]) */ |
