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

Bug#837395: apt-get build-dep ignores Build-Depends-Arch



Control: tag -1 + patch
Control: retitle -1 please support Build-Depends-Arch

On Mon, 12 Sep 2016 12:37:00 +0200 David Kalnischkies <david@kalnischkies.de> wrote:
> The difference is that dpkg supports and documents it (e.g. in
> deb-src-control(5)), but apt doesn't and e.g. policy doesn't document
> it. It even goes as far as saying that such a field does not exist [0].
> See also #823910.
> 
> I am going to write a patch for apt later, but I guess that can't be
> considered a bugfix and hence might not be 1.3 material (depending on
> how big or not that might turn out to be).

I wrote a patch which is attached.

Thanks!

cheers, josch
diff -Nru apt-1.3~rc4/apt-pkg/deb/debsrcrecords.cc apt-1.3~rc4+nmu1/apt-pkg/deb/debsrcrecords.cc
--- apt-1.3~rc4/apt-pkg/deb/debsrcrecords.cc	2016-09-02 20:26:36.000000000 +0200
+++ apt-1.3~rc4+nmu1/apt-pkg/deb/debsrcrecords.cc	2016-09-13 08:04:20.000000000 +0200
@@ -106,11 +106,13 @@
    const char *fields[] = {"Build-Depends", 
                            "Build-Depends-Indep",
 			   "Build-Conflicts",
-			   "Build-Conflicts-Indep"};
+			   "Build-Conflicts-Indep",
+			   "Build-Depends-Arch",
+			   "Build-Conflicts-Arch"};
 
    BuildDeps.clear();
 
-   for (I = 0; I < 4; I++) 
+   for (I = 0; I < 6; I++) 
    {
       if (ArchOnly && (I == 1 || I == 3))
          continue;
diff -Nru apt-1.3~rc4/apt-pkg/srcrecords.cc apt-1.3~rc4+nmu1/apt-pkg/srcrecords.cc
--- apt-1.3~rc4/apt-pkg/srcrecords.cc	2016-09-02 20:26:36.000000000 +0200
+++ apt-1.3~rc4+nmu1/apt-pkg/srcrecords.cc	2016-09-13 08:09:42.000000000 +0200
@@ -139,7 +139,9 @@
    const char *fields[] = {"Build-Depends",
 			   "Build-Depends-Indep",
 			   "Build-Conflicts",
-			   "Build-Conflicts-Indep"};
+			   "Build-Conflicts-Indep",
+			   "Build-Depends-Arch",
+			   "Build-Conflicts-Arch"};
    if (unlikely(Type >= sizeof(fields)/sizeof(fields[0])))
       return "";
    return fields[Type];
diff -Nru apt-1.3~rc4/apt-pkg/srcrecords.h apt-1.3~rc4+nmu1/apt-pkg/srcrecords.h
--- apt-1.3~rc4/apt-pkg/srcrecords.h	2016-09-02 20:26:36.000000000 +0200
+++ apt-1.3~rc4+nmu1/apt-pkg/srcrecords.h	2016-09-13 07:30:17.000000000 +0200
@@ -56,7 +56,8 @@
       public:
 
       enum BuildDep {BuildDepend=0x0,BuildDependIndep=0x1,
-	             BuildConflict=0x2,BuildConflictIndep=0x3};
+	             BuildConflict=0x2,BuildConflictIndep=0x3,
+	             BuildDependArch=0x4,BuildConflictArch=0x5};
 
       struct BuildDepRec 
       {
diff -Nru apt-1.3~rc4/apt-private/private-source.cc apt-1.3~rc4+nmu1/apt-private/private-source.cc
--- apt-1.3~rc4/apt-private/private-source.cc	2016-09-02 20:26:36.000000000 +0200
+++ apt-1.3~rc4+nmu1/apt-private/private-source.cc	2016-09-13 07:39:48.000000000 +0200
@@ -620,7 +620,9 @@
    for (auto const &dep: Dependencies)
    {
       std::string * type;
-      if (dep.Type == pkgSrcRecords::Parser::BuildConflict || dep.Type == pkgSrcRecords::Parser::BuildConflictIndep)
+      if (dep.Type == pkgSrcRecords::Parser::BuildConflict ||
+		  dep.Type == pkgSrcRecords::Parser::BuildConflictIndep ||
+		  dep.Type == pkgSrcRecords::Parser::BuildConflictArch)
 	 type = &conflicts;
       else
 	 type = &depends;

Attachment: signature.asc
Description: signature


Reply to: