~lifeless/ubuntu/lucid/apt/bug-22354

« back to all changes in this revision

Viewing changes to apt-pkg/contrib/hashes.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jason Gunthorpe
  • Date: 2001-08-18 17:21:59 UTC
  • Revision ID: james.westby@ubuntu.com-20010818172159-85f7g43wdzi9dwb5
Tags: 0.5.4
* M68k config.guess patch. Closes: #88913
* Bi-yearly test on OpenBSD and Solaris
* Doc updates. Closes: #89121, #89854, #99671, #98353, #95823, #93057,
        #97520, #102867, #101071, #102421, #101565, #98272, #106914,
        #105606, #105377
* Various cosmetic code updates. Closes: #89066, #89066, #89152
* Add "pre-auto" as an option for DSelect::Clean (run autoclean after
  update).
* More patches from Alfredo for Vendors and more SHA-1 stuff
* Fix for AJ's 'desire to remove perl-5.005' and possibly other
  similar situations. Closes: #56708, #59432
* no_proxy and ftp. Closes: #89671
* Philippe Batailler's man page patches.
* Fix for display bug. Closes: #92033, #93652, #98468
* Use more than 16bits for the dep ID. Some people ran out..
  Closes: #103020, #97809, #102951, #99974, #107362, #107395, #107362,
          #106911, #107395, #108968
* Reordered some things to make dante and FTP happier. Closes: #92757
* James R. Van Zandt's guide.sgml updates. Closes: #90027
* apt-ftparchive copes with no uncompressed package files + contents.
* French man pages from philippe batailler - well sort of. They 
  don't build yet..
* run-parts. Closes: #94286
* 'apt-cache policy' preferences debug tool.
* Whatever. Closes: #89762
* libstdc++ and HURD. Closes: #92025
* More apt-utils verbage. Closes: #86954
* Fliped comparision operator. Closes: #94618
* Used the right copyright file. Closes: #65691
* Randolph's G++3 patches. 
* Fixed no_proxy tokanizing. Closes: #100046
* Strip Config-Version when copying status to available. Closes: #97520
* Segfault with missing source files. Closes: #100325
* EINTR check. Closes: #102293
* Various changes to the locking metholodgy for --print-uris. 
  Closes: #100590
* Lame LD_LIBRARY_PATH thing. Closes: #98928
* apt-cache search searchs provide names too now. Closes: #98695
* Checksum and long lines problem. Closes: #106591
* .aptignr and empty files are just a warning. Closes: #97364  

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: cpp; mode: fold -*-
 
2
// Description                                                          /*{{{*/
 
3
// $Id: hashes.cc,v 1.1 2001/03/06 07:15:29 jgg Exp $
 
4
/* ######################################################################
 
5
 
 
6
   Hashes - Simple wrapper around the hash functions
 
7
   
 
8
   This is just used to make building the methods simpler, this is the
 
9
   only interface required..
 
10
   
 
11
   ##################################################################### */
 
12
                                                                        /*}}}*/
 
13
// Include Files                                                        /*{{{*/
 
14
#ifdef __GNUG__
 
15
#pragma implementation "apt-pkg/hashes.h"
 
16
#endif
 
17
 
 
18
#include <apt-pkg/hashes.h>
 
19
    
 
20
#include <unistd.h>    
 
21
#include <system.h>    
 
22
                                                                        /*}}}*/
 
23
 
 
24
// Hashes::AddFD - Add the contents of the FD                           /*{{{*/
 
25
// ---------------------------------------------------------------------
 
26
/* */
 
27
bool Hashes::AddFD(int Fd,unsigned long Size)
 
28
{
 
29
   unsigned char Buf[64*64];
 
30
   int Res = 0;
 
31
   while (Size != 0)
 
32
   {
 
33
      Res = read(Fd,Buf,MIN(Size,sizeof(Buf)));
 
34
      if (Res < 0 || (unsigned)Res != MIN(Size,sizeof(Buf)))
 
35
         return false;
 
36
      Size -= Res;
 
37
      MD5.Add(Buf,Res);
 
38
      SHA1.Add(Buf,Res);
 
39
   }
 
40
   return true;
 
41
}
 
42
                                                                        /*}}}*/
 
43