diff --git a/CHANGELOG b/CHANGELOG index 4b1665c6ee..4f4e5e97cc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,9 @@ git-annex (8.20200720.2) UNRELEASED; urgency=medium * move, copy --to: Sped up seeking files by 2x. * drop: Sped up seeking files to drop by 2x, and also some performance improvements to checking numcopies. + * Deal with unusual IFS settings in the shell scripts for linux + standalone and OSX app. + Thanks, Yaroslav Halchenko -- Joey Hess Tue, 21 Jul 2020 12:58:30 -0400 diff --git a/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__.mdwn b/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__.mdwn index bee64d7f7f..03e6a5fd90 100644 --- a/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__.mdwn +++ b/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__.mdwn @@ -24,3 +24,5 @@ most likely it is just a matter of sanitizing this variable in `runshell` or ali [[!meta author=yoh]] [[!tag projects/datalad]] + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__/comment_3_ba1b34111d47d58517ea64f537214e98._comment b/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__/comment_3_ba1b34111d47d58517ea64f537214e98._comment new file mode 100644 index 0000000000..1416c7cd12 --- /dev/null +++ b/doc/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__/comment_3_ba1b34111d47d58517ea64f537214e98._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2020-07-24T18:43:32Z" + content=""" +Applied a version of the patch without the :- , although it seems the :- is +not a bashism after all. It still makes no sense to me unless there's some +other setting that might make the shell blow up when IFS isn't set. +"""]] diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell index d442627594..4e3feb92ee 100755 --- a/standalone/linux/skel/runshell +++ b/standalone/linux/skel/runshell @@ -4,6 +4,9 @@ set -e +orig_IFS="${IFS}" +unset IFS + os="$(uname -o 2>/dev/null || true)" base="$(dirname "$0")" @@ -238,6 +241,11 @@ else cmd=sh fi +if [ -n "${orig_IFS}" ]; then + IFS="${orig_IFS}" + export IFS +fi + if [ -z "$tbase" ]; then if [ "$useproot" ]; then exec proot "$cmd" "$@" diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell index 557c59e224..5572a9fd65 100755 --- a/standalone/osx/git-annex.app/Contents/MacOS/runshell +++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell @@ -4,6 +4,9 @@ set -e +orig_IFS="${IFS}" +unset IFS + base="$(dirname "$0")" if [ ! -d "$base" ]; then @@ -85,6 +88,11 @@ export GIT_ANNEX_DIR GIT_ANNEX_STANDLONE_ENV="PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR" export GIT_ANNEX_STANDLONE_ENV +if [ -n "${orig_IFS}" ]; then + IFS="${orig_IFS}" + export IFS +fi + if [ "$1" ]; then cmd="$1" shift 1