소스 검색

--print-uris works with update now. Closes: 57070
Author: jgg
Date: 2002-04-02 07:16:24 GMT
--print-uris works with update now. Closes: 57070

Arch Librarian 22 년 전
부모
커밋
f0863b2140
2개의 변경된 파일17개의 추가작업 그리고 4개의 파일을 삭제
  1. 12 2
      cmdline/apt-get.cc
  2. 5 2
      doc/apt-get.8.sgml

+ 12 - 2
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.117 2002/03/27 05:26:24 jgg Exp $
+// $Id: apt-get.cc,v 1.118 2002/04/02 07:16:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    apt-get - Cover for dpkg
    apt-get - Cover for dpkg
@@ -1176,11 +1176,21 @@ bool DoUpdate(CommandLine &CmdL)
    // Create the download object
    // Create the download object
    AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
    AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
    pkgAcquire Fetcher(&Stat);
    pkgAcquire Fetcher(&Stat);
-   
+
    // Populate it with the source selection
    // Populate it with the source selection
    if (List.GetIndexes(&Fetcher) == false)
    if (List.GetIndexes(&Fetcher) == false)
 	 return 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
    // Run it
    if (Fetcher.Run() == pkgAcquire::Failed)
    if (Fetcher.Run() == pkgAcquire::Failed)
       return false;
       return false;

+ 5 - 2
doc/apt-get.8.sgml

@@ -328,8 +328,11 @@
      Instead of fetching the files to install their URIs are printed. Each
      Instead of fetching the files to install their URIs are printed. Each
      URI will have the path, the destination file name, the size and the expected
      URI will have the path, the destination file name, the size and the expected
      md5 hash. Note that the file name to write to will not always match
      md5 hash. Note that the file name to write to will not always match
-     the file name on the remote site! This also works with the /source/
-     command. Configuration Item: <literal/APT::Get::Print-URIs/.
+     the file name on the remote site! This also works with the 
+     <liternal/source/ and <literal/update/ commands. When used with the
+     <literal/update/ command the MD5 and size are not included, and it is
+     up to the user to decompress any compressed files.
+     Configuration Item: <literal/APT::Get::Print-URIs/.
      </VarListEntry>
      </VarListEntry>
 
 
      <VarListEntry><term><option/--purge/</>
      <VarListEntry><term><option/--purge/</>