From ae1b3fc38c15a4b5a6ebaef17b59a6e4ab35b948 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 2 Jan 2020 16:55:33 +0100 Subject: [PATCH] pmb/helpers/pmaports: ignore provides without ver (!1851) The APKBUILD reference for "provides" [1] is not worded clearly; but after reading it over and over again, my understanding is: * package with provides='foo=1.2' will be automatically installed if user requests installing "foo" * package with provides='foo' (without version) will NOT get automatically installed if user requests installing "foo" For pmbootstrap, this means, that we must not attempt to build a package where the pkgname mentioned in provides matches what we are currently resolving, unless there is an equals sign in the provides entry. Fixes: #1862, pmaports#404 [1] https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#provides says: "List of package names (and optionally version info) this package provides. If package with a version is provided (provides='foo=1.2') apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides. If version is not provided (provides='foo'), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed." --- pmb/helpers/pmaports.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmb/helpers/pmaports.py b/pmb/helpers/pmaports.py index d2dac675..d1193317 100644 --- a/pmb/helpers/pmaports.py +++ b/pmb/helpers/pmaports.py @@ -143,6 +143,11 @@ def find(args, package, must_exist=True): # "mkbootimg=0.0.1") if not found: for provides_i in apkbuild["provides"]: + # Ignore provides without version, they shall never be + # automatically selected + if "=" not in provides_i: + continue + if package == provides_i.split("=", 1)[0]: found = True break