forked from Mirror/pmbootstrap
pmaports.guess_main: new assumption for -dev pkgs (!1827)
Packages ending in -dev: just assume that the originating aport has the same pkgname, except for the -dev at the end. Otherwise we may end up with the wrong package. For example, if something depends on plasma-framework-dev, and plasma-framework is in Alpine, but plasma is in pmaports, then the regular guess_main() algorithm below would pick plasma instead of plasma-framework. Fixes: build.postmarketos.org#52
This commit is contained in:
parent
8a5c8fcc3e
commit
cf9d648ac9
2 changed files with 46 additions and 0 deletions
|
@ -50,3 +50,18 @@ def test_guess_main(args, tmpdir):
|
|||
assert func(args, "qemu-system-x86_64") == tmpdir + "/temp/qemu"
|
||||
assert func(args, "some-pkg-sub-pkg") == tmpdir + "/main/some-pkg"
|
||||
assert func(args, "qemuPackageWithoutDashes") is None
|
||||
|
||||
|
||||
def test_guess_main_dev(args, tmpdir):
|
||||
# Fake pmaports folder
|
||||
tmpdir = str(tmpdir)
|
||||
args.aports = tmpdir
|
||||
os.makedirs(tmpdir + "/temp/plasma")
|
||||
|
||||
func = pmb.helpers.pmaports.guess_main_dev
|
||||
assert func(args, "plasma-framework-dev") is None
|
||||
assert func(args, "plasma-dev") == tmpdir + "/temp/plasma"
|
||||
|
||||
func = pmb.helpers.pmaports.guess_main
|
||||
assert func(args, "plasma-framework-dev") is None
|
||||
assert func(args, "plasma-randomsubpkg") == tmpdir + "/temp/plasma"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue