From 47645f41b11e676b2001f4f95b0c9f9d4b14224c Mon Sep 17 00:00:00 2001 From: Minecrell Date: Mon, 1 Nov 2021 09:39:45 +0100 Subject: [PATCH] pmb.parse._apkbuild: parse provider_priority as int (MR 2132) --- pmb/config/__init__.py | 1 + pmb/parse/_apkbuild.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 4a08a1fd..c00988a5 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -559,6 +559,7 @@ apkbuild_package_attributes = { "pkgdesc": {}, "depends": {"array": True}, "provides": {"array": True}, + "provider_priority": {"int": True}, "install": {"array": True}, # UI meta-packages can specify apps in "_pmb_recommends" to be explicitly diff --git a/pmb/parse/_apkbuild.py b/pmb/parse/_apkbuild.py index bb9a3f5a..1e1a44ea 100644 --- a/pmb/parse/_apkbuild.py +++ b/pmb/parse/_apkbuild.py @@ -209,6 +209,11 @@ def _parse_attributes(path, lines, apkbuild_attributes, ret): if options.get("array", False): # Split up arrays, delete empty strings inside the list ret[attribute] = list(filter(None, ret[attribute].split(" "))) + if options.get("int", False): + if ret[attribute]: + ret[attribute] = int(ret[attribute]) + else: + ret[attribute] = 0 def _parse_subpackage(path, lines, apkbuild, subpackages, subpkg):