mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
RPM Copyright tag has been deprecated in favour of License tag since rpm 4.0
This commit is contained in:
committed by
Joey Hess
parent
6049930109
commit
2f50988983
@@ -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,12 +123,18 @@ sub scan {
|
||||
$this->summary('Converted RPM package');
|
||||
}
|
||||
}
|
||||
if (! $this->copyright) {
|
||||
$this->copyright('unknown');
|
||||
}
|
||||
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->release || ! $this->version ||
|
||||
! $this->name) {
|
||||
die "Error querying rpm file";
|
||||
|
||||
Reference in New Issue
Block a user