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] cmd = ["fus", "--verbose", "--arch", arch]
for idx, repo in enumerate(repos): # Lookaside repos should be first. If the same package is present in
cmd.append("--repo=repo-%s,repo,%s" % (idx, _prep_path(repo))) # multiple repos, libsolv gives priority to the first repo.
for idx, repo in enumerate(lookasides): for idx, repo in enumerate(lookasides):
cmd.append("--repo=lookaside-%s,lookaside,%s" % (idx, _prep_path(repo))) 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: if platform:
cmd.append("--platform=%s" % platform) cmd.append("--platform=%s" % platform)

View File

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