--- /dev/null
+General Information
+~~~~~~~~~~~~~~~~~~~
+To compile this you need a couple things
+ - A working POSIX system with working POSIX gcc, g++, make (GNU),
+ ar, sh, awk and sed in the path
+ - GNU Make 3.74 or so, -- normal UNIX make will NOT work
+ * Note 3.77 is broken.
+ - 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
+ on other compilers :< You will need a properly working STL as well.
+ - 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:
+ http://www.opengroup.org/onlinepubs/7908799/index.html
+
+Guidelines
+~~~~~~~~~~
+I am not interested in making 'ultra portable code'. I will accept patches
+to make the code that already exists conform more to SUS or POSIX, but
+I don't really care if your not-SUS OS doesn't work. It is simply too
+much work to maintain patches for dysfunctional OSs. I highly suggest you
+contact your vendor and express intrest in a conforming C library.
+
+That said, there are lots of finniky problems that must be delt with even
+between the supported OS's. Primarily the path I choose to take is to put
+a shim header file in build/include that transparently adds the required
+functionality. Patches to make autoconf detect these cases and generate the
+required shims are OK.
+
+Current shims:
+ * C9x integer types 'inttypes.h'
+ * sys/statvfs.h to convert from BSD statfs to SUS statvfs
+ * rfc2553 hostname resolution (methods/rfc*), shims to normal gethostbyname.
+
+The only completely non-shimed OS is Linux with glibc2.1
+
+Platform Notes
+~~~~~~~~~~~~~~
+Debian GNU Linux 2.1 'slink'
+Debian GNU Linux 'potato'
+ * All Archs
+ - Works flawlessly
+ - You will want to have debiandoc-sgml and yodl installed to get
+ best results.
+ - No IPv6 Support in glibc's < 2.1
+
+Sun Solaris
+ SunOS cab101 5.7 Generic_106541-04 sun4u sparc
+ - Works fine
+ - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
+
+HP-UX
+ HP-UX nyquist B.10.20 C 9000/780 2016574337 32-user license
+ - Evil OS, does not conform very well to SUS
+ 1) snprintf exists but is not prototyped, ignore spurios warnings
+ 2) No socklen_t
+ 3) Requires -D_XOPEN_SOURCE_EXTENDED for h_errno
+ Items 2 and 3 have to be fixed by hand. Insert this into
+ build/include/netdb.h:
+
+ #define _XOPEN_SOURCE_EXTENDED
+ #define socklen_t size_t
+ #include_next <netdb.h>
+
+ A similar techinque can be used for snprintf/vsprintf if you dislike
+ the warnings
+ - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
+
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cdromutl.cc,v 1.10 1999/12/10 06:30:42 jgg Exp $
+// $Id: cdromutl.cc,v 1.11 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
CDROM Utilities - Some functions to manipulate CDROM mounts.
struct stat Buf;
if (stat(Dir->d_name,&Buf) != 0)
continue;
- sprintf(S,"%lu",Buf.st_mtime);
+ sprintf(S,"%lu",(unsigned long)Buf.st_mtime);
}
Hash.Add(S);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.cc,v 1.32 1999/12/09 21:18:01 jgg Exp $
+// $Id: fileutl.cc,v 1.33 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
File Utilities
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <sys/wait.h>
#include <signal.h>
-#include <wait.h>
#include <errno.h>
/*}}}*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: md5.cc,v 1.10 1999/11/16 03:10:56 jgg Exp $
+// $Id: md5.cc,v 1.11 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
MD5Sum - MD5 Message Digest Algorithm.
#include <apt-pkg/strutl.h>
#include <string.h>
-#include <system.h>
#include <unistd.h>
#include <netinet/in.h> // For htonl
#include <inttypes.h>
#include <config.h>
+#include <system.h>
/*}}}*/
// byteSwap - Swap bytes in a buffer /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: system.h,v 1.2 1999/01/18 06:20:08 jgg Exp $
+// $Id: system.h,v 1.3 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
System Header - Usefull private definitions
#define MAX_VAL(t) (((t)(-1) > 0) ? (t)(-1) : (t)(((1L<<(sizeof(t)*8-1))-1)))
// Min/Max functions
+#if !defined(MIN)
#if defined(__HIGHC__)
#define MIN(x,y) _min(x,y)
#define MAX(x,y) _max(x,y)
#define MIN(A,B) ((A) < (B)?(A):(B))
#define MAX(A,B) ((A) > (B)?(A):(B))
#endif
+#endif
/* Bound functions, bound will return the value b within the limits a-c
bounv will change b so that it is within the limits of a-c. */
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcache.cc,v 1.30 1999/12/05 05:37:45 jgg Exp $
+// $Id: pkgcache.cc,v 1.31 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
Package Cache - Accessor code for the cache
#include <apt-pkg/version.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
-#include <system.h>
#include <string>
#include <sys/stat.h>
#include <unistd.h>
+
+#include <system.h>
+
/*}}}*/
// Cache::Header::Header - Constructor /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcachegen.cc,v 1.42 1999/10/29 04:49:37 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.43 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
#include <apt-pkg/configuration.h>
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/strutl.h>
-#include <system.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
+
+#include <system.h>
/*}}}*/
// CacheGenerator::pkgCacheGenerator - Constructor /*{{{*/
powerpc powerpc powerpc
ppc powerpc powerpc
mipsel mipsel mipsel
+hppa1.1 hppa hppa
m68k: big 1 4 2 4
powerpc: big 1 4 2 4
mipsel: little 1 4 2 4
+hppa: big 1 4 2 4
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: indexcopy.cc,v 1.2 1999/09/03 05:46:48 jgg Exp $
+// $Id: indexcopy.cc,v 1.3 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
Index Copying - Aid for copying and verifying the index files
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
-#include <wait.h>
/*}}}*/
// IndexCopy::CopyPackages - Copy the package files from the CD /*{{{*/
}
// Wait for gzip to finish
- int Status;
- if (waitpid(Process,&Status,0) != Process)
- return _error->Errno("wait","Waiting for gzip failed");
- if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
+ if (ExecWait(Process,_config->Find("Dir::bin::gzip","gzip").c_str(),false) == false)
return _error->Error("gzip failed, perhaps the disk is full.");
+
Pkg.Seek(0);
}
pkgTagFile Parser(Pkg);
dnl We use C9x types if at all possible
AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
AC_TRY_COMPILE([#include <inttypes.h>],
- [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
+ [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;],
c9x_ints=yes,c9x_ints=no)])
dnl Single Unix Spec statvfs
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: gzip.cc,v 1.8 1999/07/30 05:37:00 jgg Exp $
+// $Id: gzip.cc,v 1.9 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
GZip method - Take a file URI in and decompress it into the target
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
-#include <wait.h>
#include <stdio.h>
/*}}}*/
From.Close();
// Wait for gzip to finish
- int Status;
- if (waitpid(Process,&Status,0) != Process)
+ if (ExecWait(Process,_config->Find("Dir::bin::gzip","gzip").c_str(),false) == false)
{
To.OpFail();
- return _error->Errno("wait","Waiting for gzip failed");
- }
-
- if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
- {
- To.OpFail();
- return _error->Error("gzip failed, perhaps the disk is full or the directory permissions are wrong.");
- }
-
+ return false;
+ }
+
To.Close();
// Transfer the modification times
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: http.cc,v 1.42 1999/12/10 08:53:43 jgg Exp $
+// $Id: http.cc,v 1.43 1999/12/10 23:40:29 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
{
// In this case we send an if-range query with a range header
- sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n",SBuf.st_size - 1,
+ sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n",(long)SBuf.st_size - 1,
TimeRFC1123(SBuf.st_mtime).c_str());
Req += Buf;
}