Commit fa746a48 authored by Jan Mette's avatar Jan Mette

--no commit message

--no commit message
parent a8cb9930
# $Id: PKGBUILD 67889 2010-02-09 12:02:26Z paul $
# Maintainer: tobias [ tobias at archlinux org ]
pkgname=vi
pkgver=050325
pkgrel=2
pkgdesc='The original ex/vi text editor.'
arch=('i686' 'x86_64')
url='http://ex-vi.sourceforge.net/'
license=('custom:ex')
depends=('ncurses')
groups=('base')
options=(force strip !libtool emptydirs)
source=(http://downloads.sourceforge.net/sourceforge/ex-vi/ex-${pkgver}.tar.bz2
du.patch increase-tube.patch exrc.sample)
md5sums=('e668595254233e4d96811083a3e4e2f3' '2d80fbc7d612963466d9ae45058a3778' \
'e596e05a00a24187b576e389fa1de45d' 'd3b483c994d859232ce369b82a4b5668')
build() {
cd ${srcdir}/ex-${pkgver}
sed -i -e 's/^PREFIX.*$/PREFIX = \/usr/' Makefile
sed -i -e 's/^LIBEXECDIR.*$/LIBEXECDIR = $(PREFIX)\/lib\/ex/' Makefile
sed -i -e 's/^PRESERVEDIR.*$/PRESERVEDIR = \/var\/lib\/ex/' Makefile
sed -i -e 's/^DESTDIR.*$/DESTDIR = ..\/..\/pkg/' Makefile
sed -i -e 's/^INSTALL.*$/INSTALL = \/bin\/install/' Makefile
sed -i -e 's/^FEATURES.*$/FEATURES = -DCHDIR -DFASTTAG -DUCVISUAL -DMB -DBIT8/' Makefile
sed -i -e 's/^TERMLIB.*$/TERMLIB = ncurses/' Makefile
sed -i -e 's/^\.B \/usr\/libexec/.B \/usr\/lib\/ex/' vi.1
sed -i -e 's/^\.B \/var\/preserve$/.B \/var\/lib\/ex/' vi.1
patch -Np1 -i ../du.patch || return 1
patch -Np0 -i ../increase-tube.patch || return 1
make || return 1
make install
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/vi/LICENSE
install -D -m644 ${srcdir}/exrc.sample ${pkgdir}/etc/exrc.sample
}
#! /bin/sh /usr/share/dpatch/dpatch-run
## 27support_C_locale.dpatch by <hesso@pool.math.tu-berlin.de>
##
## DP: Allow users to edit 8-bit files even under LC_CTYPE=C.
@DPATCH@
--- nvi-1.81.6.orig/common/conv.c 2007-11-18 17:41:42.000000000 +0100
+++ nvi-1.81.6/common/conv.c 2009-03-09 16:45:37.812022582 +0100
@@ -322,11 +322,16 @@
else {
setlocale(LC_ALL, "");
#ifdef USE_WIDECHAR
- sp->conv.sys2int = cs_char2int;
- sp->conv.int2sys = cs_int2char;
- sp->conv.file2int = fe_char2int;
- sp->conv.int2file = fe_int2char;
- sp->conv.input2int = ie_char2int;
+ if (!strcmp(LANGCODESET, "ANSI_X3.4-1968")) {
+ sp->conv.file2int = sp->conv.input2int = sp->conv.sys2int = raw2int;
+ sp->conv.int2sys = sp->conv.int2file = int2raw;
+ } else {
+ sp->conv.sys2int = cs_char2int;
+ sp->conv.int2sys = cs_int2char;
+ sp->conv.file2int = fe_char2int;
+ sp->conv.int2file = fe_int2char;
+ sp->conv.input2int = ie_char2int;
+ }
#endif
#ifdef USE_ICONV
o_set(sp, O_FILEENCODING, OS_STRDUP, nl_langinfo(CODESET), 0);
diff --git a/cl/cl_main.c b/cl/cl_main.c
index 0ecbe44..87feb28 100644
--- a/cl/cl_main.c
+++ b/cl/cl_main.c
@@ -57,6 +57,9 @@ main(int argc, char **argv)
int rval;
char **p_av, **t_av, *ttype;
+ /* Hack for db-4.7. */
+ unsetenv("LANG");
+ unsetenv("LC_ALL");
/* If loaded at 0 and jumping through a NULL pointer, stop. */
if (reenter++)
abort();
diff --git a/common/db.h b/common/db.h
index fd1dc64..00a7ce7 100644
--- a/common/db.h
+++ b/common/db.h
@@ -18,7 +18,7 @@
#if 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)
+ (db)->open(db, NULL, file, NULL, type, flags | DB_CREATE, mode)
#else
#define db_open(db,file,type,flags,mode) \
(db)->open(db, file, NULL, type, flags, mode)
\ No newline at end of file
diff -ru ex-050325/ex_tty.c ex-050325-du/ex_tty.c
--- ex-050325/ex_tty.c 2005-03-04 13:42:58.000000000 +0100
+++ ex-050325-du/ex_tty.c 2009-06-25 20:06:57.000000000 +0200
@@ -132,7 +132,8 @@
&ED, &EI, &F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9,
&HO, &IC, &IM, &IP, &KD, &KE, &KH, &KL, &KR, &KS, &KU, &LL, &ND, &xNL,
&xPC, &RC, &SC, &SE, &SF, &SO, &SR, &TA, &TE, &TI, &UP, &VB, &VS, &VE,
- &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM
+ &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM,
+ &kI, &kD, &kh, &at7, &kP, &kN
};
bool *sflags[] = {
&AM, &BS, &DA, &DB, &EO, &HC,
@@ -170,7 +171,12 @@
addmac1(KD, "j", "down", arrows, 1);
addmac1(KL, "h", "left", arrows, 1);
addmac1(KR, "l", "right", arrows, 1);
- addmac1(KH, "H", "home", arrows, 1);
+ addmac1(kI, "i", "insert", arrows, 1);
+ addmac1(kD, "x", "delete", arrows, 1);
+ addmac1(kh, "^", "home", arrows, 1);
+ addmac1(at7, "$", "end", arrows, 1);
+ addmac1(kP, "", "pgup", arrows, 1);
+ addmac1(kN, "", "pgdn", arrows, 1);
/*
* Handle funny termcap capabilities
@@ -341,7 +347,7 @@
*(*fp++) = flag;
namp += 2;
} while (*namp);
- namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERI";
+ namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERIkIkDkh@7kPkN";
sp = sstrs;
do {
string = tgetstr(namp, &aoftspace);
diff -ru ex-050325/ex_tty.h ex-050325-du/ex_tty.h
--- ex-050325/ex_tty.h 2004-12-01 19:21:06.000000000 +0100
+++ ex-050325-du/ex_tty.h 2009-06-25 20:06:05.000000000 +0200
@@ -183,6 +183,15 @@
var bool XX; /* Tektronix 4025 insert line */
/* X? is reserved for severely nauseous glitches */
/* If there are enough of these we may need bit masks! */
+/*
+ * Insert, Delete, Home, End, PgUp an PgDown keys
+ */
+var char *kI;
+var char *kD;
+var char *kh;
+var char *at7;
+var char *kP;
+var char *kN;
/*
* From the tty modes...
diff -ru ex-050325/libuxre/regnfa.c ex-050325-du/libuxre/regnfa.c
--- ex-050325/libuxre/regnfa.c 2005-02-06 15:16:14.000000000 +0100
+++ ex-050325-du/libuxre/regnfa.c 2009-06-25 21:33:30.000000000 +0200
@@ -535,7 +535,7 @@
* the alignments (given the varying length of rm[])
* are potentially nontrivial.
*/
- n = offsetof(Context, rm) + np->rmlen * sizeof(regmatch_t);
+ n = ((size_t)&cp->rm - (size_t)cp) + np->rmlen * sizeof(regmatch_t);
i = 4;
cpp = &np->avail;
while ((ncp = malloc(n)) != 0)
" A sample .exrc file. Copy it to your home dir as ~/.exrc in order to work.
set showmode
set noflash
set autoindent
set shiftwidth=2
--- config.h 2005-02-19 05:25:39.000000000 -0500
+++ config.h.fixed 2010-01-04 22:02:01.000000000 -0500
@@ -95,8 +95,8 @@
#define TUBESIZE 6000 /* Maximum screen size for visual */
#else /* VMUNIX */
#define TUBELINES 100
-#define TUBECOLS 160
-#define TUBESIZE 16000
+#define TUBECOLS 320
+#define TUBESIZE 32000
#endif /* VMUNIX */
/*
#! /bin/sh /usr/share/dpatch/dpatch-run
## 13widechar_horrors.dpatch by <hesso@pool.math.tu-berlin.de>
##
## DP: This patch tries to cope with the fact that widechar support
## DP: in nvi is at best rudimentary.
## DP: Hunk 1)
## DP: * Due to "ch = *t", this code is not wide-char aware, so
## DP: cast the value to a proper type so the KEY_ macros make
## DP: the right choice.
## DP: Hunk 2)
## DP: * Printing of the in-/decreased number back into the screen
## DP: buffer is not widechar-aware, either. Add a dirty fix.
## DP: Cf. #497349.
@DPATCH@
--- nvi-1.81.6.orig/vi/vs_msg.c 2007-11-18 17:41:42.000000000 +0100
+++ nvi-1.81.6/vi/vs_msg.c 2009-03-01 14:51:08.211414132 +0100
@@ -472,10 +472,10 @@
*/
if (ch == '\t')
ch = ' ';
- chlen = KEY_LEN(sp, ch);
+ chlen = KEY_LEN(sp, (unsigned char)ch);
if (cbp + chlen >= ecbp)
FLUSH;
- for (kp = KEY_NAME(sp, ch); chlen--;)
+ for (kp = KEY_NAME(sp, (unsigned char)ch); chlen--;)
*cbp++ = *kp++;
}
if (cbp > cbuf)
--- nvi-1.81.6.orig/vi/v_increment.c 2007-11-18 17:41:42.000000000 +0100
+++ nvi-1.81.6/vi/v_increment.c 2009-03-01 15:12:50.950415874 +0100
@@ -57,7 +57,7 @@
long change, ltmp, lval;
size_t beg, blen, end, len, nlen, wlen;
int base, isempty, rval;
- char *ntype, nbuf[100];
+ char *ntype, nbuf[100 * sizeof(CHAR_T)];
CHAR_T *bp, *p, *t;
/* Validate the operator. */
@@ -202,7 +202,7 @@
/* If we cross 0, signed numbers lose their sign. */
if (lval == 0 && ntype == fmt[SDEC])
ntype = fmt[DEC];
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, lval);
+ nlen = snprintf(nbuf, sizeof(nbuf)/sizeof(CHAR_T), ntype, lval);
} else {
if ((nret = nget_uslong(sp, &ulval, t, NULL, base)) != NUM_OK)
goto err;
@@ -224,7 +224,15 @@
if (base == 16)
wlen -= 2;
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, wlen, ulval);
+ nlen = snprintf(nbuf, sizeof(nbuf)/sizeof(CHAR_T), ntype, wlen, ulval);
+ }
+
+ /* Inflate the printed char buffer to CHAR_T elements if necessary */
+ if (sizeof(CHAR_T) > sizeof(char)) {
+ int nlen_inflate;
+ for (nlen_inflate = nlen; nlen_inflate >= 0; nlen_inflate--) {
+ ((CHAR_T *)nbuf)[nlen_inflate] = nbuf[nlen_inflate];
+ }
}
/* Build the new line. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment