ugrep: update to 3.12.0 (#8787)

This commit is contained in:
augiedoggie
2023-06-03 13:53:35 -06:00
committed by GitHub
parent 480e45cd2f
commit cbebf4f44f
2 changed files with 93 additions and 11 deletions

View File

@@ -0,0 +1,79 @@
From 734705dd4d6584c16b76ef0d0df1be73104ba446 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sat, 3 Jun 2023 13:35:13 -0600
Subject: quick patch to move ugrep settings
diff --git a/man/ugrep.1 b/man/ugrep.1
index 22a5ce9..b55fdbb 100644
--- a/man/ugrep.1
+++ b/man/ugrep.1
@@ -15,9 +15,9 @@ An empty pattern matches every line. Each input line that matches at least one
of the patterns is written to the standard output.
.PP
The \fBug\fR command is intended for interactive searching, using a .ugrep
-configuration file located in the working directory or home directory, see
-CONFIGURATION. \fBug\fR is equivalent to \fBugrep --config\fR and sorts files
-by name by default.
+configuration file located in the working directory or ugrep in the home
+directory, see CONFIGURATION. \fBug\fR is equivalent to \fBugrep --config\fR
+and sorts files by name by default.
.PP
The \fBugrep+\fR and \fBug+\fR commands are the same as the \fBugrep\fR and
\fBug\fR commands, but also use filters to search pdfs, documents, e-books,
@@ -855,8 +855,8 @@ the exit status is 0 even if an error occurred.
.SH CONFIGURATION
The \fBug\fR command is intended for context-dependent interactive searching
and is equivalent to the \fBugrep --config\fR command to load the default
-configuration file `.ugrep' when present in the working directory or in the
-home directory.
+configuration file `.ugrep' when present in the working directory or `ugrep' in
+the home directory.
.PP
A configuration file contains `NAME=VALUE' pairs per line, where `NAME` is the
name of a long option (without `--') and `=VALUE' is an argument, which is
diff --git a/src/ugrep.cpp b/src/ugrep.cpp
index 91ea915..8690137 100644
--- a/src/ugrep.cpp
+++ b/src/ugrep.cpp
@@ -4118,7 +4118,11 @@ static void load_config(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_
{
// check the home directory for the configuration file
if (flag_config == NULL || *flag_config == '\0')
+#ifdef __HAIKU__
+ flag_config_file.assign(home_dir).append(PATHSEPSTR).append("ugrep");
+#else
flag_config_file.assign(home_dir).append(PATHSEPSTR).append(".ugrep");
+#endif
else
flag_config_file.assign(home_dir).append(PATHSEPSTR).append(flag_config);
if (fopen_smart(&file, flag_config_file.c_str(), "r") != 0)
@@ -5457,6 +5461,8 @@ void init(int argc, const char **argv)
#ifdef OS_WIN
home_dir = getenv("USERPROFILE");
+#elif defined(__HAIKU__)
+ home_dir = "/boot/home/config/settings";
#else
home_dir = getenv("HOME");
#endif
@@ -11887,10 +11893,12 @@ void help(std::ostream& out)
hyperlinks. Parameter `rv' reverses the `sl=' and `cx=' parameters\n\
when option -v is specified. Selectively overrides GREP_COLORS.\n\
--config[=FILE], ---[FILE]\n\
- Use configuration FILE. The default FILE is `.ugrep'. The working\n\
- directory is checked first for FILE, then the home directory. The\n\
- options specified in the configuration FILE are parsed first,\n\
- followed by the remaining options specified on the command line.\n\
+ Use configuration FILE. The default FILE is `.ugrep' in the \n\
+ working directory, and `ugrep' in the settings directoy. The \n\
+ working directory is checked first for FILE, then the settings \n\
+ directory. The options specified in the configuration FILE are \n\
+ parsed first, followed by the remaining options specified on the \n\
+ command line.\n \
--confirm\n\
Confirm actions in -Q query mode. The default is confirm.\n\
--cpp\n\
--
2.39.2

View File

@@ -1,15 +1,15 @@
SUMMARY="Ultra fast grep with interactive query UI"
DESCRIPTION="NEW ultra fast grep with interactive query UI: \
search file systems, source code, text, binary files, \
archives (cpio/tar/pax/zip), compressed files (gz/Z/bz2/lzma/xz/lz4), \
documents, fuzzy search, and more. \
A faster, user-friendly replacement for GNU/BSD grep."
HOMEPAGE="https://github.com/Genivia/ugrep/wiki"
COPYRIGHT="2019-2020 Robert van Engelen, Genivia Inc."
DESCRIPTION="Ultra fast grep with interactive TUI, fuzzy search, boolean queries, hexdumps and \
more: search file systems, source code, text, binary files, archives (cpio/tar/pax/zip), \
compressed files (gz/Z/bz2/lzma/xz/lz4/zstd), pdfs, documents etc. A faster, user-friendly and \
compatible grep replacement. "
HOMEPAGE="https://github.com/Genivia/ugrep/"
COPYRIGHT="2019-2023 Robert van Engelen, Genivia Inc."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/Genivia/ugrep/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="83f2017ba05f7ce7ded74097832df071d2be89d41b357f45c4dce801c2a0cae6"
CHECKSUM_SHA256="f69330b74a2d2e46c878c19da3453e97d92ae960d0e1a92a853481cb889fca3e"
PATCHES="ugrep-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
@@ -23,8 +23,10 @@ fi
PROVIDES="
$portName = $portVersion
cmd:ugrep = $portVersion
cmd:ug = $portVersion
cmd:ug+ = $portVersion
cmd:ugrep = $portVersion
cmd:ugrep+ = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
@@ -33,6 +35,7 @@ REQUIRES="
lib:liblzma$secondaryArchSuffix
lib:libpcre2_8$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libzstd$secondaryArchSuffix
"
BUILD_REQUIRES="
@@ -42,10 +45,10 @@ BUILD_REQUIRES="
devel:liblzma$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:libzstd$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:ar
cmd:autoconf
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
@@ -54,7 +57,7 @@ BUILD_PREREQUIRES="
BUILD()
{
autoreconf -fi
autoreconf -vfi
runConfigure --omit-dirs binDir ./configure --bindir="$commandBinDir"
make $jobArgs
}