summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2012-04-23 15:52:37 +0000
committerAlexis Ballier <aballier@gentoo.org>2012-04-23 15:52:37 +0000
commit6751c2d7d4ff8014ab9571ef1de2956ef42f8e67 (patch)
tree8e94c81586ad3e950a36581bf583d5ee224db560 /dev-libs/libedit
parentStable for amd64, wrt bug #413117 (diff)
downloadhistorical-6751c2d7d4ff8014ab9571ef1de2956ef42f8e67.tar.gz
historical-6751c2d7d4ff8014ab9571ef1de2956ef42f8e67.tar.bz2
historical-6751c2d7d4ff8014ab9571ef1de2956ef42f8e67.zip
Port the el_fn_sh_complete from FreeBSD. This function is needed by FreeBSD-9.0 sh. That way we can drop the bundled version in freebsd-lib.
Package-Manager: portage-2.2.0_alpha101/cvs/Linux x86_64
Diffstat (limited to 'dev-libs/libedit')
-rw-r--r--dev-libs/libedit/ChangeLog10
-rw-r--r--dev-libs/libedit/Manifest10
-rw-r--r--dev-libs/libedit/files/libedit-20120311-3.0-el_fn_sh_complete.patch258
-rw-r--r--dev-libs/libedit/libedit-20120311.3.0-r1.ebuild48
4 files changed, 321 insertions, 5 deletions
diff --git a/dev-libs/libedit/ChangeLog b/dev-libs/libedit/ChangeLog
index 15b97453304e..9d222fb8bab4 100644
--- a/dev-libs/libedit/ChangeLog
+++ b/dev-libs/libedit/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-libs/libedit
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libedit/ChangeLog,v 1.61 2012/03/30 15:18:58 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libedit/ChangeLog,v 1.62 2012/04/23 15:52:36 aballier Exp $
+
+*libedit-20120311.3.0-r1 (23 Apr 2012)
+
+ 23 Apr 2012; Alexis Ballier <aballier@gentoo.org>
+ +files/libedit-20120311-3.0-el_fn_sh_complete.patch,
+ +libedit-20120311.3.0-r1.ebuild:
+ Port the el_fn_sh_complete from FreeBSD. This function is needed by
+ FreeBSD-9.0 sh. That way we can drop the bundled version in freebsd-lib.
*libedit-20120311.3.0 (30 Mar 2012)
diff --git a/dev-libs/libedit/Manifest b/dev-libs/libedit/Manifest
index 1a8164203121..c50f6ae19609 100644
--- a/dev-libs/libedit/Manifest
+++ b/dev-libs/libedit/Manifest
@@ -5,6 +5,7 @@ AUX libedit-20090111-3.0-weak_reference.patch 659 RMD160 1d1b5c990bccf27b8467c4f
AUX libedit-20100424.3.0-bsd.patch 724 RMD160 89be9d63791d0d1bdfd8d5faade9fe47fef86884 SHA1 ff63f51dbd9d7c72545c5f4359631aee190f4ead SHA256 2226e17f65b2486c45964867a1ed4a699c1861089b7a1501bccc83d28bca6c45
AUX libedit-20100424.3.0-weak-reference.patch 622 RMD160 8b5a2eab56bd7bbc4cefbc4c7a86093b22b02b95 SHA1 6eb7c8bf1ded99098b642b3f0e6632f7d610d672 SHA256 17c70fce91ee7a77bb3b4259091435e33aafc35c7c6f25eae522e41915f319e0
AUX libedit-20110709.3.0-weak-reference.patch 651 RMD160 18ec25734ffee5379196dfb0e7eba165ad898745 SHA1 e4a727e6e40ac85f488f959ca99fa6f4f395bd31 SHA256 f4bbf2b49d158966b8ccb8556928b22af3690e7d91d5e3062842b6c9587641be
+AUX libedit-20120311-3.0-el_fn_sh_complete.patch 7724 RMD160 68342a70229aed9602d14017f95fa3b7c9141225 SHA1 616c30758e8e480700d0d934956256bab1cd1118 SHA256 8fb2844923c3750c9b833ad4f9dfd15f78e0bb917b0d8fb98d3e0ffb7f1037fb
AUX libedit-ncursesprivate.patch 497 RMD160 b7455b87e2086defe86da7b1be67699d793c75b3 SHA1 8e857d4b422a7a4b5c226ad06407d6b8f79f93c6 SHA256 e1fc9f5c3ffe5e5ba4117bc6b1c615e6f3e5ef82dfcebece16aaa5d571abb8a1
DIST libedit-20090923-3.0.tar.gz 466724 RMD160 c8b05abbb5743a3c709d981c131cb6d11b6e83fd SHA1 25b4f63103f2098fc06dc9c2f455d2a937507bb5 SHA256 6aca4e63d27148514a40be5bd59305914836a1fe0d2d79e1733cb1d01636460a
DIST libedit-20100424-3.0.tar.gz 442438 RMD160 daa0bace15c0eb063c151f1fad26677a7673c248 SHA1 bbc9b77daf95c2482bf406e07d69cdbe0fa29db7 SHA256 602b385906b6057f52922afc42cafbceadd8bae4be43c9189ea7fa870a561d86
@@ -13,13 +14,14 @@ DIST libedit-20120311-3.0.tar.gz 469830 RMD160 48a0774003687534b162c3ccb55518129
EBUILD libedit-20090923.3.0.ebuild 978 RMD160 04a0e91bce0ac4dfb23b594e6bf009a776bce5f8 SHA1 1e63d2487470609878d3628a275b27edae734764 SHA256 064a714b8d61a84ea7def15351d90fd767755994133e4446efb5104d1cc9e12d
EBUILD libedit-20100424.3.0.ebuild 1263 RMD160 f84d385e2681e6e7d1694ee6b199b747b1bec48e SHA1 22b7751c46536687a06cc0b85b5abdbf686727bf SHA256 513f371ac17c22e3db210d3f1ed0acf456aab58a22fa0626f32471dcfe8b97b4
EBUILD libedit-20110709.3.0.ebuild 1292 RMD160 71b4d708413c1947a7e3b4b3350c49ebd11e8abe SHA1 544655706675fd2662ef147b261f32112e9ebf02 SHA256 dd2fd00ebe02e54de6e23d4371dbd200497e5030718e104a3d09a63bf2e96123
+EBUILD libedit-20120311.3.0-r1.ebuild 1364 RMD160 31c45f1a0c62ae0035f5a532d4a05823b6ec0284 SHA1 4464991bc3458599cb0acc2186e0ea669564b207 SHA256 5bb3e70cf935c8d2320407f36b0faecd89645ef3601b1c438cb9c6555a1c6479
EBUILD libedit-20120311.3.0.ebuild 1303 RMD160 13af03b22573df9662740bbe0eb1b4cbe019ca80 SHA1 a3dbe7ad6df475c7d4f2fd650d731c04b0fc7eb1 SHA256 9697cc978408259a8a1022987a847995d0f62db09a6a5fea6ce5dc5a2ae769f3
-MISC ChangeLog 8066 RMD160 d1e6cdc8bea0f03761956f63ce0d5e23b0de39e8 SHA1 7af42b6dc36a05a033d356e04610ffbda3595c31 SHA256 dcdd440f9b9b493ba702c5eb2dbf10b944a1af4230ab4680dcb858d6b1cef36d
+MISC ChangeLog 8394 RMD160 ffd57c9f30168fd6437e0b71db70ad1a2fdb2ef8 SHA1 19811ddb175520be07860e100ead0da268c6ac31 SHA256 02e349b45ffe958b300e0c7e7109bb04f6bba8311d376d0a60989fe0febc48ae
MISC metadata.xml 554 RMD160 35a9c1672f8234e632d132cb027b49dfafde7088 SHA1 8c587cc015553e0679099d1e924ed27edcef4b62 SHA256 31620c2c90ee411f950c9ccf31ec24c3734bcb4a9cc13c083a3214c05e62cdbd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iEYEARECAAYFAk91zugACgkQvFcC4BYPU0rPPgCgtBP/Kn9dcd3DKRNaXLS3H+4N
-828An0ac82xz6QPLIgRYxWf21LRZC+KU
-=t4sL
+iEYEARECAAYFAk+VesoACgkQvFcC4BYPU0oH0ACdGBtZ0BKJYvCbJy9lrdBl8Lnv
+lM4An3SqXIEMUqHRjZ56AfOuPC6FkuX1
+=27KR
-----END PGP SIGNATURE-----
diff --git a/dev-libs/libedit/files/libedit-20120311-3.0-el_fn_sh_complete.patch b/dev-libs/libedit/files/libedit-20120311-3.0-el_fn_sh_complete.patch
new file mode 100644
index 000000000000..b0b157a24fda
--- /dev/null
+++ b/dev-libs/libedit/files/libedit-20120311-3.0-el_fn_sh_complete.patch
@@ -0,0 +1,258 @@
+Port the el_fn_sh_complete from FreeBSD.
+This function is required by FreeBSD-9.0's sh.
+So that we can drop the bundled version in FreeBSD-9.0
+
+diff -uNr libedit-20120311-3.0/src/filecomplete.c libedit-20120311-3.0.freebsd/src/filecomplete.c
+--- libedit-20120311-3.0/src/filecomplete.c 2012-03-11 09:54:58.000000000 +0000
++++ libedit-20120311-3.0.freebsd/src/filecomplete.c 2012-04-23 12:14:25.000000000 +0000
+@@ -56,6 +56,9 @@
+
+ static const Char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@',
+ '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
++/* Tilde is deliberately omitted here, we treat it specially. */
++static const Char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' };
++
+
+
+ /********************************/
+@@ -411,10 +414,14 @@
+ char **(*attempted_completion_function)(const char *, int, int),
+ const Char *word_break, const Char *special_prefixes,
+ const char *(*app_func)(const char *), size_t query_items,
+- int *completion_type, int *over, int *point, int *end)
++ int *completion_type, int *over, int *point, int *end,
++ const char *(*find_word_start_func)(const char *, const char *),
++ char *(*dequoting_func)(const char *),
++ char *(*quoting_func)(const char *))
+ {
+ const TYPE(LineInfo) *li;
+ Char *temp;
++ char *dequoted_temp;
+ char **matches;
+ const Char *ctemp;
+ size_t len;
+@@ -435,17 +442,28 @@
+
+ /* We now look backwards for the start of a filename/variable word */
+ li = FUN(el,line)(el);
++ if (find_word_start_func)
++ ctemp = ct_decode_string(find_word_start_func(ct_encode_string(li->buffer,&el->el_scratch), ct_encode_string(li->cursor,&el->el_scratch)),&el->el_scratch);
++ else {
+ ctemp = li->cursor;
+ while (ctemp > li->buffer
+ && !Strchr(word_break, ctemp[-1])
+ && (!special_prefixes || !Strchr(special_prefixes, ctemp[-1]) ) )
+ ctemp--;
++ }
+
+ len = (size_t)(li->cursor - ctemp);
+ temp = el_malloc((len + 1) * sizeof(*temp));
+ (void)Strncpy(temp, ctemp, len);
+ temp[len] = '\0';
+
++ if (dequoting_func) {
++ dequoted_temp = dequoting_func(ct_encode_string(temp,&el->el_scratch));
++ if (dequoted_temp == NULL)
++ return retval;
++ } else
++ dequoted_temp = NULL;
++
+ /* these can be used by function called in completion_matches() */
+ /* or (*attempted_completion_function)() */
+ if (point != 0)
+@@ -456,14 +474,14 @@
+ if (attempted_completion_function) {
+ int cur_off = (int)(li->cursor - li->buffer);
+ matches = (*attempted_completion_function)(
+- ct_encode_string(temp, &el->el_scratch),
++ dequoted_temp? dequoted_temp : ct_encode_string(temp, &el->el_scratch),
+ cur_off - (int)len, cur_off);
+ } else
+ matches = 0;
+ if (!attempted_completion_function ||
+ (over != NULL && !*over && !matches))
+ matches = completion_matches(
+- ct_encode_string(temp, &el->el_scratch), complet_func);
++ dequoted_temp? dequoted_temp : ct_encode_string(temp, &el->el_scratch), complet_func);
+
+ if (over != NULL)
+ *over = 0;
+@@ -478,9 +496,19 @@
+ * possible matches if there is possible completion.
+ */
+ if (matches[0][0] != '\0') {
++ char *quoted_match;
++ if (quoting_func) {
++ quoted_match = quoting_func(matches[0]);
++ if (quoted_match == NULL)
++ goto free_matches;
++ } else
++ quoted_match = NULL;
++
+ el_deletestr(el, (int) len);
+ FUN(el,insertstr)(el,
+- ct_decode_string(matches[0], &el->el_scratch));
++ ct_decode_string(quoted_match? quoted_match : matches[0], &el->el_scratch));
++
++ free(quoted_match);
+ }
+
+ if (what_to_do == '?')
+@@ -553,12 +581,14 @@
+ retval = CC_NORM;
+ }
+
++free_matches:
+ /* free elements of array and the array itself */
+ for (i = 0; matches[i]; i++)
+ el_free(matches[i]);
+ el_free(matches);
+ matches = NULL;
+ }
++ el_free(dequoted_temp);
+ el_free(temp);
+ return retval;
+ }
+@@ -572,5 +602,102 @@
+ {
+ return (unsigned char)fn_complete(el, NULL, NULL,
+ break_chars, NULL, NULL, (size_t)100,
+- NULL, NULL, NULL, NULL);
++ NULL, NULL, NULL, NULL,
++ NULL, NULL, NULL);
++}
++
++static const char *
++sh_find_word_start(const char *buffer, const char *cursor)
++{
++ const char *word_start = buffer;
++
++ while (buffer < cursor) {
++ if (*buffer == '\\')
++ buffer++;
++ else if (Strchr(break_chars, *buffer))
++ word_start = buffer + 1;
++
++ buffer++;
++ }
++
++ return word_start;
++}
++
++
++static char *
++sh_quote(const char *str)
++{
++ const char *src;
++ int extra_len = 0;
++ char *quoted_str, *dst;
++
++ if (*str == '-' || *str == '+')
++ extra_len += 2;
++ for (src = str; *src != '\0'; src++)
++ if (Strchr(break_chars, *src) ||
++ Strchr(extra_quote_chars, *src))
++ extra_len++;
++
++ quoted_str = malloc(sizeof(*quoted_str) *
++ (strlen(str) + extra_len + 1));
++ if (quoted_str == NULL)
++ return NULL;
++
++ dst = quoted_str;
++ if (*str == '-' || *str == '+')
++ *dst++ = '.', *dst++ = '/';
++ for (src = str; *src != '\0'; src++) {
++ if (Strchr(break_chars, *src) ||
++ Strchr(extra_quote_chars, *src))
++ *dst++ = '\\';
++ *dst++ = *src;
++ }
++ *dst = '\0';
++
++ return quoted_str;
++}
++
++
++static char *
++sh_dequote(const char *str)
++{
++ char *dequoted_str, *dst;
++
++ /* save extra space to replace \~ with ./~ */
++ dequoted_str = malloc(sizeof(*dequoted_str) * (strlen(str) + 1 + 1));
++ if (dequoted_str == NULL)
++ return NULL;
++
++ dst = dequoted_str;
++
++ /* dequote \~ at start as ./~ */
++ if (*str == '\\' && str[1] == '~') {
++ str++;
++ *dst++ = '.';
++ *dst++ = '/';
++ }
++
++ while (*str) {
++ if (*str == '\\')
++ str++;
++ if (*str)
++ *dst++ = *str++;
++ }
++ *dst = '\0';
++
++ return dequoted_str;
++}
++
++
++/*
++ * completion function using sh quoting rules; for key binding
++ */
++/* ARGSUSED */
++unsigned char
++_el_fn_sh_complete(EditLine *el, int ch __attribute__((__unused__)))
++{
++ return (unsigned char)fn_complete(el, NULL, NULL,
++ break_chars, NULL, NULL, 100,
++ NULL, NULL, NULL, NULL,
++ sh_find_word_start, sh_dequote, sh_quote);
+ }
+diff -uNr libedit-20120311-3.0/src/filecomplete.h libedit-20120311-3.0.freebsd/src/filecomplete.h
+--- libedit-20120311-3.0/src/filecomplete.h 2010-04-22 19:13:17.000000000 +0000
++++ libedit-20120311-3.0.freebsd/src/filecomplete.h 2012-04-23 12:04:12.000000000 +0000
+@@ -35,7 +35,10 @@
+ char *(*)(const char *, int),
+ char **(*)(const char *, int, int),
+ const Char *, const Char *, const char *(*)(const char *), size_t,
+- int *, int *, int *, int *);
++ int *, int *, int *, int *,
++ const char *(*)(const char *, const char *),
++ char *(*)(const char *),
++ char *(*)(const char *));
+
+ void fn_display_match_list(EditLine *, char **, size_t, size_t);
+ char *fn_tilde_expand(const char *);
+Binary files libedit-20120311-3.0/src/filecomplete.o and libedit-20120311-3.0.freebsd/src/filecomplete.o differ
+diff -uNr libedit-20120311-3.0/src/histedit.h libedit-20120311-3.0.freebsd/src/histedit.h
+--- libedit-20120311-3.0/src/histedit.h 2011-08-02 06:52:08.000000000 +0000
++++ libedit-20120311-3.0.freebsd/src/histedit.h 2012-04-23 11:44:33.000000000 +0000
+@@ -113,6 +113,7 @@
+ int el_set(EditLine *, int, ...);
+ int el_get(EditLine *, int, ...);
+ unsigned char _el_fn_complete(EditLine *, int);
++unsigned char _el_fn_sh_complete(EditLine *, int);
+
+ /*
+ * el_set/el_get parameters
+diff -ur libedit-20120311-3.0/src/readline.c libedit-20120311-3.0.freebsd/src/readline.c
+--- libedit-20120311-3.0/src/readline.c 2012-03-11 09:54:58.000000000 +0000
++++ libedit-20120311-3.0.freebsd/src/readline.c 2012-04-23 12:20:11.000000000 +0000
+@@ -1773,7 +1773,7 @@
+ _rl_completion_append_character_function,
+ (size_t)rl_completion_query_items,
+ &rl_completion_type, &rl_attempted_completion_over,
+- &rl_point, &rl_end);
++ &rl_point, &rl_end, NULL, NULL, NULL);
+
+
+ }
diff --git a/dev-libs/libedit/libedit-20120311.3.0-r1.ebuild b/dev-libs/libedit/libedit-20120311.3.0-r1.ebuild
new file mode 100644
index 000000000000..f4bc4291076a
--- /dev/null
+++ b/dev-libs/libedit/libedit-20120311.3.0-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libedit/libedit-20120311.3.0-r1.ebuild,v 1.1 2012/04/23 15:52:36 aballier Exp $
+
+EAPI=2
+
+inherit eutils toolchain-funcs versionator base
+
+MY_PV=$(get_major_version)-$(get_after_major_version)
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="BSD replacement for libreadline."
+HOMEPAGE="http://www.thrysoee.dk/editline/"
+SRC_URI="http://www.thrysoee.dk/editline/${MY_P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="static-libs"
+
+DEPEND=">=sys-libs/ncurses-5.7-r5[static-libs?]
+ !<=sys-freebsd/freebsd-lib-6.2_rc1"
+
+RDEPEND=${DEPEND}
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-ncursesprivate.patch"
+ "${FILESDIR}/${PN}-20100424.3.0-bsd.patch"
+ "${FILESDIR}/${PN}-20110709.3.0-weak-reference.patch"
+ "${FILESDIR}/${PN}-20120311-3.0-el_fn_sh_complete.patch"
+ )
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ --enable-widec \
+ --disable-dependency-tracking \
+ --enable-fast-install
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ find "${D}" -name '*.la' -delete
+
+ gen_usr_ldscript -a edit
+}