You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If help2man isn't installed an empty manpage is generated, without make being aware of an error:
[tom@jackdaw mons]$ which help2man
help2man not found
[tom@jackdaw mons]$ help2man -N -n "POSIX Shell script to quickly manage 2-monitors display." -h -h -v -v ./mons.sh | gzip - > mons.1.gz
zsh: command not found: help2man
[tom@jackdaw mons]$ echo $?
0
[tom@jackdaw mons]$ ls -l mons.1.gz
-rw-r--r-- 1 tom tom 20 Apr 29 10:51 mons.1.gz
[tom@jackdaw mons]$
This is because (quoting from the Bash manpage, although I believe the behaviour is POSIX) "The exit status of a pipeline is the exit status of the last command in the pipeline". So because gzip is successful, the pipeline as a whole is seen to have succeeded, and make happily installs the empty manpage.
There are of course various workarounds. One option is set -o pipefail although that's not POSIX, and in particular doesn't work on dash so far as I'm aware.
This patch worked for me to cause the makefile to fail rather than silently install a broken manpage:
The makefile autogenerates the manpage to install using the help2man command:
If help2man isn't installed an empty manpage is generated, without make being aware of an error:
This is because (quoting from the Bash manpage, although I believe the behaviour is POSIX) "The exit status of a pipeline is the exit status of the last command in the pipeline". So because gzip is successful, the pipeline as a whole is seen to have succeeded, and make happily installs the empty manpage.
There are of course various workarounds. One option is
set -o pipefail
although that's not POSIX, and in particular doesn't work on dash so far as I'm aware.This patch worked for me to cause the makefile to fail rather than silently install a broken manpage:
The text was updated successfully, but these errors were encountered: