Fix if conditions in sanity checks: if a field was not found it is defined, but it is empty

This commit is contained in:
Alexey Khoroshilov
2010-04-16 23:29:56 -07:00
committed by Joey Hess
parent f581595af6
commit 6049930109

View File

@@ -111,7 +111,7 @@ sub scan {
}
# Sanity check and sanitize fields.
unless (defined $this->summary) {
if (! $this->summary) {
# Older rpms will have no summary, but will have a
# description. We'll take the 1st line out of the
# description, and use it for the summary.
@@ -122,14 +122,14 @@ sub scan {
$this->summary('Converted RPM package');
}
}
unless (defined $this->copyright) {
if (! $this->copyright) {
$this->copyright('unknown');
}
unless (defined $this->description) {
if (! $this->description) {
$this->description($this->summary);
}
if (! defined $this->release || ! defined $this->version ||
! defined $this->name) {
if (! $this->release || ! $this->version ||
! $this->name) {
die "Error querying rpm file";
}