summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 11:58:55 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 11:58:55 +0200
commit75bda61948950a88fdd41a5362920cc46c9669e2 (patch)
tree8e8d278d44be6d31d0ab4cd086ccedd08bf9aa15 /apt-pkg
parent14b4780d0da30493b949bf65587f4e8a71db561d (diff)
[ABI break] merged patch from Jonathan Thomas to have a new
RecordField() function in the pkgRecorder parser. Many thanks Thomas
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/debrecords.cc9
-rw-r--r--apt-pkg/deb/debrecords.h3
-rw-r--r--apt-pkg/pkgrecords.h5
3 files changed, 16 insertions, 1 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index 1ca9ae1d2..f323c03c2 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -101,6 +101,15 @@ string debRecordParser::Maintainer()
return Section.FindS("Maintainer");
}
/*}}}*/
+// RecordParser::RecordField - Return the value of an arbitrary field /*{{*/
+// ---------------------------------------------------------------------
+/* */
+string debRecordParser::RecordField(const char *fieldName)
+{
+ return Section.FindS(fieldName);
+}
+
+ /*}}}*/
// RecordParser::ShortDesc - Return a 1 line description /*{{{*/
// ---------------------------------------------------------------------
/* */
diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h
index 9692ac94c..7868bfa3d 100644
--- a/apt-pkg/deb/debrecords.h
+++ b/apt-pkg/deb/debrecords.h
@@ -50,6 +50,9 @@ class debRecordParser : public pkgRecords::Parser
virtual string Name();
virtual string Homepage();
+ // An arbitrary custom field
+ virtual string RecordField(const char *fieldName);
+
virtual void GetRec(const char *&Start,const char *&Stop);
debRecordParser(string FileName,pkgCache &Cache);
diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h
index 78e39e577..ce92cacc4 100644
--- a/apt-pkg/pkgrecords.h
+++ b/apt-pkg/pkgrecords.h
@@ -69,7 +69,10 @@ class pkgRecords::Parser /*{{{*/
virtual string LongDesc() {return string();};
virtual string Name() {return string();};
virtual string Homepage() {return string();}
-
+
+ // An arbitrary custom field
+ virtual string RecordField(const char *fieldName) { return string();};
+
// The record in binary form
virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};