OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   13-Jul-2004 19:53:34
  Branch: HEAD                             Handle: 2004071318533300

  Added files:
    openpkg-src/geoip       geoip.patch
  Modified files:
    openpkg-src/geoip       geoip.spec

  Log:
    upgrading package: geoip 1.3.4 -> 1.3.5

  Summary:
    Revision    Changes     Path
    1.12        +41 -0      openpkg-src/geoip/geoip.patch
    1.51        +4  -2      openpkg-src/geoip/geoip.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/geoip/geoip.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.12 geoip.patch
  --- /dev/null 2004-07-13 19:53:34.000000000 +0200
  +++ geoip.patch       2004-07-13 19:53:34.000000000 +0200
  @@ -0,0 +1,41 @@
  +Yes, gethostbyname_r is thread-safe, but unfortunately too
  +unportable for use within OpenPKG...
  +
  +Index: libGeoIP/GeoIP.c
  +--- libGeoIP/GeoIP.c.orig    2004-06-14 05:09:08 +0200
  ++++ libGeoIP/GeoIP.c 2004-07-13 19:51:02 +0200
  +@@ -434,32 +434,14 @@
  + 
  + unsigned long lookupaddress (const char *host) {
  +     unsigned long addr = inet_addr(host);
  +-    struct hostent phe2;
  +-    struct hostent * phe = &phe2;
  +-    char *buf = NULL;
  +-    int buflength = 16384;
  +-    int herr = 0;
  ++    struct hostent *phe;
  +     int result = 0;
  +-    buf = malloc(buflength);
  +     if (addr == INADDR_NONE) {
  +-            while (1) {
  +-                    /* we use gethostbyname_r here because it is thread-safe and 
gethostbyname is not */
  +-                    result = gethostbyname_r(host,&phe2,buf,buflength,&phe,&herr);
  +-                    if (herr != ERANGE)
  +-                            break;
  +-                    if (result == 0)
  +-                            break;
  +-                    /* double the buffer if the buffer is too small */
  +-                    buflength = buflength * 2;
  +-                    buf = realloc(buf,buflength);
  +-            }
  ++        phe = gethostbyname(host);
  +             if (!phe)
  +                     return 0;
  +-            if (result != 0)
  +-                    return 0;
  +             addr = *((unsigned long *) phe->h_addr_list[0]);
  +     }
  +-    free(buf);
  +     return ntohl(addr);
  + }
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/geoip/geoip.spec
  ============================================================================
  $ cvs diff -u -r1.50 -r1.51 geoip.spec
  --- openpkg-src/geoip/geoip.spec      6 Jul 2004 07:26:56 -0000       1.50
  +++ openpkg-src/geoip/geoip.spec      13 Jul 2004 17:53:33 -0000      1.51
  @@ -24,7 +24,7 @@
   ##
   
   #   package version
  -%define       V_api_c   1.3.4
  +%define       V_api_c   1.3.5
   %define       V_api_pl  1.21
   
   #   package information
  @@ -38,7 +38,7 @@
   Group:        Network
   License:      GPL
   Version:      %{V_api_c}
  -Release:      20040606
  +Release:      20040713
   
   #   package options
   %option       with_perl   no
  @@ -46,6 +46,7 @@
   #   list of sources
   Source0:      http://www.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz
   Source1:      http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz
  +Patch0:       geoip.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -78,6 +79,7 @@
   
   %prep
       %setup -q -n GeoIP-%{V_api_c}
  +    %patch -p0
   %if "%{with_perl}" == "yes"
       %setup -q -T -D -a 1 -n GeoIP-%{V_api_c}
   %endif
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to