Kaynağa Gözat

[ABI break] merged patch from Jonathan Thomas to have a new
RecordField() function in the pkgRecorder parser. Many thanks
Thomas

Michael Vogt 15 yıl önce
ebeveyn
işleme
75bda61948

+ 9 - 0
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		/*{{{*/
 // ---------------------------------------------------------------------
 /* */

+ 3 - 0
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);

+ 4 - 1
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;};
    

+ 3 - 0
debian/changelog

@@ -14,6 +14,9 @@ apt (0.8.16~exp4) UNRELEASED; urgency=low
     - cleanup old ABI break avoidance hacks
   * [ABI break] apt-pkg/acquire-item.{cc,h}:
     - cleanup around OptionalIndexTarget and SubIndexTarget
+  * [ABI break] merged patch from Jonathan Thomas to have a new
+    RecordField() function in the pkgRecorder parser. Many thanks
+    Thomas
 
  -- Julian Andres Klode <jak@debian.org>  Wed, 20 Jul 2011 16:23:55 +0200