diff --git a/src/python/jw/pkg/lib/Distro.py b/src/python/jw/pkg/lib/Distro.py index f041a8af..f1019cbe 100644 --- a/src/python/jw/pkg/lib/Distro.py +++ b/src/python/jw/pkg/lib/Distro.py @@ -354,13 +354,15 @@ class Distro(abc.ABC): # Download first and then install. Override if Distro knows better. async def _install_urls(self, urls: Iterable[str], only_update: bool) -> None: - import tempfile from .util import copy - with tempfile.TemporaryDirectory(prefix='jw-pkg-') as tmp: - paths: list[str] = [] - for url in urls: - paths.append(await copy(url, tmp)) + tmp: str|None = None + try: + tmp = await self.__exec_context.mktemp('/tmp/jw-pkg-XXXXXX', directory=True) + paths = await copy(urls, self.__exec_context.uri.scheme_plus_authority + tmp) await self._install_local_files(paths, only_update=only_update) + finally: + if tmp is not None: + await self.__exec_context.erase(tmp) # Default implementation installs in two steps: # - Download URLs into local directories and install