summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-06-23 16:40:54 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-06-23 16:40:54 +0000
commita83d884db24933000f19dbff706529db057d50c1 (patch)
treefc3ffeb8da0cfd99e290d36c59ede04edba58fb3 /cmdline
parentafb1e2e3bb580077c6c917e6ea98baad8f3c39b3 (diff)
* cleanups
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc23
1 files changed, 3 insertions, 20 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 31148a807..9f9ecd375 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -994,25 +994,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
return _error->Error(_("Aborting install."));
}
- // write the auto-mark list ----------------------------------
// -- we do it here because there is no libapt::Commit() :/
- FileFd state_file;
- string state = _config->FindDir("Dir::State") + "pkgstates";
-
-
- state_file.Open(state, FileFd::WriteEmpty);
- std::ostringstream ostr;
- for(pkgCache::PkgIterator p=Cache->PkgBegin(); !p.end();p++) {
- if(Cache[p].AutomaticRemove != pkgCache::State::RemoveUnknown) {
- ostr.str(string(""));
- ostr << "Package: " << p.Name()
- << "\nRemove-Reason: "
- << (int)(Cache[p].AutomaticRemove) << "\n\n";
- state_file.Write(ostr.str().c_str(), ostr.str().size());
- //std::cout << "Writing auto-mark: " << ostr.str() << endl;
- }
- }
- // ----------------------------------------------------------
+ Cache->writeStateFile(NULL);
_system->UnLock();
pkgPackageManager::OrderResult Res = PM->DoInstall();
@@ -1720,8 +1703,8 @@ bool DoInstall(CommandLine &CmdL)
if (*J == 0) {
List += string(I.Name()) + " ";
- //if (_config->FindB("APT::Get::AutomaticRemove"))
- Cache[I].AutomaticRemove = pkgCache::State::RemoveRequired;
+ // mark each pkg as auto-installed
+ Cache[I].AutomaticRemove = pkgCache::State::RemoveRequired;
VersionsList += string(Cache[I].CandVersion) + "\n";
}
}