mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] git ptx-patches fails
@ 2014-03-27  7:16 Alexander Stein
  2014-03-29  9:28 ` Michael Olbrich
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stein @ 2014-03-27  7:16 UTC (permalink / raw)
  To: ptxdist

Hi there,

I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
I could track down the problem to this command (from scripts/git-ptx-patches):
> man git-format-patch | grep -q -e --notes

Executing this command manually results in this error message:
> Error executing formatting or display command.
> System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> No manual entry for git-format-patch

Interestingly executing
> (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
works as expected. I have no idea what's wrong here.

Alexander

-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-03-27  7:16 [ptxdist] git ptx-patches fails Alexander Stein
@ 2014-03-29  9:28 ` Michael Olbrich
  2014-03-31 17:08   ` Alexander Stein
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Olbrich @ 2014-03-29  9:28 UTC (permalink / raw)
  To: ptxdist

On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> I could track down the problem to this command (from scripts/git-ptx-patches):
> > man git-format-patch | grep -q -e --notes
> 
> Executing this command manually results in this error message:
> > Error executing formatting or display command.
> > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > No manual entry for git-format-patch
> 
> Interestingly executing
> > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> works as expected. I have no idea what's wrong here.

Maybe this is caused by some aliases or interactive/non-ineractive magic.
Does it help to replace "man git-format-patch" with "git format-patch
--help" or "man -P cat git-format-patch"?

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-03-29  9:28 ` Michael Olbrich
@ 2014-03-31 17:08   ` Alexander Stein
  2014-04-01  8:24     ` Uwe Kleine-König
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stein @ 2014-03-31 17:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > man git-format-patch | grep -q -e --notes
> > 
> > Executing this command manually results in this error message:
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > No manual entry for git-format-patch
> > 
> > Interestingly executing
> > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > works as expected. I have no idea what's wrong here.
> 
> Maybe this is caused by some aliases or interactive/non-ineractive magic.
> Does it help to replace "man git-format-patch" with "git format-patch
> --help" or "man -P cat git-format-patch"?

