upgrade to latest 2.2.0
This commit is contained in:
parent
fe52424ed9
commit
2ce292c211
|
@ -13,3 +13,5 @@
|
|||
/0.33.0-944e011.tar.gz
|
||||
/2.0.0-99cf183.tar.gz
|
||||
/2.1.0-1a5e259.tar.gz
|
||||
/2.2.0-965f71d.tar.gz
|
||||
/2.2.0-b93c271.tar.gz
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
diff --git a/src/ignore.c b/src/ignore.c
|
||||
index 7ae83f3e..88036eff 100644
|
||||
--- a/src/ignore.c
|
||||
+++ b/src/ignore.c
|
||||
@@ -20,6 +20,8 @@
|
||||
const int fnmatch_flags = FNM_PATHNAME;
|
||||
#endif
|
||||
|
||||
+ignores *root_ignores;
|
||||
+
|
||||
/* TODO: build a huge-ass list of files we want to ignore by default (build cache stuff, pyc files, etc) */
|
||||
|
||||
const char *evil_hardcoded_ignore_files[] = {
|
||||
diff --git a/src/ignore.h b/src/ignore.h
|
||||
index 20d5a6af..8db0f377 100644
|
||||
--- a/src/ignore.h
|
||||
+++ b/src/ignore.h
|
||||
@@ -29,7 +29,7 @@ struct ignores {
|
||||
};
|
||||
typedef struct ignores ignores;
|
||||
|
||||
-ignores *root_ignores;
|
||||
+extern ignores *root_ignores;
|
||||
|
||||
extern const char *evil_hardcoded_ignore_files[];
|
||||
extern const char *ignore_pattern_files[];
|
||||
diff --git a/src/log.c b/src/log.c
|
||||
index 1481b6d0..f6f4e9a8 100644
|
||||
--- a/src/log.c
|
||||
+++ b/src/log.c
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
+pthread_mutex_t print_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
static enum log_level log_threshold = LOG_LEVEL_ERR;
|
||||
|
||||
void set_log_level(enum log_level threshold) {
|
||||
diff --git a/src/log.h b/src/log.h
|
||||
index 85847ee7..318622c3 100644
|
||||
--- a/src/log.h
|
||||
+++ b/src/log.h
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
-pthread_mutex_t print_mtx;
|
||||
+extern pthread_mutex_t print_mtx;
|
||||
|
||||
enum log_level {
|
||||
LOG_LEVEL_DEBUG = 10,
|
||||
diff --git a/src/options.c b/src/options.c
|
||||
index 4abf4dcd..69953013 100644
|
||||
--- a/src/options.c
|
||||
+++ b/src/options.c
|
||||
@@ -20,6 +20,8 @@ const char *color_line_number = "\033[1;33m"; /* bold yellow */
|
||||
const char *color_match = "\033[30;43m"; /* black with yellow background */
|
||||
const char *color_path = "\033[1;32m"; /* bold green */
|
||||
|
||||
+cli_options opts;
|
||||
+
|
||||
/* TODO: try to obey out_fd? */
|
||||
void usage(void) {
|
||||
printf("\n");
|
||||
diff --git a/src/options.h b/src/options.h
|
||||
index aae93093..0d852167 100644
|
||||
--- a/src/options.h
|
||||
+++ b/src/options.h
|
||||
@@ -92,7 +92,7 @@ typedef struct {
|
||||
} cli_options;
|
||||
|
||||
/* global options. parse_options gives it sane values, everything else reads from it */
|
||||
-cli_options opts;
|
||||
+extern cli_options opts;
|
||||
|
||||
typedef struct option option_t;
|
||||
|
||||
diff --git a/src/search.c b/src/search.c
|
||||
index 0f4ae211..0dad3c07 100644
|
||||
--- a/src/search.c
|
||||
+++ b/src/search.c
|
||||
@@ -2,6 +2,19 @@
|
||||
#include "print.h"
|
||||
#include "scandir.h"
|
||||
|
||||
+size_t alpha_skip_lookup[256];
|
||||
+size_t *find_skip_lookup;
|
||||
+uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
|
||||
+
|
||||
+work_queue_t *work_queue = NULL;
|
||||
+work_queue_t *work_queue_tail = NULL;
|
||||
+int done_adding_files = 0;
|
||||
+pthread_cond_t files_ready = PTHREAD_COND_INITIALIZER;
|
||||
+pthread_mutex_t stats_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
+pthread_mutex_t work_queue_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
+
|
||||
+symdir_t *symhash = NULL;
|
||||
+
|
||||
/* Returns: -1 if skipped, otherwise # of matches */
|
||||
ssize_t search_buf(const char *buf, const size_t buf_len,
|
||||
const char *dir_full_path) {
|
||||
diff --git a/src/search.h b/src/search.h
|
||||
index 6bac4203..00aa018d 100644
|
||||
--- a/src/search.h
|
||||
+++ b/src/search.h
|
||||
@@ -31,9 +31,9 @@
|
||||
#include "uthash.h"
|
||||
#include "util.h"
|
||||
|
||||
-size_t alpha_skip_lookup[256];
|
||||
-size_t *find_skip_lookup;
|
||||
-uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
|
||||
+extern size_t alpha_skip_lookup[256];
|
||||
+extern size_t *find_skip_lookup;
|
||||
+extern uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
|
||||
|
||||
struct work_queue_t {
|
||||
char *path;
|
||||
@@ -41,12 +41,12 @@ struct work_queue_t {
|
||||
};
|
||||
typedef struct work_queue_t work_queue_t;
|
||||
|
||||
-work_queue_t *work_queue;
|
||||
-work_queue_t *work_queue_tail;
|
||||
-int done_adding_files;
|
||||
-pthread_cond_t files_ready;
|
||||
-pthread_mutex_t stats_mtx;
|
||||
-pthread_mutex_t work_queue_mtx;
|
||||
+extern work_queue_t *work_queue;
|
||||
+extern work_queue_t *work_queue_tail;
|
||||
+extern int done_adding_files;
|
||||
+extern pthread_cond_t files_ready;
|
||||
+extern pthread_mutex_t stats_mtx;
|
||||
+extern pthread_mutex_t work_queue_mtx;
|
||||
|
||||
|
||||
/* For symlink loop detection */
|
||||
@@ -64,7 +64,7 @@ typedef struct {
|
||||
UT_hash_handle hh;
|
||||
} symdir_t;
|
||||
|
||||
-symdir_t *symhash;
|
||||
+extern symdir_t *symhash;
|
||||
|
||||
ssize_t search_buf(const char *buf, const size_t buf_len,
|
||||
const char *dir_full_path);
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 3949477b..90ffb6f1 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -21,6 +21,8 @@
|
||||
} \
|
||||
return ptr;
|
||||
|
||||
+FILE *out_fd = NULL;
|
||||
+ag_stats stats;
|
||||
void *ag_malloc(size_t size) {
|
||||
void *ptr = malloc(size);
|
||||
CHECK_AND_RETURN(ptr)
|
||||
diff --git a/src/util.h b/src/util.h
|
||||
index 0c9b9b11..338b05f4 100644
|
||||
--- a/src/util.h
|
||||
+++ b/src/util.h
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "log.h"
|
||||
#include "options.h"
|
||||
|
||||
-FILE *out_fd;
|
||||
+extern FILE *out_fd;
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
@@ -51,7 +51,7 @@ typedef struct {
|
||||
} ag_stats;
|
||||
|
||||
|
||||
-ag_stats stats;
|
||||
+extern ag_stats stats;
|
||||
|
||||
/* Union to translate between chars and words without violating strict aliasing */
|
||||
typedef union {
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (2.1.0-1a5e259.tar.gz) = ad469414fb8d99d6167f8c363691b10ba3d45032a0a16d2c93e3e7cc92a9b4fade02f3bcce997e049f579e2bc14d5ff43bd2a9e543a6684011f2a23dcb5e02a8
|
||||
SHA512 (2.2.0-b93c271.tar.gz) = 1ac1b74827521fff9cb793e32255577d301923fcb808d6c1886009f05407c77715c6218f90c9ba4c697da17a493df03370897fd51f251701fb4b231829c8eace
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%global commit 1a5e259b259130b50607174fc9f9508dc1f2941c
|
||||
%global commit b93c2719933d8824d749bfa8573cc02e4f050c10
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion)
|
||||
%if "%{bashcompdir}" == ""
|
||||
|
@ -6,12 +6,14 @@
|
|||
%endif
|
||||
|
||||
Name: the_silver_searcher
|
||||
Version: 2.1.0
|
||||
Release: 6%{?dist}
|
||||
Version: 2.2.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Super-fast text searching tool (ag)
|
||||
License: ASL 2.0 and BSD
|
||||
URL: https://github.com/ggreer/the_silver_searcher
|
||||
Source: https://github.com/ggreer/the_silver_searcher/archive/%{commit}/%{version}-%{shortcommit}.tar.gz
|
||||
# My (= shlomif) pull request to fix the build
|
||||
Patch1: https://patch-diff.githubusercontent.com/raw/ggreer/the_silver_searcher/pull/1377.diff
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: autoconf
|
||||
|
@ -29,6 +31,7 @@ with a focus on speed.
|
|||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{commit}
|
||||
%patch1 -p1 -b .GLOBALS
|
||||
|
||||
%build
|
||||
aclocal
|
||||
|
@ -58,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|||
%{_datadir}/zsh/site-functions/_%{name}
|
||||
|
||||
%changelog
|
||||
* Wed Apr 15 2020 Shlomi Fish <shlomif@cpan.org> - 2.2.0-1
|
||||
- New upstream version
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
|
|
Loading…
Reference in New Issue