Skip Menu |

This queue is for tickets about the Archive-Extract CPAN distribution.

Report information
The Basics
Id: 78201
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Archive-Extract

People
Owner: Nobody in particular
Requestors: bgp4 [...] rambler.ru
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.78



Subject: Archive::Extract can't find unzip commund under FreeBSD
On FreeBSD there is /usr/bin/unzip command, installed as part of base system. But Archive::Extract ignores this command. Small test: #!/usr/bin/perl use 5.012; use warnings; use Archive::Extract; use IPC::Cmd qw[can_run]; my $ae = Archive::Extract->new( archive => 'ost.zip'); say '$ae->bin_unzip = '.$ae->bin_unzip; say 'IPC::Cmd::can_run = ' . can_run('unzip'); will output: Use of uninitialized value in concatenation (.) or string at ./ttt2.pl line 10. $ae->bin_unzip = IPC::Cmd::can_run = /usr/bin/unzip ---- I use Archive::Extract 0.58 but as I can see from source bug is still here. Why don't just use IPC::Cmd::can_run result in Archive::Extract?
Subject: Re: [rt.cpan.org #78201] Archive::Extract can't find unzip commund under FreeBSD
Date: Wed, 4 Jul 2012 16:27:20 +0100
To: "http://ospf-ripe.livejournal.com/ via RT" <bug-Archive-Extract [...] rt.cpan.org>
From: "Chris 'BinGOs' Williams" <chris [...] bingosnet.co.uk>
On Wed, Jul 04, 2012 at 09:34:21AM -0400, http://ospf-ripe.livejournal.com/ via RT wrote: Show quoted text
> Wed Jul 04 09:34:20 2012: Request 78201 was acted upon. > Transaction: Ticket created by http://ospf-ripe.livejournal.com/ > Queue: Archive-Extract > Subject: Archive::Extract can't find unzip commund under FreeBSD > Broken in: (no value) > Severity: Normal > Owner: Nobody > Requestors: bgp4@rambler.ru > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78201 > > > > On FreeBSD there is /usr/bin/unzip command, installed as part of base > system. But Archive::Extract ignores this command. > > Small test: > > #!/usr/bin/perl > use 5.012; > use warnings; > > use Archive::Extract; > use IPC::Cmd qw[can_run]; > > my $ae = Archive::Extract->new( archive => 'ost.zip'); > > say '$ae->bin_unzip = '.$ae->bin_unzip; > say 'IPC::Cmd::can_run = ' . can_run('unzip'); > > will output: > Use of uninitialized value in concatenation (.) or string at ./ttt2.pl > line 10. > $ae->bin_unzip = > IPC::Cmd::can_run = /usr/bin/unzip > ---- > I use Archive::Extract 0.58 but as I can see from source bug is still > here. Why don't just use IPC::Cmd::can_run result in Archive::Extract?
This is very deliberate behaviour as the unzip command that has started shipping with FreeBSD (and NetBSD) in /usr/bin is unsuitable for the purposes of Archive::Extract. A::E relies on INFO-Zip unzip's -Z switch for getting a list of the files contained in the archive (unzip -Z -1 <archive>) The FreeBSD and NetBSD unzips do not provide this functionality. (You may though install archive/unzip from ports/pkgsrc which A::E will use). Cheers, -- Chris Williams aka BinGOs PGP ID 0x4658671F http://www.gumbynet.org.uk ==========================
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

Show quoted text
> A::E relies on INFO-Zip unzip's -Z switch for getting a list of the > files contained in the archive (unzip -Z -1 <archive>) >
unzip -Z -1 works under FreeBSD. x0083:~> uname -srp FreeBSD 8.3-STABLE-20120615 amd64 x0083:~> /usr/bin/unzip -Z -1 /usr/local/lib/python2.6/test/zipdir.zip a/ a/b/ a/b/c ---- Anyway /usr/bin/unzip is better than nothing. If boot /usr/local/bin/zip and /usr/bin/unzip than /usr/local/bin/zip can be preferred over /usr/bin.
For what it's worth, recent (i.e. supported: 7.x, 8.x, 9.x[0]) versions of FreeBSD ship with a /usr/bin/tar linked to libarchive which is fully capable of reading, listing, and extracting zip archives. If you're not running an ancient version of FreeBSD, you can assume /usr/bin/tar (with tar-like options) can do what you need. [0] Maybe even 6.x but no guarantees there
Subject: Re: [rt.cpan.org #78201] Archive::Extract can't find unzip commund under FreeBSD
Date: Fri, 6 Jul 2012 23:39:03 +0100
To: "http://ospf-ripe.livejournal.com/ via RT" <bug-Archive-Extract [...] rt.cpan.org>
From: "Chris 'BinGOs' Williams" <chris [...] bingosnet.co.uk>
On Fri, Jul 06, 2012 at 04:59:25AM -0400, http://ospf-ripe.livejournal.com/ via RT wrote: Show quoted text
> Queue: Archive-Extract > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78201 > >
> > A::E relies on INFO-Zip unzip's -Z switch for getting a list of the > > files contained in the archive (unzip -Z -1 <archive>) > >
> > unzip -Z -1 works under FreeBSD. > > x0083:~> uname -srp > FreeBSD 8.3-STABLE-20120615 amd64 > x0083:~> /usr/bin/unzip -Z -1 /usr/local/lib/python2.6/test/zipdir.zip > a/ > a/b/ > a/b/c > > ---- > > Anyway /usr/bin/unzip is better than nothing. > > If boot /usr/local/bin/zip and /usr/bin/unzip than /usr/local/bin/zip > can be preferred over /usr/bin.
If it supports -Z it is INFO-Zip's unzip and FreeBSD do not ship that as /usr/bin/unzip The one they do ship only appeared as /usr/bin/unzip with 9.0 (despite what 'man unzip' reports). $ which unzip /usr/bin/unzip $ unzip -Z -1 unzip: illegal option -- Z usage: unzip [-aCcfjLlnopqtuv] [-d dir] [-x pattern] zipfile $ /usr/local/bin/unzip -Z -1 ZipInfo 3.00 of 20 April 2009, by Greg Roelofs and the Info-ZIP group. List name, date/time, attribute, size, compression method, etc., about files in list (excluding those in xlist) contained in the specified .zip archive(s). "file[.zip]" may be a wildcard name containing *, ?, [] (e.g., "[a-j]*.zip"). usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...] or: unzip -Z [-12smlvChMtTz] file[.zip] [list...] [-x xlist...] main listing-format options: -s short Unix "ls -l" format (def.) -1 filenames ONLY, one per line -m medium Unix "ls -l" format -2 just filenames but allow -h/-t/-z -l long Unix "ls -l" format -v verbose, multi-page format miscellaneous options: -h print header line -t print totals for listed files or for all -z print zipfile comment -T print file times in sortable decimal format -C be case-insensitive -M page output through built-in "more" -x exclude filenames that follow from listing $ uname -a FreeBSD <censored> 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 -- Chris Williams aka BinGOs PGP ID 0x4658671F http://www.gumbynet.org.uk ==========================
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

This issue was resolved with the 0.78 release. From the commit message: Add additional heuristics for unzip on FreeBSD FreeBSD started shipping an unzip with 9.0-RELEASE in /usr/bin That unzip didn't have -Z1 switch. FreeBSD added the -Z switch starting with 9.1-RELEASE, but it was also backported to 8.4-RELEASE. MidnightBSD also appear to have an unzip which supports -Z1 as well since 0.4 Many thanks.
Closing ticket.