* cmdline/apt-get.cc:
[ntk/apt.git] / cmdline / apt-get.cc
index 1849f13..9096f26 100644 (file)
@@ -657,22 +657,22 @@ public:
                                        pkgCache::PkgIterator Pkg = I.OwnerPkg();
 
                                        if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer()) {
-                                               out << "  " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr();
+                                               c1out << "  " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr();
                                                if (Cache[Pkg].Install() == true && Cache[Pkg].NewInstall() == false)
-                                                       out << _(" [Installed]");
-                                               out << endl;
+                                                       c1out << _(" [Installed]");
+                                               c1out << endl;
                                                ++provider;
                                        }
                                }
                                // if we found no candidate which provide this package, show non-candidates
                                if (provider == 0)
                                        for (I = Pkg.ProvidesList(); I.end() == false; ++I)
-                                               out << "  " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
+                                               c1out << "  " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
                                                    << _(" [Not candidate version]") << endl;
                                else
                                        out << _("You should explicitly select one to install.") << endl;
                        } else {
-                               ioprintf(out,
+                               ioprintf(c1out,
                                        _("Package %s is not available, but is referred to by another package.\n"
                                          "This may mean that the package is missing, has been obsoleted, or\n"
                                          "is only available from another source\n"),Pkg.FullName(true).c_str());
@@ -691,9 +691,9 @@ public:
                                        List += Dep.ParentPkg().FullName(true) + " ";
                                        //VersionsList += string(Dep.ParentPkg().CurVersion) + "\n"; ???
                                }
-                               ShowList(out,_("However the following packages replace it:"),List,VersionsList);
+                               ShowList(c1out,_("However the following packages replace it:"),List,VersionsList);
                        }
-                       out << std::endl;
+                       c1out << std::endl;
                }
                return false;
        }
@@ -1625,7 +1625,8 @@ bool DoUpdate(CommandLine &CmdL)
    if (_config->FindB("APT::Get::Download",true) == true)
        ListUpdate(Stat, *List);
 
-   // Rebuild the cache.   
+   // Rebuild the cache.
+   pkgCacheFile::RemoveCaches();
    if (Cache.BuildCaches() == false)
       return false;
    
@@ -2203,10 +2204,14 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
 /* */
 bool DoClean(CommandLine &CmdL)
 {
+   std::string const archivedir = _config->FindDir("Dir::Cache::archives");
+   std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
+   std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+
    if (_config->FindB("APT::Get::Simulate") == true)
    {
-      cout << "Del " << _config->FindDir("Dir::Cache::archives") << "* " <<
-        _config->FindDir("Dir::Cache::archives") << "partial/*" << endl;
+      cout << "Del " << archivedir << "* " << archivedir << "partial/*"<< endl
+          << "Del " << pkgcache << " " << srcpkgcache << endl;
       return true;
    }
    
@@ -2214,14 +2219,17 @@ bool DoClean(CommandLine &CmdL)
    FileFd Lock;
    if (_config->FindB("Debug::NoLocking",false) == false)
    {
-      Lock.Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock"));
+      Lock.Fd(GetLock(archivedir + "lock"));
       if (_error->PendingError() == true)
         return _error->Error(_("Unable to lock the download directory"));
    }
    
    pkgAcquire Fetcher;
-   Fetcher.Clean(_config->FindDir("Dir::Cache::archives"));
-   Fetcher.Clean(_config->FindDir("Dir::Cache::archives") + "partial/");
+   Fetcher.Clean(archivedir);
+   Fetcher.Clean(archivedir + "partial/");
+
+   pkgCacheFile::RemoveCaches();
+
    return true;
 }
                                                                        /*}}}*/