summaryrefslogtreecommitdiff
path: root/cmdline/apt-sortpkgs.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2022-05-06 16:20:52 +0000
committerJulian Andres Klode <jak@debian.org>2022-05-06 16:20:52 +0000
commit97f16727b50dcaa4810e80d3c16639e0ce6a0958 (patch)
tree1228c44118015b13b2f94177571c6780eb861a7e /cmdline/apt-sortpkgs.cc
parent6778e2d672d84c962a578f6de415c666b9cf6ee1 (diff)
parent05fae6fae95d8ef6690f3d56863e3bb6a44d424c (diff)
Merge branch 'fix/tagfilekeys' into 'main'
Consistently dealing with fields via pkgTagSection::Key See merge request apt-team/apt!233
Diffstat (limited to 'cmdline/apt-sortpkgs.cc')
-rw-r--r--cmdline/apt-sortpkgs.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index da451708f..519825457 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -20,6 +20,7 @@
#include <apt-pkg/init.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile-keys.h>
#include <apt-pkg/tagfile.h>
#include <apt-private/private-cmndline.h>
@@ -85,9 +86,9 @@ static bool DoIt(string InFile)
/* Fetch the name, auto-detecting if this is a source file or a
package file */
- Tmp.Name = Section.FindS("Package");
- Tmp.Ver = Section.FindS("Version");
- Tmp.Arch = Section.FindS("Architecture");
+ Tmp.Name = Section.Find(pkgTagSection::Key::Package).to_string();
+ Tmp.Ver = Section.Find(pkgTagSection::Key::Version).to_string();
+ Tmp.Arch = Section.Find(pkgTagSection::Key::Architecture).to_string();
if (Tmp.Name.empty() == true)
return _error->Error(_("Unknown package record!"));