fus: List lookaside repos first

This works around a bug where fus prioritizes first repo and thus could
include packages even if they were in lookaside.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-10-03 13:19:38 +02:00
parent 604ec40c8e
commit 1bff5ccfa2
2 changed files with 6 additions and 4 deletions

View File

@ -36,10 +36,12 @@ def get_cmd(
):
cmd = ["fus", "--verbose", "--arch", arch]
for idx, repo in enumerate(repos):
cmd.append("--repo=repo-%s,repo,%s" % (idx, _prep_path(repo)))
# Lookaside repos should be first. If the same package is present in
# multiple repos, libsolv gives priority to the first repo.
for idx, repo in enumerate(lookasides):
cmd.append("--repo=lookaside-%s,lookaside,%s" % (idx, _prep_path(repo)))
for idx, repo in enumerate(repos):
cmd.append("--repo=repo-%s,repo,%s" % (idx, _prep_path(repo)))
if platform:
cmd.append("--platform=%s" % platform)

View File

@ -37,10 +37,10 @@ class TestGetCmd(unittest.TestCase):
"--verbose",
"--arch",
"x86_64",
"--repo=repo-0,repo,/tmp/first",
"--repo=repo-1,repo,/tmp/second",
"--repo=lookaside-0,lookaside,/tmp/fst",
"--repo=lookaside-1,lookaside,/tmp/snd",
"--repo=repo-0,repo,/tmp/first",
"--repo=repo-1,repo,/tmp/second",
"--platform=f29",
"module(mod:1.0)",
"pkg",