aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-14 10:24:43 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-14 10:24:43 +0000
commit4ccfb57bdeef84f71e8e9e4d961e7379cf983205 (patch)
treea74f20da3eded0935a5bebab97502ab5cf87b195
parent4e81102894db4d46909f480705890863f45e0d7d (diff)
downloadrpmtools-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.
-rw-r--r--packdrake.pm15
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.