diff options
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/nvi.scm | 4 | ||||
| -rw-r--r-- | gnu/packages/patches/nvi-db4.patch | 35 | ||||
| -rw-r--r-- | gnu/packages/patches/nvi-dbpagesize-binpower.patch | 35 |
3 files changed, 73 insertions, 1 deletions
diff --git a/gnu/packages/nvi.scm b/gnu/packages/nvi.scm index 8fd736d1808..128715f6acf 100644 --- a/gnu/packages/nvi.scm +++ b/gnu/packages/nvi.scm | |||
| @@ -37,7 +37,9 @@ | |||
| 37 | ".tar.bz2")) | 37 | ".tar.bz2")) |
| 38 | (sha256 | 38 | (sha256 |
| 39 | (base32 "0nbbs1inyrqds0ywn3ln5slv54v5zraq7lszkg8nsavv4kivhh9l")) | 39 | (base32 "0nbbs1inyrqds0ywn3ln5slv54v5zraq7lszkg8nsavv4kivhh9l")) |
| 40 | (patches (list (search-patch "nvi-assume-preserve-path.patch"))) | 40 | (patches (list (search-patch "nvi-assume-preserve-path.patch") |
| 41 | (search-patch "nvi-dbpagesize-binpower.patch") | ||
| 42 | (search-patch "nvi-db4.patch"))) | ||
| 41 | (snippet | 43 | (snippet |
| 42 | ;; Create a wrapper for the configure script, make it executable. | 44 | ;; Create a wrapper for the configure script, make it executable. |
| 43 | '(let ((conf-wrap (open-output-file "configure"))) | 45 | '(let ((conf-wrap (open-output-file "configure"))) |
diff --git a/gnu/packages/patches/nvi-db4.patch b/gnu/packages/patches/nvi-db4.patch new file mode 100644 index 00000000000..03b736cd08c --- /dev/null +++ b/gnu/packages/patches/nvi-db4.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | This patch originates from the Debian project, see https://www.debian.org/ | ||
| 2 | |||
| 3 | 03db4.dpatch by <hesso@pool.math.tu-berlin.de> | ||
| 4 | |||
| 5 | |||
| 6 | libdb4 compatibility adjustments. | ||
| 7 | |||
| 8 | In particular, this patch adds extra file permission checking and passes the | ||
| 9 | DB_CREATE flag to the first invocation of db_open on the file's database | ||
| 10 | structure, which rids us of the following message: | ||
| 11 | |||
| 12 | BDB0635 DB_CREATE must be specified to create databases. | ||
| 13 | |||
| 14 | --- nvi-1.81.6.orig/common/msg.c 2009-02-26 14:26:58.350336128 +0100 | ||
| 15 | +++ nvi-1.81.6/common/msg.c 2009-02-26 14:29:05.235335829 +0100 | ||
| 16 | @@ -724,9 +724,18 @@ | ||
| 17 | p = buf; | ||
| 18 | } else | ||
| 19 | p = file; | ||
| 20 | + if (access(p, F_OK) != 0) { | ||
| 21 | + if (first) { | ||
| 22 | + first = 0; | ||
| 23 | + return (1); | ||
| 24 | + } | ||
| 25 | + sp->db_error = ENOENT; | ||
| 26 | + msgq_str(sp, M_DBERR, p, "%s"); | ||
| 27 | + return (1); | ||
| 28 | + } | ||
| 29 | if ((sp->db_error = db_create(&db, 0, 0)) != 0 || | ||
| 30 | (sp->db_error = db->set_re_source(db, p)) != 0 || | ||
| 31 | - (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) { | ||
| 32 | + (sp->db_error = db_open(db, NULL, DB_RECNO, DB_CREATE, 0)) != 0) { | ||
| 33 | if (first) { | ||
| 34 | first = 0; | ||
| 35 | return (1); | ||
diff --git a/gnu/packages/patches/nvi-dbpagesize-binpower.patch b/gnu/packages/patches/nvi-dbpagesize-binpower.patch new file mode 100644 index 00000000000..7dde693351b --- /dev/null +++ b/gnu/packages/patches/nvi-dbpagesize-binpower.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | This patch originates from the Debian project, see https://www.debian.org/ | ||
| 2 | |||
| 3 | 18dbpagesize_binpower.dpatch by <hesso@pool.math.tu-berlin.de> | ||
| 4 | |||
| 5 | |||
| 6 | Make sure that the pagesize passed to db__set_pagesize() is a power of two. | ||
| 7 | |||
| 8 | nvi stores the content of files in BDB database structures. When initiating a | ||
| 9 | file, it picks a page size for the database to fit the file within 15 pages, | ||
| 10 | with a minimal page size of 1K and maximal of 10K. | ||
| 11 | |||
| 12 | In vanilla nvi, this size is calculated as a multiple of 1024. Modern versions | ||
| 13 | of BDB, however, require the page size of a database to be a power of two, which | ||
| 14 | this patch addresses, ridding us of the following message: | ||
| 15 | |||
| 16 | BDB0511 page sizes must be a power-of-2 | ||
| 17 | |||
| 18 | --- nvi-1.81.6.orig/common/exf.c 2009-03-09 01:48:01.695862889 +0100 | ||
| 19 | +++ nvi-1.81.6/common/exf.c 2009-03-09 10:42:41.147866272 +0100 | ||
| 20 | @@ -249,11 +249,10 @@ | ||
| 21 | * (vi should have good locality) or smaller than 1K. | ||
| 22 | */ | ||
| 23 | psize = ((sb.st_size / 15) + 1023) / 1024; | ||
| 24 | - if (psize > 10) | ||
| 25 | - psize = 10; | ||
| 26 | - if (psize == 0) | ||
| 27 | - psize = 1; | ||
| 28 | - psize *= 1024; | ||
| 29 | + if (psize >= 8) psize=8<<10; | ||
| 30 | + else if (psize >= 4) psize=4<<10; | ||
| 31 | + else if (psize >= 2) psize=2<<10; | ||
| 32 | + else psize=1<<10; | ||
| 33 | |||
| 34 | F_SET(ep, F_DEVSET); | ||
| 35 | ep->mdev = sb.st_dev; | ||
