diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-14 10:24:43 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-14 10:24:43 +0000 |
commit | 4ccfb57bdeef84f71e8e9e4d961e7379cf983205 (patch) | |
tree | a74f20da3eded0935a5bebab97502ab5cf87b195 /packdrake.pm | |
parent | 4e81102894db4d46909f480705890863f45e0d7d (diff) | |
download | rpmtools-4ccfb57bdeef84f71e8e9e4d961e7379cf983205.tar rpmtools-4ccfb57bdeef84f71e8e9e4d961e7379cf983205.tar.gz rpmtools-4ccfb57bdeef84f71e8e9e4d961e7379cf983205.tar.bz2 rpmtools-4ccfb57bdeef84f71e8e9e4d961e7379cf983205.tar.xz rpmtools-4ccfb57bdeef84f71e8e9e4d961e7379cf983205.zip |
extract_archive() should do nothing in no files are specified.
Add an extract_all_archive function.
Diffstat (limited to 'packdrake.pm')
-rw-r--r-- | packdrake.pm | 15 |
1 files 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<packdrake::list_archive(@list)> List files packed into achives given. |