Explorar el Código

use a less generic special trigger filename for stdin

Git-Dch: Ignore
David Kalnischkies hace 10 años
padre
commit
7f58427b95

+ 1 - 1
apt-pkg/edsp/edspindexfile.cc

@@ -47,7 +47,7 @@ uint8_t edspIndex::GetIndexFlags() const
 }
 bool edspIndex::OpenListFile(FileFd &Pkg, std::string const &FileName)
 {
-   if (FileName.empty() == false && FileName != "stdin")
+   if (FileName.empty() == false && FileName != "/nonexistent/stdin")
       return pkgDebianIndexRealFile::OpenListFile(Pkg, FileName);
    if (Pkg.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly) == false)
       return _error->Error("Problem opening %s",FileName.c_str());

+ 2 - 2
apt-pkg/edsp/edspsystem.cc

@@ -131,8 +131,8 @@ bool edspSystem::AddStatusFiles(std::vector<pkgIndexFile *> &List)	/*{{{*/
 {
    if (StatusFile == 0)
    {
-      if (_config->Find("edsp::scenario", "") == "stdin")
-	 StatusFile = new edspIndex("stdin");
+      if (_config->Find("edsp::scenario", "") == "/nonexistent/stdin")
+	 StatusFile = new edspIndex("/nonexistent/stdin");
       else
 	 StatusFile = new edspIndex(_config->FindFile("edsp::scenario"));
    }

+ 6 - 2
apt-pkg/indexfile.cc

@@ -267,9 +267,13 @@ std::string pkgDebianIndexTargetFile::GetProgressDescription() const
    return Target.Description;
 }
 
-pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::string const &File, bool const Trusted) :/*{{{*/
-   pkgDebianIndexFile(Trusted), d(NULL), File(flAbsPath(File))
+pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::string const &pFile, bool const Trusted) :/*{{{*/
+   pkgDebianIndexFile(Trusted), d(NULL)
 {
+   if (pFile == "/nonexistent/stdin")
+      File = pFile;
+   else
+      File = flAbsPath(pFile);
 }
 									/*}}}*/
 // IndexRealFile::Size - Return the size of the index			/*{{{*/

+ 1 - 1
cmdline/apt-internal-solver.cc

@@ -111,7 +111,7 @@ int main(int argc,const char *argv[])					/*{{{*/
 
 	_config->Set("APT::System", "Debian APT solver interface");
 	_config->Set("APT::Solver", "internal");
-	_config->Set("edsp::scenario", "stdin");
+	_config->Set("edsp::scenario", "/nonexistent/stdin");
 	int input = STDIN_FILENO;
 	FILE* output = stdout;
 	SetNonBlock(input, false);