Pārlūkot izejas kodu

BSD testing fixes
Author: jgg
Date: 2001-03-11 05:30:20 GMT
BSD testing fixes

Arch Librarian 22 gadi atpakaļ
vecāks
revīzija
678bc33eaf
4 mainītis faili ar 34 papildinājumiem un 17 dzēšanām
  1. 22 8
      COMPILING
  2. 3 4
      apt-pkg/contrib/hashes.h
  3. 1 2
      apt-pkg/contrib/sha1.cc
  4. 8 3
      methods/gzip.cc

+ 22 - 8
COMPILING

@@ -8,10 +8,19 @@ To compile this you need a couple things
   - A working ANSI C++ compiler, this is not g++ 2.7.* 
   - A working ANSI C++ compiler, this is not g++ 2.7.* 
     g++ 2.8 works OK and newer egcs work well also. Nobody has tried it
     g++ 2.8 works OK and newer egcs work well also. Nobody has tried it
     on other compilers :< You will need a properly working STL as well.
     on other compilers :< You will need a properly working STL as well.
+    g++ 3 does not presently work because they made the STL headers
+    use namespaces. 
   - A C library with the usual POSIX functions and a BSD socket layer. 
   - A C library with the usual POSIX functions and a BSD socket layer. 
-    If you OS conforms to the Single User Spec then you are fine:
+    If you OS conforms to the Single Unix Spec then you are fine:
       http://www.opengroup.org/onlinepubs/7908799/index.html      
       http://www.opengroup.org/onlinepubs/7908799/index.html      
 
 
+** NOTICE **
+The C++ global constructors do not link correctly when using non-shared
+libaries. This is probably the correct behavior of the linker, but I have
+not yet had time to devise a work around for it. The correct thing to 
+do is add a reference to debSystem in apt-pkg/init.cc, 
+assert(&debSystem == 0) would be fine for instance.
+
 Guidelines
 Guidelines
 ~~~~~~~~~~
 ~~~~~~~~~~
 I am not interested in making 'ultra portable code'. I will accept patches
 I am not interested in making 'ultra portable code'. I will accept patches
@@ -27,12 +36,12 @@ functionality. Patches to make autoconf detect these cases and generate the
 required shims are OK.
 required shims are OK.
 
 
 Current shims:
 Current shims:
-  * C9x integer types 'inttypes.h' 
-  * sys/statvfs.h to convert from BSD/Linux statfs to SUS statvfs
+  * C99 integer types 'inttypes.h' 
+  * sys/statvfs.h to convert from BSD/old-glibc statfs to SUS statvfs
   * rfc2553 hostname resolution (methods/rfc*), shims to normal gethostbyname.
   * rfc2553 hostname resolution (methods/rfc*), shims to normal gethostbyname.
     The more adventerous could steal the KAME IPv6 enabled resolvers for those
     The more adventerous could steal the KAME IPv6 enabled resolvers for those
     OS's with IPv6 support but no rfc2553 (why?)
     OS's with IPv6 support but no rfc2553 (why?)
-  * define _XOPEN_EXTENDES_SOURCE to bring in h_errno on HP-UX
+  * define _XOPEN_EXTENDED_SOURCE to bring in h_errno on HP-UX
   * socklen_t shim in netdb.h if the OS does not have socklen_t
   * socklen_t shim in netdb.h if the OS does not have socklen_t
   
   
 The only completely non-shimed OS is Linux with glibc2.1, glibc2.0 requires
 The only completely non-shimed OS is Linux with glibc2.1, glibc2.0 requires
@@ -42,24 +51,29 @@ Platform Notes
 ~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~
 Debian GNU Linux 2.1 'slink'
 Debian GNU Linux 2.1 'slink'
 Debian GNU Linux 'potato'
 Debian GNU Linux 'potato'
+Debian GNU Linux 'woody'
   * All Archs
   * All Archs
   - Works flawlessly
   - Works flawlessly
-  - You will want to have debiandoc-sgml and yodl installed to get
+  - You will want to have debiandoc-sgml and docbook2man installed to get
     best results.
     best results.
   - No IPv6 Support in glibc's < 2.1.
   - No IPv6 Support in glibc's < 2.1.
 
 
 Sun Solaris
 Sun Solaris
   SunOS cab101 5.7 Generic_106541-04 sun4u sparc
   SunOS cab101 5.7 Generic_106541-04 sun4u sparc
+  SunOS csu201 5.8 Generic_108528-04 sun4u sparc  
   - Works fine
   - Works fine
   - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
   - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
 
 
 OpenBSD
 OpenBSD
   OpenBSD gsb086 2.5 CMPUT#0 i386 unknown
   OpenBSD gsb086 2.5 CMPUT#0 i386 unknown
