summaryrefslogtreecommitdiff
path: root/apt-pkg/statechanges.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-03 14:39:16 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-10 23:18:04 +0200
commitb820fd59c4fe6e3581901eee648e88209be56137 (patch)
tree0f0dbfefc9ed35e553a70a7f8c3e95857a3bea02 /apt-pkg/statechanges.cc
parentf495992428a396e0f98886c9a761a804aa161c68 (diff)
save and restore selection states before/after calling dpkg
dpkg decides certain things on its own based on selections and especially if we want to call --pending on purge/remove actions, we need to ensure a clean slate or otherwise we surprise the user by removing packages we weren't allowed to remove by the user in this run (the selection might be an overarching plan for the not-yet "future"). Ideally dpkg would have some kind of temporal selection interface for this case, but it hasn't, so we make it temporal with the risk of loosing state if we don't manage to restore them.
Diffstat (limited to 'apt-pkg/statechanges.cc')
-rw-r--r--apt-pkg/statechanges.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/statechanges.cc b/apt-pkg/statechanges.cc
index ed8f9f524..35af45538 100644
--- a/apt-pkg/statechanges.cc
+++ b/apt-pkg/statechanges.cc
@@ -25,7 +25,8 @@ public:
#define APT_GETTERSETTER(Name, Container) \
void StateChanges::Name(pkgCache::VerIterator const &Ver) \
{ \
- Container.push_back(Ver); \
+ if (Ver.end() == false) \
+ Container.push_back(Ver); \
}\
APT::VersionVector& StateChanges::Name() \
{ \