Mail archive
alpine-devel

[alpine-devel] Re: xzdiff in xz package is broken on alpine linux

From: Michael Fox <415fox_at_gmail.com>
Date: Tue, 30 Jun 2015 10:52:20 -0700

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 <lasse.collin_at_tukaani.org>.
> + escape=
>   s/'/'\\''/g
>   $s/X$/'/
14,18d17
< Report bugs to <lasse.collin_at_tukaani.org>.'
< + escape='
<   s/'\''/'\''\\'\'''\''/g
<   $s/X$/'\''/
< '
20d18
< + case $1 in
22,28c20,26
< + cmp='diff --'
< + for file in '"$_at_"'
< + test Xgood-1-lzma2-1.xz = X-
< + for file in '"$_at_"'
< + 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_at_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 <lasse.collin_at_tukaani.org>
> 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 _at_ IRCnet & Freenode
>>
>
>
>
> --
>
> -
> Michael
>
-- 
-
Michael
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Tue Jun 30 2015 - 10:52:20 GMT