RPM Copyright tag has been deprecated in favour of License tag since rpm 4.0

This commit is contained in:
Alexey Khoroshilov
2010-04-16 23:35:45 -07:00
committed by Joey Hess
parent 6049930109
commit 2f50988983

View File

@@ -76,11 +76,12 @@ sub scan {
POSTIN => 'postinst',
PREUN => 'prerm',
POSTUN => 'postrm',
LICENSE => 'copyright', # RPM Copyright tag has been deprecated in favour of License tag since rpm 4.0
);
# Use --queryformat to pull out all the fields we need.
foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT
SUMMARY DESCRIPTION COPYRIGHT PREFIXES},
SUMMARY DESCRIPTION PREFIXES},
keys(%fieldtrans)) {
my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file");
my $key;
@@ -122,11 +123,17 @@ sub scan {
$this->summary('Converted RPM package');
}
}
if (! $this->description) {
$this->description($this->summary);
}
if (! $this->copyright) {
# Older rpms have no licence tag, but have a copyright.
$this->copyright($this->runpipe(0, "LANG=C rpm -qp --queryformat \%{COPYRIGHT} $file"));
# Fallback.
if (! $this->copyright) {
$this->copyright('unknown');
}
if (! $this->description) {
$this->description($this->summary);
}
if (! $this->release || ! $this->version ||
! $this->name) {