Re: Do test-path_is_{file,dir,exists} make sense anymore with -x?
- From
Matthieu Moy <matthieu.moy@matthieu-moy.fr>
- Date
- Feb 26, 2019, 17:48 UTC
- Message-ID
- <86va1630g4.fsf@matthieu-moy.fr>
- In-Reply-To
- <20190226170400.GC19739@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 10 quoted lines
> On Tue, Feb 26, 2019 at 05:10:30PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> However. I wonder in general if we've re-visited the utility of these
>> wrappers and maybe other similar wrappers after -x was added.
>
>> But 4 years after this was added in a136f6d8ff ("test-lib.sh: support -x
>> option for shell-tracing", 2014-10-10) we got -x, and then with "-i -v -x":
>
> '-x' tracing doesn't work in all test scripts, unless it is run with a
> Bash version already supporting BASH_XTRACEFD, i.e. v4.1 or later.
> Notably the default Bash shipped in macOS is somewhere around v3.2.According to http://www.tldp.org/LDP/abs/html/bashver4.html#AEN21183, bash 4.1 was released on May, 2010. Are you sure macOS is _that_ late?
I also tried with dash, and -x seems to work fine too (I use "works with dash" as a heuristic for "should word on any shell", but it doesn't always work).
If -x doesn't work in some setups, it may be a good reason to wait a bit before trashing test_path_is_*, but if it's clear enough that the vast majority of platforms get -x, then why not trash these wrappers indeed.
-- Matthieu Moy https://matthieu-moy.fr/