summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/deblistparser.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-02-18 15:07:56 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-02-18 15:07:56 +0100
commitb026dbb970c71213e12caaeb47bf7a27b91ea0a0 (patch)
tree68c68ff6bc12037ac74899f686fce9c0a3e419bd /apt-pkg/deb/deblistparser.cc
parent07f2526e45f9978201817237745727db6177c29a (diff)
parentd328fd1a20543192a7ea3eac124f10a5793743e9 (diff)
* [BREAK] add possibility to download and use multiply
Translation files, configurable with Acquire::Translation (Closes: #444222, #448216, #550564) * Ignore :qualifiers after package name in build dependencies for now as long we don't understand them (Closes: #558103) * apt-pkg/contrib/mmap.{cc,h}: - extend it to have a growable flag - unused now but maybe... * apt-pkg/pkgcache.h: - use long instead of short for {Ver,Desc}File size, patch from Víctor Manuel Jáquez Leal, thanks! (Closes: #538917) * apt-pkg/acquire-item.cc: - allow also to skip the last patch if target is reached, thanks Bernhard R. Link! (Closes: #545699) * ftparchive/writer.{cc,h}: - add APT::FTPArchive::AlwaysStat to disable the too aggressive caching if versions are build multiply times (not recommend) Patch by Christoph Goehre, thanks! (Closes: #463260)
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r--apt-pkg/deb/deblistparser.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 25b0953e0..66108d822 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -13,6 +13,7 @@
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/crc-16.h>
#include <apt-pkg/md5.h>
@@ -128,10 +129,11 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
only describe package properties */
string debListParser::Description()
{
- if (DescriptionLanguage().empty())
+ string const lang = DescriptionLanguage();
+ if (lang.empty())
return Section.FindS("Description");
else
- return Section.FindS(("Description-" + pkgIndexFile::LanguageCode()).c_str());
+ return Section.FindS(string("Description-").append(lang).c_str());
}
/*}}}*/
// ListParser::DescriptionLanguage - Return the description lang string /*{{{*/
@@ -141,7 +143,16 @@ string debListParser::Description()
assumed to describe original description. */
string debListParser::DescriptionLanguage()
{
- return Section.FindS("Description").empty() ? pkgIndexFile::LanguageCode() : "";
+ if (Section.FindS("Description").empty() == false)
+ return "";
+
+ std::vector<string> const lang = APT::Configuration::getLanguages();
+ for (std::vector<string>::const_iterator l = lang.begin();
+ l != lang.end(); l++)
+ if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
+ return *l;
+
+ return "";
}
/*}}}*/
// ListParser::Description - Return the description_md5 MD5SumValue /*{{{*/
@@ -383,7 +394,8 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
bit by bit. */
const char *debListParser::ParseDepends(const char *Start,const char *Stop,
string &Package,string &Ver,
- unsigned int &Op, bool ParseArchFlags)
+ unsigned int &Op, bool const &ParseArchFlags,
+ bool const &StripMultiArch)
{
// Strip off leading space
for (;Start != Stop && isspace(*Start) != 0; Start++);
@@ -402,7 +414,14 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
// Stash the package name
Package.assign(Start,I - Start);
-
+
+ // We don't want to confuse library users which can't handle MultiArch
+ if (StripMultiArch == true) {
+ size_t const found = Package.rfind(':');
+ if (found != string::npos)
+ Package = Package.substr(0,found);
+ }
+
// Skip white space to the '('
for (;I != Stop && isspace(*I) != 0 ; I++);