diff options
| author | Julian Andres Klode <jak@debian.org> | 2022-05-06 16:20:52 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2022-05-06 16:20:52 +0000 |
| commit | 97f16727b50dcaa4810e80d3c16639e0ce6a0958 (patch) | |
| tree | 1228c44118015b13b2f94177571c6780eb861a7e /apt-pkg/depcache.cc | |
| parent | 6778e2d672d84c962a578f6de415c666b9cf6ee1 (diff) | |
| parent | 05fae6fae95d8ef6690f3d56863e3bb6a44d424c (diff) | |
Merge branch 'fix/tagfilekeys' into 'main'
Consistently dealing with fields via pkgTagSection::Key
See merge request apt-team/apt!233
Diffstat (limited to 'apt-pkg/depcache.cc')
| -rw-r--r-- | apt-pkg/depcache.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index f7d9832a0..a5b586f5b 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -23,6 +23,7 @@ #include <apt-pkg/prettyprinters.h> #include <apt-pkg/progress.h> #include <apt-pkg/strutl.h> +#include <apt-pkg/tagfile-keys.h> #include <apt-pkg/tagfile.h> #include <apt-pkg/version.h> #include <apt-pkg/versionmatch.h> @@ -310,8 +311,8 @@ bool pkgDepCache::readStateFile(OpProgress * const Prog) /*{{{*/ off_t amt = 0; bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false); while(tagfile.Step(section)) { - string const pkgname = section.FindS("Package"); - string pkgarch = section.FindS("Architecture"); + auto const pkgname = section.Find(pkgTagSection::Key::Package); + auto pkgarch = section.Find(pkgTagSection::Key::Architecture); if (pkgarch.empty() == true) pkgarch = "any"; pkgCache::PkgIterator pkg = Cache->FindPkg(pkgname, pkgarch); @@ -379,8 +380,8 @@ bool pkgDepCache::writeStateFile(OpProgress * const /*prog*/, bool const Install pkgTagSection section; std::set<string> pkgs_seen; while(tagfile.Step(section)) { - string const pkgname = section.FindS("Package"); - string pkgarch = section.FindS("Architecture"); + auto const pkgname = section.Find(pkgTagSection::Key::Package); + auto pkgarch = section.Find(pkgTagSection::Key::Architecture); if (pkgarch.empty() == true) pkgarch = "native"; // Silently ignore unknown packages and packages with no actual |
