aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rpmtools.pm')
-rw-r--r--rpmtools.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/rpmtools.pm b/rpmtools.pm
index a3655d2..ac9b9ea 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -146,8 +146,10 @@ sub build_hdlist {
foreach (@rpms) {
my ($key) = /([^\/]*)\.rpm$/ or next; #- get rpm filename.
- system("rpm2header '$_' > '$dir/$key'") unless -s "$dir/$key";
- $? == 0 or unlink("$dir/$key"), die "bad rpm $_\n";
+ unless (-s "$dir/$key") {
+ system("rpm2header '$_' > '$dir/$key'");
+ $? == 0 or unlink("$dir/$key"), die "bad rpm $_\n";
+ }
-s "$dir/$key" or unlink("$dir/$key"), die "bad rpm $_\n";
my ($name, $version, $release, $arch) = $key =~ /(.*)-([^-]*)-([^-]*)\.([^\.]*)$/;