X-Original-To: alpine-devel@mail.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 24A2DDCB44D for ; Sat, 4 Jul 2015 11:16:46 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id EA11CDC040F for ; Sat, 4 Jul 2015 11:16:45 +0000 (UTC) Received: by oihr66 with SMTP id r66so35723263oih.2 for ; Sat, 04 Jul 2015 04:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FbBw7jyre9bRooya55D0qNSoD25UdufWbPeFCmzfK/s=; b=o1ZuyAzfqy99yPdX+bsR/VN90NBDqWRdunNkvfI8SkqikcACf0xWiBDqP7SaQ1Wgiw JMezKUpXDiiEnOpkYHSrWLXXLmmdnQAe2/4mMtlmr1+gAsnBNaUSmfZZs4sgPkIUbaGT 45xuugICxO57byzwf24hXfvhAwKsXlzNm+O4fmaq+ud83QJWc1szidvPAGAyeQRi4uY1 zP2dvT3otDmlmDQYBPl1niEEUJsM7fLLTyeGaU6RzYRRLZ9BEF+x1+gNPxhJojkwvKkB nzvixA5Jwun08BZyH4+l9qVds1o/hYZWf1Fp6UAsGFofC3pVKx7OYaPntPzOXxCm4alT 8EoQ== X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 X-Received: by 10.60.42.42 with SMTP id k10mr18994896oel.82.1436008605134; Sat, 04 Jul 2015 04:16:45 -0700 (PDT) Received: by 10.76.70.199 with HTTP; Sat, 4 Jul 2015 04:16:45 -0700 (PDT) In-Reply-To: <20150704122154.1f62da73@tukaani.org> References: <20150630183840.543112f7@tukaani.org> <20150703213148.2060418c@tukaani.org> <20150704122154.1f62da73@tukaani.org> Date: Sat, 4 Jul 2015 04:16:45 -0700 Message-ID: Subject: [alpine-devel] Re: xzdiff in xz package is broken on alpine linux From: Michael Fox <415fox@gmail.com> To: Lasse Collin Cc: busybox@busybox.net, alpine-devel , Natanael Copa Content-Type: multipart/alternative; boundary=089e0149d14ecdb796051a0ace32 X-Virus-Scanned: ClamAV using ClamSMTP --089e0149d14ecdb796051a0ace32 Content-Type: text/plain; charset=UTF-8 It's easy to get confused on a system with multiple shells and utilities installed so I'm trying it on a fresh minimal alpline livecd. It is exactly as you say. I think busybox has a bug. I hope someone from their list can comment. On Sat, Jul 4, 2015 at 2:21 AM, Lasse Collin wrote: > On 2015-07-03 Michael Fox wrote: > > Do you think it's a bug in busybox? I think they follow this opengroup > > standard > > > > http://pubs.opengroup.org/onlinepubs/009695399/utilities/diff.html > > > > It's hard to tell from the description of diff in that document > > whether and how it should deal with two stdin pipes. > > There is just one stdin which often (but not always) is a pipe. > > Both POSIX.1-2001 (your link) and the latest version (POSIX.1-2008) > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html > > say that diff should work with pipes: > > Many early implementations of diff require seekable files. Since > the System Interfaces volume of POSIX.1-2008 supports named pipes, > the standard developers decided that such a restriction was > unreasonable. Note also that the allowed filename - almost always > refers to a pipe. > > > I was hoping this might work: > > > > diff <(echo foo) <(echo bar) > > > > But no. This part of the standard describes a subshell environment but > > scrolling up it gives grammar: > > Seems that I confused you with the bash-specific syntax. Sorry about > that. The syntax used with the shell has nothing to do with diff. Here > is a test case using POSIX sh: > > sh$ mkfifo fifo > sh$ echo foo > fifo & > sh$ echo bar | diff fifo - > 1c1 > < foo > --- > > bar > sh$ echo $? > 1 > > Switching to BusyBox diff: > > sh$ mkfifo fifo > sh$ echo foo > fifo & > sh$ echo bar | busybox diff fifo - > sh$ echo $? > 0 > > Or: > > sh$ mkfifo fifo fifo2 > sh$ echo foo > fifo & > sh$ echo bar > fifo2 & > sh$ busybox diff fifo fifo2 > sh$ echo $? > 0 > > diff from BusyBox 1.23.2 doesn't work if both arguments are pipes. > > -- > Lasse Collin | IRC: Larhzu @ IRCnet & Freenode > -- - Michael --089e0149d14ecdb796051a0ace32 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It's easy to get confused on a system with m= ultiple shells and utilities installed so I'm trying it on a fresh mini= mal alpline livecd. It is exactly as you say.

