summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-03-31 15:10:13 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-03-31 15:10:13 +0200
commitc3b851268e6e900be2bf0bd715435db9010fd591 (patch)
tree029c45c6faffa0de55923fda83f943be3b8f16c6 /apt-pkg
parent29099cb6855af2e465d26e888160e4f97bda4f0b (diff)
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
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/algorithms.cc8
-rw-r--r--apt-pkg/edsp.cc (renamed from apt-pkg/edsp/edspwriter.cc)22
-rw-r--r--apt-pkg/edsp.h (renamed from apt-pkg/edsp/edspwriter.h)6
-rw-r--r--apt-pkg/makefile9
4 files changed, 22 insertions, 23 deletions
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 <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;
}
diff --git a/apt-pkg/edsp/edspwriter.cc b/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 <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; }
diff --git a/apt-pkg/edsp/edspwriter.h b/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 <apt-pkg/depcache.h>
#include <string>
-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))