summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-03-31 11:47:01 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-03-31 11:47:01 +0200
commit41ceaf02483a826d5797cf0bd61bd7b6013733a8 (patch)
treead640516dcb0066b0c93a7c639e3967290066a95
parente3674d91d27a7290d2b01e14eb2540e10be9d883 (diff)
add a special scenario filename for using stdin
-rw-r--r--apt-pkg/edsp/edspindexfile.cc6
-rw-r--r--apt-pkg/edsp/edspsystem.cc11
2 files changed, 14 insertions, 3 deletions
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index 5a9d5aacd..366325d0f 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -28,7 +28,11 @@ edspIndex::edspIndex(string File) : debStatusIndex(File)
// StatusIndex::Merge - Load the index file into a cache /*{{{*/
bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
{
- FileFd Pkg(File,FileFd::ReadOnlyGzip);
+ FileFd Pkg;
+ if (File != "stdin")
+ Pkg.Open(File, FileFd::ReadOnly);
+ else
+ Pkg.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly);
if (_error->PendingError() == true)
return false;
edspListParser Parser(&Pkg);
diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc
index 579ffc656..c8e417b1d 100644
--- a/apt-pkg/edsp/edspsystem.cc
+++ b/apt-pkg/edsp/edspsystem.cc
@@ -86,8 +86,10 @@ bool edspSystem::ArchiveSupported(const char *Type)
// System::Score - Determine if we should use the edsp system /*{{{*/
signed edspSystem::Score(Configuration const &Cnf)
{
+ if (Cnf.Find("Dir::State::universe", "") == "stdin")
+ return 1000;
if (FileExists(Cnf.FindFile("Dir::State::universe","")) == true)
- return 1000;
+ return 1000;
return -1000;
}
/*}}}*/
@@ -95,7 +97,12 @@ signed edspSystem::Score(Configuration const &Cnf)
bool edspSystem::AddStatusFiles(vector<pkgIndexFile *> &List)
{
if (StatusFile == 0)
- StatusFile = new edspIndex(_config->FindFile("Dir::State::universe"));
+ {
+ if (_config->Find("Dir::State::universe", "") == "stdin")
+ StatusFile = new edspIndex("stdin");
+ else
+ StatusFile = new edspIndex(_config->FindFile("Dir::State::universe"));
+ }
List.push_back(StatusFile);
return true;
}