avoid depending on cmp

If it was not available, the caches would get deleted unncessarily.
This should be just as fast as using it.
This commit is contained in:
Joey Hess 2020-10-06 11:25:17 -04:00
parent 30677d5858
commit db7fb5b8cf
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -145,7 +145,7 @@ if [ -z "${LOCPATH+set}" ] && [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
# Clean up locale caches when their standalone bundle no longer exists.
for localecache in $HOME/.cache/git-annex/locales/*; do
cachebase=$(cat "$localecache/base" 2>/dev/null || true)
if [ ! -d "$cachebase" ] || ! cmp "$localecache/buildid" "$cachebase/buildid" >/dev/null 2>&1 ; then
if [ ! -d "$cachebase" ] || [ "$(cat "$localecache/buildid" 2>/dev/null || true)" != "$(cat "$cachebase/buildid" 2>/dev/null || true)" ]; then
rm -rf "$localecache" >/dev/null 2>&1 || true
fi
done