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 8A7A5DC1388 for ; Sat, 4 Jul 2015 14:49:10 +0000 (UTC) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 5BC2ADC00D7 for ; Sat, 4 Jul 2015 14:49:09 +0000 (UTC) Received: by obbkm3 with SMTP id km3so83461585obb.1 for ; Sat, 04 Jul 2015 07:49:09 -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=Z+tNtAyp1QpqYvXkNiVbHN6r9gLEPPDg+OALrXnBwCg=; b=zwLaBeF/gTEDEAcIlF87TlmbtzoLibjbaFZcD8dZguwqX5pwe5syPiyalorWsqRuQj bqIXWUNL2Xah7qzUMtL3z6cnx/ZEVggpAOLLuBADG4uWG38tKm1/w1GNVH35OJ1ptoKb GLzVAXTP4hgBm9ryaSUcXNnUt8yPkg8kFaBbkB8p/oEqZqtYiT39r/8lK3R5O2mQLWSf cgzKkXI7FTxF7WLkVPod2QP2JMOo+sQte2aKnMj20qgjvBW4IaE9CWao6LOvQhWVriOF weM8g3205TrxnnuoYsPFLIUqXzZYBZfRd4vKKDbrgv7wAAbDL28P+mXhFl9Afkq1lGAE wDTA== 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.84.42 with SMTP id v10mr39195804oey.43.1436021349455; Sat, 04 Jul 2015 07:49:09 -0700 (PDT) Received: by 10.76.70.199 with HTTP; Sat, 4 Jul 2015 07:49:09 -0700 (PDT) In-Reply-To: References: <20150630183840.543112f7@tukaani.org> <20150703213148.2060418c@tukaani.org> <20150704122154.1f62da73@tukaani.org> Date: Sat, 4 Jul 2015 07:49:09 -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=089e010d92fa6c9f69051a0dc651 X-Virus-Scanned: ClamAV using ClamSMTP --089e010d92fa6c9f69051a0dc651 Content-Type: text/plain; charset=UTF-8 Looks like it's fixed in busybox/master; I confirmed that it is broken as of 1.23.2 which is the latest release alpine uses. On Sat, Jul 4, 2015 at 4:16 AM, Michael Fox <415fox@gmail.com> wrote: > 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 > -- - Michael --089e010d92fa6c9f69051a0dc651 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Looks like it's fixed in busybox/master; I confirmed t= hat it is broken as of 1.23.2 which is the latest release alpine uses.
<= br>

On Sat, = Jul 4, 2015 at 4:16 AM, Michael Fox <415fox@gmail.com> wrote:=
It's easy= to get confused on a system with multiple shells and utilities installed s= o 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 thei= r list can comment.






On Sat, Jul 4, 2015 at 2:21 AM, Lasse Collin <lasse.c= ollin@tukaani.org> wrote:
<= span>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



--

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