summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Labedan <plabedan@gmail.com>2015-12-04 11:43:18 +0100
committerPaul Labedan <plabedan@gmail.com>2015-12-04 11:43:18 +0100
commitdf82385865f6662d367691d2b78e34c0ed104c2b (patch)
tree29747cdf5b35ec258b8149608f301bf505ff8617
parentadd libedit-20150325.3.1 (diff)
downloadplab-df82385865f6662d367691d2b78e34c0ed104c2b.tar.gz
plab-df82385865f6662d367691d2b78e34c0ed104c2b.tar.bz2
plab-df82385865f6662d367691d2b78e34c0ed104c2b.zip
add missing files
-rw-r--r--dev-libs/libedit/Manifest2
-rw-r--r--dev-libs/libedit/files/libedit-20120311-3.0-el_fn_sh_complete.patch258
-rw-r--r--dev-libs/libedit/files/libedit-ncursesprivate.patch13
3 files changed, 273 insertions, 0 deletions
diff --git a/dev-libs/libedit/Manifest b/dev-libs/libedit/Manifest
index 89762f4..300aed2 100644
--- a/dev-libs/libedit/Manifest
+++ b/dev-libs/libedit/Manifest
@@ -1,2 +1,4 @@
+AUX libedit-20120311-3.0-el_fn_sh_complete.patch 7724 SHA256 8fb2844923c3750c9b833ad4f9dfd15f78e0bb917b0d8fb98d3e0ffb7f1037fb SHA512 c62490079ff73a14310c6840d379d950699cd178e5e4a15231a79ea06600ba7bb805630e032d5d49ea5479e4919514ee79b035bf7d00e20b6e8512c84920bba3 WHIRLPOOL 1d0737e628f663edf8734d93aec6e0d33ba8e17e4893be33805c731a343701106778979fcaa8ccb7d227b78402b1a715d78a7102178a6871392f421d40e8b17a
+AUX libedit-ncursesprivate.patch 497 SHA256 e1fc9f5c3ffe5e5ba4117bc6b1c615e6f3e5ef82dfcebece16aaa5d571abb8a1 SHA512 41175b20f7b925e347db008d5e8a535b8326cd2c010a67b9db3a59131fce77a7791b7940e7eea9d68e82dbd3731efaa503d4bd218d78b29f946152dd56bd9b14 WHIRLPOOL df6b644fdaa70ec62997c2bd353ad757e6aafda7c17b4926ad3044d4f1d02deb379bd84946f5cea08c63eb4ba346752949f5b0a1577bc046dbbb4c4221fdf239
DIST libedit-20150325-3.1.tar.gz 502792 SHA256 c88a5e4af83c5f40dda8455886ac98923a9c33125699742603a88a0253fcc8c5 SHA512 03221f3de844a7768764b3ebf80bc3110a13699f452609ba351c134e4225fc7d9e826522c672e925a7f6183094b3f3dbf489f197ddd44e6b1ea5fed762aed07d WHIRLPOOL 19b50ac19c02d852e7fde10896d8e092e305ebd1066903c6a5a9be9792a56f55a5ffc1bebb80bcedacc22b9d9035944bc0ff94ca28173ad6ccc2e97c5754ec81
EBUILD libedit-20150325.3.1.ebuild 1276 SHA256 698e932859269032c7caa61a2d39e4d5ae7475236e47a24a798561caf0ce74ce SHA512 91bd73edacd2f44648b9b04356dac363a417c1454bd6e7760e75d58b2293c16765af619afddda7a208db8d9198c334befbd40153e66ef55efed21b60d5e7177d WHIRLPOOL 475f8fc11c1fc07d6ac08794477965e7e1d661bea9e57951694fdbb165bde3ce0289d72971f121ec86bcbc8d6091da14bce0cb431395516c490ce97ee0078821
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 0000000..b0b157a
--- /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/files/libedit-ncursesprivate.patch b/dev-libs/libedit/files/libedit-ncursesprivate.patch
new file mode 100644
index 0000000..0af9b1b
--- /dev/null
+++ b/dev-libs/libedit/files/libedit-ncursesprivate.patch
@@ -0,0 +1,13 @@
+Index: libedit-20110709-3.0/libedit.pc.in
+===================================================================
+--- libedit-20110709-3.0.orig/libedit.pc.in
++++ libedit-20110709-3.0/libedit.pc.in
+@@ -7,6 +7,7 @@ Name: libedit
+ Description: command line editor library provides generic line editing, history, and tokenization functions.
+ Version: @VERSION@
+ Requires:
+-Libs: -L${libdir} -ledit @LIBS@
++Libs: -L${libdir} -ledit
++Libs.private: @LIBS@
+ Cflags: -I${includedir} -I${includedir}/editline
+