1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
diff -ru apt-0.7.25.3/apt-pkg/cacheiterators.h apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h
--- apt-0.7.25.3/apt-pkg/cacheiterators.h 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/cacheiterators.h 2010-02-23 20:59:22.000000000 +0000
@@ -71,6 +71,7 @@
inline pkgCache *Cache() {return Owner;};
inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
+ inline const char *Display() const {return Pkg->Display == 0?0:Owner->StrP + Pkg->Display;};
inline const char *Section() const {return Pkg->Section == 0?0:Owner->StrP + Pkg->Section;};
inline bool Purge() const {return Pkg->CurrentState == pkgCache::State::Purge ||
(Pkg->CurrentVer == 0 && Pkg->CurrentState == pkgCache::State::NotInstalled);};
@@ -132,6 +133,7 @@
inline pkgCache *Cache() {return Owner;};
inline const char *VerStr() const {return Ver->VerStr == 0?0:Owner->StrP + Ver->VerStr;};
+ inline const char *Display() const {return Ver->Display == 0?0:Owner->StrP + Ver->Display;};
inline const char *Section() const {return Ver->Section == 0?0:Owner->StrP + Ver->Section;};
inline const char *Arch() const {return Ver->Arch == 0?0:Owner->StrP + Ver->Arch;};
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Ver->ParentPkg);};
diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.cc apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc
--- apt-0.7.25.3/apt-pkg/deb/deblistparser.cc 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.cc 2010-02-23 20:59:56.000000000 +0000
@@ -39,6 +39,18 @@
// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
// ---------------------------------------------------------------------
/* */
+unsigned long debListParser::FindTagWrite(const char *Tag)
+{
+ const char *Start;
+ const char *Stop;
+ if (Section.Find(Tag,Start,Stop) == false)
+ return 0;
+ return WriteString(Start,Stop - Start);
+}
+ /*}}}*/
+// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
+// ---------------------------------------------------------------------
+/* */
unsigned long debListParser::UniqFindTagWrite(const char *Tag)
{
const char *Start;
@@ -74,6 +86,10 @@
/* */
bool debListParser::NewVersion(pkgCache::VerIterator Ver)
{
+ Ver->Display = FindTagWrite("Name");
+ if (Ver->Display == 0)
+ Ver->Display = FindTagWrite("Maemo-Display-Name");
+
// Parse the section
Ver->Section = UniqFindTagWrite("Section");
Ver->Arch = UniqFindTagWrite("Architecture");
@@ -170,6 +186,10 @@
bool debListParser::UsePackage(pkgCache::PkgIterator Pkg,
pkgCache::VerIterator Ver)
{
+ if (Pkg->Display == 0)
+ Pkg->Display = FindTagWrite("Name");
+ if (Pkg->Display == 0)
+ Pkg->Display = FindTagWrite("Maemo-Display-Name");
if (Pkg->Section == 0)
Pkg->Section = UniqFindTagWrite("Section");
if (Section.FindFlag("Essential",Pkg->Flags,pkgCache::Flag::Essential) == false)
diff -ru apt-0.7.25.3/apt-pkg/deb/deblistparser.h apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h
--- apt-0.7.25.3/apt-pkg/deb/deblistparser.h 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/deb/deblistparser.h 2010-02-23 20:59:46.000000000 +0000
@@ -33,6 +33,7 @@
unsigned long iOffset;
string Arch;
+ unsigned long FindTagWrite(const char *Tag);
unsigned long UniqFindTagWrite(const char *Tag);
bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
diff -ru apt-0.7.25.3/apt-pkg/deb/debrecords.cc apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.cc
--- apt-0.7.25.3/apt-pkg/deb/debrecords.cc 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.cc 2010-02-23 20:59:22.000000000 +0000
@@ -51,6 +51,17 @@
return Section.FindS("Package");
}
/*}}}*/
+// RecordParser::Display - Return the package display name /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string debRecordParser::Display()
+{
+ string display(Section.FindS("Name"));
+ if (display.empty())
+ display = Section.FindS("Maemo-Display-Name");
+ return display;
+}
+ /*}}}*/
// RecordParser::Homepage - Return the package homepage /*{{{*/
// ---------------------------------------------------------------------
/* */
diff -ru apt-0.7.25.3/apt-pkg/deb/debrecords.h apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.h
--- apt-0.7.25.3/apt-pkg/deb/debrecords.h 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/deb/debrecords.h 2010-02-23 20:59:22.000000000 +0000
@@ -47,6 +47,7 @@
virtual string ShortDesc();
virtual string LongDesc();
virtual string Name();
+ virtual string Display();
virtual string Homepage();
virtual void GetRec(const char *&Start,const char *&Stop);
diff -ru apt-0.7.25.3/apt-pkg/pkgcache.h apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h
--- apt-0.7.25.3/apt-pkg/pkgcache.h 2010-02-23 20:58:32.000000000 +0000
+++ apt-0.7.25.3+iPhone/apt-pkg/pkgcache.h 2010-02-23 20:59:22.000000000 +0000
@@ -206,6 +206,7 @@
{
// Pointers
map_ptrloc Name; // Stringtable
+ map_ptrloc Display; // Stringtable
map_ptrloc VersionList; // Version
map_ptrloc CurrentVer; // Version
map_ptrloc Section; // StringTable (StringItem)
@@ -271,6 +272,7 @@
struct pkgCache::Version /*{{{*/
{
map_ptrloc VerStr; // Stringtable
+ map_ptrloc Display; // Stringtable
map_ptrloc Section; // StringTable (StringItem)
map_ptrloc Arch; // StringTable
|