From e5c505f909ebabd0744bf82cd1cf637f5eb6510d Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Thu, 19 Apr 2012 21:09:13 -0300 Subject: aptcc: change the way we mark auto-installed packages --- backends/aptcc/apt-intf.cpp | 14 ++++++-------- backends/aptcc/apt-intf.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backends/aptcc/apt-intf.cpp b/backends/aptcc/apt-intf.cpp index bd471de7f..2ed68655f 100644 --- a/backends/aptcc/apt-intf.cpp +++ b/backends/aptcc/apt-intf.cpp @@ -2067,19 +2067,16 @@ void AptIntf::refreshCache() ListUpdate(Stat, *m_cache.GetSourceList()); } -bool AptIntf::markAutoInstalled(AptCacheFile &cache, const PkgList &pkgs, bool flag) +void AptIntf::markAutoInstalled(AptCacheFile &cache, const PkgList &pkgs) { - bool ret; - for(PkgList::const_iterator it = pkgs.begin(); it != pkgs.end(); ++it) { + for (PkgList::const_iterator it = pkgs.begin(); it != pkgs.end(); ++it) { if (m_cancel) { break; } // Mark package as auto-installed - cache->MarkAuto(it->ParentPkg(), flag); + cache->MarkAuto(it->ParentPkg(), true); } - - return true; } bool AptIntf::markFileForInstall(const gchar *file, PkgList &install, PkgList &remove) @@ -2322,8 +2319,9 @@ bool AptIntf::runTransaction(const PkgList &install, const PkgList &remove, bool } } - if (!simulate) { - markAutoInstalled(cache, install, markAuto); + // Mark package dependencies of a local file as auto-installed + if (!simulate && markAuto) { + markAutoInstalled(cache, install); } for (PkgList::const_iterator it = remove.begin(); it != remove.end(); ++it) { diff --git a/backends/aptcc/apt-intf.h b/backends/aptcc/apt-intf.h index 0f906c047..8c6485162 100644 --- a/backends/aptcc/apt-intf.h +++ b/backends/aptcc/apt-intf.h @@ -85,7 +85,7 @@ public: /** * Marks the given packages as auto installed */ - bool markAutoInstalled(AptCacheFile &cache, const PkgList &pkgs, bool flag); + void markAutoInstalled(AptCacheFile &cache, const PkgList &pkgs); /** * runs a transaction to install/remove/update packages -- cgit v1.2.3