Sfoglia il codice sorgente

rename edspwriter to straight edsp in toplevel as it does more than
just writing stuff… it also reads and can work for both:
- APT talking to an external solver
- an external solver (understanding EDSP) talking to APT

David Kalnischkies 15 anni fa
parent
commit
c3b851268e
4 ha cambiato i file con 22 aggiunte e 23 eliminazioni
  1. 4 4
      apt-pkg/algorithms.cc
  2. 11 11
      apt-pkg/edsp/edspwriter.cc
  3. 3 3
      apt-pkg/edsp/edspwriter.h
  4. 4 5
      apt-pkg/makefile

+ 4 - 4
apt-pkg/algorithms.cc

@@ -20,7 +20,7 @@
 #include <apt-pkg/version.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/acquire-item.h>
-#include <apt-pkg/edspwriter.h>
+#include <apt-pkg/edsp.h>
 
 #include <apti18n.h>
 #include <sys/types.h>
@@ -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;
    }

+ 11 - 11
apt-pkg/edsp/edspwriter.cc

@@ -5,7 +5,7 @@
    ##################################################################### */
 									/*}}}*/
 // Include Files							/*{{{*/
-#include <apt-pkg/edspwriter.h>
+#include <apt-pkg/edsp.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/version.h>
@@ -17,8 +17,8 @@
 #include <stdio.h>
 									/*}}}*/
 
-// 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<std::string> &install,
+bool EDSP::ReadRequest(FILE* input, std::list<std::string> &install,
 			std::list<std::string> &remove)
 { return false; }
-bool edspWriter::ApplyRequest(std::list<std::string> const &install,
+bool EDSP::ApplyRequest(std::list<std::string> const &install,
 			 std::list<std::string> 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; }

+ 3 - 3
apt-pkg/edsp/edspwriter.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 <apt-pkg/depcache.h>
 
 #include <string>
 
-class edspWriter								/*{{{*/
+class EDSP								/*{{{*/
 {
 public:
 	bool static WriteRequest(pkgDepCache &Cache, FILE* output);

+ 4 - 5
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))