development/nvi: New maintainer + patch DB.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Don Allen 2014-11-14 02:45:57 +07:00 committed by Willy Sudiarto Raharjo
parent 3642f5db8d
commit 2057942373
3 changed files with 34 additions and 3 deletions

View file

@ -24,7 +24,7 @@
PRGNAM=nvi
VERSION=${VERSION:-1.81.6}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -70,6 +70,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Apply patches to eliminate bogus "DB_CREATE must be specified to create databases." error message on exit
patch -p1 < $CWD/patches/nvi.diffs
cd build.unix
CFLAGS="$SLKCFLAGS" \
../dist/configure \

View file

@ -6,5 +6,5 @@ MD5SUM="88d1e23115ee9f2961186b62e55f5704"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Robby Workman"
EMAIL="rworkman@slackbuilds.org"
MAINTAINER="Don Allen"
EMAIL="donaldcallen@gmail.com"

View file

@ -0,0 +1,28 @@
diff -up nvi-1.81.6/common/db.h patched-nvi-1.81.6/common/db.h
--- nvi-1.81.6/common/db.h 2007-11-18 11:41:42.000000000 -0500
+++ patched-nvi-1.81.6/common/db.h 2014-10-04 08:53:11.000000000 -0400
@@ -16,7 +16,10 @@
(env)->remove(env, path, NULL, flags)
#endif
-#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
+# if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 4) || DB_VERSION_MAJOR > 4
+#define db_open(db,file,type,flags,mode) \
+ (db)->open(db, NULL, file, NULL, type, flags | DB_CREATE, mode)
+#elif DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
#define db_open(db,file,type,flags,mode) \
(db)->open(db, NULL, file, NULL, type, flags, mode)
#else
diff -up nvi-1.81.6/common/msg.c patched-nvi-1.81.6/common/msg.c
--- nvi-1.81.6/common/msg.c 2007-11-18 11:41:42.000000000 -0500
+++ patched-nvi-1.81.6/common/msg.c 2014-10-04 08:55:13.000000000 -0400
@@ -724,7 +724,8 @@ msg_open(SCR *sp, char *file)
p = buf;
} else
p = file;
- if ((sp->db_error = db_create(&db, 0, 0)) != 0 ||
+ if (access(p, R_OK) != 0 ||
+ (sp->db_error = db_create(&db, 0, 0)) != 0 ||
(sp->db_error = db->set_re_source(db, p)) != 0 ||
(sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) {
if (first) {