This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 11/13] Add LDesc() accessor method to SolvableVersion
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Sun, 5 Aug 2018 23:08:49 +0100
- Subject: [PATCH setup 11/13] Add LDesc() accessor method to SolvableVersion
- References: <20180805220851.270212-1-jon.turney@dronecode.org.uk>
---
libsolv.cc | 14 ++++++++++++++
libsolv.h | 1 +
2 files changed, 15 insertions(+)
diff --git a/libsolv.cc b/libsolv.cc
index 955a1b2..ba54fc5 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -192,6 +192,20 @@ SolvableVersion::SDesc () const
return sdesc;
}
+const std::string
+SolvableVersion::LDesc () const
+{
+ if (!id)
+ return "";
+ Solvable *solvable = pool_id2solvable(pool, id);
+ const char *ldesc = repo_lookup_str(solvable->repo, id, SOLVABLE_DESCRIPTION);
+
+ if (!ldesc)
+ return "";
+
+ return ldesc;
+}
+
const std::string
SolvableVersion::sourcePackageName () const
{
diff --git a/libsolv.h b/libsolv.h
index f394e65..2eb1f24 100644
--- a/libsolv.h
+++ b/libsolv.h
@@ -54,6 +54,7 @@ class SolvableVersion
const std::string Name () const;
const std::string SDesc () const;
+ const std::string LDesc () const;
// In setup-speak, 'Canonical' version means 'e:v-r', the non-decomposed version
const std::string Canonical_version () const;
// Return the dependency list
--
2.17.0