Browse Source

HP-UX fixes

Author: jgg
Date: 1999-12-10 23:40:29 GMT
HP-UX fixes
debian/1.8.y
Arch Librarian 18 years ago
parent
commit
1ae93c9442
  1. 67
      COMPILING
  2. 4
      apt-pkg/contrib/cdromutl.cc
  3. 4
      apt-pkg/contrib/fileutl.cc
  4. 4
      apt-pkg/contrib/md5.cc
  5. 4
      apt-pkg/contrib/system.h
  6. 6
      apt-pkg/pkgcache.cc
  7. 5
      apt-pkg/pkgcachegen.cc
  8. 1
      buildlib/archtable
  9. 1
      buildlib/sizetable
  10. 9
      cmdline/indexcopy.cc
  11. 2
      configure.in
  12. 18
      methods/gzip.cc
  13. 4
      methods/http.cc

67
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

4
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);

4
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>
/*}}}*/

4
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 /*{{{*/

4
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. */

6
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 /*{{{*/

5
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 /*{{{*/

1
buildlib/archtable

@ -29,3 +29,4 @@ armv4l arm arm
powerpc powerpc powerpc
ppc powerpc powerpc
mipsel mipsel mipsel
hppa1.1 hppa hppa

1
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

9
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);

2
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

18
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

4
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;
}

Loading…
Cancel
Save