M pmb/helpers/package.py => pmb/helpers/package.py +8 -0
@@ 12,6 12,14 @@ import pmb.helpers.pmaports
import pmb.helpers.repo
+def remove_operators(package):
+ for operator in [">", ">=", "<=", "=", "<", "~"]:
+ if operator in package:
+ package = package.split(operator)[0]
+ break
+ return package
+
+
def get(args, pkgname, arch, replace_subpkgnames=False, must_exist=True):
""" Find a package in pmaports, and as fallback in the APKINDEXes of the
binary packages.
M pmb/helpers/pmaports.py => pmb/helpers/pmaports.py +1 -0
@@ 204,6 204,7 @@ def get(args, pkgname, must_exist=True, subpackages=True):
"options": [],
... }
"""
+ pkgname = pmb.helpers.package.remove_operators(pkgname)
if subpackages:
aport = find(args, pkgname, must_exist)
if aport:
M pmb/parse/apkindex.py => pmb/parse/apkindex.py +2 -4
@@ 5,6 5,7 @@ import logging
import os
import tarfile
import pmb.chroot.apk
+import pmb.helpers.package
import pmb.helpers.repo
import pmb.parse.version
@@ 283,10 284,7 @@ def providers(args, package, arch=None, must_exist=True, indexes=None):
arch = arch or pmb.config.arch_native
indexes = pmb.helpers.repo.apkindex_files(args, arch)
- for operator in [">", ">=", "=", "<=", "<", "~"]:
- if operator in package:
- package = package.split(operator)[0]
- break
+ package = pmb.helpers.package.remove_operators(package)
ret = collections.OrderedDict()
for path in indexes: