]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
* apt-pkg/deb/dpkgpm.cc:
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 6feada4ccc012541ff32e17c7ee5e3bbb724aaae..99c28d201639eb8edd7f25fa8ed74b10b778b33d 100644 (file)
@@ -1090,8 +1090,12 @@ bool pkgDPkgPM::Go(int OutStatusFd)
            }
            else
            {
+              pkgCache::VerIterator PkgVer;
               std::string name = I->Pkg.Name();
-              pkgCache::VerIterator PkgVer = Cache[I->Pkg].InstVerIter(Cache);
+              if (Op == Item::Remove || Op == Item::Purge)
+                  PkgVer = I->Pkg.CurrentVer();
+              else
+                  PkgVer = Cache[I->Pkg].InstVerIter(Cache);
               name.append(":").append(PkgVer.Arch());
               char * const fullname = strdup(name.c_str());
               Packages.push_back(fullname);