ag: Refresh patches
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 8ef5dc35835c271e955979af7ccc660a9996debd Mon Sep 17 00:00:00 2001
|
||||
From 1ede87c906fc1f9cab44f351c3eadf0080f75cf4 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Mon, 23 Feb 2015 21:46:45 +0000
|
||||
Subject: [PATCH 1/6] lang: Allow both extensions and full filenames
|
||||
@@ -12,14 +12,14 @@ are indicated by prefixing the pattern with a '^'.
|
||||
---
|
||||
src/lang.c | 57 ++++++++++++++++++++++++++++++++++-----------------------
|
||||
src/lang.h | 24 +++++++++++++-----------
|
||||
src/options.c | 28 ++++++++++++++--------------
|
||||
3 files changed, 61 insertions(+), 48 deletions(-)
|
||||
src/options.c | 26 +++++++++++++-------------
|
||||
3 files changed, 60 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/src/lang.c b/src/lang.c
|
||||
index 87cdcec..54f51ca 100644
|
||||
index 96d6be0..37d61ac 100644
|
||||
--- a/src/lang.c
|
||||
+++ b/src/lang.c
|
||||
@@ -101,20 +101,27 @@ size_t get_lang_count() {
|
||||
@@ -109,20 +109,27 @@ size_t get_lang_count() {
|
||||
return sizeof(langs) / sizeof(lang_spec_t);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ index 87cdcec..54f51ca 100644
|
||||
regex_capacity *= 2;
|
||||
regex = ag_realloc(regex, regex_capacity);
|
||||
}
|
||||
@@ -123,8 +130,12 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
|
||||
@@ -131,8 +138,12 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
|
||||
} else {
|
||||
subsequent = 1;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ index 87cdcec..54f51ca 100644
|
||||
}
|
||||
|
||||
regex[regex_length++] = ')';
|
||||
@@ -133,29 +144,29 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
|
||||
@@ -141,29 +152,29 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
|
||||
return regex;
|
||||
}
|
||||
|
||||
@@ -165,10 +165,10 @@ index d0007f9..202da4b 100644
|
||||
+size_t combine_file_patterns(size_t *pattern_index, size_t len, char **pats);
|
||||
#endif
|
||||
diff --git a/src/options.c b/src/options.c
|
||||
index 88ad65b..bafb1ea 100644
|
||||
index 67567eb..1e7648e 100644
|
||||
--- a/src/options.c
|
||||
+++ b/src/options.c
|
||||
@@ -210,9 +210,9 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
@@ -212,9 +212,9 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
size_t longopts_len, full_len;
|
||||
option_t *longopts;
|
||||
char *lang_regex = NULL;
|
||||
@@ -181,7 +181,7 @@ index 88ad65b..bafb1ea 100644
|
||||
|
||||
init_options();
|
||||
|
||||
@@ -304,8 +304,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
@@ -318,8 +318,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
full_len = (longopts_len + lang_count + 1);
|
||||
longopts = ag_malloc(full_len * sizeof(option_t));
|
||||
memcpy(longopts, base_longopts, sizeof(base_longopts));
|
||||
@@ -192,23 +192,21 @@ index 88ad65b..bafb1ea 100644
|
||||
|
||||
for (i = 0; i < lang_count; i++) {
|
||||
option_t opt = { langs[i].name, no_argument, NULL, 0 };
|
||||
@@ -544,7 +544,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
|
||||
@@ -561,7 +561,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
for (i = 0; i < lang_count; i++) {
|
||||
if (strcmp(longopts[opt_index].name, langs[i].name) == 0) {
|
||||
has_filetype = 1;
|
||||
- ext_index[lang_num++] = i;
|
||||
+ pat_index[lang_num++] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -572,16 +572,16 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
free(file_search_regex);
|
||||
@@ -595,15 +595,15 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
}
|
||||
|
||||
- if (ext_index[0]) {
|
||||
if (has_filetype) {
|
||||
- num_exts = combine_file_extensions(ext_index, lang_num, &extensions);
|
||||
- lang_regex = make_lang_regex(extensions, num_exts);
|
||||
+ if (pat_index[0]) {
|
||||
+ num_pats = combine_file_patterns(pat_index, lang_num, &patterns);
|
||||
+ lang_regex = make_lang_regex(patterns, num_pats);
|
||||
compile_study(&opts.file_search_regex, &opts.file_search_regex_extra, lang_regex, 0, 0);
|
||||
@@ -224,7 +222,7 @@ index 88ad65b..bafb1ea 100644
|
||||
if (lang_regex) {
|
||||
free(lang_regex);
|
||||
}
|
||||
@@ -614,8 +614,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
@@ -644,8 +644,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
for (lang_index = 0; lang_index < lang_count; lang_index++) {
|
||||
printf(" --%s\n ", langs[lang_index].name);
|
||||
int j;
|
||||
@@ -236,5 +234,5 @@ index 88ad65b..bafb1ea 100644
|
||||
printf("\n\n");
|
||||
}
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8560a5b4e4a3c984265c767f7b6fcc5aa787c654 Mon Sep 17 00:00:00 2001
|
||||
From ac70e920d375b271adfeaedba68d8d086d36b7d1 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Mon, 23 Feb 2015 22:12:15 +0000
|
||||
Subject: [PATCH 2/6] options: Fix ordering problems with --color
|
||||
@@ -18,26 +18,12 @@ Moved around the logic of setting opts.color so that:
|
||||
|
||||
4. Default color to TRUE if MSYSCON env. var = mintty.exe
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
src/options.c | 148 ++++++++++++++++++++++++++++++++++++----------------------
|
||||
src/options.c | 150 +++++++++++++++++++++++++++++++++++-----------------------
|
||||
src/options.h | 10 ++++
|
||||
3 files changed, 102 insertions(+), 58 deletions(-)
|
||||
2 files changed, 102 insertions(+), 58 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 42aaf79..9e6b778 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -24,7 +24,7 @@ AX_PTHREAD(
|
||||
)
|
||||
|
||||
# Run CFLAGS="-pg" ./configure if you want debug symbols
|
||||
-CFLAGS="$CFLAGS $PTHREAD_CFLAGS $PCRE_CFLAGS -Wall -Wextra -Wformat=2 -Wno-format-nonliteral -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -Wno-missing-braces -std=gnu89 -D_GNU_SOURCE -O2"
|
||||
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS $PCRE_CFLAGS -Wall -Wextra -Wformat=2 -Wno-format-nonliteral -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -Wno-missing-braces -std=gnu89 -D_GNU_SOURCE -O0"
|
||||
LDFLAGS="$LDFLAGS"
|
||||
|
||||
case $host in
|
||||
diff --git a/src/options.c b/src/options.c
|
||||
index bafb1ea..f329887 100644
|
||||
index 1e7648e..8d86e39 100644
|
||||
--- a/src/options.c
|
||||
+++ b/src/options.c
|
||||
@@ -140,8 +140,16 @@ void print_version(void) {
|
||||
@@ -58,8 +44,8 @@ index bafb1ea..f329887 100644
|
||||
+
|
||||
opts.max_matches_per_file = 0;
|
||||
opts.max_search_depth = DEFAULT_MAX_SEARCH_DEPTH;
|
||||
opts.multiline = TRUE;
|
||||
@@ -226,11 +234,11 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
opts.mmap = TRUE;
|
||||
@@ -228,11 +236,11 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
{ "before", optional_argument, NULL, 'B' },
|
||||
{ "break", no_argument, &opts.print_break, 1 },
|
||||
{ "case-sensitive", no_argument, NULL, 's' },
|
||||
@@ -73,16 +59,18 @@ index bafb1ea..f329887 100644
|
||||
{ "column", no_argument, &opts.column, 1 },
|
||||
{ "context", optional_argument, NULL, 'C' },
|
||||
{ "count", no_argument, NULL, 'c' },
|
||||
@@ -262,7 +270,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
{ "no-recurse", no_argument, NULL, 'n' },
|
||||
@@ -265,8 +273,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
{ "noaffinity", no_argument, &opts.use_thread_affinity, 0 },
|
||||
{ "no-break", no_argument, &opts.print_break, 0 },
|
||||
{ "nobreak", no_argument, &opts.print_break, 0 },
|
||||
- { "no-color", no_argument, &opts.color, 0 },
|
||||
- { "nocolor", no_argument, &opts.color, 0 },
|
||||
+ { "no-color", no_argument, &opts.color, COLOR_EXPLICIT_FALSE },
|
||||
+ { "nocolor", no_argument, &opts.color, COLOR_EXPLICIT_FALSE },
|
||||
{ "no-filename", no_argument, NULL, 0 },
|
||||
{ "nofilename", no_argument, NULL, 0 },
|
||||
{ "nofollow", no_argument, &opts.follow_symlinks, 0 },
|
||||
{ "nogroup", no_argument, &group, 0 },
|
||||
@@ -327,22 +335,6 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
{ "no-follow", no_argument, &opts.follow_symlinks, 0 },
|
||||
@@ -341,22 +349,6 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +93,7 @@ index bafb1ea..f329887 100644
|
||||
char *file_search_regex = NULL;
|
||||
while ((ch = getopt_long(argc, argv, "A:aB:C:cDG:g:FfHhiLlm:nop:QRrSsvVtuUwW:z0", longopts, &opt_index)) != -1) {
|
||||
switch (ch) {
|
||||
@@ -662,42 +654,6 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
@@ -707,42 +699,6 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
opts.after = opts.context;
|
||||
}
|
||||
|
||||
@@ -148,7 +136,7 @@ index bafb1ea..f329887 100644
|
||||
if (accepts_query && argc > 0) {
|
||||
// use the provided query
|
||||
opts.query = ag_strdup(argv[0]);
|
||||
@@ -761,6 +717,84 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
@@ -806,6 +762,84 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
|
||||
(*paths)[i] = NULL;
|
||||
(*base_paths)[i] = NULL;
|
||||
|
||||
@@ -234,7 +222,7 @@ index bafb1ea..f329887 100644
|
||||
windows_use_ansi(opts.color_win_ansi);
|
||||
#endif
|
||||
diff --git a/src/options.h b/src/options.h
|
||||
index ac213f2..2cf8c68 100644
|
||||
index 273bb9a..a617a11 100644
|
||||
--- a/src/options.h
|
||||
+++ b/src/options.h
|
||||
@@ -26,6 +26,16 @@ enum path_print_behavior {
|
||||
@@ -255,5 +243,5 @@ index ac213f2..2cf8c68 100644
|
||||
int ackmate;
|
||||
pcre *ackmate_dir_filter;
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8a1495dce46227097c73adfbeb55cc4dea9c1a3d Mon Sep 17 00:00:00 2001
|
||||
From d08c1df938db1b002c8bb2880ef302795214d008 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Mon, 23 Feb 2015 22:16:54 +0000
|
||||
Subject: [PATCH 3/6] lang: Add autotools (ac, am, in, m4, pc)
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH 3/6] lang: Add autotools (ac, am, in, m4, pc)
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/lang.c b/src/lang.c
|
||||
index 54f51ca..b5b2a2b 100644
|
||||
index 37d61ac..b0f4aec 100644
|
||||
--- a/src/lang.c
|
||||
+++ b/src/lang.c
|
||||
@@ -8,6 +8,7 @@ lang_spec_t langs[] = {
|
||||
@@ -20,5 +20,5 @@ index 54f51ca..b5b2a2b 100644
|
||||
{ "bitbake", { "bb", "bbappend", "bbclass", "inc" } },
|
||||
{ "bro", { "bro", "bif" } },
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 778583071e6b237db7e80f08b63e62a6f1dc5d98 Mon Sep 17 00:00:00 2001
|
||||
From e38826920ff1f2927b63f6c51663197fa147fd0e Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Mon, 23 Feb 2015 22:18:27 +0000
|
||||
Subject: [PATCH 4/6] lang: Add to make (^Makefile, ^Makefile.Debug,
|
||||
@@ -12,10 +12,10 @@ one is used by CMake.
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lang.c b/src/lang.c
|
||||
index b5b2a2b..ede3b85 100644
|
||||
index b0f4aec..ec39d61 100644
|
||||
--- a/src/lang.c
|
||||
+++ b/src/lang.c
|
||||
@@ -45,7 +45,7 @@ lang_spec_t langs[] = {
|
||||
@@ -50,7 +50,7 @@ lang_spec_t langs[] = {
|
||||
{ "lisp", { "lisp", "lsp" } },
|
||||
{ "lua", { "lua" } },
|
||||
{ "m4", { "m4" } },
|
||||
@@ -25,5 +25,5 @@ index b5b2a2b..ede3b85 100644
|
||||
{ "markdown", { "markdown", "mdown", "mdwn", "mkdn", "mkd", "md" } },
|
||||
{ "mason", { "mas", "mhtml", "mpl", "mtxt" } },
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 7faacc6b0552fb87e34f6b4ff7afc6b37edcfb68 Mon Sep 17 00:00:00 2001
|
||||
From 9a33ddf551f8421fd8d73bc473a6298922f5af09 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Mon, 23 Feb 2015 22:21:26 +0000
|
||||
Subject: [PATCH 5/6] lang: Add makepkg (^PKGBUILD, diff, patch, in, install)
|
||||
@@ -9,10 +9,10 @@ Used by the makepkg build system of ArchLinux and MSYS2
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/lang.c b/src/lang.c
|
||||
index ede3b85..fc4ae6b 100644
|
||||
index ec39d61..90637ed 100644
|
||||
--- a/src/lang.c
|
||||
+++ b/src/lang.c
|
||||
@@ -46,6 +46,7 @@ lang_spec_t langs[] = {
|
||||
@@ -51,6 +51,7 @@ lang_spec_t langs[] = {
|
||||
{ "lua", { "lua" } },
|
||||
{ "m4", { "m4" } },
|
||||
{ "make", { "^Makefile", "^Makefile.Debug", "^Makefile.Release", "Makefiles", "mk", "mak", "make" } },
|
||||
@@ -21,5 +21,5 @@ index ede3b85..fc4ae6b 100644
|
||||
{ "markdown", { "markdown", "mdown", "mdwn", "mkdn", "mkd", "md" } },
|
||||
{ "mason", { "mas", "mhtml", "mpl", "mtxt" } },
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 10d70a323b34491746fc2e563c7765b54ab7f0e9 Mon Sep 17 00:00:00 2001
|
||||
From 9dd0f2868112d2715925cc44ec49b045e050b8ae Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Sat, 12 Dec 2015 19:55:47 +0000
|
||||
Subject: [PATCH 6/6] lang: Add cmake (^CMakeLists.txt, ^CMakeCache.txt ..
|
||||
@@ -9,17 +9,17 @@ Subject: [PATCH 6/6] lang: Add cmake (^CMakeLists.txt, ^CMakeCache.txt ..
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/lang.c b/src/lang.c
|
||||
index fc4ae6b..77a32dd 100644
|
||||
index 90637ed..bf41d4f 100644
|
||||
--- a/src/lang.c
|
||||
+++ b/src/lang.c
|
||||
@@ -15,6 +15,7 @@ lang_spec_t langs[] = {
|
||||
{ "cc", { "c", "h", "xs" } },
|
||||
@@ -16,6 +16,7 @@ lang_spec_t langs[] = {
|
||||
{ "cfmx", { "cfc", "cfm", "cfml" } },
|
||||
{ "chpl", { "chpl" } },
|
||||
{ "clojure", { "clj", "cljs", "cljc", "cljx" } },
|
||||
+ { "cmake", { "^CMakeLists.txt", "^CMakeCache.txt", "^CMakeError.log", "^CMakeOutput.log", "cmake" } },
|
||||
{ "coffee", { "coffee", "cjsx" } },
|
||||
{ "cpp", { "cpp", "cc", "C", "cxx", "m", "hpp", "hh", "h", "H", "hxx" } },
|
||||
{ "crystal", { "cr", "ecr" } },
|
||||
--
|
||||
2.6.3
|
||||
2.10.1
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ _realname=ag
|
||||
_longname=the_silver_searcher
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=0.31.0.r1666.0e577cc
|
||||
pkgver=0.33.0.r1783.0880058
|
||||
pkgrel=1
|
||||
pkgdesc="The Silver Searcher: An attempt to make something better than ack, which itself is better than grep (mingw-w64)"
|
||||
arch=('any')
|
||||
@@ -26,12 +26,12 @@ source=("${_realname}"::"git+https://github.com/ggreer/the_silver_searcher.git"
|
||||
"0005-lang-Add-makepkg-PKGBUILD-diff-patch-in-install.patch"
|
||||
"0006-lang-Add-cmake-CMakeLists.txt-CMakeCache.txt.patch")
|
||||
sha256sums=('SKIP'
|
||||
'eface051f399e098ffe5719d9d65334ac62cf079385cd7ff179203e0184709a9'
|
||||
'2b6ca4627ce76ae41ac9873357257e8236955445af181011f051027a7260077d'
|
||||
'6a6e5d555b15daed84cf523699aef7dd1b8fd0ff499ea961645640298e4de202'
|
||||
'a203c2bcdc24461e188fec14f240674d2e5614f2ee7f65a210bc03973786094f'
|
||||
'abe95b36af951d5515f58c04de847fd4c68b7b2e38a83da3f9cf20792229ad78'
|
||||
'794db6b04ff5656d3e93bc4f7323fbdbbcdb9a1f1a31b9a2956b56660c7de19d')
|
||||
'f4c06e982f0465febd70237fec85eb52ae8308bd0931c8c38784c2b57ffb0d59'
|
||||
'0ed184b58980f13670d7a58c37fbe24a6834c50985d85050643178f0021712d8'
|
||||
'f27611170b05d809d3580bcd2d44cf7f5a4cd3c1c8e5111be340e85c7a2647d8'
|
||||
'03ae0a003b1420ab94f645a42f6255d07f8493f1a4f19bdc8a20974b38a78784'
|
||||
'c9234420ac2069fcb1864fa3389f402a201967b308ec25656aaaa62055ee5bd2'
|
||||
'513455af6be8e0325073af7f5e937255d9ae632c555f89d3cbeeb5fcdcd2e42c')
|
||||
|
||||
pkgver() {
|
||||
cd ${srcdir}/${_realname}
|
||||
|
||||
Reference in New Issue
Block a user