diff options
| author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-02-25 11:55:54 +0100 |
|---|---|---|
| committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-02-25 11:55:54 +0100 |
| commit | 546601f1df0536ba7818eec31eb658676e11f56f (patch) | |
| tree | c9f12e9b99926207ff9fda4ebaa1929acc6c807c /lib/MiddleWare | |
| parent | 605c08c7d9607f2c98d0b7588dd8d55ca8d23f2b (diff) | |
added package's description
Diffstat (limited to 'lib/MiddleWare')
| -rw-r--r-- | lib/MiddleWare/RPMInfo.cpp | 9 | ||||
| -rw-r--r-- | lib/MiddleWare/RPMInfo.h | 2 |
2 files changed, 9 insertions, 2 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); diff --git a/lib/MiddleWare/RPMInfo.h b/lib/MiddleWare/RPMInfo.h index 2850fd6..f2d00aa 100644 --- a/lib/MiddleWare/RPMInfo.h +++ b/lib/MiddleWare/RPMInfo.h @@ -46,7 +46,7 @@ class CRPMInfo bool CheckFingerprint(const std::string& pPackage); bool CheckHash(const std::string& pPackage, const std::string&pPath); - std::string GetPackage(const std::string& pFileName); + std::string GetPackage(const std::string& pFileName, std::string& pDescription); }; #endif /* RPMINFO_H_ */ |
