From cd9a60bc7dbc621bafa78db15b39e4c3963a0210 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2020 12:44:40 -0400 Subject: [PATCH] runshell: Fix a edge case where rm errors were sent to stdout, which could confuse things parsing git-annex output. --- CHANGELOG | 2 ++ .../comment_2_c43bb7ffa7b900f5824b4495a6a82d0e._comment | 9 +++++++++ standalone/linux/skel/runshell | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs/comment_2_c43bb7ffa7b900f5824b4495a6a82d0e._comment diff --git a/CHANGELOG b/CHANGELOG index 6b1a6cd8e0..0854abaa0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Mon, 14 Sep 2020 18:34:37 -0400 diff --git a/doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs/comment_2_c43bb7ffa7b900f5824b4495a6a82d0e._comment b/doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs/comment_2_c43bb7ffa7b900f5824b4495a6a82d0e._comment new file mode 100644 index 0000000000..3cca5ec64a --- /dev/null +++ b/doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs/comment_2_c43bb7ffa7b900f5824b4495a6a82d0e._comment @@ -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. +"""]] diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell index e18769cea8..b3683dd46d 100755 --- a/standalone/linux/skel/runshell +++ b/standalone/linux/skel/runshell @@ -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 -- 2.30.2