From c3b851268e6e900be2bf0bd715435db9010fd591 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 31 Mar 2011 15:10:13 +0200 Subject: [PATCH] =?utf8?q?rename=20edspwriter=20to=20straight=20edsp=20in?= =?utf8?q?=20toplevel=20as=20it=20does=20more=20than=20just=20writing=20st?= =?utf8?q?uff=E2=80=A6=20it=20also=20reads=20and=20can=20work=20for=20both?= =?utf8?q?:=20-=20APT=20talking=20to=20an=20external=20solver=20-=20an=20e?= =?utf8?q?xternal=20solver=20(understanding=20EDSP)=20talking=20to=20APT?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apt-pkg/algorithms.cc | 8 ++++---- apt-pkg/{edsp/edspwriter.cc => edsp.cc} | 22 +++++++++++----------- apt-pkg/{edsp/edspwriter.h => edsp.h} | 6 +++--- apt-pkg/makefile | 9 ++++----- 4 files changed, 22 insertions(+), 23 deletions(-) rename apt-pkg/{edsp/edspwriter.cc => edsp.cc} (88%) rename apt-pkg/{edsp/edspwriter.h => edsp.h} (91%) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index b55ff2897..00f558420 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -743,15 +743,15 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) if (solver != "internal") { FILE* output = fopen("/tmp/scenario.log", "w"); - edspWriter::WriteScenario(Cache, output); + EDSP::WriteScenario(Cache, output); fclose(output); output = fopen("/tmp/request.log", "w"); - edspWriter::WriteRequest(Cache, output); + EDSP::WriteRequest(Cache, output); fclose(output); if (ResolveInternal(BrokenFix) == false) return false; output = fopen("/tmp/solution.log", "w"); - edspWriter::WriteSolution(Cache, output); + EDSP::WriteSolution(Cache, output); fclose(output); return true; } diff --git a/apt-pkg/edsp/edspwriter.cc b/apt-pkg/edsp.cc similarity index 88% rename from apt-pkg/edsp/edspwriter.cc rename to apt-pkg/edsp.cc index 2f6bde5a1..1af5aed53 100644 --- a/apt-pkg/edsp/edspwriter.cc +++ b/apt-pkg/edsp.cc @@ -5,7 +5,7 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include +#include #include #include #include @@ -17,8 +17,8 @@ #include /*}}}*/ -// edspWriter::WriteScenario - to the given file descriptor /*{{{*/ -bool edspWriter::WriteScenario(pkgDepCache &Cache, FILE* output) +// EDSP::WriteScenario - to the given file descriptor /*{{{*/ +bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output) { // we could use pkgCache::DepType and ::Priority, but these would be lokalized strings… const char * const PrioMap[] = {0, "important", "required", "standard", @@ -101,8 +101,8 @@ bool edspWriter::WriteScenario(pkgDepCache &Cache, FILE* output) return true; } /*}}}*/ -// edspWriter::WriteRequest - to the given file descriptor /*{{{*/ -bool edspWriter::WriteRequest(pkgDepCache &Cache, FILE* output) +// EDSP::WriteRequest - to the given file descriptor /*{{{*/ +bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output) { string del, inst, upgrade; for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) @@ -128,17 +128,17 @@ bool edspWriter::WriteRequest(pkgDepCache &Cache, FILE* output) return true; } /*}}}*/ -bool edspWriter::ReadResponse(FILE* input, pkgDepCache &Cache) { return false; } +bool EDSP::ReadResponse(FILE* input, pkgDepCache &Cache) { return false; } -bool edspWriter::ReadRequest(FILE* input, std::list &install, +bool EDSP::ReadRequest(FILE* input, std::list &install, std::list &remove) { return false; } -bool edspWriter::ApplyRequest(std::list const &install, +bool EDSP::ApplyRequest(std::list const &install, std::list const &remove, pkgDepCache &Cache) { return false; } -// edspWriter::WriteSolution - to the given file descriptor /*{{{*/ -bool edspWriter::WriteSolution(pkgDepCache &Cache, FILE* output) +// EDSP::WriteSolution - to the given file descriptor /*{{{*/ +bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output) { bool const Debug = _config->FindB("Debug::EDSPWriter::WriteSolution", false); for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) @@ -157,4 +157,4 @@ bool edspWriter::WriteSolution(pkgDepCache &Cache, FILE* output) return true; } /*}}}*/ -bool edspWriter::WriteError(std::string const &message, FILE* output) { return false; } +bool EDSP::WriteError(std::string const &message, FILE* output) { return false; } diff --git a/apt-pkg/edsp/edspwriter.h b/apt-pkg/edsp.h similarity index 91% rename from apt-pkg/edsp/edspwriter.h rename to apt-pkg/edsp.h index c5eed788f..ef137b8f6 100644 --- a/apt-pkg/edsp/edspwriter.h +++ b/apt-pkg/edsp.h @@ -4,14 +4,14 @@ Set of methods to help writing and reading everything needed for EDSP ##################################################################### */ /*}}}*/ -#ifndef PKGLIB_EDSPWRITER_H -#define PKGLIB_EDSPWRITER_H +#ifndef PKGLIB_EDSP_H +#define PKGLIB_EDSP_H #include #include -class edspWriter /*{{{*/ +class EDSP /*{{{*/ { public: bool static WriteRequest(pkgDepCache &Cache, FILE* output); diff --git a/apt-pkg/makefile b/apt-pkg/makefile index a7880e81c..e6bcf8524 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -35,7 +35,7 @@ SOURCE+= pkgcache.cc version.cc depcache.cc \ srcrecords.cc cachefile.cc versionmatch.cc policy.cc \ pkgsystem.cc indexfile.cc pkgcachegen.cc acquire-item.cc \ indexrecords.cc vendor.cc vendorlist.cc cdrom.cc indexcopy.cc \ - aptconfiguration.cc cachefilter.cc cacheset.cc + aptconfiguration.cc cachefilter.cc cacheset.cc edsp.cc HEADERS+= algorithms.h depcache.h pkgcachegen.h cacheiterators.h \ orderlist.h sourcelist.h packagemanager.h tagfile.h \ init.h pkgcache.h version.h progress.h pkgrecords.h \ @@ -43,7 +43,7 @@ HEADERS+= algorithms.h depcache.h pkgcachegen.h cacheiterators.h \ clean.h srcrecords.h cachefile.h versionmatch.h policy.h \ pkgsystem.h indexfile.h metaindex.h indexrecords.h vendor.h \ vendorlist.h cdrom.h indexcopy.h aptconfiguration.h \ - cachefilter.h cacheset.h + cachefilter.h cacheset.h edsp.h # Source code for the debian specific components # In theory the deb headers do not need to be exported.. @@ -54,9 +54,8 @@ HEADERS+= debversion.h debsrcrecords.h dpkgpm.h debrecords.h \ deblistparser.h debsystem.h debindexfile.h debmetaindex.h # Source code for the APT resolver interface specific components -SOURCE+= edsp/edsplistparser.cc edsp/edspindexfile.cc edsp/edspsystem.cc \ - edsp/edspwriter.cc -HEADERS+= edsplistparser.h edspindexfile.h edspsystem.h edspwriter.h +SOURCE+= edsp/edsplistparser.cc edsp/edspindexfile.cc edsp/edspsystem.cc +HEADERS+= edsplistparser.h edspindexfile.h edspsystem.h HEADERS := $(addprefix apt-pkg/,$(HEADERS)) -- 2.47.2