Top Level Namespace
- Extended by:
- EnvActivation
- Includes:
- SystemCommand::Mixin, Utils::Curl
Defined Under Namespace
Modules: ArchitectureListExtension, Cachable, Cask, Commands, Context, Debrew, Dependable, DependenciesHelpers, DeprecateDisable, DiskUsageExtension, ELFShim, EnvActivation, Formatter, FormulaCellarChecks, FormulaClassUnavailableErrorModule, FormulaUnreadableErrorModule, Formulary, GitHub, GitRepositoryExtension, Hardware, HashValidator, Homebrew, InstallRenamed, Kernel, Language, LivecheckFormula, MachOShim, Metafiles, OS, Patch, Predicable, PyPI, Readall, Repology, RuboCop, SPDX, Searchable, SharedAudits, SharedEnvExtension, Stdenv, Superenv, SystemConfig, Tty, UnpackStrategy, Utils Classes: AbstractDownloadStrategy, AbstractFileDownloadStrategy, ArchRequirement, BazaarDownloadStrategy, Bintray, Bottle, BottleDisableReason, BottleFormulaUnavailableError, BottleSpecification, Build, BuildEnvironment, BuildError, BuildFlagsError, BuildOptions, BuildToolsError, CVSDownloadStrategy, CacheStore, CacheStoreDatabase, CannotInstallFormulaError, CaskDependent, CaskLock, Caveats, Checksum, ChecksumMismatchError, ChecksumMissingError, ChildProcessError, Cleaner, CodesignRequirement, CompilerFailure, CompilerSelectionError, CompilerSelector, CoreTap, CurlApacheMirrorDownloadStrategy, CurlDownloadStrategy, CurlDownloadStrategyError, CurlPostDownloadStrategy, CxxStdlib, DATAPatch, Dependencies, Dependency, DependencyCollector, DeprecatedOption, DescriptionCacheStore, Descriptions, DevelopmentTools, DownloadError, DownloadStrategyDetector, DuplicateResourceError, EmbeddedPatch, ErrorDuringExecution, ExternalPatch, Formula, FormulaAmbiguousPythonError, FormulaClassUnavailableError, FormulaConflict, FormulaConflictError, FormulaInfo, FormulaInstallationAlreadyAttemptedError, FormulaInstaller, FormulaLock, FormulaOrCaskUnavailableError, FormulaOrCaskUnspecifiedError, FormulaPin, FormulaSpecificationError, FormulaUnavailableError, FormulaUnknownPythonError, FormulaUnreadableError, FormulaUnspecifiedError, FormulaValidationError, FormulaVersions, FossilDownloadStrategy, GitDownloadStrategy, GitHubArtifactDownloadStrategy, GitHubGitDownloadStrategy, HeadSoftwareSpec, HeadVersion, IO, JavaRequirement, Keg, KegOnlyReason, KegUnspecifiedError, LazyObject, LegacyPatch, LinkageCacheStore, LinkageChecker, LinuxRequirement, Livecheck, LocalBottleDownloadStrategy, Locale, LockFile, MacOSRequirement, MacOSVersionError, MercurialDownloadStrategy, Messages, MethodDeprecatedError, Migrator, MissingApplyError, MissingEnvironmentVariables, Mktemp, Module, MultipleVersionsInstalledError, NoSuchKegError, NoUnzipCurlDownloadStrategy, NotAKegError, OperationInProgressError, Option, Options, OsxfuseRequirement, PATH, Pathname, PkgVersion, PourBottleCheck, PrettyListing, Reporter, ReporterHub, Requirement, Requirements, Resource, ResourceMissingError, ResourceStageContext, Sandbox, SoftwareSpec, String, StringInreplaceExtension, StringPatch, SubversionDownloadStrategy, Symbol, SystemCommand, Tab, Tap, TapAlreadyTappedError, TapConfig, TapDependency, TapFormulaAmbiguityError, TapFormulaClassUnavailableError, TapFormulaUnavailableError, TapFormulaUnreadableError, TapFormulaWithOldnameAmbiguityError, TapRemoteMismatchError, TapUnavailableError, TuntapRequirement, URL, UnsatisfiedRequirements, UsageError, User, VCSDownloadStrategy, Version, X11Requirement, XcodeRequirement
Constant Summary collapse
- TEST_TIMEOUT_SECONDS =
5 * 60
- HOMEBREW_BREW_FILE =
Path to
bin/brew
main executable inHOMEBREW_PREFIX
Pathname.new(ENV["HOMEBREW_BREW_FILE"]).freeze
- HOMEBREW_PREFIX =
Where we link under
Pathname.new(get_env_or_raise("HOMEBREW_PREFIX")).freeze
- HOMEBREW_REPOSITORY =
Where
.git
is found Pathname.new(get_env_or_raise("HOMEBREW_REPOSITORY")) .extend(GitRepositoryExtension) .freeze
- HOMEBREW_LIBRARY =
Where we store most of Homebrew, taps, and various metadata
Pathname.new(get_env_or_raise("HOMEBREW_LIBRARY")).freeze
- HOMEBREW_SHIMS_PATH =
Where shim scripts for various build and SCM tools are stored
(HOMEBREW_LIBRARY/"Homebrew/shims").freeze
- HOMEBREW_DATA_PATH =
Where external data that has been incorporated into Homebrew is stored
(HOMEBREW_LIBRARY/"Homebrew/data").freeze
- HOMEBREW_LINKED_KEGS =
Where we store symlinks to currently linked kegs
(HOMEBREW_PREFIX/"var/homebrew/linked").freeze
- HOMEBREW_PINNED_KEGS =
Where we store symlinks to currently version-pinned kegs
(HOMEBREW_PREFIX/"var/homebrew/pinned").freeze
- HOMEBREW_LOCKS =
Where we store lock files
(HOMEBREW_PREFIX/"var/homebrew/locks").freeze
- HOMEBREW_CELLAR =
Where we store built products
Pathname.new(get_env_or_raise("HOMEBREW_CELLAR")).freeze
- HOMEBREW_CACHE =
Where downloads (bottles, source tarballs, etc.) are cached
Pathname.new(get_env_or_raise("HOMEBREW_CACHE")).freeze
- HOMEBREW_CACHE_FORMULA =
Where brews installed via URL are cached
(HOMEBREW_CACHE/"Formula").freeze
- HOMEBREW_LOGS =
Where build, postinstall, and test logs of formulae are written to
Pathname.new(get_env_or_raise("HOMEBREW_LOGS"))..freeze
- HOMEBREW_TEMP =
Must use
/tmp
instead ofTMPDIR
because long paths break Unix domain sockets Pathname.new(get_env_or_raise("HOMEBREW_TEMP")).yield_self do |tmp| tmp.mkpath unless tmp.exist? tmp.realpath end.freeze
- HOMEBREW_BOTTLE_DEFAULT_DOMAIN =
ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
- HOMEBREW_BREW_DEFAULT_GIT_REMOTE =
ENV["HOMEBREW_BREW_DEFAULT_GIT_REMOTE"]
- HOMEBREW_CORE_DEFAULT_GIT_REMOTE =
ENV["HOMEBREW_CORE_DEFAULT_GIT_REMOTE"]
- HOMEBREW_DEFAULT_CACHE =
ENV["HOMEBREW_DEFAULT_CACHE"]
- HOMEBREW_DEFAULT_LOGS =
ENV["HOMEBREW_DEFAULT_LOGS"]
- HOMEBREW_DEFAULT_TEMP =
ENV["HOMEBREW_DEFAULT_TEMP"]
- HOMEBREW_REQUIRED_RUBY_VERSION =
typed: true frozen_string_literal: true
ARGV.first.freeze
- HOMEBREW_PRODUCT =
ENV["HOMEBREW_PRODUCT"]
- HOMEBREW_VERSION =
ENV["HOMEBREW_VERSION"]
- HOMEBREW_WWW =
"https://brew.sh"
- RUBY_PATH =
Pathname.new(RbConfig.ruby).freeze
- RUBY_BIN =
RUBY_PATH.dirname.freeze
- HOMEBREW_USER_AGENT_CURL =
ENV["HOMEBREW_USER_AGENT_CURL"]
- HOMEBREW_USER_AGENT_RUBY =
"#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
- HOMEBREW_USER_AGENT_FAKE_SAFARI =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 " \ "(KHTML, like Gecko) Version/10.0.3 Safari/602.4.8"
- HOMEBREW_DEFAULT_PREFIX =
"/usr/local"
- LINUXBREW_DEFAULT_PREFIX =
"/home/linuxbrew/.linuxbrew"
- HOMEBREW_PULL_API_REGEX =
%r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze
- HOMEBREW_PULL_OR_COMMIT_URL_REGEX =
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze
- HOMEBREW_RELEASES_URL_REGEX =
%r{https://github\.com/([\w-]+)/([\w-]+)?/releases/download/(.+)}.freeze
- ORIGINAL_PATHS =
PATH.new(ENV["HOMEBREW_PATH"]).map do |p| Pathname.new(p). rescue nil end.compact.freeze
- HOMEBREW_LIBRARY_PATH =
Pathname(__dir__).realpath.freeze
- BUG_REPORTS_URL =
"https://github.com/Homebrew/homebrew-cask#reporting-bugs"
- COMMAND_DESC_WIDTH =
80
- OPTION_DESC_WIDTH =
43
- OFFICIAL_CASK_TAPS =
typed: true frozen_string_literal: true
%w[ cask versions ].freeze
- OFFICIAL_CMD_TAPS =
{ "homebrew/bundle" => ["bundle"], "homebrew/test-bot" => ["test-bot"], "homebrew/services" => ["services"], }.freeze
- DEPRECATED_OFFICIAL_TAPS =
%w[ apache binary cask-eid completions devel-only dupes emacs fuse games gui head-only livecheck nginx php python science tex versions x11 ].freeze
- HOMEBREW_TAP_FORMULA_REGEX =
Match taps' formulae, e.g.
someuser/sometap/someformula
%r{^([\w-]+)/([\w-]+)/([\[email protected]]+)$}.freeze
- HOMEBREW_TAP_CASK_REGEX =
Match taps' casks, e.g.
someuser/sometap/somecask
%r{^([\w-]+)/([\w-]+)/([a-z0-9\-]+)$}.freeze
- HOMEBREW_TAP_DIR_REGEX =
Match taps' directory paths, e.g.
HOMEBREW_LIBRARY/Taps/someuser/sometap
%r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/(?<user>[\w-]+)/(?<repo>[\w-]+)}.freeze
- HOMEBREW_TAP_PATH_REGEX =
Match taps' formula paths, e.g.
HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula
Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{(?:/.*)?$}.source).freeze
- HOMEBREW_CASK_TAP_CASK_REGEX =
Match official taps' casks, e.g.
homebrew/cask/somecask or homebrew/cask-versions/somecask
%r{^(?:([Cc]askroom)/(cask|versions)|(homebrew)/(cask|cask-[\w-]+))/([\w+-.]+)$}.freeze
- HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX =
/^(home|linux)brew-/.freeze
- BOTTLE_ERB =
<<-EOS bottle do <% if root_url != "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles" %> root_url "<%= root_url %>" <% end %> <% if ![HOMEBREW_DEFAULT_PREFIX, LINUXBREW_DEFAULT_PREFIX].include?(prefix) %> prefix "<%= prefix %>" <% end %> <% if cellar.is_a? Symbol %> cellar :<%= cellar %> <% elsif ![Homebrew::DEFAULT_CELLAR, "/usr/local/Cellar"].include?(cellar) %> cellar "<%= cellar %>" <% end %> <% if rebuild.positive? %> rebuild <%= rebuild %> <% end %> <% checksums.each do |checksum_type, checksum_values| %> <% checksum_values.each do |checksum_value| %> <% checksum, macos = checksum_value.shift %> <%= checksum_type %> "<%= checksum %>" => :<%= macos %> <% end %> <% end %> end EOS
- MAXIMUM_STRING_MATCHES =
100
- HOMEBREW_PATCHELF_RB_WRITE =
Enables experimental
patchelf.rb
write support. ( ENV["HOMEBREW_NO_PATCHELF_RB_WRITE"].blank? && (ENV["HOMEBREW_PATCHELF_RB_WRITE"].present? || (ENV["CI"].blank? && ENV["HOMEBREW_DEVELOPER"].present?)) ).freeze
Instance Method Summary collapse
Methods included from EnvActivation
activate_extensions!, clear_sensitive_environment!, sensitive?, sensitive_environment, with_build_environment
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods included from Utils::Curl
curl, curl_args, curl_check_http_content, curl_download, curl_executable, curl_http_content_headers_and_checksum, curl_output, curl_with_workarounds, http_status_ok?, url_protected_by_cloudflare?, url_protected_by_incapsula?
Instance Method Details
#get_env_or_raise(env) ⇒ Object
11 12 13 14 15 |
# File 'Library/Homebrew/config.rb', line 11 def get_env_or_raise(env) raise MissingEnvironmentVariables, "#{env} was not exported!" unless ENV[env] ENV[env] end |
#superenv?(env) ⇒ Boolean
10 11 12 |
# File 'Library/Homebrew/extend/ENV.rb', line 10 def superenv?(env) env != "std" && Superenv.bin end |
#with_monkey_patch ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'Library/Homebrew/dev-cmd/extract.rb', line 10 def with_monkey_patch BottleSpecification.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) define_method(:method_missing) { |*| } end Module.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) define_method(:method_missing) { |*| } end Resource.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) define_method(:method_missing) { |*| } end DependencyCollector.class_eval do alias_method :old_parse_symbol_spec, :parse_symbol_spec if method_defined?(:parse_symbol_spec) define_method(:parse_symbol_spec) { |*| } end if defined?(DependencyCollector::Compat) DependencyCollector::Compat.class_eval do alias_method :old_parse_string_spec, :parse_string_spec if method_defined?(:parse_string_spec) define_method(:parse_string_spec) { |*| } end end yield ensure BottleSpecification.class_eval do if method_defined?(:old_method_missing) alias_method :method_missing, :old_method_missing undef :old_method_missing end end Module.class_eval do if method_defined?(:old_method_missing) alias_method :method_missing, :old_method_missing undef :old_method_missing end end Resource.class_eval do if method_defined?(:old_method_missing) alias_method :method_missing, :old_method_missing undef :old_method_missing end end DependencyCollector.class_eval do if method_defined?(:old_parse_symbol_spec) alias_method :parse_symbol_spec, :old_parse_symbol_spec undef :old_parse_symbol_spec end end if defined?(DependencyCollector::Compat) DependencyCollector::Compat.class_eval do if method_defined?(:old_parse_string_spec) alias_method :parse_string_spec, :old_parse_string_spec undef :old_parse_string_spec end end end end |