Follow-up Comment #19, bug #44768 (project groff):

Hi Mark, Peter,

I tried to solve the 3 problems mentioned previously (attached a patch
bug_44768_diff_sh_sed.patch).

1. Diff

-D option is mandatory, so we have to use GNU diff. In groff.m4 I define a
DIFF_PROG command (set to diff by default).  I first check if diff is working.
 If not, I'm looking for gdiff (I assume that people would install GNU diff as
gdiff on a standard path). If gdiff is not available, I let the default
command as diff: the error message in gdiffmk will explain the problem.

2. test -ef

Instead to force the use of bash, I propose to use ls -i, which gives the
inode of the file.

3. Sed

I was about to implement the same solution than for diff. However the error on
Solaris:
"Unrecognized command: /^#else \/\* __diffmk_18037__/ ! {"
looked stranged: the command has nothing special (no GNU extension) and should
work. But POSIX says: "A function can be preceded by one or more '!'
characters, in which case the function shall be applied if the addresses do
not select the pattern space. Zero or more <blank> characters shall be
accepted before the first '!' character. It is unspecified whether <blank>
characters can follow a '!' character, and conforming applications shall not
follow a '!' character with <blank> characters."
So it seems that the space after the '!' character is not correct (I removed
it in the patch).

Then, I made more tests by forcing the option --posix to the sed command: this
causes make check to fail on my Arch Linux environment. The sed script of
gdiffmk uses a GNU extension that allows to match a regexp or another regexp:
\(not\|!\), this in order to match lines like
#else /* not __diffmk_xxxx__
or
#else /* ! __diffmx_xxxx__

So I split this it in two sets of pattern tests and commands.

Could you please test on Solaris 10 ?

Regards,

Bertrand Garrigues


(file #33791)
    _______________________________________________________

Additional Item Attachment:

File name: bug_44768_diff_sh_sed.patch    Size:3 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44768>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
bug-groff mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-groff

Reply via email to