Access to changelogs via record parser interface
Add RecordParser::Changelog() and SrcRecordParser::Changelog() functions that returns raw changelog text. libapt-pkg SONAME changed according to libtool versioning rules. Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
This commit is contained in:
parent
01ac47bcaf
commit
1843a505d9
@ -2,7 +2,7 @@
|
|||||||
lib_LTLIBRARIES = libapt-pkg.la
|
lib_LTLIBRARIES = libapt-pkg.la
|
||||||
|
|
||||||
libapt_pkg_la_LIBADD = @RPMLIBS@
|
libapt_pkg_la_LIBADD = @RPMLIBS@
|
||||||
libapt_pkg_la_LDFLAGS = -version-info 2:0:0 -release @GLIBC_VER@-@LIBSTDCPP_VER@
|
libapt_pkg_la_LDFLAGS = -version-info 3:0:1 -release @GLIBC_VER@-@LIBSTDCPP_VER@
|
||||||
|
|
||||||
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
|
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
|
||||||
|
|
||||||
|
@ -92,6 +92,14 @@ string debRecordParser::LongDesc()
|
|||||||
return Section.FindS("Description");
|
return Section.FindS("Description");
|
||||||
}
|
}
|
||||||
/*}}}*/
|
/*}}}*/
|
||||||
|
// RecordParser::Changelog - Return package changelog if any /*{{{*/
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
/* */
|
||||||
|
string debRecordParser::Changelog()
|
||||||
|
{
|
||||||
|
return string("");
|
||||||
|
}
|
||||||
|
/*}}}*/
|
||||||
// RecordParser::SourcePkg - Return the source package name if any /*{{{*/
|
// RecordParser::SourcePkg - Return the source package name if any /*{{{*/
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
/* */
|
/* */
|
||||||
|
@ -44,6 +44,7 @@ class debRecordParser : public pkgRecords::Parser
|
|||||||
virtual string ShortDesc();
|
virtual string ShortDesc();
|
||||||
virtual string LongDesc();
|
virtual string LongDesc();
|
||||||
virtual string Name();
|
virtual string Name();
|
||||||
|
virtual string Changelog();
|
||||||
|
|
||||||
virtual void GetRec(const char *&Start,const char *&Stop);
|
virtual void GetRec(const char *&Start,const char *&Stop);
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
|
|||||||
virtual string Version() const {return Sect.FindS("Version");};
|
virtual string Version() const {return Sect.FindS("Version");};
|
||||||
virtual string Maintainer() const {return Sect.FindS("Maintainer");};
|
virtual string Maintainer() const {return Sect.FindS("Maintainer");};
|
||||||
virtual string Section() const {return Sect.FindS("Section");};
|
virtual string Section() const {return Sect.FindS("Section");};
|
||||||
|
virtual string Changelog() const {return string("");};
|
||||||
virtual const char **Binaries();
|
virtual const char **Binaries();
|
||||||
virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
|
virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
|
||||||
virtual unsigned long Offset() {return iOffset;};
|
virtual unsigned long Offset() {return iOffset;};
|
||||||
|
@ -67,6 +67,7 @@ class pkgRecords::Parser
|
|||||||
virtual string ShortDesc() {return string();};
|
virtual string ShortDesc() {return string();};
|
||||||
virtual string LongDesc() {return string();};
|
virtual string LongDesc() {return string();};
|
||||||
virtual string Name() {return string();};
|
virtual string Name() {return string();};
|
||||||
|
virtual string Changelog() {return string();};
|
||||||
|
|
||||||
// The record in binary form
|
// The record in binary form
|
||||||
virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
|
virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
|
||||||
|
@ -170,6 +170,27 @@ string rpmRecordParser::LongDesc()
|
|||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
/*}}}*/
|
||||||
|
// RecordParser::Changelog - Return package changelog if any /*{{{*/
|
||||||
|
// -----------------------------------------------
|
||||||
|
string rpmRecordParser::Changelog()
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
string rval("");
|
||||||
|
|
||||||
|
str = headerSprintf(HeaderP,
|
||||||
|
"[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]",
|
||||||
|
rpmTagTable, rpmHeaderFormats, NULL);
|
||||||
|
|
||||||
|
if (str && *str) {
|
||||||
|
rval = (const char *)str;
|
||||||
|
}
|
||||||
|
if (str)
|
||||||
|
str = (char *)_free(str);
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
/*}}}*/
|
/*}}}*/
|
||||||
// RecordParser::SourcePkg - Return the source package name if any /*{{{*/
|
// RecordParser::SourcePkg - Return the source package name if any /*{{{*/
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
@ -59,6 +59,7 @@ class rpmRecordParser : public pkgRecords::Parser
|
|||||||
virtual string ShortDesc();
|
virtual string ShortDesc();
|
||||||
virtual string LongDesc();
|
virtual string LongDesc();
|
||||||
virtual string Name();
|
virtual string Name();
|
||||||
|
virtual string Changelog();
|
||||||
|
|
||||||
inline Header GetRecord() { return HeaderP; };
|
inline Header GetRecord() { return HeaderP; };
|
||||||
|
|
||||||
|
@ -191,6 +191,26 @@ string rpmSrcRecordParser::Section() const
|
|||||||
return string(rc?str:"");
|
return string(rc?str:"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SrcRecordParser::Changelog - Package changelog
|
||||||
|
// ----------------------------------------------
|
||||||
|
string rpmSrcRecordParser::Changelog() const
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
string rval("");
|
||||||
|
|
||||||
|
str = headerSprintf(HeaderP,
|
||||||
|
"[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]",
|
||||||
|
rpmTagTable, rpmHeaderFormats, NULL);
|
||||||
|
|
||||||
|
if (str && *str) {
|
||||||
|
rval = (const char *)str;
|
||||||
|
}
|
||||||
|
if (str)
|
||||||
|
str = (char *)_free(str);
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long rpmSrcRecordParser::Offset()
|
unsigned long rpmSrcRecordParser::Offset()
|
||||||
{
|
{
|
||||||
return Handler->Offset();
|
return Handler->Offset();
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
virtual string Version() const;
|
virtual string Version() const;
|
||||||
virtual string Maintainer() const;
|
virtual string Maintainer() const;
|
||||||
virtual string Section() const;
|
virtual string Section() const;
|
||||||
|
virtual string Changelog() const;
|
||||||
virtual const char **Binaries();
|
virtual const char **Binaries();
|
||||||
virtual unsigned long Offset();
|
virtual unsigned long Offset();
|
||||||
virtual string AsStr();
|
virtual string AsStr();
|
||||||
|
@ -70,6 +70,7 @@ class pkgSrcRecords
|
|||||||
virtual string Version() const = 0;
|
virtual string Version() const = 0;
|
||||||
virtual string Maintainer() const = 0;
|
virtual string Maintainer() const = 0;
|
||||||
virtual string Section() const = 0;
|
virtual string Section() const = 0;
|
||||||
|
virtual string Changelog() const = 0;
|
||||||
virtual const char **Binaries() = 0; // Ownership does not transfer
|
virtual const char **Binaries() = 0; // Ownership does not transfer
|
||||||
|
|
||||||
virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly) = 0;
|
virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly) = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user