diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2016-11-29 22:55:57 -0800 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-08-17 12:29:11 -1000 |
commit | 44cf45b356578c70a9b580d65ea33dab4cfa9306 (patch) | |
tree | ec9ac3f25afe8b4783ce0e8bb9273c27bfea4710 | |
parent | 28b6166f80db429fc04ad9c8821ec7d0c54714b0 (diff) |
Most interfaces (Maemo) need a high-level name :/.
-rw-r--r-- | apt-pkg/cacheiterators.h | 1 | ||||
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 9 | ||||
-rw-r--r-- | apt-pkg/deb/debrecords.cc | 9 | ||||
-rw-r--r-- | apt-pkg/deb/debrecords.h | 1 | ||||
-rw-r--r-- | apt-pkg/pkgcache.h | 2 | ||||
-rw-r--r-- | apt-pkg/pkgrecords.h | 1 |
6 files changed, 23 insertions, 0 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 22e5574c9..fdebbdee4 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -216,6 +216,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> { // Accessors inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;} inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;} + inline const char *Display() const {return S->Display == 0?0:Owner->StrP + S->Display;} /** \brief source package name this version comes from Always contains the name, even if it is the same as the binary name */ inline const char *SourcePkgName() const {return Owner->StrP + S->SourcePkgName;} diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 3c148dd01..01fdf0079 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -158,6 +158,15 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) const char *Start; const char *Stop; + if (Section.Find("Name",Start,Stop) == true) + { + Ver->Display = WriteString(Start, Stop - Start); + } + else if (Section.Find("Maemo-Display-Name",Start,Stop) == true) + { + Ver->Display = WriteString(Start, Stop - Start); + } + // Parse the section if (Section.Find(pkgTagSection::Key::Section,Start,Stop) == true) { diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 22ac219ba..e0e8a4c49 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -72,6 +72,15 @@ string debRecordParserBase::Name() return Result; } /*}}}*/ +// RecordParserBase::Display - Return the package homepage /*{{{*/ +string debRecordParserBase::Display() +{ + string display(Section.FindS("Name")); + if (display.empty()) + display = Section.FindS("Maemo-Display-Name"); + return display; +} + /*}}}*/ // RecordParserBase::Homepage - Return the package homepage /*{{{*/ string debRecordParserBase::Homepage() { diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 7c3b9020c..dca6dda20 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -43,6 +43,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser virtual std::string ShortDesc(std::string const &lang) APT_OVERRIDE; virtual std::string LongDesc(std::string const &lang) APT_OVERRIDE; virtual std::string Name() APT_OVERRIDE; + virtual std::string Display() APT_OVERRIDE; virtual std::string Homepage() APT_OVERRIDE; // An arbitrary custom field diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 3a7afd50f..de3d49227 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -629,6 +629,8 @@ struct pkgCache::Version map_stringitem_t VerStr; /** \brief section this version is filled in */ map_stringitem_t Section; + /** \brief high-level name used to display package */ + map_stringitem_t Display; /** \brief source package name this version comes from Always contains the name, even if it is the same as the binary name */ map_stringitem_t SourcePkgName; diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 6d1342d45..dec722330 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -91,6 +91,7 @@ class pkgRecords::Parser /*{{{*/ std::string LongDesc() {return LongDesc("");}; virtual std::string Name() {return std::string();}; + virtual std::string Display() {return std::string();} virtual std::string Homepage() {return std::string();} // An arbitrary custom field |