]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp/edspsystem.cc
Avoid wedging the entire system if recoverable :/.
[apt.git] / apt-pkg / edsp / edspsystem.cc
index 9b23dc3ca9d0379ea44e08462766f811354218de..1ceb21a17201db28936011f441864d447b99ef95 100644 (file)
@@ -34,6 +34,9 @@ edspLikeSystem::edspLikeSystem(char const * const Label) : pkgSystem(Label, &deb
 }
 edspSystem::edspSystem() : edspLikeSystem("Debian APT solver interface")
 {
+}
+eippSystem::eippSystem() : edspLikeSystem("Debian APT planner interface")
+{
 }
                                                                        /*}}}*/
 // System::Lock - Get the lock                                         /*{{{*/
@@ -60,9 +63,12 @@ pkgPackageManager *edspLikeSystem::CreatePM(pkgDepCache * /*Cache*/) const
 // System::Initialize - Setup the configuration space..                        /*{{{*/
 bool edspLikeSystem::Initialize(Configuration &Cnf)
 {
+   Cnf.Set("Dir::Log", "/dev/null");
    // state is included completely in the input files
+   Cnf.Set("Dir::Etc::preferences", "/dev/null");
    Cnf.Set("Dir::Etc::preferencesparts", "/dev/null");
    Cnf.Set("Dir::State::status","/dev/null");
+   Cnf.Set("Dir::State::extended_states","/dev/null");
    Cnf.Set("Dir::State::lists","/dev/null");
    // do not store an mmap cache
    Cnf.Set("Dir::Cache::pkgcache", "");
@@ -131,6 +137,19 @@ bool edspSystem::AddStatusFiles(std::vector<pkgIndexFile *> &List) /*{{{*/
    return true;
 }
                                                                        /*}}}*/
+bool eippSystem::AddStatusFiles(std::vector<pkgIndexFile *> &List)     /*{{{*/
+{
+   if (StatusFile == nullptr)
+   {
+      if (_config->Find("eipp::scenario", "") == "/nonexistent/stdin")
+        StatusFile.reset(new eippIndex("/nonexistent/stdin"));
+      else
+        StatusFile.reset(new eippIndex(_config->FindFile("eipp::scenario")));
+   }
+   List.push_back(StatusFile.get());
+   return true;
+}
+                                                                       /*}}}*/
 
 edspLikeSystem::~edspLikeSystem() {}
 edspSystem::~edspSystem()
@@ -142,5 +161,7 @@ edspSystem::~edspSystem()
    RemoveFile("~edspSystem", tempPrefsFile);
    rmdir(tempDir.c_str());
 }
+eippSystem::~eippSystem() {}
 
 APT_HIDDEN edspSystem edspSys;
+APT_HIDDEN eippSystem eippSys;