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',
|
POSTIN => 'postinst',
|
||||||
PREUN => 'prerm',
|
PREUN => 'prerm',
|
||||||
POSTUN => 'postrm',
|
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.
|
# Use --queryformat to pull out all the fields we need.
|
||||||
foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT
|
foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT
|
||||||
SUMMARY DESCRIPTION COPYRIGHT PREFIXES},
|
SUMMARY DESCRIPTION PREFIXES},
|
||||||
keys(%fieldtrans)) {
|
keys(%fieldtrans)) {
|
||||||
my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file");
|
my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file");
|
||||||
my $key;
|
my $key;
|
||||||
@@ -122,12 +123,18 @@ sub scan {
|
|||||||
$this->summary('Converted RPM package');
|
$this->summary('Converted RPM package');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $this->copyright) {
|
|
||||||
$this->copyright('unknown');
|
|
||||||
}
|
|
||||||
if (! $this->description) {
|
if (! $this->description) {
|
||||||
$this->description($this->summary);
|
$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 ||
|
if (! $this->release || ! $this->version ||
|
||||||
! $this->name) {
|
! $this->name) {
|
||||||
die "Error querying rpm file";
|
die "Error querying rpm file";
|
||||||
|
|||||||
Reference in New Issue
Block a user