Skip to content

Commit

Permalink
Fix --local-mirror mounting
Browse files Browse the repository at this point in the history
This can be specified as a URI, let's make sure we handle that
properly.
  • Loading branch information
DaanDeMeyer authored and bluca committed Mar 11, 2024
1 parent f86a739 commit 725de0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mkosi/installer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from mkosi.sandbox import finalize_crypto_mounts
from mkosi.tree import copy_tree, rmtree
from mkosi.types import PathString
from mkosi.util import flatten
from mkosi.util import flatten, startswith


class PackageManager:
Expand All @@ -32,11 +32,13 @@ def scripts(cls, context: Context) -> dict[str, list[PathString]]:
@classmethod
def mounts(cls, context: Context) -> list[PathString]:
mounts: list[PathString] = [
*(["--ro-bind", m, m] if (m := context.config.local_mirror) else []),
*finalize_crypto_mounts(tools=context.config.tools()),
"--bind", context.packages, "/work/packages",
]

if context.config.local_mirror and (mirror := startswith(context.config.local_mirror, "file://")):
mounts += ["--ro-bind", mirror, mirror]

subdir = context.config.distribution.package_manager(context.config).subdir(context.config)

for d in ("cache", "lib"):
Expand Down

0 comments on commit 725de0b

Please sign in to comment.