diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire.cc | 4 | ||||
-rw-r--r-- | apt-pkg/algorithms.cc | 4 | ||||
-rw-r--r-- | apt-pkg/contrib/fileutl.h | 1 | ||||
-rw-r--r-- | apt-pkg/contrib/progress.cc | 2 | ||||
-rw-r--r-- | apt-pkg/edsp.cc | 7 | ||||
-rw-r--r-- | apt-pkg/upgrade.cc | 3 |
6 files changed, 16 insertions, 5 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 100ccde32..dd0624ad6 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -53,11 +53,11 @@ using namespace std; // helper to convert time_point to a timeval -static struct timeval SteadyDurationToTimeVal(std::chrono::steady_clock::duration Time) +constexpr struct timeval SteadyDurationToTimeVal(std::chrono::steady_clock::duration Time) { auto const Time_sec = std::chrono::duration_cast<std::chrono::seconds>(Time); auto const Time_usec = std::chrono::duration_cast<std::chrono::microseconds>(Time - Time_sec); - return {Time_sec.count(), Time_usec.count()}; + return timeval{static_cast<time_t>(Time_sec.count()), static_cast<suseconds_t>(Time_usec.count())}; } std::string pkgAcquire::URIEncode(std::string const &part) /*{{{*/ 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/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index f4eefd7c2..6f808ac9b 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -26,6 +26,7 @@ #include <set> #include <string> #include <vector> +#include <sys/stat.h> #include <time.h> /* Define this for python-apt */ diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 03f88d4ce..eb688b9a2 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -122,7 +122,7 @@ bool OpProgress::CheckChange(float Interval) auto const Now = std::chrono::steady_clock::now().time_since_epoch(); auto const Now_sec = std::chrono::duration_cast<std::chrono::seconds>(Now); auto const Now_usec = std::chrono::duration_cast<std::chrono::microseconds>(Now - Now_sec); - struct timeval NowTime = { Now_sec.count(), Now_usec.count() }; + struct timeval NowTime = { static_cast<time_t>(Now_sec.count()), static_cast<suseconds_t>(Now_usec.count()) }; std::chrono::duration<decltype(Interval)> Delta = std::chrono::seconds(NowTime.tv_sec - LastTime.tv_sec) + 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]) */ |