summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debrecords.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb/debrecords.cc')
-rw-r--r--apt-pkg/deb/debrecords.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index a132f34a6..696c55e6a 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -35,7 +35,7 @@ using std::string;
// RecordParser::debRecordParser - Constructor /*{{{*/
debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension),
- Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200)
+ Tags(&File)
{
}
/*}}}*/
@@ -74,6 +74,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()
{
@@ -153,7 +162,7 @@ string debRecordParserBase::LongDesc(std::string const &lang)
}
char const * const codeset = nl_langinfo(CODESET);
- if (strcmp(codeset,"UTF-8") != 0) {
+ if (strcmp(codeset,"US-ASCII") != 0 && strcmp(codeset,"UTF-8") != 0) {
string dest;
UTF8ToCodeset(codeset, orig, &dest);
return dest;
@@ -201,6 +210,12 @@ void debRecordParserBase::GetRec(const char *&Start,const char *&Stop)
Section.GetSection(Start,Stop);
}
/*}}}*/
+// RecordParserBase::Find - Locate a tag /*{{{*/
+bool debRecordParserBase::Find(const char *Tag,const char *&Start, const char *&End)
+{
+ return Section.Find(Tag,Start,End);
+}
+ /*}}}*/
debRecordParserBase::~debRecordParserBase() {}
bool debDebFileRecordParser::LoadContent()
@@ -217,7 +232,7 @@ bool debDebFileRecordParser::LoadContent()
content << "\n\n";
controlContent = content.str();
- if (Section.Scan(controlContent.c_str(), controlContent.length()) == false)
+ if (Section.Scan(controlContent.c_str(), controlContent.length(), false) == false)
return _error->Error(_("Unable to parse package file %s (%d)"), debFileName.c_str(), 3);
return true;
}