Subject: Re: bug#24737: `guix lint` should not check patch-file-names on inherited sources

From: Marius Bakke <[email-masked]>
Date: Sat, 22 Oct 2016 20:07:15 +0100

Marius Bakke <[email-masked]> writes:

> Ludovic Courtès <[email-masked]> writes:
>
>> Marius Bakke <[email-masked]> skribis:
>>
>>> After patching 'notmuch', `guix lint -c patch-file-names` does not pass
>>> for 'python-notmuch' which inherits the source from 'notmuch'.
>>
>> I agree but that’s not quite possible: the “inheritance” relation (which
>> is really just a copy of a record) is not known at run time.
>>
>> So we’d need another trick to guess whether a patch is coming from
>> elsewhere and should consequently be ignored by ‘lint’.
>
> Here is a "RFC" patch that thwarts the warning if the source file name
> is different from the package name. Not sure how to properly make it
> part of the procedure, so that the checks are actually skipped as well.

I just realized this approach will skip this check completely, if there
are no packages that are named the same as origin (e.g. in the case of
the soon-to-be-added avro, where the source is shared between the
various avro-{c,python,java} etc packages.)

The best approach is probably to check patch-file-names against
(origin-actual-file-name (package-source package)), assuming one can
extract the "base" name of origin-actual-file-name reliably.