summaryrefslogtreecommitdiffstats
path: root/lib/MiddleWare/RPMInfo.cpp
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-02-25 11:55:54 +0100
committerZdenek Prikryl <zprikryl@redhat.com>2009-02-25 11:55:54 +0100
commit546601f1df0536ba7818eec31eb658676e11f56f (patch)
treec9f12e9b99926207ff9fda4ebaa1929acc6c807c /lib/MiddleWare/RPMInfo.cpp
parent605c08c7d9607f2c98d0b7588dd8d55ca8d23f2b (diff)
downloadabrt-546601f1df0536ba7818eec31eb658676e11f56f.tar.gz
abrt-546601f1df0536ba7818eec31eb658676e11f56f.tar.xz
abrt-546601f1df0536ba7818eec31eb658676e11f56f.zip
added package's description
Diffstat (limited to 'lib/MiddleWare/RPMInfo.cpp')
-rw-r--r--lib/MiddleWare/RPMInfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MiddleWare/RPMInfo.cpp b/lib/MiddleWare/RPMInfo.cpp
index 55dccd2..605f698 100644
--- a/lib/MiddleWare/RPMInfo.cpp
+++ b/lib/MiddleWare/RPMInfo.cpp
@@ -96,7 +96,7 @@ bool CRPMInfo::CheckHash(const std::string& pPackage, const std::string& pPath)
return ret;
}
-std::string CRPMInfo::GetPackage(const std::string& pFileName)
+std::string CRPMInfo::GetPackage(const std::string& pFileName, std::string& pDescription)
{
std::string ret = "";
rpmts ts = rpmtsCreate();
@@ -110,6 +110,13 @@ std::string CRPMInfo::GetPackage(const std::string& pFileName)
ret = nerv;
free(nerv);
}
+ rpmtd td = rpmtdNew();
+ headerGet(header, RPMTAG_SUMMARY, td, HEADERGET_DEFAULT);
+ const char* summary = rpmtdGetString(td);
+ headerGet(header, RPMTAG_DESCRIPTION, td, HEADERGET_DEFAULT);
+ const char* description = rpmtdGetString(td);
+ pDescription = summary + std::string("\n\n") + description;
+ rpmtdFree(td);
}
rpmdbFreeIterator(iter);