summary refs log tree commit diff
path: root/xlocate
diff options
context:
space:
mode:
Diffstat (limited to 'xlocate')
-rwxr-xr-xxlocate8
1 files changed, 6 insertions, 2 deletions
diff --git a/xlocate b/xlocate
index 30234bc..5f5d387 100755
--- a/xlocate
+++ b/xlocate
@@ -67,8 +67,12 @@ elif [ "$1" = -S ]; then
 fi
 
 if [ -d "$XLOCATE_GIT" ]; then
-	if find /var/db/xbps/ -name '*repodata' -newer "$XLOCATE_GIT/HEAD" | grep -q .; then
-		echo "xlocate: database outdated, please run xlocate -g." 1>&2
+	if find /var/db/xbps/ -name '*repodata' -newer "$XLOCATE_GIT/refs/heads/master" | grep -q .; then
+		if grep -q origin "$XLOCATE_GIT/config"; then
+			echo "xlocate: database outdated, please run xlocate -S." 1>&2
+		else
+			echo "xlocate: database outdated, please run xlocate -g." 1>&2
+		fi
 	fi
 	git -c grep.lineNumber=false --git-dir="$XLOCATE_GIT" grep "$@" @ |
 		sed 's/^@://; s/:/\t/' | grep .