Skip to content

Commit

Permalink
Merge pull request #18528 from Homebrew/no-rm_const
Browse files Browse the repository at this point in the history
Remove removable constants
  • Loading branch information
MikeMcQuaid authored Oct 8, 2024
2 parents 9753ede + ed4129b commit b975313
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
16 changes: 0 additions & 16 deletions Library/Homebrew/extend/os/mac/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@

require "system_command"

class Keg
# TODO: re-implement these as functions, so that we aren't modifying constants:
GENERIC_KEG_LINK_DIRECTORIES = (remove_const :KEG_LINK_DIRECTORIES).freeze
KEG_LINK_DIRECTORIES = (GENERIC_KEG_LINK_DIRECTORIES + ["Frameworks"]).freeze
GENERIC_MUST_EXIST_SUBDIRECTORIES = (remove_const :MUST_EXIST_SUBDIRECTORIES).freeze
MUST_EXIST_SUBDIRECTORIES = (
GENERIC_MUST_EXIST_SUBDIRECTORIES +
[HOMEBREW_PREFIX/"Frameworks"]
).sort.uniq.freeze
GENERIC_MUST_BE_WRITABLE_DIRECTORIES = (remove_const :MUST_BE_WRITABLE_DIRECTORIES).freeze
MUST_BE_WRITABLE_DIRECTORIES = (
GENERIC_MUST_BE_WRITABLE_DIRECTORIES +
[HOMEBREW_PREFIX/"Frameworks"]
).sort.uniq.freeze
end

module OS
module Mac
module Keg
Expand Down
26 changes: 0 additions & 26 deletions Library/Homebrew/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,6 @@ def to_s
# Locale-specific directories have the form `language[_territory][.codeset][@modifier]`
LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}
INFOFILE_RX = %r{info/([^.].*?\.info(\.gz)?|dir)$}
KEG_LINK_DIRECTORIES = %w[
bin etc include lib sbin share var
].freeze
MUST_EXIST_SUBDIRECTORIES = (
KEG_LINK_DIRECTORIES - %w[var] + %w[
opt
var/homebrew/linked
]
).map { |dir| HOMEBREW_PREFIX/dir }.sort.uniq.freeze
MUST_BE_WRITABLE_DIRECTORIES = (
%w[
etc/bash_completion.d lib/pkgconfig
share/aclocal share/doc share/info share/locale share/man
share/man/man1 share/man/man2 share/man/man3 share/man/man4
share/man/man5 share/man/man6 share/man/man7 share/man/man8
share/zsh share/zsh/site-functions
var/log
].map { |dir| HOMEBREW_PREFIX/dir } + MUST_EXIST_SUBDIRECTORIES + [
HOMEBREW_CACHE,
HOMEBREW_CELLAR,
HOMEBREW_LOCKS,
HOMEBREW_LOGS,
HOMEBREW_REPOSITORY,
Language::Python.homebrew_site_packages,
]
).sort.uniq.freeze

# These paths relative to the keg's share directory should always be real
# directories in the prefix, never symlinks.
Expand Down

0 comments on commit b975313

Please sign in to comment.