Fixed --no-download
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:19 +0000 (16:55 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:19 +0000 (16:55 +0000)
Author: jgg
Date: 1999-12-09 05:22:33 GMT
Fixed --no-download

apt-pkg/acquire.cc
apt-pkg/packagemanager.cc
cmdline/apt-get.cc
debian/changelog
doc/apt-get.8.yo

index a7b2849..a9a8b33 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire.cc,v 1.43 1999/10/27 22:34:29 jgg Exp $
+// $Id: acquire.cc,v 1.44 1999/12/09 05:22:33 jgg Exp $
 /* ######################################################################
 
    Acquire - File Acquiration
 /* ######################################################################
 
    Acquire - File Acquiration
@@ -105,6 +105,8 @@ void pkgAcquire::Add(Item *Itm)
 /* Remove an item from the acquire list. This is usually not used.. */
 void pkgAcquire::Remove(Item *Itm)
 {
 /* Remove an item from the acquire list. This is usually not used.. */
 void pkgAcquire::Remove(Item *Itm)
 {
+   Dequeue(Itm);
+   
    for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
    {
       if (*I == Itm)
    for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
    {
       if (*I == Itm)
index fad40c4..3929310 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: packagemanager.cc,v 1.22 1999/10/22 05:58:54 jgg Exp $
+// $Id: packagemanager.cc,v 1.23 1999/12/09 05:22:33 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -547,7 +547,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
       if (List->IsMissing(Pkg) == true)
       {
         if (Debug == true)
       if (List->IsMissing(Pkg) == true)
       {
         if (Debug == true)
-           clog << "Sequence completed at" << Pkg.Name() << endl;
+           clog << "Sequence completed at " << Pkg.Name() << endl;
         if (DoneSomething == false)
         {
            _error->Error("Internal Error, ordering was unable to handle the media swap");
         if (DoneSomething == false)
         {
            _error->Error("Internal Error, ordering was unable to handle the media swap");
index 4933e38..88b4ffc 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.91 1999/11/28 01:03:28 jgg Exp $
+// $Id: apt-get.cc,v 1.92 1999/12/09 05:22:33 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -516,7 +516,8 @@ bool CacheFile::CheckDeps(bool AllowBroken)
 // ---------------------------------------------------------------------
 /* This displays the informative messages describing what is going to 
    happen and then calls the download routines */
 // ---------------------------------------------------------------------
 /* This displays the informative messages describing what is going to 
    happen and then calls the download routines */
-bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = true)
+bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
+                    bool Saftey = true)
 {
    if (_config->FindB("APT::Get::Purge",false) == true)
    {
 {
    if (_config->FindB("APT::Get::Purge",false) == true)
    {
@@ -694,13 +695,33 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
    // Run it
    while (1)
    {
    // Run it
    while (1)
    {
-      if (_config->FindB("APT::Get::No-Download",false) == false)
-        if (Fetcher.Run() == pkgAcquire::Failed)
-           return false;
+      bool Transient = false;
+      if (_config->FindB("APT::Get::No-Download",false) == true)
+      {
+        for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd();)
+        {
+           if ((*I)->Local == true)
+           {
+              I++;
+              continue;
+           }
+
+           // Close the item and check if it was found in cache
+           (*I)->Finished();
+           if ((*I)->Complete == false)
+              Transient = true;
+           
+           // Clear it out of the fetch list
+           delete *I;
+           I = Fetcher.ItemsBegin();
+        }       
+      }
+      
+      if (Fetcher.Run() == pkgAcquire::Failed)
+        return false;
       
       // Print out errors
       bool Failed = false;
       
       // Print out errors
       bool Failed = false;
-      bool Transient = false;
       for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
       {
         if ((*I)->Status == pkgAcquire::Item::StatDone &&
       for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
       {
         if ((*I)->Status == pkgAcquire::Item::StatDone &&
@@ -713,16 +734,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
            // Failed = true;
            continue;
         }
            // Failed = true;
            continue;
         }
-        
+
         cerr << "Failed to fetch " << (*I)->DescURI() << endl;
         cerr << "  " << (*I)->ErrorText << endl;
         Failed = true;
       }
 
         cerr << "Failed to fetch " << (*I)->DescURI() << endl;
         cerr << "  " << (*I)->ErrorText << endl;
         Failed = true;
       }
 
-      /* If we are in no download mode and missing files then there were
+      /* If we are in no download mode and missing files and there were
          'failures' then the user must specify -m. Furthermore, there 
          is no such thing as a transient error in no-download mode! */
          'failures' then the user must specify -m. Furthermore, there 
          is no such thing as a transient error in no-download mode! */
-      if (Transient == true && 
+      if (Transient == true &&
          _config->FindB("APT::Get::No-Download",false) == true)
       {
         Transient = false;
          _config->FindB("APT::Get::No-Download",false) == true)
       {
         Transient = false;
@@ -750,7 +771,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
         cerr << "Unable to correct missing packages." << endl;
         return _error->Error("Aborting Install.");
       }
         cerr << "Unable to correct missing packages." << endl;
         return _error->Error("Aborting Install.");
       }
-      
+                
       Cache.ReleaseLock();
       pkgPackageManager::OrderResult Res = PM.DoInstall();
       if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
       Cache.ReleaseLock();
       pkgPackageManager::OrderResult Res = PM.DoInstall();
       if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
@@ -1513,9 +1534,10 @@ bool DoSource(CommandLine &CmdL)
         
         // Diff only mode only fetches .diff files
         if (_config->FindB("APT::Get::Diff-Only",false) == true ||
         
         // Diff only mode only fetches .diff files
         if (_config->FindB("APT::Get::Diff-Only",false) == true ||
-            _config->FindB("APT::Get::Tar-Only",false) == true)
+            _config->FindB("APT::Get::Tar-Only",false) == true ||
+            Dsc[I].Dsc.empty() == true)
            continue;
            continue;
-        
+
         // See if the package is already unpacked
         struct stat Stat;
         if (stat(Dir.c_str(),&Stat) == 0 &&
         // See if the package is already unpacked
         struct stat Stat;
         if (stat(Dir.c_str(),&Stat) == 0 &&
index 63998b8..eaf8350 100644 (file)
@@ -1,3 +1,9 @@
+apt (0.3.15.1) unstable; urgency=low
+
+  * Made --no-download work.
+  
+ -- Jason Gunthorpe <jgg@debian.org>  Sat,  4 Dec 1999 21:17:24 -0800
+  
 apt (0.3.15) unstable; urgency=low
 
   * Added DSelect::WaitAfterDownload Closes: #49549
 apt (0.3.15) unstable; urgency=low
 
   * Added DSelect::WaitAfterDownload Closes: #49549
index 6812e46..d46eb9b 100644 (file)
@@ -158,11 +158,15 @@ dit(bf(-m, --ignore-missing, --fix-missing))
 Ignore missing packages; If packages cannot be retrieved or fail the    
 integrity check after retrieval (corrupted package files), hold back    
 those packages and handle the result. Use of this option together with  
 Ignore missing packages; If packages cannot be retrieved or fail the    
 integrity check after retrieval (corrupted package files), hold back    
 those packages and handle the result. Use of this option together with  
--f may produce an error in some situations. Configuration Item: bf(ignore-missing).
+-f may produce an error in some situations. If a package is selected for 
+installation (particularly if it is mentioned on the command line) and it
+could not be downloaded then it will be silently held back.
+Configuration Item: bf(APT::Get::ignore-missing).
 
 dit(bf(--no-download))
 Disables downloading of packages. This is best used with --ignore-missing to
 force APT to use only the .debs it has already downloaded.
 
 dit(bf(--no-download))
 Disables downloading of packages. This is best used with --ignore-missing to
 force APT to use only the .debs it has already downloaded.
+Configuration Item: bf(APT::Get::No-Download).
 
 dit(bf(-q, --quiet))
 Quiet; produces output suitable for logging, omitting progress indicators.
 
 dit(bf(-q, --quiet))
 Quiet; produces output suitable for logging, omitting progress indicators.
@@ -195,6 +199,7 @@ upgraded. Configuration Item: bf(APT::Get::Show-Upgraded).
 
 dit(bf(-b, --compile, --build))
 Compile source packages after downloading them.
 
 dit(bf(-b, --compile, --build))
 Compile source packages after downloading them.
+Configuration Item: bf(APT::Get::Compile).
 
 dit(bf(--ignore-hold))
 Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on 
 
 dit(bf(--ignore-hold))
 Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on 
@@ -221,6 +226,7 @@ command. Configuration Item: bf(APT::Get::Print-URIs).
 
 dit(bf(--purge))
 Use purge instead of remove for anything that would be removed.
 
 dit(bf(--purge))
 Use purge instead of remove for anything that would be removed.
+Configuration Item: bf(APT::Get::Purge).
 
 dit(bf(--reinstall))
 Re-Install packages that are already installed and at the newest version.
 
 dit(bf(--reinstall))
 Re-Install packages that are already installed and at the newest version.
@@ -241,7 +247,7 @@ dit(bf(--no-remove))
 If any packages are to be removed apt-get immediately aborts without
 prompting. Configuration Item: bf(APT::Get::No-Remove)
 
 If any packages are to be removed apt-get immediately aborts without
 prompting. Configuration Item: bf(APT::Get::No-Remove)
 
-dit(bf(--diff-only), bd(--tar-only))
+dit(bf(--diff-only), bf(--tar-only))
 Download only the diff or tar file of a source archive. 
 Configuration Item: bf(APT::Get::Diff-Only)
 
 Download only the diff or tar file of a source archive. 
 Configuration Item: bf(APT::Get::Diff-Only)