]> git.saurik.com Git - apt.git/commitdiff
add support for Build-Depends/Conflicts-Arch
authorJohannes Schauer <josch@debian.org>
Wed, 9 Nov 2016 14:28:15 +0000 (15:28 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 9 Nov 2016 15:18:54 +0000 (16:18 +0100)
These new enum values might cause "interesting" behaviour in tools not
expecting them – like an old apt would think a Build-Conflicts-Arch is
some sort of Build-Depends – but that can't reasonably be avoided and
effects only packages using B-D/C-A so if there is any breakage the
tools can easily be adapted.

The APT_PKG_RELEASE number is increased so that libapt users can detect
the availability of these new enum fields via:
 #if APT_PKG_ABI > 500 || (APT_PKG_ABI == 500 && APT_PKG_RELEASE >= 1)

Closes: #837395
apt-pkg/contrib/macros.h
apt-pkg/deb/debsrcrecords.cc
apt-pkg/srcrecords.cc
apt-pkg/srcrecords.h
apt-private/private-source.cc

index 2727fd81fb668f371831e4df56e819b6a498c198..bc1f523ea63ab7709371216547c641503f8a568d 100644 (file)
 // See also buildlib/libversion.mak
 #define APT_PKG_MAJOR 5
 #define APT_PKG_MINOR 0
-#define APT_PKG_RELEASE 0
+#define APT_PKG_RELEASE 1
 #define APT_PKG_ABI ((APT_PKG_MAJOR * 100) + APT_PKG_MINOR)
 
 #endif
index d296161d6aad203c1dff8ce18fe826f3851b6088..5f0a75cd956019960f35138b04172ac11ebdb081 100644 (file)
@@ -103,14 +103,16 @@ bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDe
    unsigned int I;
    const char *Start, *Stop;
    BuildDepRec rec;
-   const char *fields[] = {"Build-Depends", 
+   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;
index 53d7e604d35e9ea4e21c2f88576266dae3a83acf..a76604a8d2eded0a78558a91788f889fa6040a50 100644 (file)
@@ -139,7 +139,9 @@ const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type)
    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];
index 9cc58c5b4b28fc00df2aa944cbc9f4b8281c9bf3..a3c8444deda05b77ff7d3f075b702d0ab98ddb50 100644 (file)
@@ -56,7 +56,8 @@ APT_IGNORE_DEPRECATED_POP
       public:
 
       enum BuildDep {BuildDepend=0x0,BuildDependIndep=0x1,
-                    BuildConflict=0x2,BuildConflictIndep=0x3};
+                    BuildConflict=0x2,BuildConflictIndep=0x3,
+                    BuildDependArch=0x4,BuildConflictArch=0x5};
 
       struct BuildDepRec 
       {
index fab1b45326847600d41715dacbced3117addea8a..1e819a6683c86bca3b1c1e0a4651534442f053c2 100644 (file)
@@ -620,7 +620,9 @@ static void WriteBuildDependencyPackage(std::ostringstream &buildDepsPkgFile,
    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;