]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp/edspsystem.cc
Fix the test suite harder
[apt.git] / apt-pkg / edsp / edspsystem.cc
index 579ffc65616ea75fe0b6df21f3b3a29555e0b1e9..f577efcbd46c097fa4fd31aa4f720fba3cea7e51 100644 (file)
@@ -2,35 +2,31 @@
 // Description                                                         /*{{{*/
 /* ######################################################################
 
-   This system provides the abstraction to use the universe file as the
+   This system provides the abstraction to use the scenario file as the
    only source of package information to be able to feed the created file
    back to APT for its own consumption (eat your own dogfood).
 
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#include <apt-pkg/edspsystem.h>
+#include <config.h>
+
+#include <apt-pkg/configuration.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/edspindexfile.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/fileutl.h>
-#include <apti18n.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
-                                                                       /*}}}*/
+#include <apt-pkg/edspsystem.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
-edspSystem edspSys;
+#include <stddef.h>
+#include <string>
+#include <vector>
 
-// System::debSystem - Constructor                                     /*{{{*/
-edspSystem::edspSystem()
-{
-   StatusFile = 0;
+                                                                       /*}}}*/
 
-   Label = "Debian APT solver interface";
-   VS = &debVS;
+// System::edspSystem - Constructor                                    /*{{{*/
+edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(NULL), StatusFile(NULL)
+{
 }
                                                                        /*}}}*/
 // System::~debSystem - Destructor                                     /*{{{*/
@@ -46,7 +42,7 @@ bool edspSystem::Lock()
 }
                                                                        /*}}}*/
 // System::UnLock - Drop a lock                                                /*{{{*/
-bool edspSystem::UnLock(bool NoErrors)
+bool edspSystem::UnLock(bool /*NoErrors*/)
 {
    return true;
 }
@@ -55,7 +51,7 @@ bool edspSystem::UnLock(bool NoErrors)
 // ---------------------------------------------------------------------
 /* we can't use edsp input as input for real installations - just a
    simulation can work, but everything else will fail bigtime */
-pkgPackageManager *edspSystem::CreatePM(pkgDepCache *Cache) const
+pkgPackageManager *edspSystem::CreatePM(pkgDepCache * /*Cache*/) const
 {
    return NULL;
 }
@@ -78,24 +74,26 @@ bool edspSystem::Initialize(Configuration &Cnf)
 }
                                                                        /*}}}*/
 // System::ArchiveSupported - Is a file format supported               /*{{{*/
-bool edspSystem::ArchiveSupported(const char *Type)
+bool edspSystem::ArchiveSupported(const char * /*Type*/)
 {
    return false;
 }
                                                                        /*}}}*/
-// System::Score - Determine if we should use the edsp system          /*{{{*/
-signed edspSystem::Score(Configuration const &Cnf)
+// System::Score - Never use the EDSP system automatically             /*{{{*/
+signed edspSystem::Score(Configuration const &)
 {
-   if (FileExists(Cnf.FindFile("Dir::State::universe","")) == true)
-       return 1000;
    return -1000;
 }
                                                                        /*}}}*/
-// System::AddStatusFiles - Register the status files                  /*{{{*/
-bool edspSystem::AddStatusFiles(vector<pkgIndexFile *> &List)
+bool edspSystem::AddStatusFiles(std::vector<pkgIndexFile *> &List)     /*{{{*/
 {
    if (StatusFile == 0)
-      StatusFile = new edspIndex(_config->FindFile("Dir::State::universe"));
+   {
+      if (_config->Find("edsp::scenario", "") == "stdin")
+        StatusFile = new edspIndex("stdin");
+      else
+        StatusFile = new edspIndex(_config->FindFile("edsp::scenario"));
+   }
    List.push_back(StatusFile);
    return true;
 }
@@ -115,3 +113,5 @@ bool edspSystem::FindIndex(pkgCache::PkgFileIterator File,
    return false;
 }
                                                                        /*}}}*/
+
+APT_HIDDEN edspSystem edspSys;