This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH setup 12/13] Restore packagemeta::LDesc()


---
 package_meta.cc | 15 +++++++++++++++
 package_meta.h  |  5 +++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/package_meta.cc b/package_meta.cc
index 4f7d39a..85aaaf9 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -404,6 +404,21 @@ packagemeta::SDesc () const
   return std::string();
 }
 
+static bool
+hasLDesc(packageversion const &pkg)
+{
+  return pkg.LDesc().size();
+}
+
+const std::string
+packagemeta::LDesc () const
+{
+  set<packageversion>::iterator i = find_if (versions.begin(), versions.end(), hasLDesc);
+  if (i == versions.end())
+    return std::string();
+  return i->LDesc ();
+};
+
 /* Return an appropriate caption given the current action. */
 std::string 
 packagemeta::action_caption () const
diff --git a/package_meta.h b/package_meta.h
index 8a42319..0eff8d0 100644
--- a/package_meta.h
+++ b/package_meta.h
@@ -108,9 +108,10 @@ public:
   bool isManuallyWanted() const;
   /* true if package was deleted on command-line. */
   bool isManuallyDeleted() const;
-  /* SDesc is global in theory, across all package versions. 
-     LDesc is not: it can be different per version */
+
   const std::string SDesc () const;
+  const std::string LDesc () const;
+
   /* what categories does this package belong in. Note that if multiple versions
    * of a package disagree.... the first one read in will take precedence.
    */
-- 
2.17.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]