aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-16 15:21:55 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-16 15:21:55 +0000
commit8570764842ecbfb67f4b26b953c94eba42f36dbe (patch)
tree42b505438c0a29f0c30846b7d1cab420fbb7dfa4
parent2250a50aba6d1424b252b7395c167f209e3b4afb (diff)
downloadrpmtools-8570764842ecbfb67f4b26b953c94eba42f36dbe.tar
rpmtools-8570764842ecbfb67f4b26b953c94eba42f36dbe.tar.gz
rpmtools-8570764842ecbfb67f4b26b953c94eba42f36dbe.tar.bz2
rpmtools-8570764842ecbfb67f4b26b953c94eba42f36dbe.tar.xz
rpmtools-8570764842ecbfb67f4b26b953c94eba42f36dbe.zip
At least show a warning when an archive can't be found
-rw-r--r--packdrake.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/packdrake.pm b/packdrake.pm
index b8a77d7..c62b805 100644
--- a/packdrake.pm
+++ b/packdrake.pm
@@ -29,8 +29,8 @@ sub new {
my $pack = Packdrakeng->open(
%options,
archive => $file
- ) or return undef;
-
+ ) or do { print STDERR "Can't open $file: $!\n"; return undef };
+ #- rebless
bless($pack, $class);
}
@@ -48,7 +48,10 @@ sub extract_all_archive {
sub list_archive {
foreach my $archive (@_) {
- my $pack = Packdrakeng->open(archive => $archive) or next;
+ my $pack = Packdrakeng->open(archive => $archive) or do {
+ print STDERR "Can't open $archive: $!\n";
+ next;
+ };
$pack->list();
}
}
@@ -73,7 +76,10 @@ sub build_archive {
sub cat_archive {
foreach my $archive (@_) {
- my $pack = Packdrakeng->open(archive => $archive) or next;
+ my $pack = Packdrakeng->open(archive => $archive) or do {
+ print STDERR "Can't open $archive: $!\n";
+ next;
+ };
(undef, my $files, undef) = $pack->getcontent();
foreach (@$files) {
$pack->extract_virtual(\*STDOUT, $_);