about summary refs log tree commit diff
path: root/xlocate
diff options
context:
space:
mode:
authorÉrico Rolim <erico.erc@gmail.com>2020-08-16 17:21:23 -0300
committerLeah Neukirchen <leah@vuxu.org>2020-08-16 22:51:20 +0200
commitdfd0448f83f2ff367009b0cacecbe40ffaeb95de (patch)
treee04d60373898188d30a3f524a9157ee2d2aeb96d /xlocate
parent421079cf380927a074457771a41b6e17da2ad2e5 (diff)
downloadxtools-dfd0448f83f2ff367009b0cacecbe40ffaeb95de.tar.gz
xtools-dfd0448f83f2ff367009b0cacecbe40ffaeb95de.tar.xz
xtools-dfd0448f83f2ff367009b0cacecbe40ffaeb95de.zip
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]
Diffstat (limited to 'xlocate')
-rwxr-xr-xxlocate5
1 files changed, 3 insertions, 2 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