]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp/edspsystem.cc
apt-inst: Do not try to create a substring of an empty string in error reporting
[apt.git] / apt-pkg / edsp / edspsystem.cc
index c8e417b1d9e7f7079ebcda9aab138a0d9daa12d7..92edb8d7715dee2745295990910bc62b588ec2c9 100644 (file)
@@ -2,24 +2,28 @@
 // Description                                                         /*{{{*/
 /* ######################################################################
 
 // 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                                                       /*{{{*/
    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 <apt-pkg/edspsystem.h>
+#include <config.h>
+
+#include <apt-pkg/configuration.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/edspindexfile.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/edspsystem.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <stddef.h>
+#include <string>
+#include <vector>
+
 #include <apti18n.h>
 #include <apti18n.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
                                                                        /*}}}*/
 
 edspSystem edspSys;
                                                                        /*}}}*/
 
 edspSystem edspSys;
@@ -46,7 +50,7 @@ bool edspSystem::Lock()
 }
                                                                        /*}}}*/
 // System::UnLock - Drop a lock                                                /*{{{*/
 }
                                                                        /*}}}*/
 // System::UnLock - Drop a lock                                                /*{{{*/
-bool edspSystem::UnLock(bool NoErrors)
+bool edspSystem::UnLock(bool /*NoErrors*/)
 {
    return true;
 }
 {
    return true;
 }
@@ -55,7 +59,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 */
 // ---------------------------------------------------------------------
 /* 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;
 }
 {
    return NULL;
 }
@@ -78,7 +82,7 @@ bool edspSystem::Initialize(Configuration &Cnf)
 }
                                                                        /*}}}*/
 // System::ArchiveSupported - Is a file format supported               /*{{{*/
 }
                                                                        /*}}}*/
 // System::ArchiveSupported - Is a file format supported               /*{{{*/
-bool edspSystem::ArchiveSupported(const char *Type)
+bool edspSystem::ArchiveSupported(const char * /*Type*/)
 {
    return false;
 }
 {
    return false;
 }
@@ -86,22 +90,22 @@ bool edspSystem::ArchiveSupported(const char *Type)
 // System::Score - Determine if we should use the edsp system          /*{{{*/
 signed edspSystem::Score(Configuration const &Cnf)
 {
 // System::Score - Determine if we should use the edsp system          /*{{{*/
 signed edspSystem::Score(Configuration const &Cnf)
 {
-   if (Cnf.Find("Dir::State::universe", "") == "stdin")
+   if (Cnf.Find("edsp::scenario", "") == "stdin")
       return 1000;
       return 1000;
-   if (FileExists(Cnf.FindFile("Dir::State::universe","")) == true)
+   if (RealFileExists(Cnf.FindFile("edsp::scenario","")) == true)
       return 1000;
    return -1000;
 }
                                                                        /*}}}*/
 // System::AddStatusFiles - Register the status files                  /*{{{*/
       return 1000;
    return -1000;
 }
                                                                        /*}}}*/
 // System::AddStatusFiles - Register the status files                  /*{{{*/
-bool edspSystem::AddStatusFiles(vector<pkgIndexFile *> &List)
+bool edspSystem::AddStatusFiles(std::vector<pkgIndexFile *> &List)
 {
    if (StatusFile == 0)
    {
 {
    if (StatusFile == 0)
    {
-      if (_config->Find("Dir::State::universe", "") == "stdin")
+      if (_config->Find("edsp::scenario", "") == "stdin")
         StatusFile = new edspIndex("stdin");
       else
         StatusFile = new edspIndex("stdin");
       else
-        StatusFile = new edspIndex(_config->FindFile("Dir::State::universe"));
+        StatusFile = new edspIndex(_config->FindFile("edsp::scenario"));
    }
    List.push_back(StatusFile);
    return true;
    }
    List.push_back(StatusFile);
    return true;