Fix symlink package spec validation (#4870)

When validating symlink:// packages, use the specified symlink path,
the same as for file:// packages.  This fixes missing symlink packages
in 'pkg list' and reinstalling on every build.
This commit is contained in:
Will Miles
2024-03-16 07:29:31 -04:00
committed by GitHub
parent c0d97287dd
commit 430acc87de

View File

@ -281,9 +281,16 @@ class BasePackageManager( # pylint: disable=too-many-public-methods,too-many-in
# external "URL" mismatch
if spec.external:
# local folder mismatch
if os.path.abspath(spec.uri) == os.path.abspath(pkg.path) or (
spec.uri.startswith("file://")
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:])
if (
os.path.abspath(spec.uri) == os.path.abspath(pkg.path)
or (
spec.uri.startswith("file://")
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[7:])
)
or (
spec.uri.startswith("symlink://")
and os.path.abspath(pkg.path) == os.path.abspath(spec.uri[10:])
)
):
return True
if spec.uri != pkg.metadata.spec.uri: