feat(export): also export /usr/sbin binaries#19
Open
CheapFuck wants to merge 1 commit into
Open
Conversation
`towel_repoquery_exportables` and `towel_auto_export` only matched `/usr/bin/...`, so executables a package installs into `/usr/sbin` were never exported. Broaden both patterns to `/usr/s?bin/` so binaries in either location are picked up. The generated wrapper already execs the binary by its full path, so `/usr/sbin` targets work unchanged. `/usr/bin` matching is unaffected. Closes codam-coding-college#14
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.
What
towel exportonly exported executables under/usr/bin. Packages that install into/usr/sbin(the issue mentions nix) were silently skipped.Two patterns hardcoded
/usr/bin:function towel_repoquery_exportables() { local pkg="$1" - local bins_regex='/usr/bin/\S+' + local bins_regex='/usr/s?bin/\S+' local desktops_regex='/usr/share/applications/\S+\.desktop'Both now match
/usr/binand/usr/sbin.Why it's safe
towel_export_bin_wrapperexecs the binary by its full path (exec $bin_path), so an/usr/sbintarget works with no other changes.[ -e "$bin_file" ]guard still applies, so only files that actually exist are wrapped./usr/binmatching is unchanged (thes?only adds/usr/sbin).Verification (inside a towel container)
/usr/binentries (dnf repoquery -l bash→/usr/bin/bash, …). No regression./usr/bin/fooand/usr/sbin/bar; the old regex dropped/usr/sbin/bar.shellcheck -xandshfmt -dpass oninstall,towel, and alltowel-*scripts.Note: on a fully usr-merged image (e.g. Fedora rawhide, where
/usr/sbin -> bin) repoquery already reports/usr/binpaths, so this is a no-op there; the change matters on systems/packages that still populate/usr/sbin.Closes #14