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."
This commit is contained in:
Oliver Smith 2020-01-02 16:55:33 +01:00
parent 5076069209
commit ae1b3fc38c
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 5 additions and 0 deletions

View File

@ -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