fix: use package base for provides mapping after cloning - #918
Open
abhi-0203 wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a
KeyErroringet_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_pkgbuildsis keyed by the AUR package name, but the code looks upinfo.package.name(the user-requested name), causing aKeyError.Fix
Look up the
PackageBuildvia itspackagebase(which is stable regardless of which name was requested) instead of directly indexingcloned_pkgbuildsby package name.Reproduction
pikaur --noconfirm --noprogressbar --mflags=--noconfirm --mflags=--skippgpcheck -ySw systemd-selinux # KeyError: 'systemd-libs-selinux'Closes #917