From dfd0448f83f2ff367009b0cacecbe40ffaeb95de Mon Sep 17 00:00:00 2001 From: Érico Rolim Date: Sun, 16 Aug 2020 17:21:23 -0300 Subject: xlocate: add warning when using xbps-query. Also: - Fix some indentation. - Add notes about -g and -S options in manual Closes: #194 [via git-merge-pr] --- xlocate | 5 +++-- xtools.1 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xlocate b/xlocate index fdd79d5..231b276 100755 --- a/xlocate +++ b/xlocate @@ -6,7 +6,7 @@ : ${XLOCATE_CONF:="${XDG_CONFIG_HOME}/xlocate.conf"} if [ -f "${XLOCATE_CONF}" ]; then - . "${XLOCATE_CONF}"; + . "${XLOCATE_CONF}"; fi : ${XLOCATE_GIT:=$XDG_CACHE_HOME/xlocate.git} @@ -31,7 +31,7 @@ xupdategit() { file = substr($0, s+2) sub(" *\\([^)]*\\)$", "", file) print file >>pkg - }' + }' printf '%s\n' ./* | LC_ALL= xargs -d'\n' -I'{}' -n1 -P "$(nproc)" -r -- \ sort -o {} {} @@ -81,6 +81,7 @@ if [ -d "$XLOCATE_GIT" ]; then git -c grep.lineNumber=false --git-dir="$XLOCATE_GIT" grep -- "$@" @ | sed 's/^@://; s/:/\t/' | grep . else + echo "xlocate: database not found, using xbps-query." 1>&2 xbps-query --regex -Ro -- "$@" | sed 's/ *([^)]*)$//; s/^\([^ ]*\)-[^-]*: /\1\t/' fi diff --git a/xtools.1 b/xtools.1 index 6feb9a8..9f8c631 100644 --- a/xtools.1 +++ b/xtools.1 @@ -83,9 +83,9 @@ but take cwd repo and sudo/su into account .Nd locate files in all XBPS packages .Bl -tag -offset 2n -width 2n -compact .It Fl g -Update a git based xlocate database +Update a git based xlocate database, useful for local repositories .It Fl S -Sync with the official git based xlocate database +Sync with the official git based xlocate database, which is recommended before using the tool .El .It Nm xlog Ar pkg .Nd open commit log for XBPS template -- cgit 1.4.1