include/package-pack: add default 'provider_priority' for APK packages
authorRobert Marko <robimarko@gmail.com>
Mon, 18 Nov 2024 18:55:57 +0000 (19:55 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 19 Nov 2024 10:24:07 +0000 (11:24 +0100)
commitdea839773c27430031c2a59c3d37ebdfef3937b9
treef328930fa1cd8ffdf02ce089397369c3f844e2b1
parentb0312c10818f36bc6e61a518bb528d2809562796
include/package-pack: add default 'provider_priority' for APK packages

Currently, trying to use APK to install a package that has a dependency on
a virtual package that needs to be resolved via 'provides' it will fail if
package does not have 'DEFAULT_VARIANT:=1' like:
apk add usbutils
ERROR: unable to select packages:
  libudev (virtual):
    note: please select one of the 'provided by' packages explicitly
    provided by: libudev-zero
    required by: usbutils-017-r1[libudev]

Issue is that we dont set 'provider_priority' that APK uses to break ties
when choosing a virtual package to satisfy a dependency and thus despite
only one package providing the dependency it will still end up with a tie
and just error out.

So, lets simply fix this by providing a default value for
'provider_priority' when 'DEFAULT_VARIANT' is not set and then APK will
be able to resolve dependencies.

Fixes: #16976
Link: https://github.com/openwrt/openwrt/pull/17008
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/package-pack.mk