hide stderr if cmp is used on file that does not exist

seen on android in termux
This commit is contained in:
Joey Hess 2018-10-10 15:28:27 -04:00
parent fd8094cbbc
commit 142795993a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -133,13 +133,13 @@ if [ -z "${LOCPATH+set}" ]; 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 ; then
if [ ! -d "$cachebase" ] || ! cmp "$localecache/buildid" "$cachebase/buildid" >/dev/null 2>&1 ; then
rm -rf "$localecache" 2>&1 || true
fi
done
# If the locale cache for this bundle is out of date, refresh it.
if [ -e "$LOCPATH/buildid" ] && ! cmp "$LOCPATH/buildid" "$base/buildid" >/dev/null ; then
if [ -e "$LOCPATH/buildid" ] && ! cmp "$LOCPATH/buildid" "$base/buildid" >/dev/null 2>&1 ; then
rm -rf "$LOCPATH"
fi
if ! mkdir -p "$LOCPATH"; then