Skip to content

fix: use package base for provides mapping after cloning - #918

Open
abhi-0203 wants to merge 1 commit into
actionless:masterfrom
abhi-0203:fix/provides-key-error
Open

fix: use package base for provides mapping after cloning#918
abhi-0203 wants to merge 1 commit into
actionless:masterfrom
abhi-0203:fix/provides-key-error

Conversation

@abhi-0203

Copy link
Copy Markdown

Summary

Fixes a KeyError in get_package_builds() when a package is requested by a provided name that differs from the AUR package name.

Problem

When installing a package like systemd-libs-selinux, the AUR package that provides it may have a different name (e.g., systemd-selinux). After cloning, cloned_pkgbuilds is keyed by the AUR package name, but the code looks up info.package.name (the user-requested name), causing a KeyError.

Fix

Look up the PackageBuild via its packagebase (which is stable regardless of which name was requested) instead of directly indexing cloned_pkgbuilds by package name.

Reproduction

pikaur --noconfirm --noprogressbar --mflags=--noconfirm --mflags=--skippgpcheck -ySw systemd-selinux
# KeyError: 'systemd-libs-selinux'

Closes #917

When a package is requested by a provided name (e.g. systemd-libs-selinux)
but the AUR package that provides it has a different name (e.g.
systemd-selinux), the lookup `cloned_pkgbuilds[info.package.name]`
raises KeyError because the provided name isn't a key in the dict.

Fix by looking up the PackageBuild via its package base, which is
stable regardless of which name was requested.

Closes actionless#917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError on building a package

1 participant