Hello community,
here is the log from the commit of package the_silver_searcher for
openSUSE:Factory checked in at 2016-05-19 12:15:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/the_silver_searcher (Old)
and /work/SRC/openSUSE:Factory/.the_silver_searcher.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "the_silver_searcher"
Changes:
--------
--- /work/SRC/openSUSE:Factory/the_silver_searcher/the_silver_searcher.changes
2015-09-24 06:14:42.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.the_silver_searcher.new/the_silver_searcher.changes
2016-05-19 12:16:00.000000000 +0200
@@ -1,0 +2,8 @@
+Wed May 18 10:32:20 UTC 2016 - [email protected]
+
+- Update to version 0.32.0
+ * Add support for Fish, Chapel, Factor, Kotlin, Julia, TypeScript,
+ RDoc, Velocity, RestructuredText, TOML, BitBake, Bro file types.
+ * Various bugfixes.
+
+-------------------------------------------------------------------
Old:
----
the_silver_searcher-0.31.0.tar.gz
the_silver_searcher-0.31.0.tar.gz.asc
New:
----
the_silver_searcher-0.32.0.tar.gz
the_silver_searcher-0.32.0.tar.gz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ the_silver_searcher.spec ++++++
--- /var/tmp/diff_new_pack.SMV7Cx/_old 2016-05-19 12:16:01.000000000 +0200
+++ /var/tmp/diff_new_pack.SMV7Cx/_new 2016-05-19 12:16:01.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package the_silver_searcher
#
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: the_silver_searcher
-Version: 0.31.0
+Version: 0.32.0
Release: 0
Summary: A code-searching tool similar to ack, but faster
License: Apache-2.0
++++++ the_silver_searcher-0.31.0.tar.gz -> the_silver_searcher-0.32.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/Makefile.am
new/the_silver_searcher-0.32.0/Makefile.am
--- old/the_silver_searcher-0.31.0/Makefile.am 2015-08-31 10:26:29.000000000
+0200
+++ new/the_silver_searcher-0.32.0/Makefile.am 2016-05-10 19:39:38.000000000
+0200
@@ -22,4 +22,7 @@
test_big: ag
cram -v tests/big/*.t
+test_fail: ag
+ cram -v tests/fail/*.t
+
.PHONY : all test clean
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/Makefile.in
new/the_silver_searcher-0.32.0/Makefile.in
--- old/the_silver_searcher-0.31.0/Makefile.in 2015-09-07 07:31:07.000000000
+0200
+++ new/the_silver_searcher-0.32.0/Makefile.in 2016-05-16 07:15:58.000000000
+0200
@@ -930,6 +930,9 @@
test_big: ag
cram -v tests/big/*.t
+test_fail: ag
+ cram -v tests/fail/*.t
+
.PHONY : all test clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/Makefile.w32
new/the_silver_searcher-0.32.0/Makefile.w32
--- old/the_silver_searcher-0.31.0/Makefile.w32 2015-08-28 22:32:41.000000000
+0200
+++ new/the_silver_searcher-0.32.0/Makefile.w32 2016-05-10 19:39:37.000000000
+0200
@@ -1,7 +1,8 @@
-GREP=grep
-VERSION:=$(shell $(GREP) -Po "(?<=\[)([0-9.]+.[0-9]+.[0-9]+)(?=\])"
configure.ac)
+SED=sed
+VERSION:=$(shell "$(SED)" -n "s/[^[]*\[\([0-9]\+\.[0-9]\+\.[0-9]\+\)\],/\1/p"
configure.ac)
CC=gcc
+RM=/bin/rm
SRCS = \
src/decompress.c \
@@ -23,11 +24,12 @@
all : $(TARGET)
-$(TARGET) : $(OBJS)
+# depend on configure.ac to account for version changes
+$(TARGET) : $(OBJS) configure.ac
$(CC) -o $@ $(OBJS) $(LIBS)
.c.o :
$(CC) -c $(CFLAGS) -Isrc $< -o $@
clean :
- rm -f src/*.o $(TARGET)
+ $(RM) -f src/*.o $(TARGET)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/README.md
new/the_silver_searcher-0.32.0/README.md
--- old/the_silver_searcher-0.31.0/README.md 2015-09-01 23:07:51.000000000
+0200
+++ new/the_silver_searcher-0.32.0/README.md 2016-05-10 19:39:39.000000000
+0200
@@ -56,9 +56,12 @@
* Ubuntu >= 13.10 (Saucy) or Debian >= 8 (Jessie)
apt-get install silversearcher-ag
-* Fedora 19+
+* Fedora 21 and lower
yum install the_silver_searcher
+* Fedora 22+
+
+ dnf install the_silver_searcher
* RHEL7+
rpm -Uvh
http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
@@ -84,7 +87,9 @@
pkg_add the_silver_searcher
+### Cygwin
+Run the relevant [`setup-*.exe`](https://cygwin.com/install.html), and select
"the\_silver\_searcher" in the "Utils" category.
## Building from source
@@ -112,9 +117,9 @@
./build.sh
- On Windows:
+ On Windows (inside an msys/MinGW shell):
- mingw32-make -f Makefile.w32
+ make -f Makefile.w32
3. Make install:
sudo make install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/aclocal.m4
new/the_silver_searcher-0.32.0/aclocal.m4
--- old/the_silver_searcher-0.31.0/aclocal.m4 2015-09-07 07:29:00.000000000
+0200
+++ new/the_silver_searcher-0.32.0/aclocal.m4 2016-05-16 07:14:56.000000000
+0200
@@ -1187,32 +1187,63 @@
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright © 2004 Scott James Remnant <[email protected]>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29.1)
+dnl
+dnl Copyright © 2004 Scott James Remnant <[email protected]>.
+dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running
autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but
]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -1234,18 +1265,19 @@
PKG_CONFIG=""
fi
fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
@@ -1255,8 +1287,10 @@
$3])dnl
fi])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
@@ -1268,10 +1302,11 @@
else
pkg_failed=untried
fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -1279,19 +1314,17 @@
else
_pkg_short_errors_supported=no
fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -1345,16 +1378,40 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -1365,16 +1422,18 @@
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
+])dnl PKG_INSTALLDIR
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -1385,13 +1444,15 @@
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
+])dnl PKG_NOARCH_INSTALLDIR
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
@@ -1400,5 +1461,5 @@
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
+])dnl PKG_CHECK_VAR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/ag.bashcomp.sh
new/the_silver_searcher-0.32.0/ag.bashcomp.sh
--- old/the_silver_searcher-0.31.0/ag.bashcomp.sh 2015-08-28
22:32:42.000000000 +0200
+++ new/the_silver_searcher-0.32.0/ag.bashcomp.sh 2016-05-10
19:39:40.000000000 +0200
@@ -1,3 +1,5 @@
+#!/bin/bash
+
_ag() {
local lngopt shtopt split=false
local cur prev
@@ -129,4 +131,7 @@
return 0;;
esac
} &&
+
+# shellcheck disable=SC2086
+# shellcheck disable=SC2154,SC2086
complete -F _ag ${nospace} ag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/configure
new/the_silver_searcher-0.32.0/configure
--- old/the_silver_searcher-0.31.0/configure 2015-09-07 07:29:01.000000000
+0200
+++ new/the_silver_searcher-0.32.0/configure 2016-05-16 07:14:57.000000000
+0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for the_silver_searcher 0.31.0.
+# Generated by GNU Autoconf 2.69 for the_silver_searcher 0.32.0.
#
# Report bugs to <https://github.com/ggreer/the_silver_searcher/issues>.
#
@@ -581,8 +581,8 @@
# Identity of this package.
PACKAGE_NAME='the_silver_searcher'
PACKAGE_TARNAME='the_silver_searcher'
-PACKAGE_VERSION='0.31.0'
-PACKAGE_STRING='the_silver_searcher 0.31.0'
+PACKAGE_VERSION='0.32.0'
+PACKAGE_STRING='the_silver_searcher 0.32.0'
PACKAGE_BUGREPORT='https://github.com/ggreer/the_silver_searcher/issues'
PACKAGE_URL='https://github.com/ggreer/the_silver_searcher'
@@ -1297,7 +1297,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures the_silver_searcher 0.31.0 to adapt to many kinds of
systems.
+\`configure' configures the_silver_searcher 0.32.0 to adapt to many kinds of
systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1368,7 +1368,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of the_silver_searcher 0.31.0:";;
+ short | recursive ) echo "Configuration of the_silver_searcher 0.32.0:";;
esac
cat <<\_ACEOF
@@ -1471,7 +1471,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-the_silver_searcher configure 0.31.0
+the_silver_searcher configure 0.32.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1943,7 +1943,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by the_silver_searcher $as_me 0.31.0, which was
+It was created by the_silver_searcher $as_me 0.32.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2807,7 +2807,7 @@
# Define the identity of the package.
PACKAGE='the_silver_searcher'
- VERSION='0.31.0'
+ VERSION='0.32.0'
# Some tools Automake needs.
@@ -5494,7 +5494,7 @@
fi
-for ac_func in fgetln getline realpath strlcpy strndup vasprintf madvise
posix_fadvise pthread_setaffinity_np
+for ac_func in fgetln getline realpath strlcpy strndup vasprintf madvise
posix_fadvise pthread_setaffinity_np pledge
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -6107,7 +6107,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by the_silver_searcher $as_me 0.31.0, which was
+This file was extended by the_silver_searcher $as_me 0.32.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6174,7 +6174,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-the_silver_searcher config.status 0.31.0
+the_silver_searcher config.status 0.32.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/configure.ac
new/the_silver_searcher-0.32.0/configure.ac
--- old/the_silver_searcher-0.31.0/configure.ac 2015-09-07 07:28:47.000000000
+0200
+++ new/the_silver_searcher-0.32.0/configure.ac 2016-05-16 07:13:17.000000000
+0200
@@ -1,6 +1,6 @@
AC_INIT(
[the_silver_searcher],
- [0.31.0],
+ [0.32.0],
[https://github.com/ggreer/the_silver_searcher/issues],
[the_silver_searcher],
[https://github.com/ggreer/the_silver_searcher])
@@ -57,7 +57,7 @@
AC_CHECK_MEMBER([struct dirent.d_type], [AC_DEFINE([HAVE_DIRENT_DTYPE], [],
[Have dirent struct member d_type])], [], [[#include <dirent.h>]])
AC_CHECK_MEMBER([struct dirent.d_namlen], [AC_DEFINE([HAVE_DIRENT_DNAMLEN],
[], [Have dirent struct member d_namlen])], [], [[#include <dirent.h>]])
-AC_CHECK_FUNCS(fgetln getline realpath strlcpy strndup vasprintf madvise
posix_fadvise pthread_setaffinity_np)
+AC_CHECK_FUNCS(fgetln getline realpath strlcpy strndup vasprintf madvise
posix_fadvise pthread_setaffinity_np pledge)
AC_CONFIG_FILES([Makefile the_silver_searcher.spec])
AC_CONFIG_HEADERS([src/config.h])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/doc/ag.1
new/the_silver_searcher-0.32.0/doc/ag.1
--- old/the_silver_searcher-0.31.0/doc/ag.1 2015-08-28 22:32:44.000000000
+0200
+++ new/the_silver_searcher-0.32.0/doc/ag.1 2016-05-16 07:20:04.000000000
+0200
@@ -179,6 +179,10 @@
Print stats (files scanned, time taken, etc)\.
.
.TP
+\fB\-\-stats-only\fR
+Print stats (files scanned, time taken, etc) and nothing else\.
+.
+.TP
\fB\-t \-\-all\-text\fR
Search all text files\. This doesn\'t include hidden files\.
.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/config.h.in
new/the_silver_searcher-0.32.0/src/config.h.in
--- old/the_silver_searcher-0.31.0/src/config.h.in 2015-09-07
07:29:08.000000000 +0200
+++ new/the_silver_searcher-0.32.0/src/config.h.in 2016-05-16
07:15:08.000000000 +0200
@@ -27,6 +27,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `pledge' function. */
+#undef HAVE_PLEDGE
+
/* Define to 1 if you have the `posix_fadvise' function. */
#undef HAVE_POSIX_FADVISE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/ignore.c
new/the_silver_searcher-0.32.0/src/ignore.c
--- old/the_silver_searcher-0.31.0/src/ignore.c 2015-08-28 22:32:44.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/ignore.c 2016-05-10 19:39:37.000000000
+0200
@@ -337,24 +337,11 @@
/* This function is REALLY HOT. It gets called for every file */
int filename_filter(const char *path, const struct dirent *dir, void *baton) {
const char *filename = dir->d_name;
-/* TODO: don't call strlen on filename every time we call filename_filter() */
-#ifdef HAVE_DIRENT_DNAMLEN
- size_t filename_len = dir->d_namlen;
-#else
- size_t filename_len = strlen(filename);
-#endif
- size_t i;
- scandir_baton_t *scandir_baton = (scandir_baton_t *)baton;
- const ignores *ig = scandir_baton->ig;
- const char *base_path = scandir_baton->base_path;
- const size_t base_path_len = scandir_baton->base_path_len;
- const char *path_start = path;
- char *temp;
-
if (!opts.search_hidden_files && filename[0] == '.') {
return 0;
}
+ size_t i;
for (i = 0; evil_hardcoded_ignore_files[i] != NULL; i++) {
if (strcmp(filename, evil_hardcoded_ignore_files[i]) == 0) {
return 0;
@@ -375,6 +362,11 @@
return 1;
}
+ scandir_baton_t *scandir_baton = (scandir_baton_t *)baton;
+ const char *base_path = scandir_baton->base_path;
+ const size_t base_path_len = scandir_baton->base_path_len;
+ const char *path_start = path;
+
for (i = 0; base_path[i] == path[i] && i < base_path_len; i++) {
/* base_path always ends with "/\0" while path doesn't, so this is
safe */
path_start = path + i + 2;
@@ -392,6 +384,14 @@
}
}
+/* TODO: don't call strlen on filename every time we call filename_filter() */
+#ifdef HAVE_DIRENT_DNAMLEN
+ size_t filename_len = dir->d_namlen;
+#else
+ size_t filename_len = strlen(filename);
+#endif
+ const ignores *ig = scandir_baton->ig;
+
while (ig != NULL) {
if (strncmp(filename, "./", 2) == 0) {
filename++;
@@ -411,6 +411,7 @@
}
if (is_directory(path, dir) && filename[filename_len - 1] != '/') {
+ char *temp;
ag_asprintf(&temp, "%s/", filename);
int rv = path_ignore_search(ig, path_start, temp);
free(temp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/lang.c
new/the_silver_searcher-0.32.0/src/lang.c
--- old/the_silver_searcher-0.31.0/src/lang.c 2015-08-28 22:32:44.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/lang.c 2016-05-12 09:19:27.000000000
+0200
@@ -9,18 +9,24 @@
{ "ada", { "ada", "adb", "ads" } },
{ "asm", { "asm", "s" } },
{ "batch", { "bat", "cmd" } },
+ { "bitbake", { "bb", "bbappend", "bbclass", "inc" } },
+ { "bro", { "bro", "bif" } },
{ "cc", { "c", "h", "xs" } },
{ "cfmx", { "cfc", "cfm", "cfml" } },
+ { "chpl", { "chpl" } },
{ "clojure", { "clj", "cljs", "cljc", "cljx" } },
{ "coffee", { "coffee", "cjsx" } },
{ "cpp", { "cpp", "cc", "C", "cxx", "m", "hpp", "hh", "h", "H", "hxx" } },
+ { "crystal", { "cr", "ecr" } },
{ "csharp", { "cs" } },
{ "css", { "css" } },
+ { "cython", { "pyx", "pxd", "pxi" } },
{ "delphi", { "pas", "int", "dfm", "nfm", "dof", "dpk", "dproj",
"groupproj", "bdsgroup", "bdsproj" } },
{ "ebuild", { "ebuild", "eclass" } },
{ "elisp", { "el" } },
- { "elixir", { "ex", "exs" } },
+ { "elixir", { "ex", "eex", "exs" } },
{ "erlang", { "erl", "hrl" } },
+ { "factor", { "factor" } },
{ "fortran", { "f", "f77", "f90", "f95", "f03", "for", "ftn", "fpp" } },
{ "fsharp", { "fs", "fsi", "fsx" } },
{ "gettext", { "po", "pot", "mo" } },
@@ -33,9 +39,11 @@
{ "ini", { "ini" } },
{ "jade", { "jade" } },
{ "java", { "java", "properties" } },
- { "js", { "js", "jsx" } },
+ { "js", { "js", "jsx", "vue" } },
{ "json", { "json" } },
{ "jsp", { "jsp", "jspx", "jhtm", "jhtml" } },
+ { "julia", { "jl" } },
+ { "kotlin", { "kt" } },
{ "less", { "less" } },
{ "liquid", { "liquid" } },
{ "lisp", { "lisp", "lsp" } },
@@ -57,20 +65,23 @@
{ "perl", { "pl", "pm", "pm6", "pod", "t" } },
{ "php", { "php", "phpt", "php3", "php4", "php5", "phtml" } },
{ "pike", { "pike", "pmod" } },
- { "plone", { "pt", "cpt", "metadata", "cpy", "py" } },
+ { "plone", { "pt", "cpt", "metadata", "cpy", "py", "xml", "zcml" } },
{ "puppet", { "pp" } },
{ "python", { "py" } },
+ { "qml", { "qml" } },
{ "racket", { "rkt", "ss", "scm" } },
{ "rake", { "Rakefiles" } },
+ { "restructuredtext", { "rst" } },
{ "rs", { "rs" } },
{ "r", { "R", "Rmd", "Rnw", "Rtex", "Rrst" } },
+ { "rdoc", { "rdoc" } },
{ "ruby", { "rb", "rhtml", "rjs", "rxml", "erb", "rake", "spec" } },
{ "rust", { "rs" } },
{ "salt", { "sls" } },
{ "sass", { "sass", "scss" } },
{ "scala", { "scala" } },
{ "scheme", { "scm", "ss" } },
- { "shell", { "sh", "bash", "csh", "tcsh", "ksh", "zsh" } },
+ { "shell", { "sh", "bash", "csh", "tcsh", "ksh", "zsh", "fish" } },
{ "smalltalk", { "st" } },
{ "sml", { "sml", "fun", "mlb", "sig" } },
{ "sql", { "sql", "ctl" } },
@@ -79,12 +90,15 @@
{ "tcl", { "tcl", "itcl", "itk" } },
{ "tex", { "tex", "cls", "sty" } },
{ "tt", { "tt", "tt2", "ttml" } },
+ { "toml", { "toml" } },
+ { "ts", { "ts", "tsx" } },
{ "vala", { "vala", "vapi" } },
{ "vb", { "bas", "cls", "frm", "ctl", "vb", "resx" } },
- { "velocity", { "vm" } },
+ { "velocity", { "vm", "vtl", "vsl" } },
{ "verilog", { "v", "vh", "sv" } },
{ "vhdl", { "vhd", "vhdl" } },
{ "vim", { "vim" } },
+ { "wix", { "wxi", "wxs" } },
{ "wsdl", { "wsdl" } },
{ "wadl", { "wadl" } },
{ "xml", { "xml", "dtd", "xsl", "xslt", "ent" } },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/main.c
new/the_silver_searcher-0.32.0/src/main.c
--- old/the_silver_searcher-0.31.0/src/main.c 2015-09-06 06:29:27.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/main.c 2016-05-10 19:39:37.000000000
+0200
@@ -35,6 +35,12 @@
int workers_len;
int num_cores;
+#ifdef HAVE_PLEDGE
+ if (pledge("stdio rpath proc exec", NULL) == -1) {
+ die("pledge: %s", strerror(errno));
+ }
+#endif
+
set_log_level(LOG_LEVEL_WARN);
work_queue = NULL;
@@ -156,6 +162,12 @@
log_debug("No CPU affinity support.");
#endif
}
+
+#ifdef HAVE_PLEDGE
+ if (pledge("stdio rpath", NULL) == -1) {
+ die("pledge: %s", strerror(errno));
+ }
+#endif
for (i = 0; paths[i] != NULL; i++) {
log_debug("searching path %s for %s", paths[i], opts.query);
symhash = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/options.c
new/the_silver_searcher-0.32.0/src/options.c
--- old/the_silver_searcher-0.31.0/src/options.c 2015-09-06
08:20:35.000000000 +0200
+++ new/the_silver_searcher-0.32.0/src/options.c 2016-05-10
19:39:40.000000000 +0200
@@ -70,6 +70,8 @@
don't match\n\
--silent Suppress all log messages, including errors\n\
--stats Print stats (files scanned, time taken, etc.)\n\
+ --stats-only Print stats and nothing else.\n\
+ (Same as --count when searching a single file)\n\
--vimgrep Print results like vim's :vimgrep /pattern/g would\n\
(it reports every match on the line)\n\
-0 --null --print0 Separate filenames with null (for 'xargs -0')\n\
@@ -103,6 +105,7 @@
(.gitignore, .hgignore, .svnignore; still obey
.agignore)\n\
-v --invert-match\n\
-w --word-regexp Only match whole words\n\
+ -W --width NUM Truncate match lines after NUM characters\n\
-z --search-zip Search contents of compressed (e.g., gzip) files\n\
\n");
printf("File Types:\n\
@@ -142,6 +145,7 @@
opts.max_matches_per_file = 0;
opts.max_search_depth = DEFAULT_MAX_SEARCH_DEPTH;
opts.multiline = TRUE;
+ opts.width = 0;
opts.path_sep = '\n';
opts.print_break = TRUE;
opts.print_path = PATH_PRINT_DEFAULT;
@@ -202,6 +206,7 @@
int rv;
size_t lang_count;
size_t lang_num = 0;
+ int has_filetype = 0;
size_t longopts_len, full_len;
option_t *longopts;
@@ -286,9 +291,11 @@
{ "skip-vcs-ignores", no_argument, NULL, 'U' },
{ "smart-case", no_argument, NULL, 'S' },
{ "stats", no_argument, &opts.stats, 1 },
+ { "stats-only", no_argument, NULL, 0 },
{ "unrestricted", no_argument, NULL, 'u' },
{ "version", no_argument, &version, 1 },
{ "vimgrep", no_argument, &opts.vimgrep, 1 },
+ { "width", required_argument, NULL, 'W' },
{ "word-regexp", no_argument, NULL, 'w' },
{ "workers", required_argument, NULL, 0 },
};
@@ -337,8 +344,8 @@
opts.stdout_inode = statbuf.st_ino;
}
- int pcre_opts = 0;
- while ((ch = getopt_long(argc, argv,
"A:aB:C:cDG:g:FfHhiLlm:nop:QRrSsvVtuUwz0", longopts, &opt_index)) != -1) {
+ 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) {
case 'A':
if (optarg) {
@@ -393,15 +400,14 @@
case 'g':
needs_query = accepts_query = 0;
opts.match_files = 1;
- /* Fall through and build regex */
+ /* Fall through so regex is built */
case 'G':
- if (opts.casing == CASE_DEFAULT) {
- opts.casing = CASE_SENSITIVE;
+ if (file_search_regex) {
+ log_err("File search regex (-g or -G) already specified.");
+ usage();
+ exit(1);
}
- if (opts.casing != CASE_SENSITIVE) {
- pcre_opts |= PCRE_CASELESS;
- }
- compile_study(&opts.file_search_regex,
&opts.file_search_regex_extra, optarg, pcre_opts, 0);
+ file_search_regex = ag_strdup(optarg);
break;
case 'H':
opts.print_path = PATH_PRINT_TOP;
@@ -467,6 +473,12 @@
case 'w':
opts.word_regexp = 1;
break;
+ case 'W':
+ opts.width = strtol(optarg, &num_end, 10);
+ if (num_end == optarg || *num_end != '\0' || errno == ERANGE) {
+ die("Invalid width\n");
+ }
+ break;
case 'z':
opts.search_zip_files = 1;
break;
@@ -519,6 +531,11 @@
} else if (strcmp(longopts[opt_index].name, "silent") == 0) {
set_log_level(LOG_LEVEL_NONE);
break;
+ } else if (strcmp(longopts[opt_index].name, "stats-only") ==
0) {
+ opts.print_filename_only = 1;
+ opts.print_path = PATH_PRINT_NOTHING;
+ opts.stats = 1;
+ break;
}
/* Continue to usage if we don't recognize the option */
@@ -528,6 +545,7 @@
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;
break;
}
@@ -543,8 +561,25 @@
}
}
+ if (opts.casing == CASE_DEFAULT) {
+ opts.casing = CASE_SMART;
+ }
+
+ if (file_search_regex) {
+ int pcre_opts = 0;
+ if (opts.casing == CASE_INSENSITIVE || (opts.casing == CASE_SMART &&
is_lowercase(file_search_regex))) {
+ pcre_opts |= PCRE_CASELESS;
+ }
+ if (opts.word_regexp) {
+ char *old_file_search_regex = file_search_regex;
+ ag_asprintf(&file_search_regex, "\\b%s\\b", file_search_regex);
+ free(old_file_search_regex);
+ }
+ compile_study(&opts.file_search_regex, &opts.file_search_regex_extra,
file_search_regex, pcre_opts, 0);
+ free(file_search_regex);
+ }
- 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);
compile_study(&opts.file_search_regex, &opts.file_search_regex_extra,
lang_regex, 0, 0);
@@ -562,10 +597,6 @@
argc -= optind;
argv += optind;
- if (opts.casing == CASE_DEFAULT) {
- opts.casing = CASE_SMART;
- }
-
if (opts.pager) {
out_fd = popen(opts.pager, "w");
if (!out_fd) {
@@ -574,6 +605,14 @@
}
}
+#ifdef HAVE_PLEDGE
+ if (opts.skip_vcs_ignores) {
+ if (pledge("stdio rpath proc", NULL) == -1) {
+ die("pledge: %s", strerror(errno));
+ }
+ }
+#endif
+
if (help) {
usage();
exit(0);
@@ -626,13 +665,28 @@
buf_len += fread(gitconfig_res + buf_len, 1, 64,
gitconfig_file);
} while (!feof(gitconfig_file) && buf_len > 0 && buf_len % 64 ==
0);
gitconfig_res[buf_len] = '\0';
- log_debug("Found user's global Git excludesfile: %s",
gitconfig_res);
+ if (buf_len == 0) {
+ free(gitconfig_res);
+ const char *config_home = getenv("XDG_CONFIG_HOME");
+ if (config_home) {
+ ag_asprintf(&gitconfig_res, "%s/%s", config_home,
"git/ignore");
+ } else {
+ ag_asprintf(&gitconfig_res, "%s/%s", home_dir,
".config/git/ignore");
+ }
+ }
+ log_debug("global core.excludesfile: %s", gitconfig_res);
load_ignore_patterns(root_ignores, gitconfig_res);
free(gitconfig_res);
pclose(gitconfig_file);
}
}
+#ifdef HAVE_PLEDGE
+ if (pledge("stdio rpath proc", NULL) == -1) {
+ die("pledge: %s", strerror(errno));
+ }
+#endif
+
if (opts.context > 0) {
opts.before = opts.context;
opts.after = opts.context;
@@ -697,7 +751,9 @@
}
char *path = NULL;
+#ifdef PATH_MAX
char *tmp = NULL;
+#endif
opts.paths_len = argc;
if (argc > 0) {
*paths = ag_calloc(sizeof(char *), argc + 1);
@@ -710,8 +766,12 @@
path[path_len - 1] = '\0';
}
(*paths)[i] = path;
+#ifdef PATH_MAX
tmp = ag_malloc(PATH_MAX);
(*base_paths)[i] = realpath(path, tmp);
+#else
+ (*base_paths)[i] = realpath(path, NULL);
+#endif
}
/* Make sure we search these paths instead of stdin. */
opts.search_stream = 0;
@@ -720,8 +780,12 @@
*paths = ag_malloc(sizeof(char *) * 2);
*base_paths = ag_malloc(sizeof(char *) * 2);
(*paths)[0] = path;
+#ifdef PATH_MAX
tmp = ag_malloc(PATH_MAX);
(*base_paths)[0] = realpath(path, tmp);
+#else
+ (*base_paths)[0] = realpath(path, NULL);
+#endif
i = 1;
}
(*paths)[i] = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/options.h
new/the_silver_searcher-0.32.0/src/options.h
--- old/the_silver_searcher-0.31.0/src/options.h 2015-09-06
08:20:35.000000000 +0200
+++ new/the_silver_searcher-0.32.0/src/options.h 2016-05-10
19:39:40.000000000 +0200
@@ -83,6 +83,7 @@
int parallel;
int use_thread_affinity;
int vimgrep;
+ size_t width;
int word_regexp;
int workers;
} cli_options;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/print.c
new/the_silver_searcher-0.32.0/src/print.c
--- old/the_silver_searcher-0.31.0/src/print.c 2015-09-02 00:45:01.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/print.c 2016-05-10 19:39:41.000000000
+0200
@@ -17,6 +17,8 @@
const char *color_reset = "\033[0m\033[K";
+const char *truncate_marker = " [...]";
+
void print_path(const char *path, const char sep) {
if (opts.print_path == PATH_PRINT_NOTHING && !opts.vimgrep) {
return;
@@ -48,7 +50,12 @@
}
void print_line(const char *buf, size_t buf_pos, size_t prev_line_offset) {
- fwrite(buf + prev_line_offset, 1, buf_pos - prev_line_offset + 1, out_fd);
+ size_t write_chars = buf_pos - prev_line_offset + 1;
+ if (opts.width > 0 && opts.width < write_chars) {
+ write_chars = opts.width;
+ }
+
+ fwrite(buf + prev_line_offset, 1, write_chars, out_fd);
}
void print_binary_file_matches(const char *path) {
@@ -133,7 +140,7 @@
}
/* We found the end of a line. */
- if (buf[i] == '\n' && opts.before > 0) {
+ if ((i == buf_len || buf[i] == '\n') && opts.before > 0) {
if (context_prev_lines[last_prev_line] != NULL) {
free(context_prev_lines[last_prev_line]);
}
@@ -142,7 +149,7 @@
last_prev_line = (last_prev_line + 1) % opts.before;
}
- if (buf[i] == '\n' || i == buf_len) {
+ if (i == buf_len || buf[i] == '\n') {
if (lines_since_last_match == 0) {
if (opts.print_path == PATH_PRINT_EACH_LINE &&
!opts.search_stream) {
print_path(path, ':');
@@ -180,6 +187,7 @@
fprintf(out_fd, "%s", opts.color_match);
}
for (j = prev_line_offset; j <= i; j++) {
+ /* close highlight of match term */
if (last_printed_match < matches_len && j ==
matches[last_printed_match].end) {
if (opts.color) {
fprintf(out_fd, "%s", color_reset);
@@ -191,6 +199,19 @@
fputc('\n', out_fd);
}
}
+ /* skip remaining characters if truncation width
exceeded, needs to be done
+ * before highlight opening */
+ if (j < buf_len && opts.width > 0 && j -
prev_line_offset >= opts.width) {
+ if (j < i) {
+ fputs(truncate_marker, out_fd);
+ }
+ fputc('\n', out_fd);
+
+ /* prevent any more characters or highlights */
+ j = i;
+ last_printed_match = matches_len;
+ }
+ /* open highlight of match term */
if (last_printed_match < matches_len && j ==
matches[last_printed_match].start) {
if (opts.only_matching && printed_match) {
if (opts.print_path == PATH_PRINT_EACH_LINE) {
@@ -210,7 +231,9 @@
if (j < buf_len) {
/* if only_matching is set, print only matches and
newlines */
if (!opts.only_matching || printing_a_match) {
- fputc(buf[j], out_fd);
+ if (opts.width == 0 || j - prev_line_offset <
opts.width) {
+ fputc(buf[j], out_fd);
+ }
}
}
}
@@ -237,7 +260,7 @@
lines_since_last_match++;
}
/* File doesn't end with a newline. Print one so the output is
pretty. */
- if (i == buf_len && buf[i] != '\n' && !opts.search_stream) {
+ if (i == buf_len && buf[i - 1] != '\n' && !opts.search_stream) {
fputc('\n', out_fd);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/search.h
new/the_silver_searcher-0.32.0/src/search.h
--- old/the_silver_searcher-0.31.0/src/search.h 2015-09-06 06:29:27.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/search.h 2016-05-10 19:39:41.000000000
+0200
@@ -28,6 +28,7 @@
#include "options.h"
#include "print.h"
#include "util.h"
+#include "decompress.h"
#include "uthash.h"
size_t alpha_skip_lookup[256];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/util.c
new/the_silver_searcher-0.32.0/src/util.c
--- old/the_silver_searcher-0.31.0/src/util.c 2015-09-07 07:25:29.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/util.c 2016-05-10 19:39:40.000000000
+0200
@@ -9,6 +9,7 @@
#include "config.h"
#ifdef _WIN32
+#include <windows.h>
#define flockfile(x)
#define funlockfile(x)
#define getc_unlocked(x) getc(x)
@@ -299,7 +300,7 @@
return 0;
}
- if (buf_len >= 4 && strncmp(buf, "%PDF-", 5) == 0) {
+ if (buf_len >= 5 && strncmp(buf, "%PDF-", 5) == 0) {
/* PDF. This is binary. */
return 1;
}
@@ -379,7 +380,7 @@
return -1;
}
- mid = (start + end) / 2; /* can screw up on arrays with > 2 billion
elements */
+ mid = start + ((end - start) / 2);
rc = strcmp(needle, haystack[mid]);
if (rc < 0) {
@@ -435,13 +436,20 @@
free(full_path);
return FALSE;
}
+#ifdef _WIN32
+ int is_dir = GetFileAttributesA(full_path) & FILE_ATTRIBUTE_DIRECTORY;
+#else
+ int is_dir = S_ISDIR(s.st_mode);
+#endif
free(full_path);
- return S_ISDIR(s.st_mode);
+ return is_dir;
}
int is_symlink(const char *path, const struct dirent *d) {
#ifdef _WIN32
- return 0;
+ char full_path[MAX_PATH + 1] = { 0 };
+ sprintf(full_path, "%s\\%s", path, d->d_name);
+ return (GetFileAttributesA(full_path) & FILE_ATTRIBUTE_REPARSE_POINT);
#else
#ifdef HAVE_DIRENT_DTYPE
/* Some filesystems, e.g. ReiserFS, always return a type DT_UNKNOWN from
readdir or scandir. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/src/util.h
new/the_silver_searcher-0.32.0/src/util.h
--- old/the_silver_searcher-0.31.0/src/util.h 2015-09-07 07:25:29.000000000
+0200
+++ new/the_silver_searcher-0.32.0/src/util.h 2016-05-10 19:39:40.000000000
+0200
@@ -42,12 +42,6 @@
struct timeval time_end;
} ag_stats;
-typedef enum {
- AG_NO_COMPRESSION,
- AG_GZIP,
- AG_COMPRESS,
- AG_ZIP
-} ag_compression_type;
ag_stats stats;
@@ -74,8 +68,6 @@
void realloc_matches(match_t **matches, size_t *matches_size, size_t
matches_len);
void compile_study(pcre **re, pcre_extra **re_extra, char *q, const int
pcre_opts, const int study_opts);
-void *decompress(const ag_compression_type zip_type, const void *buf, const
int buf_len, const char *dir_full_path, int *new_buf_len);
-ag_compression_type is_zipped(const void *buf, const int buf_len);
int is_binary(const void *buf, const size_t buf_len);
int is_regex(const char *query);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-0.31.0/the_silver_searcher.spec
new/the_silver_searcher-0.32.0/the_silver_searcher.spec
--- old/the_silver_searcher-0.31.0/the_silver_searcher.spec 2015-09-07
07:31:13.000000000 +0200
+++ new/the_silver_searcher-0.32.0/the_silver_searcher.spec 2016-05-16
07:16:07.000000000 +0200
@@ -2,7 +2,7 @@
Name: the_silver_searcher
-Version: 0.31.0
+Version: 0.32.0
Release: 1%{?dist}
Summary: A code-searching tool similar to ack, but faster