[arch-projects] [namcap] [PATCH] makedepends: Make VCS matching more robust

Michael Straube michael.straube at posteo.de
Sun Dec 2 09:25:50 UTC 2018


Am 02.12.18 um 06:04 schrieb Eli Schwartz via arch-projects:
> On 12/1/18 9:54 AM, Michael Straube via arch-projects wrote:
>> If a VCS source is renamed using the "::" syntax the makedepends are not
>> detected. If there are files starting with <name of VCS binary> in the source
>> array false positives are produced. See the gitlab package for example. Make
>> the matching more robust to avoid such issues.
>>
>> Signed-off-by: Michael Straube <michael.straube at posteo.de>
>> ---
>> Perhaps there is a more elegant way?
>>
>>   Namcap/rules/makedepends.py               | 2 +-
>>   Namcap/tests/pkgbuild/test_makedepends.py | 9 ++++++++-
>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
>> index 2a0ceaa..710e969 100644
>> --- a/Namcap/rules/makedepends.py
>> +++ b/Namcap/rules/makedepends.py
>> @@ -56,7 +56,7 @@ class VCSMakedepends(PkgbuildRule):
>>   		missing = []
>>   
>>   		for v in vcs:
>> -			if not any(s.startswith(v) for s in pkginfo["source"]):
>> +			if not any(s.split("::")[-1].startswith(v + '+') for s in pkginfo["source"]):
> 
> Instead this fails to detect git:// instead?
> 
> The check makepkg uses is to strip ::* and then strip ://* to get the
> protocol, and match on protocols like git*, although I have pending
> patches to also strip +* and match protocols exactly.
> 

Ah yes, I will send a v2 that also works for things like git://.
Thank you!


More information about the arch-projects mailing list