runshell: Fix a edge case where rm errors were sent to stdout, which could confuse things parsing git-annex output.

This commit is contained in:
Joey Hess 2020-10-05 12:44:40 -04:00
parent 3363cc7515
commit cd9a60bc7d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 12 additions and 1 deletions

View file

@ -40,6 +40,8 @@ git-annex (8.20200909) UNRELEASED; urgency=medium
* Fix build with Benchmark build flag.
* Enable building with git-annex benchmark by default, only turning it
off when the criterion library is not installed.
* runshell: Fix a edge case where rm errors were sent to stdout, which
could confuse things parsing git-annex output.
-- Joey Hess <id@joeyh.name> Mon, 14 Sep 2020 18:34:37 -0400

View file

@ -0,0 +1,9 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2020-10-05T16:43:02Z"
content="""
Fixed the rm to not redirect errors to stdout. Traced back to a8a0f7fc58
which involved a case where the rm was failing due to perms, so the intent
must have been to also send stdout to /dev/null, but that was omitted then.
"""]]

View file

@ -143,7 +143,7 @@ if [ -z "${LOCPATH+set}" ] && [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
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
rm -rf "$localecache" 2>&1 || true
rm -rf "$localecache" >/dev/null 2>&1 || true
fi
done