I could do an RPM version check before doing rpm -L, would that be
acceptable?
Thanks,
--
Michel
On Tue Feb 03 2015 at 6:46:14 PM Stanislav Ochotnicky <
sochotnicky(a)redhat.com> wrote:
As with several other patches wrt %license flag the problem is that this
is really new rpm feature and rpm in EPEL 6 doesn't support it (-L
switch)
One option would be to say we drop support for EPEL which I personally
wouldn't mind but there were different opinions on the topic...
On Tue 03 Feb 2015 10:36:31 AM CET Michel Alexandre Salim wrote:
> Dear Fedora Review developers,
>
> When conducting a review I noticed that specs that use the new %license
tag
> to mark the license file get flagged as not having a license text by
> fedora-review -- this is, as it turns out, because RPM's -d flag does not
> display files tagged as licenses; one needs the exclusive -L flag to
> display that.
>
> This patch runs rpm twice, once with -d and once with -L, and collect the
> candidate files from both runs. It also drops the redundant -l which both
> -d and -L imply.
>
> As tested with:
>
https://bugzilla.redhat.com/show_bug.cgi?id=1173159
>
> Reference:
> FPC proposal for using %license instead of %doc
>
https://fedorahosted.org/fpc/ticket/411
>
> RPM %license tag handling
>
http://www.rpm.org/ticket/116
>
> Best regards,
>
> --
> Michel Alexandre Salim
> Fedora Project Contributor (FAS: salimma, IRC: michel_slm)
> From 8dd17ef2f1d6a2c2a9cbfc05f5fb0c6d34eff8b0 Mon Sep 17 00:00:00 2001
> From: Michel Alexandre Salim <salimma(a)fedoraproject.org>
> Date: Tue, 3 Feb 2015 15:39:24 +0700
> Subject: [PATCH] Adjust license checker to take into account new-style
> %license files
>
> Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
> ---
> plugins/generic.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/plugins/generic.py b/plugins/generic.py
> index dfbf0b6..8fd3b79 100644
> --- a/plugins/generic.py
> +++ b/plugins/generic.py
> @@ -769,9 +769,10 @@ class CheckLicensInDoc(GenericCheckBase):
> for pkg in self.spec.packages:
> nvr = self.spec.get_package_nvr(pkg)
> rpm_path = Mock.get_package_rpm_path(nvr)
> - cmd = 'rpm -qldp ' + rpm_path
> - doclist = check_output(cmd.split())
> - docs.extend(doclist.split())
> + for flag in ('d', 'L'):
> + cmd = 'rpm -qp%s %s' % (flag, rpm_path)
> + doclist = check_output(cmd.split())
> + docs.extend(doclist.split())
> docs = map(lambda f: f.split('/')[-1], docs)
>
> for _license in licenses:
> --
> 2.1.0
>
> _______________________________________________
> fedorareview mailing list
> fedorareview(a)lists.fedorahosted.org
>
https://lists.fedorahosted.org/mailman/listinfo/fedorareview
--
Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Business System Analyst, Hosted and Shared Services (HSS)
PGP: 7B087241
Red Hat Inc.
http://cz.redhat.com