From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:6f8:1178:2:5054:ff:fec0:8e10] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WUwMH-0002NF-18 for ptxdist@pengutronix.de; Tue, 01 Apr 2014 12:55:57 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1WUwMG-0001Df-Vc for ptxdist@pengutronix.de; Tue, 01 Apr 2014 12:55:56 +0200 Date: Tue, 1 Apr 2014 12:55:56 +0200 From: Michael Olbrich Message-ID: <20140401105556.GA31118@pengutronix.de> References: <2600638.TXFjk7YaMQ@ws-stein> <5154092.4WVLzE0vXN@ws-stein> <20140401093730.GB29751@pengutronix.de> <5060757.6ak7jiQ6Yl@ws-stein> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5060757.6ak7jiQ6Yl@ws-stein> Subject: Re: [ptxdist] git ptx-patches fails Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de 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=F6nig 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=F6nig 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 notic= ed 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"; /bi= n/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/nro= ff -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-ineract= ive 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/bzip= 2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /us= r/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/bzip= 2 -c -d '/usr/share/man/man1/git-format-patch.1.bz2') | /usr/bin/gtbl | /us= r/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/bi= n/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/bi= n/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[= =3D]] > > > --notes[=3D] > > > = > > > It seems grep slightly behaves differently when used with -q. It clos= es 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/ma= n/man1/git-format-patch.1.gz') | /usr/bin/gtbl | /usr/bin/nroff -mandoc | c= at) | 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/ma= n/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