From 2baf46348f0d57f5c17fdf2fa74077bb25c0e787 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Thu, 22 Jan 2015 23:08:16 +0100 Subject: gnu: nvi: Fix Berkely DB compatability issues. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/nvi-db4.patch: New file. * gnu/packages/patches/nvi-dbpagesize-binpower.patch: New file. * gnu/packages/nvi.scm (nvi): Make use of them. * gnu-system.am (dist_patch_DATA): Add them. Signed-off-by: Ludovic Courtès --- gnu/packages/patches/nvi-dbpagesize-binpower.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 gnu/packages/patches/nvi-dbpagesize-binpower.patch (limited to 'gnu/packages/patches/nvi-dbpagesize-binpower.patch') diff --git a/gnu/packages/patches/nvi-dbpagesize-binpower.patch b/gnu/packages/patches/nvi-dbpagesize-binpower.patch new file mode 100644 index 0000000000..7dde693351 --- /dev/null +++ b/gnu/packages/patches/nvi-dbpagesize-binpower.patch @@ -0,0 +1,35 @@ +This patch originates from the Debian project, see https://www.debian.org/ + +18dbpagesize_binpower.dpatch by + + +Make sure that the pagesize passed to db__set_pagesize() is a power of two. + +nvi stores the content of files in BDB database structures. When initiating a +file, it picks a page size for the database to fit the file within 15 pages, +with a minimal page size of 1K and maximal of 10K. + +In vanilla nvi, this size is calculated as a multiple of 1024. Modern versions +of BDB, however, require the page size of a database to be a power of two, which +this patch addresses, ridding us of the following message: + + BDB0511 page sizes must be a power-of-2 + +--- nvi-1.81.6.orig/common/exf.c 2009-03-09 01:48:01.695862889 +0100 ++++ nvi-1.81.6/common/exf.c 2009-03-09 10:42:41.147866272 +0100 +@@ -249,11 +249,10 @@ + * (vi should have good locality) or smaller than 1K. + */ + psize = ((sb.st_size / 15) + 1023) / 1024; +- if (psize > 10) +- psize = 10; +- if (psize == 0) +- psize = 1; +- psize *= 1024; ++ if (psize >= 8) psize=8<<10; ++ else if (psize >= 4) psize=4<<10; ++ else if (psize >= 2) psize=2<<10; ++ else psize=1<<10; + + F_SET(ep, F_DEVSET); + ep->mdev = sb.st_dev; -- cgit v1.2.3