Bläddra i källkod

Fixed --no-download
Author: jgg
Date: 1999-12-09 05:22:33 GMT
Fixed --no-download

Arch Librarian 22 år sedan
förälder
incheckning
a3eaf95440
5 ändrade filer med 53 tillägg och 17 borttagningar
  1. 3 1
      apt-pkg/acquire.cc
  2. 2 2
      apt-pkg/packagemanager.cc
  3. 34 12
      cmdline/apt-get.cc
  4. 6 0
      debian/changelog
  5. 8 2
      doc/apt-get.8.yo

+ 3 - 1
apt-pkg/acquire.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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.. */
 /* Remove an item from the acquire list. This is usually not used.. */
 void pkgAcquire::Remove(Item *Itm)
 void pkgAcquire::Remove(Item *Itm)
 {
 {
+   Dequeue(Itm);
+   
    for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
    for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
    {
    {
       if (*I == Itm)
       if (*I == Itm)

+ 2 - 2
apt-pkg/packagemanager.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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 (List->IsMissing(Pkg) == true)
       {
       {
 	 if (Debug == true)
 	 if (Debug == true)
-	    clog << "Sequence completed at" << Pkg.Name() << endl;
+	    clog << "Sequence completed at " << Pkg.Name() << endl;
 	 if (DoneSomething == false)
 	 if (DoneSomething == false)
 	 {
 	 {
 	    _error->Error("Internal Error, ordering was unable to handle the media swap");
 	    _error->Error("Internal Error, ordering was unable to handle the media swap");

+ 34 - 12
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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 
 /* This displays the informative messages describing what is going to 
    happen and then calls the download routines */
    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
    // Run it
    while (1)
    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
       // Print out errors
       bool Failed = false;
       bool Failed = false;
-      bool Transient = false;
       for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
       for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
       {
       {
 	 if ((*I)->Status == pkgAcquire::Item::StatDone &&
 	 if ((*I)->Status == pkgAcquire::Item::StatDone &&
@@ -713,16 +734,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
 	    // Failed = true;
 	    // Failed = true;
 	    continue;
 	    continue;
 	 }
 	 }
-	 
+
 	 cerr << "Failed to fetch " << (*I)->DescURI() << endl;
 	 cerr << "Failed to fetch " << (*I)->DescURI() << endl;
 	 cerr << "  " << (*I)->ErrorText << endl;
 	 cerr << "  " << (*I)->ErrorText << endl;
 	 Failed = true;
 	 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 
          'failures' then the user must specify -m. Furthermore, there 
          is no such thing as a transient error in no-download mode! */
          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)
 	  _config->FindB("APT::Get::No-Download",false) == true)
       {
       {
 	 Transient = false;
 	 Transient = false;
@@ -750,7 +771,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
 	 cerr << "Unable to correct missing packages." << endl;
 	 cerr << "Unable to correct missing packages." << endl;
 	 return _error->Error("Aborting Install.");
 	 return _error->Error("Aborting Install.");
       }
       }
-      
+       	 
       Cache.ReleaseLock();
       Cache.ReleaseLock();
       pkgPackageManager::OrderResult Res = PM.DoInstall();
       pkgPackageManager::OrderResult Res = PM.DoInstall();
       if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
       if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
@@ -1513,9 +1534,10 @@ bool DoSource(CommandLine &CmdL)
 	 
 	 
 	 // Diff only mode only fetches .diff files
 	 // Diff only mode only fetches .diff files
 	 if (_config->FindB("APT::Get::Diff-Only",false) == true ||
 	 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
 	 // See if the package is already unpacked
 	 struct stat Stat;
 	 struct stat Stat;
 	 if (stat(Dir.c_str(),&Stat) == 0 &&
 	 if (stat(Dir.c_str(),&Stat) == 0 &&

+ 6 - 0
debian/changelog

@@ -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
 apt (0.3.15) unstable; urgency=low
 
 
   * Added DSelect::WaitAfterDownload Closes: #49549
   * Added DSelect::WaitAfterDownload Closes: #49549

+ 8 - 2
doc/apt-get.8.yo

@@ -158,11 +158,15 @@ dit(bf(-m, --ignore-missing, --fix-missing))
 Ignore missing packages; If packages cannot be retrieved or fail the    
 Ignore missing packages; If packages cannot be retrieved or fail the    
 integrity check after retrieval (corrupted package files), hold back    
 integrity check after retrieval (corrupted package files), hold back    
 those packages and handle the result. Use of this option together with  
 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))
 dit(bf(--no-download))
 Disables downloading of packages. This is best used with --ignore-missing to
 Disables downloading of packages. This is best used with --ignore-missing to
 force APT to use only the .debs it has already downloaded.
 force APT to use only the .debs it has already downloaded.
+Configuration Item: bf(APT::Get::No-Download).
 
 
 dit(bf(-q, --quiet))
 dit(bf(-q, --quiet))
 Quiet; produces output suitable for logging, omitting progress indicators.
 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))
 dit(bf(-b, --compile, --build))
 Compile source packages after downloading them.
 Compile source packages after downloading them.
+Configuration Item: bf(APT::Get::Compile).
 
 
 dit(bf(--ignore-hold))
 dit(bf(--ignore-hold))
 Ignore package Holds; This causes bf(apt-get) to ignore a hold placed on 
 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))
 dit(bf(--purge))
 Use purge instead of remove for anything that would be removed.
 Use purge instead of remove for anything that would be removed.
+Configuration Item: bf(APT::Get::Purge).
 
 
 dit(bf(--reinstall))
 dit(bf(--reinstall))
 Re-Install packages that are already installed and at the newest version.
 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
 If any packages are to be removed apt-get immediately aborts without
 prompting. Configuration Item: bf(APT::Get::No-Remove)
 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. 
 Download only the diff or tar file of a source archive. 
 Configuration Item: bf(APT::Get::Diff-Only)
 Configuration Item: bf(APT::Get::Diff-Only)