mip: Make mip.install() skip /rom*/lib directories.

If a ROMFS is mounted then "/rom/lib" is usually in `sys.path` before the
writable filesystem's "lib" entry.  The ROMFS directory cannot be installed
to, so skip it if found.

Signed-off-by: Damien George <damien@micropython.org>
pull/981/head
Damien George 2025-03-11 16:27:09 +11:00
rodzic 7337e0802a
commit 96e17b65d1
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
metadata(version="0.4.0", description="On-device package installer for network-capable boards")
metadata(version="0.4.1", description="On-device package installer for network-capable boards")
require("requests")

Wyświetl plik

@ -171,7 +171,7 @@ def _install_package(package, index, target, version, mpy):
def install(package, index=None, target=None, version=None, mpy=True):
if not target:
for p in sys.path:
if p.endswith("/lib"):
if not p.startswith("/rom") and p.endswith("/lib"):
target = p
break
else: