]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Speeling correction
[apt.git] / cmdline / apt-get.cc
index 98461051e62c16957f670849ee6f6ae7ea07b5b5..a41c50b0a854667d230799bbee15dcd249a3a24a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.115 2002/03/20 05:51:52 jgg Exp $
+// $Id: apt-get.cc,v 1.118 2002/04/02 07:16:24 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -46,7 +46,7 @@
 #include "acqprogress.h"
 
 #include <locale.h>
-#include <fstream.h>
+#include <fstream>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
@@ -722,7 +722,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
 
    /* Check for enough free space, but only if we are actually going to
       download */
-   if (_config->FindB("APT::Get::Print-URIs") == false)
+   if (_config->FindB("APT::Get::Print-URIs") == false &&
+       _config->FindB("APT::Get::Download",true) == true)
    {
       struct statvfs Buf;
       string OutputDir = _config->FindDir("Dir::Cache::Archives");
@@ -1175,11 +1176,21 @@ bool DoUpdate(CommandLine &CmdL)
    // Create the download object
    AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
    pkgAcquire Fetcher(&Stat);
-   
+
    // Populate it with the source selection
    if (List.GetIndexes(&Fetcher) == false)
         return false;
    
+   // Just print out the uris an exit if the --print-uris flag was used
+   if (_config->FindB("APT::Get::Print-URIs") == true)
+   {
+      pkgAcquire::UriIterator I = Fetcher.UriBegin();
+      for (; I != Fetcher.UriEnd(); I++)
+        cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
+              I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl;
+      return true;
+   }
+   
    // Run it
    if (Fetcher.Run() == pkgAcquire::Failed)
       return false;