forked from Mirror/pmbootstrap
pmb.helpers.pmaports.get: deal with operators
Fix that APKBUILDs mentioning other packages with an operator could not be found. As we are building the initial branch of v23.12, this currently happens with postmarketos-mkinitfs: it depends on devicepkg-utils>=0.2.0 and currently pmbootstrap will only remove the >=0.2.0 when looking for the pkgname in the APKINDEX of binary packages (which is why it works on master). But it does not yet do that when looking for the pkgname in pmaports. Move the code for stripping the operator to a common place and use it for getting packages from pmaports too. Change the order of operators while at it, try to find <= before =, as otherwise it would cut off example<=1.2.3 as "example<" instead of "example". Reviewed-by: Caleb Connolly <kc@postmarketos.org> (via chat)
This commit is contained in:
parent
1e3c9fc117
commit
8b8f25227f
3 changed files with 11 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue