[Libguestfs] [nbdkit PATCH] tests: Better quoting for cleanup_fn

Richard W.M. Jones rjones at redhat.com
Tue Jul 26 08:11:24 UTC 2022


On Tue, Jul 26, 2022 at 07:13:41AM +0200, Laszlo Ersek wrote:
> On 07/25/22 16:02, Eric Blake wrote:
> > +    for (( _i = 0; _i < $_cleanup_hook_count; ++_i )); do
> > +        local -n _hook=_cleanup_hook$_i
> > +        "${_hook[@]}"
> 
> BTW, "nameref" variables seem like a relatively new addition to bash;
> for example RHEL7 does not have them. Interestingly, the RHEL7 manual
> also does not document a nameref-like construct that *does* work in
> RHEL7, namely:
> 
> $ bar=foo
> $ baz=bar
> $ echo ${!baz}
> foo

Indeed it doesn't work on RHEL 7, eg:

$ make && make -C tests check TESTS=test-eflags.sh

leaves tests/eflags.{err,out} around.

Do you have a patch for this?

[...]
> I wonder if the bash release notes mention "nameref" as a more flexible
> version of "indirect expansion"... Hm, nameref was new in bash-4.3
> <https://lwn.net/Articles/589566/>, and RHEL7 has bash-4.2.46-35.el7_9,
> so the lack of "nameref" is understandable (not that it matters for
> upstream nbdkit :)); indirect expansion is not mentioned however as a
> similar feature.

Actually I'd like to keep things working on RHEL 7 if possible.  It's
still a widely used RHEL release.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW


More information about the Libguestfs mailing list