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 6C151DC0B7D for ; Tue, 30 Jun 2015 17:52:21 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 3ADDBDC1C04 for ; Tue, 30 Jun 2015 17:52:20 +0000 (UTC) Received: by obpn3 with SMTP id n3so11770630obp.0 for ; Tue, 30 Jun 2015 10:52:20 -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=kCEFDDAMw83D7cfkpobmmY8vax6o45+iDUNRmUoElc8=; b=qTjReUMzxaBIF9JdbvdntXWKV2lgdPlWuQ5JFLskLn/cNtUyLXQVfyq9m7hQQX1yOw XGetg0Nqy1yOhV+CETzRyjPxXl21bdf2oRqbXo05841+bYUdUBsGN2RqCjhE4MHHx1QA wI0bOY2DytG/SrBabJz1woI9RjMvUo9kxfPW/P4h5MR6So9slImmBstFgBRCKhNnBRbk N9JgT5Q8v5MowCIi92teDywk9TqjT+MLh+kkqWTyKdV6SxgGxjzJhc2aJA/IC20h9Gmi A3HoJ61wWpeASN1BxN5qvQvZotPNBlUY+FW7QuLcvEn1nIolsLIaJvHlrMGN1TCno7Pl OE7A== 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.182.65.194 with SMTP id z2mr20668669obs.30.1435686740460; Tue, 30 Jun 2015 10:52:20 -0700 (PDT) Received: by 10.76.70.199 with HTTP; Tue, 30 Jun 2015 10:52:20 -0700 (PDT) In-Reply-To: References: <20150630183840.543112f7@tukaani.org> Date: Tue, 30 Jun 2015 10:52:20 -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: alpine-devel , Natanael Copa Content-Type: multipart/alternative; boundary=001a11c1c9242c8ac20519bfdea5 X-Virus-Scanned: ClamAV using ClamSMTP --001a11c1c9242c8ac20519bfdea5 Content-Type: text/plain; charset=UTF-8 Here is a diff of the command: /bin/sh -x xzdiff good-1-lzma2-1.xz good-2-lzma2.xz 2>good.out diff good.out bad.out where the bad version comes from alpine: < + xz='xz --format=auto' --- > + xz=xz --format=auto 3d2 < + case ${0##*/} in 6,7c5,6 < + version='xzdiff (XZ Utils) 5.1.0alpha' < + usage='Usage: xzdiff [OPTION]... FILE1 [FILE2] --- > + version=xzdiff (XZ Utils) 5.2.1 > + usage=Usage: xzdiff [OPTION]... FILE1 [FILE2] 12c11,16 < Do comparisons like '\''diff'\'' does. OPTIONs are the same as for '\''diff'\''. --- > Do comparisons like 'diff' does. OPTIONs are the same as for 'diff'. > > Report bugs to . > + escape= > s/'/'\\''/g > $s/X$/'/ 14,18d17 < Report bugs to .' < + escape=' < s/'\''/'\''\\'\'''\''/g < $s/X$/'\''/ < ' 20d18 < + case $1 in 22,28c20,26 < + cmp='diff --' < + for file in '"$@"' < + test Xgood-1-lzma2-1.xz = X- < + for file in '"$@"' < + test Xgood-2-lzma2.xz = X- < + xz1='xz --format=auto' < + xz2='xz --format=auto' --- > + cmp=diff -- > + test Xfiles/good-1-check-crc32.xz = X- > + > + test Xfiles/good-2-lzma2.xz = X- > + > + xz1=xz --format=auto > + xz2=xz --format=auto 33,37c31 < + case $1 in < + case $2 in < + case $1 in < + case "$2" in < + test good-1-lzma2-1.xzgood-2-lzma2.xz = -- --- > + test files/good-1-check-crc32.xzfiles/good-2-lzma2.xz = -- 38a33 > + eval diff -- /dev/fd/5 - 40,51c35,44 < + eval 'diff --' /dev/fd/5 - < ++ exec < ++ xz --format=auto -cdfq -- good-1-lzma2-1.xz < ++ xz --format=auto -cdfq -- good-2-lzma2.xz < ++ eval 'diff --' /dev/fd/5 - < +++ diff -- /dev/fd/5 - < ++ echo 0 < ++ echo 0 < + xz_status='0 < 0' < + cmp_status=1 < + case $xz_status in --- > + exec > + xz --format=auto -cdfq -- files/good-1-check-crc32.xz > + eval diff -- /dev/fd/5 - > + diff -- /dev/fd/5 - > + xz --format=auto -cdfq -- files/good-2-lzma2.xz > + echo 0 > + echo 0 > + xz_status=0 > 0 > + cmp_status=0 53,54c46,47 < + exit 1 < + cmp_status=1 --- > + exit 0 > + cmp_status=0 56c49 < + exit 1 --- > + exit 0 On Tue, Jun 30, 2015 at 9:20 AM, Michael Fox <415fox@gmail.com> wrote: > I have to admit the xzdiff script is a little beyond me but the way xzdiff > fails is you compare two different files and it just returns 0 as if they > were the same. I think the easiest way to see it is to download an alpine > linux live CD: > > http://alpinelinux.org/downloads/ > > To make it run in a VM takes just a few minutes. Here is complete steps to > make it simple as possible: > > In virtualbox create a new VM, Type: Linux, Version: Linux 2.6 (64 bit); > Memory 4096; Do not add a virtual hard drive; Start, select the alpine iso; > > Login: root > setup-interfaces (enter, enter, enter) > ifup eth0 > setup-dns (enter, enter) > setup-apkrepos (enter) > apk add alpine-sdk > wget http://tukaani.org/xz/xz-5.2.1.tar.gz > tar xf xz-5.2.1.tar.gz > cd xz-5.2.1 > ./configure > make && make check > > > On Tue, Jun 30, 2015 at 8:38 AM, Lasse Collin > wrote: > >> On 2015-06-29 Michael Fox wrote: >> > > I found this by running make check. It's probably due to xzdiff >> > > being a shell script with some hair regexs and musl having some >> > > regex incompatibilities in the name of standards compliance. >> >> Thanks. It wouldn't be a surprise if xzdiff (or xzgrep) has a bug. A >> little more information would be useful to find out what exactly is >> causing a problem. :-) I already checked for \+ or + in regexes and >> there are none in xzdiff or xzgrep. >> >> -- >> Lasse Collin | IRC: Larhzu @ IRCnet & Freenode >> > > > > -- > > - > Michael > -- - Michael --001a11c1c9242c8ac20519bfdea5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Here is a diff of the command: /bin/sh -x xzdiff= good-1-lzma2-1.xz good-2-lzma2.xz 2>good.out

diff good.out= bad.out

where the bad version comes from alpine:

< + xz=3D'xz --format=3Dauto'
---
> + xz=3Dxz --fo= rmat=3Dauto
3d2
< + case ${0##*/} in
6,7c5,6
< + version= =3D'xzdiff (XZ Utils) 5.1.0alpha'
< + usage=3D'Usage: xzd= iff [OPTION]... FILE1 [FILE2]
---
> + version=3Dxzdiff (XZ Utils) = 5.2.1
> + usage=3DUsage: xzdiff [OPTION]... FILE1 [FILE2]
12c11,16=
< Do comparisons like '\''diff'\'' does.=C2= =A0 OPTIONs are the same as for '\''diff'\''.
--= -
> Do comparisons like 'diff' does.=C2=A0 OPTIONs are the sa= me as for 'diff'.
>
> Report bugs to <lasse.collin@tukaani.org>.
> + = escape=3D
>=C2=A0=C2=A0 s/'/'\\''/g
>=C2=A0=C2= =A0 $s/X$/'/
14,18d17
< Report bugs to <lasse.collin@tukaani.org>.'
< + e= scape=3D'
<=C2=A0=C2=A0 s/'\''/'\''\\'= ;\'''\''/g
<=C2=A0=C2=A0 $s/X$/'\''/<= br>< '
20d18
< + case $1 in
22,28c20,26
< + cmp=3D= 'diff --'
< + for file in '"$@"'
< + = test Xgood-1-lzma2-1.xz =3D X-
< + for file in '"$@"= 9;
< + test Xgood-2-lzma2.xz =3D X-
< + xz1=3D'xz --format= =3Dauto'
< + xz2=3D'xz --format=3Dauto'
---
> + = cmp=3Ddiff --
> + test Xfiles/good-1-check-crc32.xz =3D X-
> + =
> + test Xfiles/good-2-lzma2.xz =3D X-
> +
> + xz1=3Dxz= --format=3Dauto
> + xz2=3Dxz --format=3Dauto
33,37c31
< + c= ase $1 in
< + case $2 in
< + case $1 in
< + case "$2= " in
< + test good-1-lzma2-1.xzgood-2-lzma2.xz =3D --
---
= > + test files/good-1-check-crc32.xzfiles/good-2-lzma2.xz =3D --
38a3= 3
> + eval diff -- /dev/fd/5 -
40,51c35,44
< + eval 'dif= f --' /dev/fd/5 -
< ++ exec
< ++ xz --format=3Dauto -cdfq -= - good-1-lzma2-1.xz
< ++ xz --format=3Dauto -cdfq -- good-2-lzma2.xz<= br>< ++ eval 'diff --' /dev/fd/5 -
< +++ diff -- /dev/fd/5= -
< ++ echo 0
< ++ echo 0
< + xz_status=3D'0
<= 0'
< + cmp_status=3D1
< + case $xz_status in
---
>= ; + exec
> + xz --format=3Dauto -cdfq -- files/good-1-check-crc32.xz<= br>> + eval diff -- /dev/fd/5 -
> + diff -- /dev/fd/5 -
> + = xz --format=3Dauto -cdfq -- files/good-2-lzma2.xz
> + echo 0
> = + echo 0
> + xz_status=3D0
> 0
> + cmp_status=3D0
53,5= 4c46,47
< + exit 1
< + cmp_status=3D1
---
> + exit 0> + cmp_status=3D0
56c49
< + exit 1
---
> + exit 0

On Tue, Jun 30, 2015 at 9:20 AM, Michael Fox <<= a href=3D"mailto:415fox@gmail.com" target=3D"_blank">415fox@gmail.com&g= t; wrote:
I have to admit the xzdiff script is a little beyond me but th= e way xzdiff fails is you compare two different files and it just returns 0= as if they were the same. I think the easiest way to see it is to download= =C2=A0 an alpine linux live CD:

http://alpinelinux.org/downloads/

To make it run in a VM takes just a few minutes. Here is complete steps= to make it simple as possible:

In virtualbox create a new VM,= Type: Linux, Version: Linux 2.6 (64 bit); Memory 4096; Do not add a virtua= l hard drive; Start, select the alpine iso;

Login: root
setup-interfaces (enter, enter, enter)
ifup eth0
<= /div>
setup-dns (enter, enter)
setup-apkrepos (enter)
=
apk add alpine-sdk
tar xf xz-5.2.1.tar.gz
cd xz-5.2.1
=
./configure
make && make check


On Tue, Jun 30, 2015 at 8:38 AM, Lasse Collin <lasse.= collin@tukaani.org> wrote:
= On 2015-06-29 Michael Fox wrote:
> > I found this by running make check. It's probably due to xzdi= ff
> > being a shell script with some hair regexs and musl having some > > regex incompatibilities in the name of standards compliance.

Thanks. It wouldn't be a surprise if xzdiff (or xzgrep) has a bu= g. A
little more information would be useful to find out what exactly is
causing a problem. :-) I already checked for \+ or + in regexes and
there are none in xzdiff or xzgrep.

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



--

-
Michael



--

-
Michael
--001a11c1c9242c8ac20519bfdea5-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---