[PATCH 3/6] EDSP: add Architecture(s) multi-arch fields to the Request stanza
---
apt-pkg/edsp.cc | 9 +++++++++
doc/external-dependency-solver-protocol.txt | 13 ++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 82b60d1..38a29fc 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -225,6 +225,15 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade,
req->append(" ").append(Pkg.FullName());
}
fprintf(output, "Request: EDSP 0.5\n");
+
+ const char *arch = _config->Find("APT::Architecture").c_str();
+ std::vector<string> archs = APT::Configuration::getArchitectures();
+ fprintf(output, "Architecture: %s\n", arch);
+ fprintf(output, "Architectures:");
+ for (std::vector<string>::const_iterator a = archs.begin(); a != archs.end(); ++a)
+ fprintf(output, " %s", a->c_str());
+ fprintf(output, "\n");
+
if (del.empty() == false)
fprintf(output, "Remove: %s\n", del.c_str()+1);
if (inst.empty() == false)
diff --git a/doc/external-dependency-solver-protocol.txt b/doc/external-dependency-solver-protocol.txt
index 7d41571..477bc23 100644
--- a/doc/external-dependency-solver-protocol.txt
+++ b/doc/external-dependency-solver-protocol.txt
@@ -110,7 +110,8 @@ Within a dependency solving scenario, a request represents the action on
installed packages requested by the user.
A request is a single Deb 822 stanza opened by a mandatory Request field
-and followed by a mixture of action and preference fields.
+and followed by a mixture of action, preference, and global
+configuration fields.
The value of the **Request:** field is a string describing the EDSP
protocol which will be used to communicate. At present, the string must
@@ -118,6 +119,16 @@ be `EDSP 0.5`. Request fields are mainly used to identify the beginning
of a request stanza; their actual values are otherwise not used by the
EDSP protocol.
+The following **configuration fields** are supported in request stanzas:
+
+- **Architecture:** (mandatory) The name of the *native* architecture on
+ the user machine (see also: `dpkg --print-architecture`)
+
+- **Architectures:** (optional, defaults to the native architecture) A
+ space separated list of *all* architectures known to APT (this is
+ roughly equivalent to the union of `dpkg --print-architecture` and
+ `dpkg --print-foreign-architectures`)
+
The following **action fields** are supported in request stanzas:
- **Install:** (optional, defaults to the empty string) A space
--
1.8.4.rc3
Reply to: