29#ifndef PKGLIB_ALGORITHMS_H
30#define PKGLIB_ALGORITHMS_H
33#include <apt-pkg/depcache.h>
34#include <apt-pkg/packagemanager.h>
41#include <apt-pkg/macros.h>
49 std::unique_ptr<pkgSimulatePrivate>
const d;
57 VerIterator GetCandidateVer(PkgIterator
const &Pkg)
override
59 return (*Cache)[Pkg].CandidateVerIter(*Cache);
65 std::unique_ptr<unsigned char[]> Flags;
72 bool Install(PkgIterator Pkg, std::string File)
override;
73 bool Configure(PkgIterator Pkg)
override;
74 bool Remove(PkgIterator Pkg,
bool Purge)
override;
80 APT_HIDDEN
void ShortBreaks();
81 APT_HIDDEN
void Describe(PkgIterator iPkg,std::ostream &out,
bool Current,
bool Candidate);
82 APT_HIDDEN
bool RealInstall(PkgIterator Pkg,std::string File);
83 APT_HIDDEN
bool RealConfigure(PkgIterator Pkg);
84 APT_HIDDEN
bool RealRemove(PkgIterator Pkg,
bool Purge);
99 typedef pkgCache::PkgIterator PkgIterator;
100 typedef pkgCache::VerIterator VerIterator;
101 typedef pkgCache::DepIterator DepIterator;
102 typedef pkgCache::PrvIterator PrvIterator;
108 Protected = (1 << 0),
109 PreInstalled = (1 << 1),
110 Upgradable = (1 << 2),
111 ReInstateTried = (1 << 3),
113 BrokenPolicyAllowed = (1 << 5)
115 std::unique_ptr<int[]> Scores;
116 std::unique_ptr<unsigned char[]> Flags;
120 APT_HIDDEN
int ScoreSort(
Package const *A,
Package const *B) APT_PURE;
122 struct APT_PUBLIC PackageKill
128 APT_HIDDEN
void MakeScores();
129 APT_HIDDEN
bool DoUpgrade(pkgCache::PkgIterator Pkg);
132 bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
136 inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);};
137 inline void Remove(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= ToRemove;};
138 inline void Clear(pkgCache::PkgIterator Pkg) { Flags[Pkg->ID] &= ~(Protected | ToRemove | BrokenPolicyAllowed); };
139#ifdef APT_COMPILING_APT
140 inline void AllowBrokenPolicy(pkgCache::PkgIterator Pkg) { Flags[Pkg->ID] |= BrokenPolicyAllowed; };
143 bool KeepPhasedUpdates();
146 bool Resolve(
bool BrokenFix =
false,
OpProgress *
const Progress = NULL);
147 APT_HIDDEN
bool ResolveInternal(
bool const BrokenFix =
false);
150 bool ResolveByKeep(
OpProgress *
const Progress = NULL);
151 APT_HIDDEN
bool ResolveByKeepInternal();
164namespace KernelAutoRemoveHelper
167APT_PUBLIC std::unique_ptr<APT::CacheFilter::Matcher> GetProtectedKernelsFilter(
pkgCache *cache,
bool returnRemove =
false);
168std::string GetProtectedKernelsRegex(
pkgCache *cache,
bool ReturnRemove =
false);
169std::string getUname(std::string
const &packageName);
Definition install-progress.h:18
Definition cacheiterators.h:47
Represents an active action group.
Definition depcache.h:142
Definition depcache.h:250
Definition packagemanager.h:49
Definition algorithms.h:93
Definition algorithms.cc:49
Definition algorithms.h:53
Definition algorithms.h:48
pkgCache - Structure definitions for the cache file
contains information for a single unique package
Definition pkgcache.h:460
information for a single version of a package
Definition pkgcache.h:652