summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-17 17:11:10 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-17 17:11:10 +0200
commite7fd03f92e3fa5433b367058ea5ce6220a126c93 (patch)
treecf8d64d4f1f96c065445d47223fcee576e556d14
parentc6709af75061196ace55db380aeff045715ba4e4 (diff)
downloadxtools-e7fd03f92e3fa5433b367058ea5ce6220a126c93.tar.gz
xtools-e7fd03f92e3fa5433b367058ea5ce6220a126c93.tar.xz
xtools-e7fd03f92e3fa5433b367058ea5ce6220a126c93.zip
xlocate: check refs/heads/master, better message
-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 .