From c5f22e483cc0f31f2938874370ac776e40792069 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Date: Wed, 9 Nov 2016 15:28:15 +0100 Subject: add support for Build-Depends/Conflicts-Arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 2 +- apt-pkg/deb/debsrcrecords.cc | 8 +++++--- apt-pkg/srcrecords.cc | 4 +++- apt-pkg/srcrecords.h | 3 ++- apt-private/private-source.cc | 4 +++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index 2727fd81f..bc1f523ea 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -165,7 +165,7 @@ // 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 diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index d296161d6..5f0a75cd9 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -103,14 +103,16 @@ bool debSrcRecordParser::BuildDepends(std::vector= sizeof(fields)/sizeof(fields[0]))) return ""; return fields[Type]; diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index 9cc58c5b4..a3c8444de 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -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 { diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index fab1b4532..1e819a668 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -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; -- cgit v1.2.3