-  - Works fine
+  OpenBSD csu101 2.7 CMPUT#1 i386 unknown  
   - OS needs 'ranlib' to generate the symbol table after 'ar'.. (not using
   - OS needs 'ranlib' to generate the symbol table after 'ar'.. (not using
     GNU ar with the gnu tool chain :<)
     GNU ar with the gnu tool chain :<)
-  - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
-  
+  - '2.5' does not have RFC 2553 hostname resolution, but '2.7' does
+  - Testing on '2.7' suggests the OS has a bug in its handling of 
+    ftruncate on files that have been written via mmap. It fills the page 
+    that crosses the truncation boundary with 0's. 
+    
 HP-UX
 HP-UX
   HP-UX nyquist B.10.20 C 9000/780 2016574337 32-user license
   HP-UX nyquist B.10.20 C 9000/780 2016574337 32-user license
   - Evil OS, does not conform very well to SUS
   - Evil OS, does not conform very well to SUS

+ 3 - 4
apt-pkg/contrib/hashes.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: hashes.h,v 1.1 2001/03/06 07:15:29 jgg Exp $
+// $Id: hashes.h,v 1.2 2001/03/11 05:30:20 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Hashes - Simple wrapper around the hash functions
    Hashes - Simple wrapper around the hash functions
@@ -14,7 +14,7 @@
 #define APTPKG_HASHES_H
 #define APTPKG_HASHES_H
 
 
 #ifdef __GNUG__
 #ifdef __GNUG__
-#pragma interface "apt-pkg/hashesh.h"
+#pragma interface "apt-pkg/hashes.h"
 #endif 
 #endif 
 
 
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
@@ -29,8 +29,7 @@ class Hashes
    
    
    inline bool Add(const unsigned char *Data,unsigned long Size)
    inline bool Add(const unsigned char *Data,unsigned long Size)
    {
    {
-      MD5.Add(Data,Size);
-      SHA1.Add(Data,Size);
+      return MD5.Add(Data,Size) && SHA1.Add(Data,Size);
    };
    };
    inline bool Add(const char *Data) {return Add((unsigned char *)Data,strlen(Data));};
    inline bool Add(const char *Data) {return Add((unsigned char *)Data,strlen(Data));};
    bool AddFD(int Fd,unsigned long Size);
    bool AddFD(int Fd,unsigned long Size);

+ 1 - 2
apt-pkg/contrib/sha1.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description                                                          /*{{{*/
 // Description                                                          /*{{{*/
-// $Id: sha1.cc,v 1.1 2001/03/06 05:03:49 jgg Exp $
+// $Id: sha1.cc,v 1.2 2001/03/11 05:30:20 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    SHA1 - SHA-1 Secure Hash Algorithm.
    SHA1 - SHA-1 Secure Hash Algorithm.
@@ -269,7 +269,6 @@ SHA1SumValue SHA1Summation::Result()
 {
 {
    uint32_t *state = (uint32_t *)State;
    uint32_t *state = (uint32_t *)State;
    uint32_t *count = (uint32_t *)Count;
    uint32_t *count = (uint32_t *)Count;
-   uint8_t *buffer = (uint8_t *)Buffer;
    
    
    // Apply the padding
    // Apply the padding
    if (Done == false)
    if (Done == false)

+ 8 - 3
methods/gzip.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: gzip.cc,v 1.12 2001/03/06 07:15:29 jgg Exp $
+// $Id: gzip.cc,v 1.13 2001/03/11 05:30:20 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    GZip method - Take a file URI in and decompress it into the target 
    GZip method - Take a file URI in and decompress it into the target 
@@ -34,7 +34,8 @@ class GzipMethod : public pkgAcqMethod
 
 
 // GzipMethod::Fetch - Decompress the passed URI			/*{{{*/
 // GzipMethod::Fetch - Decompress the passed URI			/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
-/* */
+/* This forks gzip and hashes the resulting decompressed output as it
+   flows to the destination file */
 bool GzipMethod::Fetch(FetchItem *Itm)
 bool GzipMethod::Fetch(FetchItem *Itm)
 {
 {
    URI Get = Itm->Uri;
    URI Get = Itm->Uri;
@@ -102,7 +103,11 @@ bool GzipMethod::Fetch(FetchItem *Itm)
 	 break;
 	 break;
       
       
       Hash.Add(Buffer,Count);
       Hash.Add(Buffer,Count);
-      To.Write(Buffer,Count);
+      if (To.Write(Buffer,Count) == false)
+      {	 
+	 Failed = true;
+	 break;
+      }	 
    }
    }
    
    
    // Wait for gzip to finish
    // Wait for gzip to finish