Bug 25164 - bzgrep no longer handles multiple archives
Summary: bzgrep no longer handles multiple archives
Status: RESOLVED WORKSFORME
Alias: None
Product: bzip2
Classification: Unclassified
Component: bzip2 (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-05 17:33 UTC by Bill Cole
Modified: 2021-04-17 07:07 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2021-04-11 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Cole 2019-11-05 17:33:39 UTC

    
Comment 1 Bill Cole 2019-11-05 17:38:44 UTC
Since the change at https://sourceware.org/git/?p=bzip2.git;a=commit;f=bzgrep;h=d0b47bde0e2f5bae7502ca55b80ab006523db820 released with 1.0.8, running bzgrep with a list of files only searched the first file. e.g.:

$ bzgrep foo /tmp/{3,2,1,0}.bz2
/tmp/3.bz2:foo
$ for x in {3..0} ; do printf "/tmp/$x.bz2: " ;bzgrep foo /tmp/$x.bz2; done
/tmp/3.bz2: foo
/tmp/2.bz2: foo
/tmp/1.bz2: foo
/tmp/0.bz2: foo
Comment 2 Mark Wielaard 2020-05-17 12:39:27 UTC
Hi Bill,

Could you give some more information about your setup?
Which system are you running this on? What does /bin/sh point to?

It does seem to work for me as intended:
$ ~/src/bzip2/bzgrep foo /tmp/bar{0,1,2,3}.bz2
/tmp/bar0.bz2:foo
/tmp/bar1.bz2:foo
/tmp/bar2.bz2:foo
/tmp/bar3.bz2:foo

That is on both a system that has /bin/sh point to bash and on one that has /bin/sh point to dash.

Thanks,

Mark
Comment 3 Bill Cole 2021-04-17 07:07:39 UTC
I apologize for the noise and the slow response. 

The original failure was on a MacOS X 10.6.8 system where /bin/sh was a bespoke build of bash 5.0.11, based on the MacPorts configuration but with all libraries other than Apple's libSystem statically linked. 

I am no longer able to reproduce this issue, despite retrieving old shell histories and versions of bzgrep from backups. I am unable to reproduce the environment and shell options, so I have to conclude that the issue was grounded in some ephemeral configuration that was in effect at that time but I have not been able to replicate now. It does not help that I apparently had at that time at least 4 different scripts named 'bzgrep' which seem to have descended from at least 2 different original sources.