From e7fd03f92e3fa5433b367058ea5ce6220a126c93 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sun, 17 Jul 2016 17:11:10 +0200 Subject: xlocate: check refs/heads/master, better message --- xlocate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xlocate') 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 . -- cgit 1.4.1