Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use install-info from texinfo if not available in /usr/bin #14974

Merged
merged 1 commit into from Mar 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions Library/Homebrew/extend/pathname.rb
Expand Up @@ -343,14 +343,24 @@ def ensure_writable
chmod saved_perms if saved_perms
end

# @private
def which_install_info
@which_install_info ||=
if File.executable?("/usr/bin/install-info")
"/usr/bin/install-info"
elsif Formula["texinfo"].any_version_installed?
Formula["texinfo"].opt_bin/"install-info"
end
end

# @private
def install_info
quiet_system "/usr/bin/install-info", "--quiet", to_s, "#{dirname}/dir"
quiet_system(which_install_info, "--quiet", to_s, "#{dirname}/dir")
end

# @private
def uninstall_info
quiet_system "/usr/bin/install-info", "--delete", "--quiet", to_s, "#{dirname}/dir"
quiet_system(which_install_info, "--delete", "--quiet", to_s, "#{dirname}/dir")
end

# Writes an exec script in this folder for each target pathname.
Expand Down