Unfortunately no :(

git format-patch --help | grep -q -e --notes
Error executing formatting or display command.
System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
No manual entry for git-format-patch

$ man -P cat git-format-patch | grep -q -e --notes
Error executing formatting or display command.
System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
No manual entry for git-format-patch

Alexander


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-03-31 17:08   ` Alexander Stein
@ 2014-04-01  8:24     ` Uwe Kleine-König
  2014-04-01  9:24       ` Alexander Stein
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2014-04-01  8:24 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > man git-format-patch | grep -q -e --notes
> > > 
> > > Executing this command manually results in this error message:
> > > > Error executing formatting or display command.
> > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > No manual entry for git-format-patch
> > > 
> > > Interestingly executing
> > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > works as expected. I have no idea what's wrong here.
> > 
> > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > Does it help to replace "man git-format-patch" with "git format-patch
> > --help" or "man -P cat git-format-patch"?
> 
> Unfortunately no :(
> 
> git format-patch --help | grep -q -e --notes
> Error executing formatting or display command.
> System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> No manual entry for git-format-patch
> 
> $ man -P cat git-format-patch | grep -q -e --notes
> Error executing formatting or display command.
> System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> No manual entry for git-format-patch
Do you have git-format-patch's manpage, i.e. does

	man git-format-patch

work? On bash, what happens on:

	$ man -P cat git-format-patch | grep -q -e --notes
	$ echo ${PIPESTATUS[@]}

Does

	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes

give any insights (e.g. where does the 141 come from?)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01  8:24     ` Uwe Kleine-König
@ 2014-04-01  9:24       ` Alexander Stein
  2014-04-01  9:37         ` Uwe Kleine-König
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stein @ 2014-04-01  9:24 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich, Uwe Kleine-König

On Tuesday 01 April 2014 10:24:41, Uwe Kleine-König wrote:
> On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> > On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > > man git-format-patch | grep -q -e --notes
> > > > 
> > > > Executing this command manually results in this error message:
> > > > > Error executing formatting or display command.
> > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > > No manual entry for git-format-patch
> > > > 
> > > > Interestingly executing
> > > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > > works as expected. I have no idea what's wrong here.
> > > 
> > > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > > Does it help to replace "man git-format-patch" with "git format-patch
> > > --help" or "man -P cat git-format-patch"?
> > 
> > Unfortunately no :(
> > 
> > git format-patch --help | grep -q -e --notes
> > Error executing formatting or display command.
> > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> > No manual entry for git-format-patch
> > 
> > $ man -P cat git-format-patch | grep -q -e --notes
> > Error executing formatting or display command.
> > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > No manual entry for git-format-patch
> Do you have git-format-patch's manpage, i.e. does
> 
> 	man git-format-patch
> 
> work?

Yep, that man page is installed.

> On bash, what happens on:
> 
> 	$ man -P cat git-format-patch | grep -q -e --notes
> 	$ echo ${PIPESTATUS[@]}

$ man -P cat git-format-patch | grep -q -e --notes
Error executing formatting or display command.
System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
No manual entry for git-format-patch
$ echo ${PIPESTATUS[@]}
1 0

> Does
> 
> 	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes
> 
> give any insights (e.g. where does the 141 come from?)

Somewhat. The 'culprit' is grep so far:
$ man -P cat git-format-patch | grep -q -e --notes
Error executing formatting or display command.
System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
No manual entry for git-format-patch
$ man -P cat git-format-patch | grep -e --notes
                          [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
       --notes[=<ref>]

It seems grep slightly behaves differently when used with -q. It closes STDIN as soon as it detects the pattern.
But the closed pipe results in an EPIPE returned from write(2) within cat which exits with an error.

A working variant/workaround ist:
$ man -P cat git-format-patch | grep -e --notes > /dev/null
$ echo $?
0

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01  9:24       ` Alexander Stein
@ 2014-04-01  9:37         ` Uwe Kleine-König
  2014-04-01  9:59           ` Alexander Stein
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2014-04-01  9:37 UTC (permalink / raw)
  To: Alexander Stein; +Cc: Michael Olbrich, ptxdist

Hello Alexander,

On Tue, Apr 01, 2014 at 11:24:52AM +0200, Alexander Stein wrote:
> On Tuesday 01 April 2014 10:24:41, Uwe Kleine-König wrote:
> > On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> > > On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > > > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > > > man git-format-patch | grep -q -e --notes
> > > > > 
> > > > > Executing this command manually results in this error message:
> > > > > > Error executing formatting or display command.
> > > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > > > No manual entry for git-format-patch
> > > > > 
> > > > > Interestingly executing
> > > > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > > > works as expected. I have no idea what's wrong here.
> > > > 
> > > > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > > > Does it help to replace "man git-format-patch" with "git format-patch
> > > > --help" or "man -P cat git-format-patch"?
> > > 
> > > Unfortunately no :(
> > > 
> > > git format-patch --help | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> > > No manual entry for git-format-patch
> > > 
> > > $ man -P cat git-format-patch | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > No manual entry for git-format-patch
> > Do you have git-format-patch's manpage, i.e. does
> > 
> > 	man git-format-patch
> > 
> > work?
> 
> Yep, that man page is installed.
> 
> > On bash, what happens on:
> > 
> > 	$ man -P cat git-format-patch | grep -q -e --notes
> > 	$ echo ${PIPESTATUS[@]}
> 
> $ man -P cat git-format-patch | grep -q -e --notes
> Error executing formatting or display command.
> System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> No manual entry for git-format-patch
> $ echo ${PIPESTATUS[@]}
> 1 0
> 
> > Does
> > 
> > 	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes
> > 
> > give any insights (e.g. where does the 141 come from?)
> 
> Somewhat. The 'culprit' is grep so far:
> $ man -P cat git-format-patch | grep -q -e --notes
> Error executing formatting or display command.
> System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> No manual entry for git-format-patch
> $ man -P cat git-format-patch | grep -e --notes
>                           [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
>        --notes[=<ref>]
> 
> It seems grep slightly behaves differently when used with -q. It closes STDIN as soon as it detects the pattern.
> But the closed pipe results in an EPIPE returned from write(2) within cat which exits with an error.
My man (from the Debian package man-db 2.6.2-1) doesn't show this
behaviour. Is your version older or newer?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01  9:37         ` Uwe Kleine-König
@ 2014-04-01  9:59           ` Alexander Stein
  2014-04-01 10:55             ` Michael Olbrich
  2014-04-01 12:30             ` Uwe Kleine-König
  0 siblings, 2 replies; 11+ messages in thread
From: Alexander Stein @ 2014-04-01  9:59 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Michael Olbrich, ptxdist

Hello Uwe,

On Tuesday 01 April 2014 11:37:30, Uwe Kleine-König wrote:
> On Tue, Apr 01, 2014 at 11:24:52AM +0200, Alexander Stein wrote:
> > On Tuesday 01 April 2014 10:24:41, Uwe Kleine-König wrote:
> > > On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> > > > On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > > > > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > > > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > > > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > > > > man git-format-patch | grep -q -e --notes
> > > > > > 
> > > > > > Executing this command manually results in this error message:
> > > > > > > Error executing formatting or display command.
> > > > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > > > > No manual entry for git-format-patch
> > > > > > 
> > > > > > Interestingly executing
> > > > > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > > > > works as expected. I have no idea what's wrong here.
> > > > > 
> > > > > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > > > > Does it help to replace "man git-format-patch" with "git format-patch
> > > > > --help" or "man -P cat git-format-patch"?
> > > > 
> > > > Unfortunately no :(
> > > > 
> > > > git format-patch --help | grep -q -e --notes
> > > > Error executing formatting or display command.
> > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> > > > No manual entry for git-format-patch
> > > > 
> > > > $ man -P cat git-format-patch | grep -q -e --notes
> > > > Error executing formatting or display command.
> > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > > No manual entry for git-format-patch
> > > Do you have git-format-patch's manpage, i.e. does
> > > 
> > > 	man git-format-patch
> > > 
> > > work?
> > 
> > Yep, that man page is installed.
> > 
> > > On bash, what happens on:
> > > 
> > > 	$ man -P cat git-format-patch | grep -q -e --notes
> > > 	$ echo ${PIPESTATUS[@]}
> > 
> > $ man -P cat git-format-patch | grep -q -e --notes
> > Error executing formatting or display command.
> > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > No manual entry for git-format-patch
> > $ echo ${PIPESTATUS[@]}
> > 1 0
> > 
> > > Does
> > > 
> > > 	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes
> > > 
> > > give any insights (e.g. where does the 141 come from?)
> > 
> > Somewhat. The 'culprit' is grep so far:
> > $ man -P cat git-format-patch | grep -q -e --notes
> > Error executing formatting or display command.
> > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > No manual entry for git-format-patch
> > $ man -P cat git-format-patch | grep -e --notes
> >                           [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
> >        --notes[=<ref>]
> > 
> > It seems grep slightly behaves differently when used with -q. It closes STDIN as soon as it detects the pattern.
> > But the closed pipe results in an EPIPE returned from write(2) within cat which exits with an error.
> My man (from the Debian package man-db 2.6.2-1) doesn't show this
> behaviour. Is your version older or newer?

I don't think this is related to man (what's man-db BTW?) at all.
I think the versions of cat and grep behave differently. I have installed grep-2.16 and coreutils-8.21 (current Gentoo stable versions).

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01  9:59           ` Alexander Stein
@ 2014-04-01 10:55             ` Michael Olbrich
  2014-04-01 12:30             ` Uwe Kleine-König
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Olbrich @ 2014-04-01 10:55 UTC (permalink / raw)
  To: ptxdist

On Tue, Apr 01, 2014 at 11:59:42AM +0200, Alexander Stein wrote:
> Hello Uwe,
> 
> On Tuesday 01 April 2014 11:37:30, Uwe Kleine-König wrote:
> > On Tue, Apr 01, 2014 at 11:24:52AM +0200, Alexander Stein wrote:
> > > On Tuesday 01 April 2014 10:24:41, Uwe Kleine-König wrote:
> > > > On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> > > > > On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > > > > > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > > > > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > > > > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > > > > > man git-format-patch | grep -q -e --notes
> > > > > > > 
> > > > > > > Executing this command manually results in this error message:
> > > > > > > > Error executing formatting or display command.
> > > > > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > > > > > No manual entry for git-format-patch
> > > > > > > 
> > > > > > > Interestingly executing
> > > > > > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > > > > > works as expected. I have no idea what's wrong here.
> > > > > > 
> > > > > > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > > > > > Does it help to replace "man git-format-patch" with "git format-patch
> > > > > > --help" or "man -P cat git-format-patch"?
> > > > > 
> > > > > Unfortunately no :(
> > > > > 
> > > > > git format-patch --help | grep -q -e --notes
> > > > > Error executing formatting or display command.
> > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> > > > > No manual entry for git-format-patch
> > > > > 
> > > > > $ man -P cat git-format-patch | grep -q -e --notes
> > > > > Error executing formatting or display command.
> > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > > > No manual entry for git-format-patch
> > > > Do you have git-format-patch's manpage, i.e. does
> > > > 
> > > > 	man git-format-patch
> > > > 
> > > > work?
> > > 
> > > Yep, that man page is installed.
> > > 
> > > > On bash, what happens on:
> > > > 
> > > > 	$ man -P cat git-format-patch | grep -q -e --notes
> > > > 	$ echo ${PIPESTATUS[@]}
> > > 
> > > $ man -P cat git-format-patch | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > No manual entry for git-format-patch
> > > $ echo ${PIPESTATUS[@]}
> > > 1 0
> > > 
> > > > Does
> > > > 
> > > > 	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes
> > > > 
> > > > give any insights (e.g. where does the 141 come from?)
> > > 
> > > Somewhat. The 'culprit' is grep so far:
> > > $ man -P cat git-format-patch | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > No manual entry for git-format-patch
> > > $ man -P cat git-format-patch | grep -e --notes
> > >                           [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
> > >        --notes[=<ref>]
> > > 
> > > It seems grep slightly behaves differently when used with -q. It closes STDIN as soon as it detects the pattern.
> > > But the closed pipe results in an EPIPE returned from write(2) within cat which exits with an error.
> > My man (from the Debian package man-db 2.6.2-1) doesn't show this
> > behaviour. Is your version older or newer?
> 
> I don't think this is related to man (what's man-db BTW?) at all.
> I think the versions of cat and grep behave differently. I have installed
> grep-2.16 and coreutils-8.21 (current Gentoo stable versions).

This is caused by 'man':

$ (cd "/usr/share/man" && (echo ".pl 11i"; /bin/gunzip -c -d '/usr/share/man/man1/git-format-patch.1.gz') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) | grep -q -e --notes
$ echo ${PIPESTATUS[@]}
141 0

$ man git-format-patch | grep -q -e --notes
$ echo ${PIPESTATUS[@]}
0 0

Either man is executing something else here or it ignores the return value.
Maybe it doesn't start a pager if stdout is a pipe, because:
$ (cd "/usr/share/man" && (echo ".pl 11i"; /bin/gunzip -c -d '/usr/share/man/man1/git-format-patch.1.gz') | /usr/bin/gtbl | /usr/bin/nroff -mandoc) | grep -q -e --notes
$ echo ${PIPESTATUS[@]}
0 0

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01  9:59           ` Alexander Stein
  2014-04-01 10:55             ` Michael Olbrich
@ 2014-04-01 12:30             ` Uwe Kleine-König
  2014-04-01 13:07               ` Alexander Stein
  1 sibling, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2014-04-01 12:30 UTC (permalink / raw)
  To: Alexander Stein; +Cc: Michael Olbrich, ptxdist

Hello Alexander,

On Tue, Apr 01, 2014 at 11:59:42AM +0200, Alexander Stein wrote:
> On Tuesday 01 April 2014 11:37:30, Uwe Kleine-König wrote:
> > On Tue, Apr 01, 2014 at 11:24:52AM +0200, Alexander Stein wrote:
> > > On Tuesday 01 April 2014 10:24:41, Uwe Kleine-König wrote:
> > > > On Mon, Mar 31, 2014 at 07:08:53PM +0200, Alexander Stein wrote:
> > > > > On Saturday 29 March 2014, 10:28:54 wrote Michael Olbrich:
> > > > > > On Thu, Mar 27, 2014 at 08:16:15AM +0100, Alexander Stein wrote:
> > > > > > > I tried to use git ptx-patches fromwithin a package and noticed it doesn't work.
> > > > > > > I could track down the problem to this command (from scripts/git-ptx-patches):
> > > > > > > > man git-format-patch | grep -q -e --notes
> > > > > > > 
> > > > > > > Executing this command manually results in this error message:
> > > > > > > > Error executing formatting or display command.
> > > > > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) exited with status 141.
> > > > > > > > No manual entry for git-format-patch
> > > > > > > 
> > > > > > > Interestingly executing
> > > > > > > > (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | less) | grep -q -e --notes
> > > > > > > works as expected. I have no idea what's wrong here.
> > > > > > 
> > > > > > Maybe this is caused by some aliases or interactive/non-ineractive magic.
> > > > > > Does it help to replace "man git-format-patch" with "git format-patch
> > > > > > --help" or "man -P cat git-format-patch"?
> > > > > 
> > > > > Unfortunately no :(
> > > > > 
> > > > > git format-patch --help | grep -q -e --notes
> > > > > Error executing formatting or display command.
> > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with status 141.
> > > > > No manual entry for git-format-patch
> > > > > 
> > > > > $ man -P cat git-format-patch | grep -q -e --notes
> > > > > Error executing formatting or display command.
> > > > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > > > No manual entry for git-format-patch
> > > > Do you have git-format-patch's manpage, i.e. does
> > > > 
> > > > 	man git-format-patch
> > > > 
> > > > work?
> > > 
> > > Yep, that man page is installed.
> > > 
> > > > On bash, what happens on:
> > > > 
> > > > 	$ man -P cat git-format-patch | grep -q -e --notes
> > > > 	$ echo ${PIPESTATUS[@]}
> > > 
> > > $ man -P cat git-format-patch | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > No manual entry for git-format-patch
> > > $ echo ${PIPESTATUS[@]}
> > > 1 0
> > > 
> > > > Does
> > > > 
> > > > 	strace -f -o /tmp/lala man -P cat git-format-patch | grep -q -e --notes
> > > > 
> > > > give any insights (e.g. where does the 141 come from?)
> > > 
> > > Somewhat. The 'culprit' is grep so far:
> > > $ man -P cat git-format-patch | grep -q -e --notes
> > > Error executing formatting or display command.
> > > System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/bzip2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | cat) exited with status 141.
> > > No manual entry for git-format-patch
> > > $ man -P cat git-format-patch | grep -e --notes
> > >                           [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
> > >        --notes[=<ref>]
> > > 
> > > It seems grep slightly behaves differently when used with -q. It closes STDIN as soon as it detects the pattern.
> > > But the closed pipe results in an EPIPE returned from write(2) within cat which exits with an error.
> > My man (from the Debian package man-db 2.6.2-1) doesn't show this
> > behaviour. Is your version older or newer?
> 
> I don't think this is related to man (what's man-db BTW?) at all.
man-db is the package that provides /usr/bin/man on Debian. Also man-db
from Debian unstable (i.e. 2.6.6) is unaffected.

> I think the versions of cat and grep behave differently. I have
At least my grep also closes its input with -q and makes cat unhappy:

	$ { seq 1 2000 | cat; echo >&2 $?; } | grep -q 1 
	141
	$ { seq 1 2000 | cat; echo >&2 $?; } | grep 1 > /dev/null
	0

So I still think it's a man problem. Reading the output of

	strace -o /tmp/tralala man git-format-patch | grep -q -e --notes

"my" man doesn't use system to render the manpage. At least it doesn't
do any execvp and it opens /usr/share/man/man1/git-format-patch.1.gz
itself.

So again, what is your man version?

> installed grep-2.16 and coreutils-8.21 (current Gentoo stable
> versions).
For completeness although I think its proven to be unrelated:
grep 2.12-2 + coreutils 8.13-3.5 (i.e. Debian stable)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01 12:30             ` Uwe Kleine-König
@ 2014-04-01 13:07               ` Alexander Stein
  2014-04-01 13:53                 ` Alexander Stein
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stein @ 2014-04-01 13:07 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Michael Olbrich, ptxdist

Hello Uwe,

On Tuesday 01 April 2014 14:30:30, Uwe Kleine-König wrote:
> > I don't think this is related to man (what's man-db BTW?) at all.
> man-db is the package that provides /usr/bin/man on Debian. Also man-db
> from Debian unstable (i.e. 2.6.6) is unaffected.
> 
> > I think the versions of cat and grep behave differently. I have
> At least my grep also closes its input with -q and makes cat unhappy:
> 
> 	$ { seq 1 2000 | cat; echo >&2 $?; } | grep -q 1 
> 	141
> 	$ { seq 1 2000 | cat; echo >&2 $?; } | grep 1 > /dev/null
> 	0

Both commands work well here:
$ { seq 1 2000 | cat; echo >&2 $?; } | grep -q 1 
0
$ { seq 1 2000 | cat; echo >&2 $?; } | grep 1 > /dev/null
0

> So I still think it's a man problem. Reading the output of
> 
> 	strace -o /tmp/tralala man git-format-patch | grep -q -e --notes
> 
> "my" man doesn't use system to render the manpage. At least it doesn't
> do any execvp and it opens /usr/share/man/man1/git-format-patch.1.gz
> itself.

You might be missing the -f option? My strace shows several execve. One of them is
> execve("/bin/sh", ["sh", "-c", "/bin/bzip2 -c -d /usr/share/man/"...], [/* 120 vars */]) = 0

> So again, what is your man version?
> 
> > installed grep-2.16 and coreutils-8.21 (current Gentoo stable
> > versions).
> For completeness although I think its proven to be unrelated:
> grep 2.12-2 + coreutils 8.13-3.5 (i.e. Debian stable)

I have man-1.6g

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] git ptx-patches fails
  2014-04-01 13:07               ` Alexander Stein
@ 2014-04-01 13:53                 ` Alexander Stein
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2014-04-01 13:53 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich, Uwe Kleine-König

On Tuesday 01 April 2014 15:07:19, Alexander Stein wrote:
> Hello Uwe,
> 
> On Tuesday 01 April 2014 14:30:30, Uwe Kleine-König wrote:
> > > I don't think this is related to man (what's man-db BTW?) at all.
> > man-db is the package that provides /usr/bin/man on Debian. Also man-db
> > from Debian unstable (i.e. 2.6.6) is unaffected.
> > 
> > > I think the versions of cat and grep behave differently. I have
> > At least my grep also closes its input with -q and makes cat unhappy:
> > 
> > 	$ { seq 1 2000 | cat; echo >&2 $?; } | grep -q 1 
> > 	141
> > 	$ { seq 1 2000 | cat; echo >&2 $?; } | grep 1 > /dev/null
> > 	0
> 
> Both commands work well here:
> $ { seq 1 2000 | cat; echo >&2 $?; } | grep -q 1 
> 0
> $ { seq 1 2000 | cat; echo >&2 $?; } | grep 1 > /dev/null
> 0
> 
> > So I still think it's a man problem. Reading the output of
> > 
> > 	strace -o /tmp/tralala man git-format-patch | grep -q -e --notes
> > 
> > "my" man doesn't use system to render the manpage. At least it doesn't
> > do any execvp and it opens /usr/share/man/man1/git-format-patch.1.gz
> > itself.
> 
> You might be missing the -f option? My strace shows several execve. One of 
them is
> > execve("/bin/sh", ["sh", "-c", "/bin/bzip2 -c -d /usr/share/man/"...], [/* 
120 vars */]) = 0
> 
> > So again, what is your man version?
> > 
> > > installed grep-2.16 and coreutils-8.21 (current Gentoo stable
> > > versions).
> > For completeness although I think its proven to be unrelated:
> > grep 2.12-2 + coreutils 8.13-3.5 (i.e. Debian stable)
> 
> I have man-1.6g

Mh, those numbers made me wonder. I checked the sources of this version and 
found this snippet:
> There is a very different man program, also derived from
> John Eaton's original version (by Graeme W. Wilford)
> distributed under the name man_db, with version numbers
> like man_db-2.3.10.  Do not confuse the two, they are
> mutually incompatible, although they perform nearly the same job.

It seems that the default (? dunno why this variant was installed though) of 
man behaves differently. I now installed man-db-2.6.6 and it works now \o/

Thanks for the hint
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-01 13:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27  7:16 [ptxdist] git ptx-patches fails Alexander Stein
2014-03-29  9:28 ` Michael Olbrich
2014-03-31 17:08   ` Alexander Stein
2014-04-01  8:24     ` Uwe Kleine-König
2014-04-01  9:24       ` Alexander Stein
2014-04-01  9:37         ` Uwe Kleine-König
2014-04-01  9:59           ` Alexander Stein
2014-04-01 10:55             ` Michael Olbrich
2014-04-01 12:30             ` Uwe Kleine-König
2014-04-01 13:07               ` Alexander Stein
2014-04-01 13:53                 ` Alexander Stein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox