[gnutls-devel] GnuTLS | [OSX, GnuTLS 3.6.15] "sed -i" requires null-length arg. if in-place editing doesn't require a backup file (#1088)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Sep 12 18:55:57 CEST 2020

christian wagner created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1088

** Summary:

On Mac OSX, at least, a null-length arg. is to be given to sed's "-i" option if one
does not require that sed creates a backup file whilst in-place editing.

** Steps to reproduce:

>From the directory where GnuTLS 3.6.15 is extracted:
1) issue the command: make -C doc install-info
2) the processing stumble on:
pkcs11-api.texi abstract-api.texi compat-api.texi dtls-api.texi crypto-api.texi ocsp-api.texi dane-api.texi pkcs7-api.texi; do \
./scripts/split-texi.pl functions < $i; \
/usr/bin/sed -i 's/\@anchor{.*//g' functions/*
sed: 1: "functions/dane_cert_typ ...": invalid command code f

** Reason of failure:

The reason is that, at least on Max OSX Yosemite, the "-i" option of sed is meant to call
for an in-place editing and to define the extension to use for the backup file.

If no backup file is desired, the parameter to the "-i" option is to be of length 0.
The current Makefile specifies extension at all which, on OSX (at least), does _not_ equate 
to an 0-length extension.

** Possible solution:

This diff output shows a possible solution:

$ diff -c Makefile.in Makefile.in.orig
*** Makefile.in 2020-09-10 11:53:09.000000000 +0100
--- Makefile.in.orig 2020-09-10 11:51:27.000000000 +0100
*** 5095,5102 ****
for i in $^; do \
$(srcdir)/scripts/split-texi.pl functions < $$i; \
! $(SED) -i "" 's/\@anchor{.*//g' functions/*
! $(SED) -i "" 's/\@subheading.*//g' functions/*
cd functions && for i in *;do grep ^"@deftypefun" $$i | $(SED) 's/@deftypefun/@item/g;s/ {/ @var{/;s/ {/ @ref{/' > ../functions/$$i.short;done
echo $@ > $@

--- 5095,5102 ----
for i in $^; do \
$(srcdir)/scripts/split-texi.pl functions < $$i; \
! $(SED) -i 's/\@anchor{.*//g' functions/*
! $(SED) -i 's/\@subheading.*//g' functions/*
cd functions && for i in *;do grep ^"@deftypefun" $$i | $(SED) 's/@deftypefun/@item/g;s/ {/ @var{/;s/ {/ @ref{/' > ../functions/$$i.short;done
echo $@ > $@

** Platform:

Macboook running Yosemite (10.10.5)

$ uname -a
Darwin ... 14.5.0 Darwin Kernel Version 14.5.0: Sun Jun  4 21:40:08 PDT 2017;
root:xnu-2782.70.3~1/RELEASE_X86_64 x86_64

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1088
You're receiving this email because of your account on gitlab.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200912/6eef3c06/attachment.html>

More information about the Gnutls-devel mailing list