+ void Initialize(Configuration &Cnf)
+ {
+ DeInitialize();
+ Cnf.Set("Dir::State::extended_states", "/dev/null");
+ Cnf.Set("Dir::Etc::preferences", "/dev/null");
+ std::string const tmp = GetTempDir();
+ char tmpname[100];
+ snprintf(tmpname, sizeof(tmpname), "%s/apt-edsp-solver-XXXXXX", tmp.c_str());
+ if (NULL == mkdtemp(tmpname))
+ return;
+ tempDir = tmpname;
+ tempStatesFile = flCombine(tempDir, "extended_states");
+ Cnf.Set("Dir::State::extended_states", tempStatesFile);
+ tempPrefsFile = flCombine(tempDir, "apt_preferences");
+ Cnf.Set("Dir::Etc::preferences", tempPrefsFile);
+ }
+
+ void DeInitialize()
+ {
+ if (tempDir.empty())
+ return;
+
+ RemoveFile("DeInitialize", tempStatesFile);
+ RemoveFile("DeInitialize", tempPrefsFile);
+ rmdir(tempDir.c_str());
+ }
+
+ ~edspSystemPrivate() { DeInitialize(); }
+};
+// System::edspSystem - Constructor /*{{{*/
+edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(new edspSystemPrivate()), StatusFile(NULL)
+{