[arch-projects] [namcap] [PATCH v2] makedepends: Make VCS matching more robust
Eli Schwartz
eschwartz at archlinux.org
Sun Dec 2 13:14:02 UTC 2018
On 12/2/18 8:01 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>
> ---
> v1 -> v2
> Make it also work for e.g. git://
>
> Namcap/rules/makedepends.py | 10 +++++++++-
> Namcap/tests/pkgbuild/test_makedepends.py | 15 +++++++++++----
> 2 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
> index 2a0ceaa..65747c4 100644
> --- a/Namcap/rules/makedepends.py
> +++ b/Namcap/rules/makedepends.py
> @@ -54,9 +54,17 @@ class VCSMakedepends(PkgbuildRule):
> 'svn' : 'subversion',
> }
> missing = []
> + protocols = set()
> +
> + for s in pkginfo["source"]:
> + p = s.split("::", 1)[-1]
> + p = p.split("://", 1)[0]
> + p = p.split("+", 1)[0]
> + if p in vcs:
> + protocols.add(p)
>
> for v in vcs:
> - if not any(s.startswith(v) for s in pkginfo["source"]):
> + if not v in protocols:
Why not just check if protocols is empty?
--
Eli Schwartz
Bug Wrangler and Trusted User
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-projects/attachments/20181202/5ca0f4b6/attachment.asc>
More information about the arch-projects
mailing list