]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp.cc
move the mapping generation to the top as the response reading is
[apt.git] / apt-pkg / edsp.cc
index 6343b57cd2f4804ba9922c36befb049fa364fcfb..9dbbbaf2646277af27870db1e93b52b5be468cdf 100644 (file)
@@ -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)