Просмотр исходного кода

Added --no-download
Author: jgg
Date: 1999-05-24 03:39:36 GMT
Added --no-download

Arch Librarian лет назад: 22
Родитель
Сommit
ab559b358d
7 измененных файлов с 35 добавлено и 8 удалено
  1. 12 1
      apt-pkg/acquire-item.cc
  2. 3 1
      apt-pkg/acquire-item.h
  3. 5 1
      apt-pkg/acquire.cc
  4. 7 3
      cmdline/apt-get.cc
  5. 2 1
      debian/changelog
  6. 4 0
      doc/apt-get.8.yo
  7. 2 1
      doc/examples/apt.conf

+ 12 - 1
apt-pkg/acquire-item.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire-item.cc,v 1.29 1999/04/28 22:48:44 jgg Exp $
+// $Id: acquire-item.cc,v 1.30 1999/05/24 03:39:36 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -541,6 +541,17 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
    }
 }
 									/*}}}*/
+// AcqArchive::Finished - Fetching has finished, tidy up		/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void pkgAcqArchive::Finished()
+{
+   if (Status == pkgAcquire::Item::StatDone &&
+       Complete == true)
+      return;
+   StoreFilename = string();
+}
+									/*}}}*/
 
 // AcqFile::pkgAcqFile - Constructor					/*{{{*/
 // ---------------------------------------------------------------------

+ 3 - 1
apt-pkg/acquire-item.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire-item.h,v 1.19 1999/04/11 21:23:09 jgg Exp $
+// $Id: acquire-item.h,v 1.20 1999/05/24 03:39:37 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -66,6 +66,7 @@ class pkgAcquire::Item
    virtual void Start(string Message,unsigned long Size);
    virtual string Custom600Headers() {return string();};
    virtual string DescURI() = 0;
+   virtual void Finished() {};
    
    // Inquire functions
    virtual string MD5Sum() {return string();};
@@ -138,6 +139,7 @@ class pkgAcqArchive : public pkgAcquire::Item
    virtual void Done(string Message,unsigned long Size,string Md5Hash);
    virtual string MD5Sum() {return MD5;};
    virtual string DescURI() {return Desc.URI;};
+   virtual void Finished();
    
    pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 		 pkgRecords *Recs,pkgCache::VerIterator const &Version,

+ 5 - 1
apt-pkg/acquire.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire.cc,v 1.33 1999/05/23 06:47:43 jgg Exp $
+// $Id: acquire.cc,v 1.34 1999/05/24 03:39:37 jgg Exp $
 /* ######################################################################
 
    Acquire - File Acquiration
@@ -334,6 +334,10 @@ bool pkgAcquire::Run()
    for (Queue *I = Queues; I != 0; I = I->Next)
       I->Shutdown();
 
+   // Shut down the items
+   for (Item **I = Items.begin(); I != Items.end(); I++)
+      (*I)->Finished();
+   
    return !_error->PendingError();
 }
 									/*}}}*/

+ 7 - 3
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.60 1999/05/23 05:45:12 jgg Exp $
+// $Id: apt-get.cc,v 1.61 1999/05/24 03:39:37 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -589,8 +589,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
    }
    
    // Run it
-   if (Fetcher.Run() == false)
-      return false;
+   if (_config->FindB("APT::Get::No-Download",false) == false)
+      if( Fetcher.Run() == false)
+	 return false;
 
    // Print out errors
    bool Failed = false;
@@ -601,6 +602,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
 	  (*I)->Complete == true)
 	 continue;
       
+      (*I)->Finished();
+      
       if ((*I)->Status == pkgAcquire::Item::StatIdle)
       {
 	 Transient = true;
@@ -1397,6 +1400,7 @@ int main(int argc,const char *argv[])
       {'f',"fix-broken","APT::Get::Fix-Broken",0},
       {'u',"show-upgraded","APT::Get::Show-Upgraded",0},
       {'m',"ignore-missing","APT::Get::Fix-Missing",0},
+      {0,"no-download","APT::Get::No-Download",0},
       {0,"fix-missing","APT::Get::Fix-Missing",0},
       {0,"ignore-hold","APT::Ingore-Hold",0},      
       {0,"no-upgrade","APT::Get::no-upgrade",0},

+ 2 - 1
debian/changelog

@@ -15,7 +15,8 @@ apt (0.3.6.1) unstable; urgency=low
     important note in the sources.list man page.
   * Accounted for resumed files in the cps calculation. Closes: #36787
   * Deal with duplicate same version different packages. Closes: #30237
-
+  * Added --no-download. Closes: #38095
+  
  -- Jason Gunthorpe <jgg@debian.org>  Wed, 12 May 1999 09:18:49 -0700
  
 apt (0.3.6) unstable; urgency=low

+ 4 - 0
doc/apt-get.8.yo

@@ -150,6 +150,10 @@ 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. See bf(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(-q, --quiet))
 Quiet; produces output suitable for logging, omitting progress indicators.
 More qs will produce more quiet up to a maximum of 2. You can also use

+ 2 - 1
doc/examples/apt.conf

@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.32 1999/04/19 06:03:09 jgg Exp $
+// $Id: apt.conf,v 1.33 1999/05/24 03:39:37 jgg Exp $
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    valid file.
@@ -33,6 +33,7 @@ APT
      No-Upgrade "false";
      Print-URIs "false";
      Compile "false";
+     No-Download "false";
   };
 
   Cache