summaryrefslogtreecommitdiff
path: root/cmdline/apt-extracttemplates.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2022-04-01 13:45:09 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2022-04-01 14:16:19 +0200
commit472376be6818b5ea43250abcbecfcab53b4a729a (patch)
tree892879ac883236b867e058a82b7ca153b3c56fc4 /cmdline/apt-extracttemplates.cc
parent0b156cd1711a5e27643b941f5a321a62e5a9b628 (diff)
Use pkgTagSection::Key in more places in src:apt
The speed critical paths were converted earlier, but the remaining could benefit a tiny bit from this as well especially as we have the facility now available and can therefore brush up the code in various places in the process as well. Also takes the time to add the hidden Exists method advertised in the headers, but previously not implemented.
Diffstat (limited to 'cmdline/apt-extracttemplates.cc')
-rw-r--r--cmdline/apt-extracttemplates.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 01b5dbb11..88a204110 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -28,6 +28,7 @@
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/sourcelist.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile-keys.h>
#include <apt-pkg/tagfile.h>
#include <apt-pkg/version.h>
@@ -170,11 +171,11 @@ bool DebFile::ParseInfo()
if (Section.Scan(Control, ControlLen) == false)
return false;
- Package = Section.FindS("Package");
+ Package = Section.Find(pkgTagSection::Key::Package).to_string();
Version = GetInstalledVer(Package);
const char *Start, *Stop;
- if (Section.Find("Depends", Start, Stop) == true)
+ if (Section.Find(pkgTagSection::Key::Depends, Start, Stop))
{
while (1)
{
@@ -191,8 +192,8 @@ bool DebFile::ParseInfo()
if (Start == Stop) break;
}
}
-
- if (Section.Find("Pre-Depends", Start, Stop) == true)
+
+ if (Section.Find(pkgTagSection::Key::Pre_Depends, Start, Stop))
{
while (1)
{