]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp/edspsystem.cc
ExecGPGV: Rework file removal on exit()
[apt.git] / apt-pkg / edsp / edspsystem.cc
index c3eea6f105909a3f35db438fc5a799ca3d658385..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,11 +63,20 @@ 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", "");
+   Cnf.Set("Dir::Cache::srcpkgcache", "");
+   // the protocols only propose actions, not do them
    Cnf.Set("Debug::NoLocking", "true");
    Cnf.Set("APT::Get::Simulate", "true");
+
    StatusFile.reset(nullptr);
    return true;
 }
@@ -125,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()
@@ -136,5 +161,7 @@ edspSystem::~edspSystem()
    RemoveFile("~edspSystem", tempPrefsFile);
    rmdir(tempDir.c_str());
 }
+eippSystem::~eippSystem() {}
 
 APT_HIDDEN edspSystem edspSys;
+APT_HIDDEN eippSystem eippSys;