I think bus= ybox has a bug. I hope someone from their list can comment.
=




=
On Sat, Jul 4, 2015 at 2:21 AM, Lasse Collin= <lasse.collin@tukaani.org> wrote:
On 2015-07-03 Michael Fox wrote:
> Do you think it's a bug in busybox? I think they follow this openg= roup
> standard
>
> http://pubs.opengroup.org/onl= inepubs/009695399/utilities/diff.html
>
> It's hard to tell from the description of diff in that document > whether and how it should deal with two stdin pipes.

There is just one stdin which often (but not always) is a pipe.

Both POSIX.1-2001 (your link) and the latest version (POSIX.1-2008)

=C2=A0 =C2=A0 http://pubs.opengro= up.org/onlinepubs/9699919799/utilities/diff.html

say that diff should work with pipes:

=C2=A0 =C2=A0 Many early implementations of diff require seekable files. Si= nce
=C2=A0 =C2=A0 the System Interfaces volume of POSIX.1-2008 supports named p= ipes,
=C2=A0 =C2=A0 the standard developers decided that such a restriction was =C2=A0 =C2=A0 unreasonable. Note also that the allowed filename - almost al= ways
=C2=A0 =C2=A0 refers to a pipe.

> I was hoping this might work:
>
>=C2=A0 =C2=A0 =C2=A0diff <(echo foo) <(echo bar)
>
> But no. This part of the standard describes a subshell environment but=
> scrolling up it gives grammar:

Seems that I confused you with the bash-specific syntax. Sorry about=
that. The syntax used with the shell has nothing to do with diff. Here
is a test case using POSIX sh:

=C2=A0 =C2=A0 sh$ mkfifo fifo
=C2=A0 =C2=A0 sh$ echo foo > fifo &
=C2=A0 =C2=A0 sh$ echo bar | diff fifo -
=C2=A0 =C2=A0 1c1
=C2=A0 =C2=A0 < foo
=C2=A0 =C2=A0 ---
=C2=A0 =C2=A0 > bar
=C2=A0 =C2=A0 sh$ echo $?
=C2=A0 =C2=A0 1

Switching to BusyBox diff:

=C2=A0 =C2=A0 sh$ mkfifo fifo
=C2=A0 =C2=A0 sh$ echo foo > fifo &
=C2=A0 =C2=A0 sh$ echo bar | busybox diff fifo -
=C2=A0 =C2=A0 sh$ echo $?
=C2=A0 =C2=A0 0

Or:

=C2=A0 =C2=A0 sh$ mkfifo fifo fifo2
=C2=A0 =C2=A0 sh$ echo foo > fifo &
=C2=A0 =C2=A0 sh$ echo bar > fifo2 &
=C2=A0 =C2=A0 sh$ busybox diff fifo fifo2
=C2=A0 =C2=A0 sh$ echo $?
=C2=A0 =C2=A0 0

diff from BusyBox 1.23.2 doesn't work if both arguments are pipes.

--
Lasse Collin=C2=A0 |=C2=A0 IRC: Larhzu @ IRCnet & Freenode



--

-
Michael
--089e0149d14ecdb796051a0ace32-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---