[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#547724: apt-get build-dep $PACKAGE doesn't handle build-dependencies with architecture wildcards



On Sa, 2010-06-26 at 20:31 +0200, Julian Andres Klode wrote:
> tags 547724 - patch
> thanks
> 
> On Sa, 2010-06-26 at 19:15 +0200, Sebastian Andrzej Siewior wrote:
> > tags 547724 + patch
> > thanks
> > 
> > * Sebastian Andrzej Siewior | 2010-06-23 21:37:26 [+0200]:
> > 
> > >-i$arch" while resolving deps. So I guess I sneak some informations
> > >during the build-process and hack the compare into
> > >debListParser::ParseDepends().
> > 
> > The patch attached does the work.
> Your patch does not make much sense. APT is written in C++, but you are
> writing raw C code (and use different function naming style).
> 
> Furthermore, I think it should be much easier to support this than you
> do in your patch. We just need to do replace 'any' in the architecture
> wildcard by '*' and check if it matches the current arch or the current
> arch prefixed by 'linux-' by calling fnmatch().

I committed the following patch in revision 1995 of the
debian-experimental-ma repository. This fully implements architecture
wildcards (as long as the architecture is named <kernel>-<cpu> or
<cpu>).

=== modified file 'apt-pkg/deb/deblistparser.cc'
--- apt-pkg/deb/deblistparser.cc	2010-06-09 11:15:34 +0000
+++ apt-pkg/deb/deblistparser.cc	2010-06-26 18:53:28 +0000
@@ -19,6 +19,7 @@
 #include <apt-pkg/md5.h>
 #include <apt-pkg/macros.h>
 
+#include <fnmatch.h>
 #include <ctype.h>
 									/*}}}*/
 
@@ -572,8 +573,15 @@ const char *debListParser::ParseDepends(
 	       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(), arch.c_str(), 0) == 0)
+	          Found = true;
+	       if (fnmatch(wildcard.c_str(), ("linux-" + arch).c_str(), 0) == 0)
+	          Found = true;
+	    }
 	    
 	    if (*End++ == ']') {
 	       I = End;


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.





Reply to: