summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-19 16:28:20 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-19 16:28:20 +0100
commit7720666fba9cd7024009bed964ccfa3f2be97c59 (patch)
treec005fed12d9e87411fd69ed79a675e271c68c8fc /apt-pkg/deb/dpkgpm.cc
parent8737e3dca39af0d8758677fc1884b5720124f96b (diff)
* apt-pkg/deb/dpkgpm.cc:
- fix segfault on pkg removal
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 6feada4cc..99c28d201 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -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);