summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:31 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:31 +0000
commit1ae93c94429de697fb17f7067367fbf32fd3b6fc (patch)
treedc02b0f8e2682908655ebf27ee5d9e6796ab84f1
parentd955fe80937173f6e4c609ae58a916b61137583d (diff)
HP-UX fixes
Author: jgg Date: 1999-12-10 23:40:29 GMT HP-UX fixes
-rw-r--r--COMPILING67
-rw-r--r--apt-pkg/contrib/cdromutl.cc4
-rw-r--r--apt-pkg/contrib/fileutl.cc4
-rw-r--r--apt-pkg/contrib/md5.cc4
-rw-r--r--apt-pkg/contrib/system.h4
-rw-r--r--apt-pkg/pkgcache.cc6
-rw-r--r--apt-pkg/pkgcachegen.cc5
-rw-r--r--buildlib/archtable1
-rw-r--r--buildlib/sizetable1
-rw-r--r--cmdline/indexcopy.cc9
-rw-r--r--configure.in2
-rw-r--r--methods/gzip.cc18
-rw-r--r--methods/http.cc4
13 files changed, 96 insertions, 33 deletions
diff --git a/COMPILING b/COMPILING
new file mode 100644
index 000000000..3ce726180
--- /dev/null
+++ b/COMPILING
@@ -0,0 +1,67 @@
+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
+
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index f703621c8..dae6f0528 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -1,6 +1,6 @@
// -*- 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.
@@ -170,7 +170,7 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version)
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);
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 59d6aa50a..7cd948265 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1,6 +1,6 @@
// -*- 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
@@ -25,8 +25,8 @@
#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>
/*}}}*/
diff --git a/apt-pkg/contrib/md5.cc b/apt-pkg/contrib/md5.cc
index 11fe07e51..1e2ab3656 100644
--- a/apt-pkg/contrib/md5.cc
+++ b/apt-pkg/contrib/md5.cc
@@ -1,6 +1,6 @@
// -*- 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.
@@ -43,11 +43,11 @@
#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 /*{{{*/
diff --git a/apt-pkg/contrib/system.h b/apt-pkg/contrib/system.h
index 325576dbf..7ec3d7feb 100644
--- a/apt-pkg/contrib/system.h
+++ b/apt-pkg/contrib/system.h
@@ -1,6 +1,6 @@
// -*- 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
@@ -19,6 +19,7 @@
#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)
@@ -36,6 +37,7 @@
#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. */
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 5cf54b9aa..37a9c3aab 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -1,6 +1,6 @@
// -*- 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
@@ -28,11 +28,13 @@
#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 /*{{{*/
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 5aaba78f3..4033dc540 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1,6 +1,6 @@
// -*- 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.
@@ -22,11 +22,12 @@
#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 /*{{{*/
diff --git a/buildlib/archtable b/buildlib/archtable
index 45149cd6e..55fab0036 100644
--- a/buildlib/archtable
+++ b/buildlib/archtable
@@ -29,3 +29,4 @@ armv4l arm arm
powerpc powerpc powerpc
ppc powerpc powerpc
mipsel mipsel mipsel
+hppa1.1 hppa hppa
diff --git a/buildlib/sizetable b/buildlib/sizetable
index 54537a7ad..735f979b6 100644
--- a/buildlib/sizetable
+++ b/buildlib/sizetable
@@ -16,3 +16,4 @@ sparc: big 1 4 2 4
m68k: big 1 4 2 4
powerpc: big 1 4 2 4
mipsel: little 1 4 2 4
+hppa: big 1 4 2 4
diff --git a/cmdline/indexcopy.cc b/cmdline/indexcopy.cc
index 2585fc1da..c8bbd754d 100644
--- a/cmdline/indexcopy.cc
+++ b/cmdline/indexcopy.cc
@@ -1,6 +1,6 @@
// -*- 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
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
-#include <wait.h>
/*}}}*/
// IndexCopy::CopyPackages - Copy the package files from the CD /*{{{*/
@@ -103,11 +102,9 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List)
}
// 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);
diff --git a/configure.in b/configure.in
index beed25387..c0ecdaa05 100644
--- a/configure.in
+++ b/configure.in
@@ -91,7 +91,7 @@ AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
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
diff --git a/methods/gzip.cc b/methods/gzip.cc
index f1bf60ce6..337219316 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -1,6 +1,6 @@
// -*- 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
@@ -17,7 +17,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
-#include <wait.h>
#include <stdio.h>
/*}}}*/
@@ -73,19 +72,12 @@ bool GzipMethod::Fetch(FetchItem *Itm)
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
diff --git a/methods/http.cc b/methods/http.cc
index 536a23b67..7a9a97a1d 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -1,6 +1,6 @@
// -*- 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.
@@ -635,7 +635,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
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;
}