X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6d38011bb93451dd9da3294614d821c77ac91687..bb0f6a34c4cebea7884de828c011dc85765ff820:/apt-pkg/edsp/edspsystem.cc diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index 579ffc656..4fb34b896 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -2,35 +2,33 @@ // 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 +#include + +#include #include #include -#include -#include +#include #include +#include +#include + +#include +#include +#include + #include -#include -#include -#include -#include /*}}}*/ -edspSystem edspSys; - -// System::debSystem - Constructor /*{{{*/ -edspSystem::edspSystem() +// System::edspSystem - Constructor /*{{{*/ +edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(NULL), StatusFile(NULL) { - StatusFile = 0; - - Label = "Debian APT solver interface"; - VS = &debVS; } /*}}}*/ // System::~debSystem - Destructor /*{{{*/ @@ -46,7 +44,7 @@ bool edspSystem::Lock() } /*}}}*/ // System::UnLock - Drop a lock /*{{{*/ -bool edspSystem::UnLock(bool NoErrors) +bool edspSystem::UnLock(bool /*NoErrors*/) { return true; } @@ -55,7 +53,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,7 +76,7 @@ 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; } @@ -86,16 +84,23 @@ bool edspSystem::ArchiveSupported(const char *Type) // System::Score - Determine if we should use the edsp system /*{{{*/ signed edspSystem::Score(Configuration const &Cnf) { - if (FileExists(Cnf.FindFile("Dir::State::universe","")) == true) - return 1000; + if (Cnf.Find("edsp::scenario", "") == "stdin") + return 1000; + if (RealFileExists(Cnf.FindFile("edsp::scenario","")) == true) + return 1000; return -1000; } /*}}}*/ // System::AddStatusFiles - Register the status files /*{{{*/ -bool edspSystem::AddStatusFiles(vector &List) +bool edspSystem::AddStatusFiles(std::vector &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 +120,5 @@ bool edspSystem::FindIndex(pkgCache::PkgFileIterator File, return false; } /*}}}*/ + +APT_HIDDEN edspSystem edspSys;