From 4ccfb57bdeef84f71e8e9e4d961e7379cf983205 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 14 Dec 2004 10:24:43 +0000 Subject: extract_archive() should do nothing in no files are specified. Add an extract_all_archive function. --- packdrake.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packdrake.pm b/packdrake.pm index f6f63e1..b8a77d7 100644 --- a/packdrake.pm +++ b/packdrake.pm @@ -36,13 +36,16 @@ sub new { sub extract_archive { my ($pack, $dir, @files) = @_; - if (! scalar(@files)) { - my ($d, $f, $l) = $pack->getcontent(); - push(@files, @$d, @$f, @$l); - } + @files or return; $pack->extract($dir, @files); } +sub extract_all_archive { + my ($pack, $dir) = @_; + my ($d, $f, $l) = $pack->getcontent(); + $pack->extract($dir, @$d, @$f, @$l); +} + sub list_archive { foreach my $archive (@_) { my $pack = Packdrakeng->open(archive => $archive) or next; @@ -123,6 +126,10 @@ Return undef on failure. Extract files list into the specified directory. +=item B<< packdrake->extract_all_archive($dir) >> + +Extract all files into the specified directory. + =item B List files packed into achives given. -- cgit v1.2.1