Fix find_binary_in_dir to prefer true binaries over same-named non-binary files#46
Draft
Fix find_binary_in_dir to prefer true binaries over same-named non-binary files#46
Conversation
…tion scripts When packages like fastfetch contain both a binary (usr/bin/fastfetch) and a bash-completion script (usr/share/bash-completion/completions/fastfetch), the old code returned whichever file the directory walker found first. The new implementation collects all name-matches and prefers candidates that either live under a `bin/` directory or (on Unix) have the executable permission bit set, falling back to the first match otherwise. Agent-Logs-Url: https://github.com/Yangmoooo/inro/sessions/25b7f4a4-f13a-445b-b1b1-5f0e02912adb Co-authored-by: Yangmoooo <72434870+Yangmoooo@users.noreply.github.com>
…ncestor Agent-Logs-Url: https://github.com/Yangmoooo/inro/sessions/25b7f4a4-f13a-445b-b1b1-5f0e02912adb Co-authored-by: Yangmoooo <72434870+Yangmoooo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix auto-select true binary for fastfetch
Fix find_binary_in_dir to prefer true binaries over same-named non-binary files
Apr 13, 2026
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.
Which issue does this PR resolve?
Closes #
Description of this PR
Packages like
fastfetchship archives containing both a binary (usr/bin/fastfetch) and a bash-completion script (usr/share/bash-completion/completions/fastfetch).find_binary_in_dirreturned whichever the directory walker hit first, which could be the completion file.Fix: Instead of returning the first name-match, prefer candidates that are likely real binaries:
bin/ancestor check — file lives under a directory namedbin+xpermission