EDSP: add Architecture(s) multi-arch fields to the Request stanza
authorStefano Zacchiroli <zack@debian.org>
Wed, 4 Sep 2013 15:13:49 +0000 (17:13 +0200)
committerStefano Zacchiroli <zack@debian.org>
Sun, 4 May 2014 16:24:24 +0000 (18:24 +0200)
apt-pkg/edsp.cc
doc/external-dependency-solver-protocol.txt

index a44d4a4..33478df 100644 (file)
@@ -232,6 +232,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)
index 7d41571..477bc23 100644 (file)
@@ -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