summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2011-07-25 15:54:03 +0200
committerMichael Vogt <egon@debian-devbox>2011-07-25 15:54:03 +0200
commit35b55cbc1ccebe25a9e3cafd5f4fc1156bf79228 (patch)
tree190a33e013cbd0cfd96518707a3176aa44a64f13 /apt-pkg
parent555a487afb510c561d094f27bb08119694e7388f (diff)
parent234675b71a2caab5c7cc0dc3b32a241683d3b3d2 (diff)
merged from lp:~donkult/apt/sid0.8.15.3
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/aptconfiguration.cc2
-rw-r--r--apt-pkg/deb/deblistparser.cc9
2 files changed, 7 insertions, 4 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index e8c8e73d0..9ccbeecf1 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -352,7 +352,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
if (archs.empty() == true ||
std::find(archs.begin(), archs.end(), arch) == archs.end())
- archs.push_back(arch);
+ archs.insert(archs.begin(), arch);
// erase duplicates and empty strings
for (std::vector<string>::reverse_iterator a = archs.rbegin();
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 9ae1065a4..651fa2a81 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -461,7 +461,7 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
*
* The complete architecture, consisting of <kernel>-<cpu>.
*/
-static string CompleteArch(std::string& arch) {
+static string CompleteArch(std::string const &arch) {
if (arch == "armel") return "linux-arm";
if (arch == "armhf") return "linux-arm";
if (arch == "lpia") return "linux-i386";
@@ -500,9 +500,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
Package.assign(Start,I - Start);
// We don't want to confuse library users which can't handle MultiArch
+ string const arch = _config->Find("APT::Architecture");
if (StripMultiArch == true) {
size_t const found = Package.rfind(':');
- if (found != string::npos)
+ if (found != string::npos &&
+ (strcmp(Package.c_str() + found, ":any") == 0 ||
+ strcmp(Package.c_str() + found, ":native") == 0 ||
+ strcmp(Package.c_str() + found + 1, arch.c_str()) == 0))
Package = Package.substr(0,found);
}
@@ -543,7 +547,6 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
if (ParseArchFlags == true)
{
- string arch = _config->Find("APT::Architecture");
string completeArch = CompleteArch(arch);
// Parse an architecture