--- Begin Message ---
Subject: |
[PATCH] Fix bzip2 utilities |
Date: |
Mon, 1 May 2017 10:49:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
The bzip2 package includes wrappers around diff, grep and less/more.
These shell scripts currently include /usr/bin (and sometimes /bin) on
the PATH, and therefore fail if any of the commands that they rely on
cannot be found.
By substituting /usr/bin (and /bin) for the appropriate package paths,
these scripts work much more reliably.
I had some issues with bzmore which uses more from util-linux, I think
there might be a circular dependency in the Guix package tree, as I get
a VM stack overflow when including util-linux as a input to bzip2.
Note that as the bzip2 package is used by so many other packages, any
non-superficial change to it probably means rebuilding the world.
Below is a script, and two invocations of it, showing first what happens
with the unaltered package, and then the package with the modifications
I describe above.
#!/bin/sh
set -x
bzip2 < /etc/shells > shells.bz2
bzcmp shells.bz2 shells.bz2
bzdiff shells.bz2 shells.bz2
bzegrep bash shells.bz2
bzfgrep bash shells.bz2
bzgrep bash shells.bz2
bzless shells.bz2
bzmore shells.bz2
→ PATH=/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin
./test.sh
+ bzip2
+ bzcmp shells.bz2 shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzcmp: line
16: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzcmp: line
40: mktemp: command not found
cannot create a temporary file
+ bzdiff shells.bz2 shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzdiff: line
16: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzdiff: line
40: mktemp: command not found
cannot create a temporary file
+ bzegrep bash shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzegrep:
line 11: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzegrep:
line 43: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzegrep:
line 63: grep: command not found
+ bzfgrep bash shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzfgrep:
line 11: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzfgrep:
line 43: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzfgrep:
line 63: grep: command not found
+ bzgrep bash shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzgrep: line
11: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzgrep: line
43: sed: command not found
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzgrep: line
63: grep: command not found
+ bzless shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzless: line
8: sed: command not found
------> shells.bz2 <------
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzless: line
55: more: command not found
+ bzmore shells.bz2
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzmore: line
8: sed: command not found
------> shells.bz2 <------
/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6/bin/bzmore: line
55: more: command not found
→ PATH=/gnu/store/i3zkljbz6ryqdlfc9gnpcjg964inp9l3-bzip2-1.0.6/bin
./test.sh
+ bzip2
+ bzcmp shells.bz2 shells.bz2
+ bzdiff shells.bz2 shells.bz2
+ bzegrep bash shells.bz2
/run/current-system/profile/bin/bash
/gnu/store/nylrl843mkfdwzz8cd5iabsib37vqc1j-bash-4.4.A/bin/bash
+ bzfgrep bash shells.bz2
/run/current-system/profile/bin/bash
/gnu/store/nylrl843mkfdwzz8cd5iabsib37vqc1j-bash-4.4.A/bin/bash
+ bzgrep bash shells.bz2
/run/current-system/profile/bin/bash
/gnu/store/nylrl843mkfdwzz8cd5iabsib37vqc1j-bash-4.4.A/bin/bash
+ bzless shells.bz2
------> shells.bz2 <------
+ bzmore shells.bz2
------> shells.bz2 <------
/gnu/store/i3zkljbz6ryqdlfc9gnpcjg964inp9l3-bzip2-1.0.6/bin/bzmore: line
55: more: command not found
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#26730: [PATCH] gnu: bzip2: Patch bzip2 utilities. |
Date: |
Wed, 17 May 2017 16:58:46 +0200 |
User-agent: |
Notmuch/0.24.1 (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) |
Christopher Baines <address@hidden> writes:
> On 15/05/17 16:46, Marius Bakke wrote:
>> Christopher Baines <address@hidden> writes:
>>
>>> * gnu/packages/compression.scm (bzip2)[arguments]: Add patch-script phase to
>>> remove absolute reference to /bin/rm.
>>
>> Thanks for catching this! (substitute* ...) has an unspecified return
>> value, so I'll add a #t at the end of this new phase before pushing.
>>
>> Waiting for feedback on the modify-phases patch first. We still have
>> ~two weeks until core-updates starts rolling again, so no rush ;-)
>
> I've resent the patches with these changes, just in case that helps.
Pushed to 'core-updates', thank you! Note: I squashed the first two.
signature.asc
Description: PGP signature
--- End Message ---