-// EDSP::WriteScenario - to the given file descriptor /*{{{*/
-bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress)
-{
- if (Progress != NULL)
- Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver"));
- unsigned long p = 0;
- std::vector<std::string> archs = APT::Configuration::getArchitectures();
- for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg)
- {
- std::string const arch = Pkg.Arch();
- if (std::find(archs.begin(), archs.end(), arch) == archs.end())
- continue;
- for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p)
- {
- WriteScenarioVersion(Cache, output, Pkg, Ver);
- WriteScenarioDependency(output, Ver);
- fprintf(output, "\n");
- if (Progress != NULL && p % 100 == 0)
- Progress->Progress(p);
- }
- }
- return true;
-}
- /*}}}*/
-// EDSP::WriteLimitedScenario - to the given file descriptor /*{{{*/
-bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
- APT::PackageSet const &pkgset,
- OpProgress *Progress)
-{
- if (Progress != NULL)
- Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver"));
- unsigned long p = 0;
- for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg, ++p)
- for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
- {
- WriteScenarioVersion(Cache, output, Pkg, Ver);
- WriteScenarioLimitedDependency(output, Ver, pkgset);
- fprintf(output, "\n");
- if (Progress != NULL && p % 100 == 0)
- Progress->Progress(p);
- }
- if (Progress != NULL)
- Progress->Done();
- return true;
-}
- /*}}}*/
-// EDSP::WriteScenarioVersion /*{{{*/
-void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg,