]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp.cc
French updated by Christian Perrier
[apt.git] / apt-pkg / edsp.cc
index 02ef7d04b23a6c022d0853c6e5865f67f741cde1..791aac72f416364f149d133074e4fbf1747e93fb 100644 (file)
@@ -5,19 +5,28 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/edsp.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/cacheset.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/version.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/progress.h>
 
-#include <apti18n.h>
 #include <limits>
-
 #include <stdio.h>
+
+#include <string>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
+using std::string;
+
 // we could use pkgCache::DepType and ::Priority, but these would be localized stringsā€¦
 const char * const EDSP::PrioMap[] = {0, "important", "required", "standard",
                                      "optional", "extra"};
@@ -82,11 +91,11 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI
    if ((Pkg->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
       fprintf(output, "Essential: yes\n");
    fprintf(output, "Section: %s\n", Ver.Section());
-   if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed)
+   if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
       fprintf(output, "Multi-Arch: allowed\n");
-   else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign)
+   else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
       fprintf(output, "Multi-Arch: foreign\n");
-   else if (Ver->MultiArch == pkgCache::Version::Same)
+   else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
       fprintf(output, "Multi-Arch: same\n");
    signed short Pin = std::numeric_limits<signed short>::min();
    for (pkgCache::VerFileIterator File = Ver.FileList(); File.end() == false; ++File) {
@@ -277,7 +286,7 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres
                        std::string msg = SubstVar(SubstVar(section.FindS("Message"), "\n .\n", "\n\n"), "\n ", "\n");
                        if (msg.empty() == true) {
                                msg = _("External solver failed without a proper error message");
-                               _error->Error(msg.c_str());
+                               _error->Error("%s", msg.c_str());
                        } else
                                _error->Error("External solver failed with: %s", msg.substr(0,msg.find('\n')).c_str());
                        if (Progress != NULL)