pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/databases/gdbm Apply upstream patch 32517af7 to check ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d225f8f39868
branches:  trunk
changeset: 458368:d225f8f39868
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Tue Sep 14 13:32:50 2021 +0000

description:
Apply upstream patch 32517af7 to check for st_mtim in struct stat. Fixes
macOS build.

diffstat:

 databases/gdbm/distinfo                      |   6 +++-
 databases/gdbm/patches/patch-configure       |  36 ++++++++++++++++++++++
 databases/gdbm/patches/patch-src_gdbmshell.c |  19 +++++++++++
 databases/gdbm/patches/patch-src_gdbmsync.c  |  45 ++++++++++++++++++++++++++++
 databases/gdbm/patches/patch-src_systems.h   |  21 +++++++++++++
 5 files changed, 126 insertions(+), 1 deletions(-)

diffs (153 lines):

diff -r 4efe91b86c30 -r d225f8f39868 databases/gdbm/distinfo
--- a/databases/gdbm/distinfo   Tue Sep 14 10:50:48 2021 +0000
+++ b/databases/gdbm/distinfo   Tue Sep 14 13:32:50 2021 +0000
@@ -1,7 +1,11 @@
-$NetBSD: distinfo,v 1.18 2021/09/12 09:12:34 wiz Exp $
+$NetBSD: distinfo,v 1.19 2021/09/14 13:32:50 schmonz Exp $
 
 SHA1 (gdbm-1.21.tar.gz) = f6eec6113f04a4b5fd2c1cfead10e7d65c8f3d89
 RMD160 (gdbm-1.21.tar.gz) = 0a39c460bc85e271cac4d7fe08f6b38bf9426e6a
 SHA512 (gdbm-1.21.tar.gz) = b2a31802d1af9f97b24d3dd01cb048bab4a8e748297f1b70851c0342400dde4281242b7f80bd92a36035e22398d240d131b550ab444ee838a077522a6921fa43
 Size (gdbm-1.21.tar.gz) = 1005982 bytes
+SHA1 (patch-configure) = 0ae6c9280f911a524a3a2043df1e24588bd93a63
 SHA1 (patch-src_Makefile.in) = 52b47f3dcd381143d1cdae40f1972bd989dcce1f
