pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/aria2 Work around API bug in pre-christos-time_t N...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a3c03ee496ac
branches:  trunk
changeset: 552400:a3c03ee496ac
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sat Jan 03 23:11:47 2009 +0000

description:
Work around API bug in pre-christos-time_t NetBSD, where struct
timeval's seconds are "long" rather than "time_t". Passing these
seconds to localtime_r() breaks on 64-bit platforms where those types
aren't the same. Fixes PR 40323 from Andreas Burghardt.

PKGREVISION++ as a precaution, since I patched the source.

diffstat:

 net/aria2/Makefile         |   3 ++-
 net/aria2/distinfo         |   3 ++-
 net/aria2/patches/patch-aa |  17 +++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r fb5c0051eac0 -r a3c03ee496ac net/aria2/Makefile
--- a/net/aria2/Makefile        Sat Jan 03 22:14:03 2009 +0000
+++ b/net/aria2/Makefile        Sat Jan 03 23:11:47 2009 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.16 2008/10/29 01:04:06 bjs Exp $
+# $NetBSD: Makefile,v 1.17 2009/01/03 23:11:47 dholland Exp $
 #
 
 DISTNAME=      aria2c-0.16.2
 PKGNAME=       ${DISTNAME:S/+/./:S/2c-/2-/}
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=aria2/}
 EXTRACT_SUFX=  .tar.bz2
diff -r fb5c0051eac0 -r a3c03ee496ac net/aria2/distinfo
--- a/net/aria2/distinfo        Sat Jan 03 22:14:03 2009 +0000
+++ b/net/aria2/distinfo        Sat Jan 03 23:11:47 2009 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.14 2008/10/29 01:04:06 bjs Exp $
+$NetBSD: distinfo,v 1.15 2009/01/03 23:11:47 dholland Exp $
 
 SHA1 (aria2c-0.16.2.tar.bz2) = 244d51c91771bf440009bb33c360f258913812ac
 RMD160 (aria2c-0.16.2.tar.bz2) = e3c124ac20501163792fe5ceb820da3d801ffc83
 Size (aria2c-0.16.2.tar.bz2) = 1153881 bytes
+SHA1 (patch-aa) = ef972e61740c7b95ca2441e6899ddadab45f51de
diff -r fb5c0051eac0 -r a3c03ee496ac net/aria2/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/aria2/patches/patch-aa        Sat Jan 03 23:11:47 2009 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-aa,v 1.6 2009/01/03 23:11:47 dholland Exp $
+
+--- src/SimpleLogger.cc~       2008-10-19 11:16:24.000000000 -0400
++++ src/SimpleLogger.cc        2009-01-03 17:46:14.000000000 -0500
+@@ -147,7 +147,12 @@ void SimpleLogger::writeLog(std::ostream
+   gettimeofday(&tv, 0);
+   char datestr[27]; // 'YYYY-MM-DD hh:mm:ss.uuuuuu'+'\0' = 27 bytes
+   struct tm tm;
++#ifdef __NetBSD__ /* work around API bug on 64-bit platforms in netbsd<6.0 */
++  time_t tmp = tv.tv_sec;
++  localtime_r(&tmp, &tm);
++#else
+   localtime_r(&tv.tv_sec, &tm);
++#endif
+   size_t dateLength =
+     strftime(datestr, sizeof(datestr), "%Y-%m-%d %H:%M:%S", &tm);
+   assert(dateLength <= (size_t)20);



Home | Main Index | Thread Index | Old Index