]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Fix spelling error in cmdline/apt-get.cc. Thanks to Osamu Aoki
[apt.git] / cmdline / apt-get.cc
index 7cf760c270cea220b08ced089b61b3ae7b8ac0f4..9b69e95896d58e99d8d8d71608e15d683b15201b 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+
+#include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/init.h>
@@ -37,6 +41,7 @@
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/version.h>
 #include <apt-pkg/cachefile.h>
+#include <apt-pkg/cacheset.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/versionmatch.h>
@@ -45,7 +50,6 @@
 #include <apti18n.h>
 
 #include "acqprogress.h"
-#include "cacheset.h"
 
 #include <set>
 #include <locale.h>
@@ -63,6 +67,9 @@
 #include <regex.h>
 #include <sys/wait.h>
 #include <sstream>
+
+#define statfs statfs64
+#define statvfs statvfs64
                                                                        /*}}}*/
 
 #define RAMFS_MAGIC     0x858458f6
@@ -837,9 +844,11 @@ struct TryToRemove {
    pkgCacheFile* Cache;
    pkgProblemResolver* Fix;
    bool FixBroken;
+   bool PurgePkgs;
    unsigned long AutoMarkChanged;
 
-   TryToRemove(pkgCacheFile &Cache, pkgProblemResolver &PM) : Cache(&Cache), Fix(&PM) {};
+   TryToRemove(pkgCacheFile &Cache, pkgProblemResolver &PM) : Cache(&Cache), Fix(&PM),
+                               PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
 
    void operator() (pkgCache::VerIterator const &Ver)
    {
@@ -849,10 +858,11 @@ struct TryToRemove {
       Fix->Protect(Pkg);
       Fix->Remove(Pkg);
 
-      if (Pkg->CurrentVer == 0)
+      if ((Pkg->CurrentVer == 0 && PurgePkgs == false) ||
+         (PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled))
         ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str());
       else
-        Cache->GetDepCache()->MarkDelete(Pkg,_config->FindB("APT::Get::Purge",false));
+        Cache->GetDepCache()->MarkDelete(Pkg, PurgePkgs);
    }
 };
                                                                        /*}}}*/
@@ -1644,7 +1654,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
    if (doAutoRemove == false && (autoremovelist.empty() == false || autoRemoveCount != 0))
    {
       if (smallList == false)
-        ShowList(c1out, P_("The following package is automatically installed and is no longer required:",
+        ShowList(c1out, P_("The following package was automatically installed and is no longer required:",
                  "The following packages were automatically installed and are no longer required:",
                  autoRemoveCount), autoremovelist, autoremoveversions);
       else
@@ -2487,6 +2497,7 @@ bool DoBuildDep(CommandLine &CmdL)
       return false;
 
    unsigned J = 0;
+   bool const StripMultiArch = APT::Configuration::getArchitectures().size() <= 1;
    for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++)
    {
       string Src;
@@ -2496,7 +2507,7 @@ bool DoBuildDep(CommandLine &CmdL)
             
       // Process the build-dependencies
       vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
-      if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only",true)) == false)
+      if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch) == false)
        return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str());
    
       // Also ensure that build-essential packages are present