+SHA1 (patch-src_gdbmshell.c) = 56e8d69db9cab2a2e4846d9adec908596dd1f6a0
+SHA1 (patch-src_gdbmsync.c) = b57595f11838faabe5accda79fb62207c021a052
+SHA1 (patch-src_systems.h) = dc4132ae62c6b4f050dcf3d4c30552af087b310b
diff -r 4efe91b86c30 -r d225f8f39868 databases/gdbm/patches/patch-configure
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/gdbm/patches/patch-configure    Tue Sep 14 13:32:50 2021 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-configure,v 1.1 2021/09/14 13:32:50 schmonz Exp $
+
+Apply upstream patch 32517af7 to check for st_mtim in struct stat.
+Fixes macOS build.
+
+--- configure.orig     2021-09-02 12:47:45.000000000 +0000
++++ configure
+@@ -15451,6 +15451,28 @@ _ACEOF
+ 
+ 
+ fi
++ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "#include <sys/types.h>
++                #include <sys/stat.h>
++"
++if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then :
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_STRUCT_STAT_ST_MTIM 1
++_ACEOF
++
++
++fi
++ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "#include <sys/types.h>
++                #include <sys/stat.h>
++"
++if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes; then :
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
++_ACEOF
++
++
++fi
+ 
+ 
+  if test "$want_compat" = yes; then
diff -r 4efe91b86c30 -r d225f8f39868 databases/gdbm/patches/patch-src_gdbmshell.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/gdbm/patches/patch-src_gdbmshell.c      Tue Sep 14 13:32:50 2021 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_gdbmshell.c,v 1.1 2021/09/14 13:32:50 schmonz Exp $
+
+Apply upstream patch 32517af7 to check for st_mtim in struct stat.
+Fixes macOS build.
+
+--- src/gdbmshell.c.orig       2021-09-02 12:39:55.000000000 +0000
++++ src/gdbmshell.c
+@@ -1010,7 +1010,11 @@ print_snapshot (char const *snapname, FI
+       fprintf (fp, "%s: ", snapname);
+       fprintf (fp, "%03o %s ", st.st_mode & 0777,
+              decode_mode (st.st_mode, buf));
++#if HAVE_STRUCT_STAT_ST_MTIM
+       fprintf (fp, "%ld.%09ld", st.st_mtim.tv_sec, st.st_mtim.tv_nsec);
++#else
++      fprintf (fp, "%ld [%s]", st.st_mtime, _("insufficient precision"));
++#endif
+       if (S_ISREG (st.st_mode))
+       {
+         GDBM_FILE dbf;
diff -r 4efe91b86c30 -r d225f8f39868 databases/gdbm/patches/patch-src_gdbmsync.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/gdbm/patches/patch-src_gdbmsync.c       Tue Sep 14 13:32:50 2021 +0000
@@ -0,0 +1,45 @@
+$NetBSD: patch-src_gdbmsync.c,v 1.1 2021/09/14 13:32:50 schmonz Exp $
+
+Apply upstream patch 32517af7 to check for st_mtim in struct stat.
+Fixes macOS build.
+
+--- src/gdbmsync.c.orig        2021-08-10 12:13:24.000000000 +0000
++++ src/gdbmsync.c
+@@ -220,16 +220,23 @@ gdbm_failure_atomic (GDBM_FILE dbf, cons
+ }
+ 
+ static inline int
+-timespec_cmp (struct timespec const *a, struct timespec const *b)
++timespec_cmp (struct stat const *a, struct stat const *b)
+ {
+-  if (a->tv_sec < b->tv_sec)
++#if HAVE_STRUCT_STAT_ST_MTIM
++  if (a->st_mtim.tv_sec < b->st_mtim.tv_sec)
+     return -1;
+-  if (a->tv_sec > b->tv_sec)
++  if (a->st_mtim.tv_sec > b->st_mtim.tv_sec)
+     return 1;
+-  if (a->tv_nsec < b->tv_nsec)
++  if (a->st_mtim.tv_nsec < b->st_mtim.tv_nsec)
+     return -1;
+-  if (a->tv_nsec > b->tv_nsec)
++  if (a->st_mtim.tv_nsec > b->st_mtim.tv_nsec)
+     return 1;
++#else
++  if (a->st_mtime < b->st_mtime)
++    return -1;
++  if (a->st_mtime > b->st_mtime)
++    return 1;
++#endif  
+   return 0;
+ }
+ 
+@@ -374,7 +381,7 @@ gdbm_latest_snapshot (const char *even, 
+          * Select the newer snapshot, i.e. the one whose mtime
+          * is greater than the other's
+          */
+-        switch (timespec_cmp (&st_even.st_mtim, &st_odd.st_mtim))
++        switch (timespec_cmp (&st_even, &st_odd))
+           {
+           case -1:
+             *ret = odd;
diff -r 4efe91b86c30 -r d225f8f39868 databases/gdbm/patches/patch-src_systems.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/gdbm/patches/patch-src_systems.h        Tue Sep 14 13:32:50 2021 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_systems.h,v 1.1 2021/09/14 13:32:50 schmonz Exp $
+
+Apply upstream patch 32517af7 to check for st_mtim in struct stat.
+Fixes macOS build.
+
+--- src/systems.h.orig 2021-08-10 12:13:24.000000000 +0000
++++ src/systems.h
+@@ -52,6 +52,13 @@
+ # define STATBLKSIZE(st) 1024
+ #endif
+ 
++#if ! HAVE_STRUCT_STAT_ST_MTIM
++# if HAVE_STRUCT_STAT_ST_MTIMESPEC
++#   define st_mtim st_mtimespec
++#   define HAVE_STRUCT_STAT_ST_MTIM 1
++# endif
++#endif
++
+ #ifndef STDERR_FILENO
+ # define STDERR_FILENO 2
+ #endif



Home | Main Index | Thread Index | Old Index