GNU-isms in sed expressions in libnbd tests
In info/info-text.sh and info/info-list.sh, FreeBSD sed complains: + sed -n '/contexts:/ { N; p; q }; $ q1' info-text.out sed: 1: "/contexts:/ { N; p; q } ...": extra characters at the end of q command If I understand correctly, 'q1' means exit with error code 1, and the man page notes that this is a GNU extension. I couldn't find any obvious/easy fix for this, so just FYI. Would it help to set POSIXLY_CORRECT when running the tests to catch these earlier? 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
On Tue, May 11, 2021 at 01:41:07PM +0100, Richard W.M. Jones wrote:
In info/info-text.sh and info/info-list.sh, FreeBSD sed complains:
+ sed -n '/contexts:/ { N; p; q }; $ q1' info-text.out sed: 1: "/contexts:/ { N; p; q } ...": extra characters at the end of q command
If I understand correctly, 'q1' means exit with error code 1, and the man page notes that this is a GNU extension.
I couldn't find any obvious/easy fix for this, so just FYI.
Would it help to set POSIXLY_CORRECT when running the tests to catch these earlier?
FWIW, libvirt simply decided to mandate install of the "gsed" package on FreeBSD to get GNU Sed rather than worry about portability. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On Tue, May 11, 2021 at 01:41:07PM +0100, Richard W.M. Jones wrote:
In info/info-text.sh and info/info-list.sh, FreeBSD sed complains:
+ sed -n '/contexts:/ { N; p; q }; $ q1' info-text.out sed: 1: "/contexts:/ { N; p; q } ...": extra characters at the end of q command
If I understand correctly, 'q1' means exit with error code 1, and the man page notes that this is a GNU extension.
I couldn't find any obvious/easy fix for this, so just FYI.
Eric fixed it in: https://gitlab.com/nbdkit/libnbd/-/commit/980b58d67451f7ece491283bc778e4b6b5...
Would it help to set POSIXLY_CORRECT when running the tests to catch these earlier?
Apparently this would not have worked because POSIXLY_CORRECT doesn't suppress the GNU extensions, only deconflicts them in cases where they would conflict with a POSIX standard. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
participants (2)
-
Daniel P. Berrangé -
Richard W.M. Jones