浏览代码

move the mapping generation to the top as the response reading is
currently waiting for the solver to complete and not non-blocking
so we can generate the map while waiting for the solver

David Kalnischkies 15 年之前
父节点
当前提交
c80a49f556
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      apt-pkg/edsp.cc

+ 5 - 5
apt-pkg/edsp.cc

@@ -221,11 +221,6 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade,
 									/*}}}*/
 // EDSP::ReadResponse - from the given file descriptor			/*{{{*/
 bool EDSP::ReadResponse(int const input, pkgDepCache &Cache) {
-	FileFd in;
-	in.OpenDescriptor(input, FileFd::ReadOnly);
-	pkgTagFile response(&in);
-	pkgTagSection section;
-
 	/* We build an map id to mmap offset here
 	   In theory we could use the offset as ID, but then VersionCount
 	   couldn't be used to create other versionmappings anymore and it
@@ -236,6 +231,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache) {
 		for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
 			VerIdx[V->ID] = V.Index();
 
+	FileFd in;
+	in.OpenDescriptor(input, FileFd::ReadOnly);
+	pkgTagFile response(&in);
+	pkgTagSection section;
+
 	while (response.Step(section) == true) {
 		std::string type;
 		if (section.Exists("Install") == true)