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 5E8ECDC49EE for ; Tue, 30 Jun 2015 17:59:24 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 35833DC1C04 for ; Tue, 30 Jun 2015 17:59:24 +0000 (UTC) Received: by oiax193 with SMTP id x193so13476421oia.2 for ; Tue, 30 Jun 2015 10:59:23 -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=ezMn5HpS1jxYeE8SixFDXhF/4zfOdcY0YC76NXXVWs0=; b=0UMxMTot30Muf7hf88SRiwJaFB8aze/njHSsF/tWevcBjEXoC6ETrc6raJGpQQwZ/g rT+CwrfmrYO1C+GsHMtJmRoHJ4PDgxpVQUK4PZafNvasdKnqKV6uthQiidf8qE6lfLOC yiK155v4enCkwcMez+MGbMwkhDnq0CqQJa+D6YJ2ue14aCsXBaNAOdzOUwYL+K420iNI k6pdRcEwLQsCeisahgwW3awLVN2n2c6snix+rh9xOvCjAIQlVeZ3vZDue1sY7cAvtZfD OwzVF9dF4HCJJJsP40zqNdzA3HlX0ns3ZXtGWKTkazsIpgw5GfbDt4cvNQ9BWEqiyHbU blpQ== 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.121.134 with SMTP id lk6mr17778825obb.51.1435687163560; Tue, 30 Jun 2015 10:59:23 -0700 (PDT) Received: by 10.76.70.199 with HTTP; Tue, 30 Jun 2015 10:59:23 -0700 (PDT) In-Reply-To: References: <20150630183840.543112f7@tukaani.org> Date: Tue, 30 Jun 2015 10:59:23 -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=089e01536a586495790519bff718 X-Virus-Scanned: ClamAV using ClamSMTP --089e01536a586495790519bff718 Content-Type: text/plain; charset=UTF-8 Sorry. I got it wrong. Here is a more exact comparison: diff ubuntu.out ~/alpine.out 1c1 < + 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,23c20 < + cmp='diff --' < + for file in '"$@"' --- > + cmp=diff -- 25c22 < + for file in '"$@"' --- > + 27,28c24,26 < + xz1='xz --format=auto' < + xz2='xz --format=auto' --- > + > + xz1=xz --format=auto > + xz2=xz --format=auto 33,36d30 < + case $1 in < + case $2 in < + case $1 in < + case "$2" in 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 -- good-1-lzma2-1.xz > + eval diff -- /dev/fd/5 - > + diff -- /dev/fd/5 - > + xz --format=auto -cdfq -- 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 10:52 AM, Michael Fox <415fox@gmail.com> wrote: > 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 > -- - Michael --089e01536a586495790519bff718 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry. I got it wrong. Here is a more exact comparison:
diff ubuntu.out ~/alpine.out
1c1
< + xz=3D'xz --format= =3Dauto'
---
> + xz=3Dxz --format=3Dauto
3d2
< + case= ${0##*/} in
6,7c5,6
< + version=3D'xzdiff (XZ Utils) 5.1.0alp= ha'
< + usage=3D'Usage: xzdiff [OPTION]... FILE1 [FILE2]
-= --
> + version=3Dxzdiff (XZ Utils) 5.2.1
> + usage=3DUsage: xzd= iff [OPTION]... FILE1 [FILE2]
12c11,16
< Do comparisons like '= \''diff'\'' does.=C2=A0 OPTIONs are the same as for = 9;\''diff'\''.
---
> Do comparisons like '= diff' does.=C2=A0 OPTIONs are the same as for 'diff'.
> <= br>> Report bugs to <lass= e.collin@tukaani.org>.
> + escape=3D
>=C2=A0=C2=A0 s/= 9;/'\\''/g
>=C2=A0=C2=A0 $s/X$/'/
14,18d17
<= Report bugs to <lasse.colli= n@tukaani.org>.'
< + escape=3D'
<=C2=A0=C2=A0 s/= '\''/'\''\\'\'''\''/g
&l= t;=C2=A0=C2=A0 $s/X$/'\''/
< '
20d18
< + cas= e $1 in
22,23c20
< + cmp=3D'diff --'
< + for file in= '"$@"'
---
> + cmp=3Ddiff --
25c22
< += for file in '"$@"'
---
> +
27,28c24,26
&= lt; + xz1=3D'xz --format=3Dauto'
< + xz2=3D'xz --format= =3Dauto'
---
> +
> + xz1=3Dxz --format=3Dauto
> += xz2=3Dxz --format=3Dauto
33,36d30
< + case $1 in
< + case $= 2 in
< + case $1 in
< + case "$2" in
38a33
>= + eval diff -- /dev/fd/5 -
40,51c35,44
< + eval 'diff --'= /dev/fd/5 -
< ++ exec
< ++ xz --format=3Dauto -cdfq -- good-1-= lzma2-1.xz
< ++ xz --format=3Dauto -cdfq -- good-2-lzma2.xz
< += + 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<= br>> + xz --format=3Dauto -cdfq -- good-1-lzma2-1.xz
> + eval diff= -- /dev/fd/5 -
> + diff -- /dev/fd/5 -
> + xz --format=3Dauto = -cdfq -- good-2-lzma2.xz
> + echo 0
> + echo 0
> + xz_sta= tus=3D0
> 0
> + cmp_status=3D0
53,54c46,47
< + exit 1<= br>< + cmp_status=3D1
---
> + exit 0
> + cmp_status=3D056c49
< + exit 1
---
> + exit 0


On Tue, Jun 30, 2015 at 10:52 = AM, Michael Fox <415fox@gmail.com> wrote:
Here is a diff of the command: /b= in/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 alpin= e:

< + xz=3D'xz --format=3Dauto'
---
>= + xz=3Dxz --format=3Dauto
3d2
< + case ${0##*/} in
6,7c5,6
= < + version=3D'xzdiff (XZ Utils) 5.1.0alpha'
< + usage=3D&= #39;Usage: xzdiff [OPTION]... FILE1 [FILE2]
---
> + version=3Dxzdi= ff (XZ Utils) 5.2.1
> + usage=3DUsage: xzdiff [OPTION]... FILE1 [FILE= 2]
12c11,16
< Do comparisons like '\''diff'\'&= #39; does.=C2=A0 OPTIONs are the same as for '\''diff'\'= ;'.
---
> Do comparisons like 'diff' does.=C2=A0 OPTIO= Ns are the same 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 b= ugs to <la= sse.collin@tukaani.org>.'
< + escape=3D'
<=C2=A0= =C2=A0 s/'\''/'\''\\'\'''\''= ;/g
<=C2=A0=C2=A0 $s/X$/'\''/
< '
20d18
&= lt; + case $1 in
22,28c20,26
< + cmp=3D'diff --'
< += for file in '"$@"'
< + test Xgood-1-lzma2-1.xz =3D= X-
< + for file in '"$@"'
< + test Xgood-2-l= zma2.xz =3D X-
< + xz1=3D'xz --format=3Dauto'
< + xz2= =3D'xz --format=3Dauto'
---
> + cmp=3Ddiff --
> + te= st Xfiles/good-1-check-crc32.xz =3D X-
> +
> + test Xfiles/goo= d-2-lzma2.xz =3D X-
> +
> + xz1=3Dxz --format=3Dauto
> += xz2=3Dxz --format=3Dauto
33,37c31
< + case $1 in
< + case $= 2 in
< + case $1 in
< + case "$2" in
< + test g= ood-1-lzma2-1.xzgood-2-lzma2.xz =3D --
---
> + test files/good-1-c= heck-crc32.xzfiles/good-2-lzma2.xz =3D --
38a33
> + eval diff -- /= dev/fd/5 -
40,51c35,44
< + eval 'diff --' /dev/fd/5 -
&= lt; ++ exec
< ++ xz --format=3Dauto -cdfq -- good-1-lzma2-1.xz
<= ; ++ xz --format=3Dauto -cdfq -- good-2-lzma2.xz
< ++ eval 'diff = --' /dev/fd/5 -
< +++ diff -- /dev/fd/5 -
< ++ echo 0
&l= t; ++ echo 0
< + xz_status=3D'0
< 0'
< + cmp_stat= us=3D1
< + case $xz_status in
---
> + exec
> + xz --fo= rmat=3Dauto -cdfq -- files/good-1-check-crc32.xz
> + eval diff -- /de= v/fd/5 -
> + diff -- /dev/fd/5 -
> + xz --format=3Dauto -cdfq -= - files/good-2-lzma2.xz
> + echo 0
> + echo 0
> + xz_stat= us=3D0
> 0
> + cmp_status=3D0
53,54c46,47
< + exit 1< + cmp_status=3D1
---
> + exit 0
> + cmp_status=3D056c49
< + exit 1
---
> + exit 0


On Tue, Jun 30, 2015 at 9:20 AM, Michael Fox <415fox@gmail.com><= /span> wrote:
=
I have to admit the xzdiff script is a little beyond me but the w= ay 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, Ty= pe: Linux, Version: Linux 2.6 (64 bit); Memory 4096; Do not add a virtual h= ard 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
tar xf xz-5.2.1.tar.gz
cd xz-5.2.1
./configure
make && make check

<= /div>

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



--

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