summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index d1931f909..24df57a5c 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -19,6 +19,7 @@
#include <apt-pkg/md5.h>
#include <apt-pkg/macros.h>
+#include <fnmatch.h>
#include <ctype.h>
/*}}}*/
@@ -473,6 +474,20 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
return I;
}
+/*
+ * CompleteArch:
+ *
+ * The complete architecture, consisting of <kernel>-<cpu>.
+ */
+static string CompleteArch(std::string& arch) {
+ if (arch == "armel") return "linux-arm";
+ if (arch == "lpia") return "linux-i386";
+ if (arch == "powerpcspe") return "linux-powerpc";
+ if (arch == "uclibc-linux-armel") return "linux-arm";
+ if (arch == "uclinux-armel") return "uclinux-arm";
+
+ return (arch.find("-") != string::npos) ? arch : "linux-" + arch;
+}
/*}}}*/
// ListParser::ParseDepends - Parse a dependency element /*{{{*/
// ---------------------------------------------------------------------
@@ -546,6 +561,7 @@ 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
if (I != Stop && *I == '[')
@@ -573,8 +589,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
I++;
}
- if (stringcmp(arch,I,End) == 0)
+ if (stringcmp(arch,I,End) == 0) {
Found = true;
+ } else {
+ std::string wildcard = SubstVar(string(I, End), "any", "*");
+ if (fnmatch(wildcard.c_str(), completeArch.c_str(), 0) == 0)
+ Found = true;
+ }
if (*End++ == ']') {
I = End;