language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | Homebrew | brew | 60876eed88639777d905d93b68a9d6ac729fe4b2.json | Improve Bootsnap behaviour
- further refactor nested conditional to make it clearer
- allow running on Linux while still excluding Apple Silicon
- only warn on `bundle install` failures | Library/Homebrew/homebrew_bootsnap.rb | @@ -1,32 +1,30 @@
# typed: false
# frozen_string_literal: true
-homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] &&
- ENV["HOMEBREW_BOOTSNAP"] &&
- # portable ruby doesn't play nice with bootsnap
- !ENV["HOMEBREW_FORCE_VENDOR_RUBY"] &&
- (!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) &&
- # Apple Silicon doesn't play nice with bootsnap
- (ENV["HOMEBREW_PROCESSOR"] == "Intel")
-
-# we need some development tools to build bootsnap native code
-development_tools_installed = if !homebrew_bootsnap_enabled
- false
-elsif RbConfig::CONFIG["host_os"].include? "darwin"
- File.directory?("/Applications/Xcode.app") || File.directory?("/Library/Developer/CommandLineTools")
+homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] && ENV["HOMEBREW_BOOTSNAP"]
+
+# portable ruby doesn't play nice with bootsnap
+# Can't use .exclude? here because we haven't required active_support yet.
+homebrew_bootsnap_enabled &&= !ENV["HOMEBREW_RUBY_PATH"].to_s.include?("/vendor/portable-ruby/") # rubocop:disable Rails/NegateInclude
+
+homebrew_bootsnap_enabled &&= if ENV["HOMEBREW_MACOS_VERSION"]
+ # Apple Silicon doesn't play nice with bootsnap
+ ENV["HOMEBREW_PROCESSOR"] == "Intel" &&
+ # we need some development tools to build bootsnap native code
+ (File.directory?("/Applications/Xcode.app") || File.directory?("/Library/Developer/CommandLineTools"))
else
File.executable?("/usr/bin/clang") || File.executable?("/usr/bin/gcc")
end
-if homebrew_bootsnap_enabled && development_tools_installed
+if homebrew_bootsnap_enabled
require "rubygems"
begin
require "bootsnap"
rescue LoadError
unless ENV["HOMEBREW_BOOTSNAP_RETRY"]
require "utils/gems"
- Homebrew.install_bundler_gems!
+ Homebrew.install_bundler_gems!(only_warn_on_failure: true)
ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1"
exec ENV["HOMEBREW_BREW_FILE"], *ARGV | true |
Other | Homebrew | brew | 60876eed88639777d905d93b68a9d6ac729fe4b2.json | Improve Bootsnap behaviour
- further refactor nested conditional to make it clearer
- allow running on Linux while still excluding Apple Silicon
- only warn on `bundle install` failures | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -532,6 +532,14 @@ class ActiveSupport::CurrentAttributes
def _reset_callbacks(); end
def _run_reset_callbacks(&block); end
+
+ def attributes(); end
+
+ def attributes=(attributes); end
+
+ def reset(); end
+
+ def set(set_attributes); end
end
class ActiveSupport::CurrentAttributes
@@ -553,9 +561,17 @@ class ActiveSupport::CurrentAttributes
def self.before_reset(&block); end
+ def self.clear_all(); end
+
def self.instance(); end
+ def self.reset(*args, &block); end
+
+ def self.reset_all(); end
+
def self.resets(&block); end
+
+ def self.set(*args, &block); end
end
module ActiveSupport::Dependencies
@@ -2814,12 +2830,99 @@ end
class Bootsnap::CompileCache::Error
end
+module Bootsnap::CompileCache::ISeq
+end
+
+module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin
+ def compile_option=(hash); end
+
+ def load_iseq(path); end
+end
+
+module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin
+end
+
+module Bootsnap::CompileCache::ISeq
+ def self.cache_dir(); end
+
+ def self.cache_dir=(cache_dir); end
+
+ def self.compile_option_updated(); end
+
+ def self.fetch(path, cache_dir: T.unsafe(nil)); end
+
+ def self.input_to_output(_data, _kwargs); end
+
+ def self.input_to_storage(_, path); end
+
+ def self.install!(cache_dir); end
+
+ def self.precompile(path, cache_dir: T.unsafe(nil)); end
+
+ def self.storage_to_output(binary, _args); end
+end
+
+module Bootsnap::CompileCache::Native
+end
+
+module Bootsnap::CompileCache::Native
+ def self.compile_option_crc32=(compile_option_crc32); end
+
+ def self.coverage_running?(); end
+
+ def self.fetch(_, _1, _2, _3); end
+
+ def self.precompile(_, _1, _2); end
+end
+
class Bootsnap::CompileCache::PermissionError
end
class Bootsnap::CompileCache::PermissionError
end
+class Bootsnap::CompileCache::Uncompilable
+end
+
+class Bootsnap::CompileCache::Uncompilable
+end
+
+module Bootsnap::CompileCache::YAML
+end
+
+module Bootsnap::CompileCache::YAML::Patch
+ def load_file(path, *args); end
+end
+
+module Bootsnap::CompileCache::YAML::Patch
+end
+
+module Bootsnap::CompileCache::YAML
+ def self.cache_dir(); end
+
+ def self.cache_dir=(cache_dir); end
+
+ def self.init!(); end
+
+ def self.input_to_output(data, kwargs); end
+
+ def self.input_to_storage(contents, _); end
+
+ def self.install!(cache_dir); end
+
+ def self.msgpack_factory(); end
+
+ def self.msgpack_factory=(msgpack_factory); end
+
+ def self.precompile(path, cache_dir: T.unsafe(nil)); end
+
+ def self.storage_to_output(data, kwargs); end
+
+ def self.supported_options(); end
+
+ def self.supported_options=(supported_options); end
+end
+
module Bootsnap::CompileCache
def self.permission_error(path); end
@@ -2950,6 +3053,13 @@ module Bootsnap::LoadPathCache::ChangeObserver
def self.register(observer, arr); end
end
+module Bootsnap::LoadPathCache::CoreExt
+end
+
+module Bootsnap::LoadPathCache::CoreExt
+ def self.make_load_error(path); end
+end
+
class Bootsnap::LoadPathCache::FallbackScan
end
@@ -5574,6 +5684,15 @@ module Cask::Caskroom
extend ::T::Private::Methods::SingletonMethodHooks
end
+class Cask::Cmd::AbstractCommand
+ include ::Homebrew::Search::Extension
+end
+
+class Cask::Cmd::AbstractCommand
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class Cask::Config
def appdir(); end
@@ -7021,8 +7140,6 @@ end
class Errno::EBADRPC
end
-Errno::ECAPMODE = Errno::NOERROR
-
Errno::EDEADLOCK = Errno::NOERROR
class Errno::EDEVERR
@@ -7043,13 +7160,6 @@ end
Errno::EIPSEC = Errno::NOERROR
-class Errno::ELAST
- Errno = ::T.let(nil, ::T.untyped)
-end
-
-class Errno::ELAST
-end
-
class Errno::ENEEDAUTH
Errno = ::T.let(nil, ::T.untyped)
end
@@ -7071,8 +7181,6 @@ end
class Errno::ENOPOLICY
end
-Errno::ENOTCAPABLE = Errno::NOERROR
-
class Errno::ENOTSUP
Errno = ::T.let(nil, ::T.untyped)
end
@@ -7115,7 +7223,12 @@ end
class Errno::EPWROFF
end
-Errno::EQFULL = Errno::ELAST
+class Errno::EQFULL
+ Errno = ::T.let(nil, ::T.untyped)
+end
+
+class Errno::EQFULL
+end
class Errno::ERPCMISMATCH
Errno = ::T.let(nil, ::T.untyped)
@@ -8251,6 +8364,14 @@ module Homebrew::Livecheck
extend ::T::Private::Methods::SingletonMethodHooks
end
+module Homebrew::MissingFormula
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+module Homebrew::Search
+ include ::Homebrew::Search::Extension
+end
+
module Homebrew::Settings
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
@@ -9607,11 +9728,13 @@ module Kernel
extend ::T::Private::Methods::SingletonMethodHooks
def self.at_exit(); end
+ def self.autoload(_, _1); end
+
def self.fork(); end
def self.gem(dep, *reqs); end
- def self.load(*_); end
+ def self.load(path, wrap=T.unsafe(nil)); end
def self.require(path); end
end
@@ -11921,6 +12044,8 @@ class Module
def anonymous?(); end
+ def autoload_without_bootsnap(_, _1); end
+
def context(*a, &b); end
def deprecate(*method_names); end
@@ -12275,13 +12400,9 @@ end
Net::HTTPFatalErrorCode = Net::HTTPClientError
-class Net::HTTPInformation
-end
-
-Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError
+Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError
-class Net::HTTPInformation
-end
+Net::HTTPInformationCode = Net::HTTPInformation
class Net::HTTPLoopDetected
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -12345,13 +12466,9 @@ Net::HTTPServerErrorCode = Net::HTTPServerError
Net::HTTPSession = Net::HTTP
-class Net::HTTPSuccess
-end
-
-Net::HTTPSuccessCode::EXCEPTION_TYPE = Net::HTTPError
+Net::HTTPSuccess::EXCEPTION_TYPE = Net::HTTPError
-class Net::HTTPSuccess
-end
+Net::HTTPSuccessCode = Net::HTTPSuccess
class Net::HTTPURITooLong
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -12521,6 +12638,7 @@ class Object
def to_query(key); end
def to_yaml(options=T.unsafe(nil)); end
+ APPLE_GEM_HOME = ::T.let(nil, ::T.untyped)
ARGF = ::T.let(nil, ::T.untyped)
ARGV = ::T.let(nil, ::T.untyped)
BUG_REPORTS_URL = ::T.let(nil, ::T.untyped)
@@ -12585,6 +12703,8 @@ class Object
RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped)
RUBY_ENGINE = ::T.let(nil, ::T.untyped)
RUBY_ENGINE_VERSION = ::T.let(nil, ::T.untyped)
+ RUBY_FRAMEWORK = ::T.let(nil, ::T.untyped)
+ RUBY_FRAMEWORK_VERSION = ::T.let(nil, ::T.untyped)
RUBY_PATCHLEVEL = ::T.let(nil, ::T.untyped)
RUBY_PATH = ::T.let(nil, ::T.untyped)
RUBY_PLATFORM = ::T.let(nil, ::T.untyped)
@@ -12637,11 +12757,7 @@ class OpenSSL::KDF::KDFError
end
module OpenSSL::KDF
- def self.hkdf(*_); end
-
def self.pbkdf2_hmac(*_); end
-
- def self.scrypt(*_); end
end
class OpenSSL::OCSP::Request
@@ -12650,29 +12766,20 @@ end
OpenSSL::PKCS7::Signer = OpenSSL::PKCS7::SignerInfo
-class OpenSSL::PKey::EC
- EXPLICIT_CURVE = ::T.let(nil, ::T.untyped)
-end
-
class OpenSSL::PKey::EC::Point
def to_octet_string(_); end
end
module OpenSSL::SSL
- OP_ALLOW_NO_DHE_KEX = ::T.let(nil, ::T.untyped)
OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = ::T.let(nil, ::T.untyped)
OP_CRYPTOPRO_TLSEXT_BUG = ::T.let(nil, ::T.untyped)
OP_LEGACY_SERVER_CONNECT = ::T.let(nil, ::T.untyped)
- OP_NO_ENCRYPT_THEN_MAC = ::T.let(nil, ::T.untyped)
- OP_NO_RENEGOTIATION = ::T.let(nil, ::T.untyped)
- OP_NO_TLSv1_3 = ::T.let(nil, ::T.untyped)
OP_SAFARI_ECDHE_ECDSA_BUG = ::T.let(nil, ::T.untyped)
OP_TLSEXT_PADDING = ::T.let(nil, ::T.untyped)
SSL2_VERSION = ::T.let(nil, ::T.untyped)
SSL3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_1_VERSION = ::T.let(nil, ::T.untyped)
TLS1_2_VERSION = ::T.let(nil, ::T.untyped)
- TLS1_3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_VERSION = ::T.let(nil, ::T.untyped)
end
@@ -17084,6 +17191,7 @@ module Psych
end
module Psych
+ extend ::Bootsnap::CompileCache::YAML::Patch
def self.add_builtin_type(type_tag, &block); end
def self.add_domain_type(domain, type_tag, &block); end
@@ -27855,6 +27963,10 @@ class RubyVM::AbstractSyntaxTree::Node
def pretty_print_children(q, names=T.unsafe(nil)); end
end
+class RubyVM::InstructionSequence
+ extend ::Bootsnap::CompileCache::ISeq::InstructionSequenceMixin
+end
+
module RubyVM::MJIT
end
@@ -28744,6 +28856,7 @@ class Socket
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
+ IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped)
@@ -28835,6 +28948,7 @@ module Socket::Constants
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
+ IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped) | true |
Other | Homebrew | brew | 60876eed88639777d905d93b68a9d6ac729fe4b2.json | Improve Bootsnap behaviour
- further refactor nested conditional to make it clearer
- allow running on Linux while still excluding Apple Silicon
- only warn on `bundle install` failures | Library/Homebrew/utils/gems.rb | @@ -34,6 +34,14 @@ def ohai_if_defined(message)
end
end
+ def opoo_if_defined(message)
+ if defined?(opoo)
+ $stderr.opoo message
+ else
+ $stderr.puts "Warning: #{message}"
+ end
+ end
+
def odie_if_defined(message)
if defined?(odie)
odie message
@@ -105,7 +113,7 @@ def install_bundler!
)
end
- def install_bundler_gems!
+ def install_bundler_gems!(only_warn_on_failure: false)
install_bundler!
ENV["BUNDLE_GEMFILE"] = File.join(ENV.fetch("HOMEBREW_LIBRARY"), "Homebrew", "Gemfile")
@@ -117,9 +125,14 @@ def install_bundler_gems!
# for some reason sometimes the exit code lies so check the output too.
if bundle_check_failed || bundle_check_output.include?("Install missing gems")
unless system bundle, "install"
- odie_if_defined <<~EOS
+ message = <<~EOS
failed to run `#{bundle} install`!
EOS
+ if only_warn_on_failure
+ opoo_if_defined message
+ else
+ odie_if_defined message
+ end
end
else
true | true |
Other | Homebrew | brew | 60876eed88639777d905d93b68a9d6ac729fe4b2.json | Improve Bootsnap behaviour
- further refactor nested conditional to make it clearer
- allow running on Linux while still excluding Apple Silicon
- only warn on `bundle install` failures | Library/Homebrew/utils/gems.rbi | @@ -22,6 +22,6 @@ module Homebrew
sig { void }
def install_bundler!; end
- sig { void }
- def install_bundler_gems!; end
+ sig { params(only_warn_on_failure: T::Boolean).void }
+ def install_bundler_gems!(only_warn_on_failure: false); end
end | true |
Other | Homebrew | brew | f079373d8c56086a6b4357eaa06c3c50410a3c1d.json | utils/fork: handle termsig in safe_fork | Library/Homebrew/build.rb | @@ -240,7 +240,14 @@ def fixopt(f)
error_hash["env"] = e.env
when "ErrorDuringExecution"
error_hash["cmd"] = e.cmd
- error_hash["status"] = e.status.exitstatus
+ error_hash["status"] = if e.status.is_a?(Process::Status)
+ {
+ exitstatus: e.status.exitstatus,
+ termsig: e.status.termsig,
+ }
+ else
+ e.status
+ end
error_hash["output"] = e.output
end
| true |
Other | Homebrew | brew | f079373d8c56086a6b4357eaa06c3c50410a3c1d.json | utils/fork: handle termsig in safe_fork | Library/Homebrew/exceptions.rb | @@ -579,19 +579,32 @@ def initialize(cmd, status:, output: nil, secrets: [])
@status = status
@output = output
+ raise ArgumentError, "Status cannot be nil." if status.nil?
+
exitstatus = case status
when Integer
status
+ when Hash
+ status["exitstatus"]
+ else
+ status.exitstatus
+ end
+
+ termsig = case status
+ when Integer
+ nil
+ when Hash
+ status["termsig"]
else
- status&.exitstatus
+ status.termsig
end
redacted_cmd = redact_secrets(cmd.shelljoin.gsub('\=', "="), secrets)
reason = if exitstatus
"exited with #{exitstatus}"
- elsif (uncaught_signal = status&.termsig)
- "was terminated by uncaught signal #{Signal.signame(uncaught_signal)}"
+ elsif termsig
+ "was terminated by uncaught signal #{Signal.signame(termsig)}"
else
raise ArgumentError, "Status neither has `exitstatus` nor `termsig`."
end | true |
Other | Homebrew | brew | f079373d8c56086a6b4357eaa06c3c50410a3c1d.json | utils/fork: handle termsig in safe_fork | Library/Homebrew/test/error_during_execution_spec.rb | @@ -5,7 +5,7 @@
subject(:error) { described_class.new(command, status: status, output: output) }
let(:command) { ["false"] }
- let(:status) { instance_double(Process::Status, exitstatus: exitstatus) }
+ let(:status) { instance_double(Process::Status, exitstatus: exitstatus, termsig: nil) }
let(:exitstatus) { 1 }
let(:output) { nil }
| true |
Other | Homebrew | brew | f079373d8c56086a6b4357eaa06c3c50410a3c1d.json | utils/fork: handle termsig in safe_fork | Library/Homebrew/test/exceptions_spec.rb | @@ -186,7 +186,7 @@ class Baz < Formula; end
describe ErrorDuringExecution do
subject { described_class.new(["badprg", "arg1", "arg2"], status: status) }
- let(:status) { instance_double(Process::Status, exitstatus: 17) }
+ let(:status) { instance_double(Process::Status, exitstatus: 17, termsig: nil) }
its(:to_s) { is_expected.to eq("Failure while executing; `badprg arg1 arg2` exited with 17.") }
end | true |
Other | Homebrew | brew | f079373d8c56086a6b4357eaa06c3c50410a3c1d.json | utils/fork: handle termsig in safe_fork | Library/Homebrew/utils/fork.rb | @@ -51,7 +51,14 @@ def self.safe_fork
# to rescue them further down.
if e.is_a?(ErrorDuringExecution)
error_hash["cmd"] = e.cmd
- error_hash["status"] = e.status.exitstatus
+ error_hash["status"] = if e.status.is_a?(Process::Status)
+ {
+ exitstatus: e.status.exitstatus,
+ termsig: e.status.termsig,
+ }
+ else
+ e.status
+ end
error_hash["output"] = e.output
end
| true |
Other | Homebrew | brew | e85149cbc4cfeb7df45b9596502ae426e539c04c.json | sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -2689,6 +2689,11 @@ class Addrinfo
def connect_internal(local_addrinfo, timeout=T.unsafe(nil)); end
end
+class Archive
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class Array
include ::MessagePack::CoreExt
def compact_blank!(); end
@@ -8146,6 +8151,8 @@ module Homebrew::EnvConfig
def self.install_badge(); end
+ def self.internet_archive_key(); end
+
def self.livecheck_watchlist(); end
def self.logs(); end | false |
Other | Homebrew | brew | c4787a0a8b315e296fe4523b7e50c392eb07b8a5.json | pr-upload: Fix a typo affecting Internet Archive | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -52,7 +52,7 @@ def check_bottled_formulae(bottles_hash)
def archive?(bottles_hash)
@archive ||= bottles_hash.values.all? do |bottle_hash|
- bottle_hash["bottle"]["root_url"].start_with? "https://archive.com/"
+ bottle_hash["bottle"]["root_url"].start_with? "https://archive.org/"
end
end
| false |
Other | Homebrew | brew | 634efba2615db158adeba1d56fc0ebf873b4c71b.json | homebrew_bootsnap: require some developer tools.
Do a very basic developer tools check to ensure that we can compile
things. We cannot use `DevelopmentTools.installed?` because this has
much higher speed requirements and needs to be run before we `require`
anything else. | Library/Homebrew/homebrew_bootsnap.rb | @@ -1,14 +1,24 @@
# typed: false
# frozen_string_literal: true
-if !ENV["HOMEBREW_NO_BOOTSNAP"] &&
- ENV["HOMEBREW_BOOTSNAP"] &&
- # portable ruby doesn't play nice with bootsnap
- !ENV["HOMEBREW_FORCE_VENDOR_RUBY"] &&
- (!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) &&
- # Apple Silicon doesn't play nice with bootsnap
- (ENV["HOMEBREW_PROCESSOR"] == "Intel")
+homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] &&
+ ENV["HOMEBREW_BOOTSNAP"] &&
+ # portable ruby doesn't play nice with bootsnap
+ !ENV["HOMEBREW_FORCE_VENDOR_RUBY"] &&
+ (!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) &&
+ # Apple Silicon doesn't play nice with bootsnap
+ (ENV["HOMEBREW_PROCESSOR"] == "Intel")
+# we need some development tools to build bootsnap native code
+development_tools_installed = if !homebrew_bootsnap_enabled
+ false
+elsif RbConfig::CONFIG["host_os"].include? "darwin"
+ File.directory?("/Applications/Xcode.app") || File.directory?("/Library/Developer/CommandLineTools")
+else
+ File.executable?("/usr/bin/clang") || File.executable?("/usr/bin/gcc")
+end
+
+if homebrew_bootsnap_enabled && development_tools_installed
require "rubygems"
begin | false |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | .github/workflows/tests.yml | @@ -276,7 +276,7 @@ jobs:
- name: Install brew tests dependencies
run: |
brew install subversion
- Library/Homebrew/shims/scm/svn --homebrew=print-path
+ brew sh -c "svn --homebrew=print-path"
which svn
which svnadmin
| true |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | Library/Homebrew/shims/mac/super/gem | @@ -0,0 +1 @@
+ruby
\ No newline at end of file | true |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | Library/Homebrew/shims/mac/super/rake | @@ -0,0 +1 @@
+ruby
\ No newline at end of file | true |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | Library/Homebrew/shims/mac/super/ruby | @@ -0,0 +1,12 @@
+#!/bin/bash
+# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly.
+
+source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh"
+
+try_exec_non_system "$SHIM_FILE" "$@"
+
+if [[ -z "$SDKROOT" && -n "$HOMEBREW_SDKROOT" ]]; then
+ export SDKROOT=$HOMEBREW_SDKROOT
+fi
+
+safe_exec "/usr/bin/$SHIM_FILE" "$@" | true |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | Library/Homebrew/shims/scm/git | @@ -3,87 +3,15 @@
# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and
# no Xcode/CLT configurations. Order is careful to be what the user would want.
-set +o posix
-
-quiet_safe_cd() {
- cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; }
-}
-
-absdir() {
- quiet_safe_cd "${1%/*}/" && pwd -P
-}
-
-dirbasepath() {
- local dir="$1"
- local base="${2##*/}"
- echo "$dir/$base"
-}
-
-realpath() {
- local path="$1"
- local dir
- local dest
-
- dir="$(absdir "$path")"
- path="$(dirbasepath "$dir" "$path")"
-
- while [[ -L "$path" ]]
- do
- dest="$(readlink "$path")"
- if [[ "$dest" = "/"* ]]
- then
- path="$dest"
- else
- path="$dir/$dest"
- fi
- dir="$(absdir "$path")"
- path="$(dirbasepath "$dir" "$path")"
- done
-
- echo "$path"
-}
-
-executable() {
- local file="$1"
- [[ -f "$file" && -x "$file" ]]
-}
-
-lowercase() {
- echo "$1" | tr "[:upper:]" "[:lower:]"
-}
-
-safe_exec() {
- local arg0="$1"
- if ! executable "$arg0"
- then
- return
- fi
- # prevent fork-bombs
- if [[ "$(lowercase "$arg0")" = "$SCM_FILE" || "$(realpath "$arg0")" = "$SCM_REAL" ]]
- then
- return
- fi
- if [[ "$HOMEBREW" = "print-path" ]]
- then
- local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)"
- local path="$(dirbasepath "$dir" "$arg0")"
- echo "$path"
- exit
- fi
- exec "$@"
-}
-
-SCM_FILE="${0##*/}"
-SCM_REAL="$(realpath "$0")"
-SCM_DIR="$(quiet_safe_cd "${SCM_REAL%/*}/" && pwd -P)"
-
-if [[ "$1" = --homebrew=* ]]
+if [ -z "$HOMEBREW_LIBRARY" ]
then
- HOMEBREW="${1:11}"
- shift
+ echo "${0##*/}: This shim is internal and must be run via `brew`." >&2
+ exit 1
fi
-case "$(lowercase "$SCM_FILE")" in
+source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh"
+
+case "$(lowercase "$SHIM_FILE")" in
git)
if [[ -n "$HOMEBREW_GIT" && "$HOMEBREW_GIT" != git ]]
then
@@ -98,21 +26,10 @@ case "$(lowercase "$SCM_FILE")" in
;;
esac
-brew_prefix_version="$(quiet_safe_cd "$SCM_DIR/../../../../../bin" 2>/dev/null && pwd -P)/$SCM_FILE"
+brew_prefix_version="$HOMEBREW_PREFIX/bin/$SHIM_FILE"
safe_exec "$brew_prefix_version" "$@"
-brew_repo_version="$(quiet_safe_cd "$SCM_DIR/../../../../bin" && pwd -P)/$SCM_FILE"
-safe_exec "$brew_repo_version" "$@"
-
-IFS=$'\n'
-for path in $(type -aP "$SCM_FILE")
-do
- if [[ "$path" != "/usr/bin/$SCM_FILE" ]]
- then
- safe_exec "$path" "$@"
- fi
-done
-unset IFS
+try_exec_non_system "$SHIM_FILE" "$@"
if executable "/usr/bin/xcode-select"
then
@@ -129,19 +46,19 @@ then
fi
if [[ -z "$popup_stub" && "$xcode_path" != "/" ]]
then
- path="$(/usr/bin/xcrun -find "$SCM_FILE" 2>/dev/null)"
+ path="$(/usr/bin/xcrun -find "$SHIM_FILE" 2>/dev/null)"
safe_exec "$path" "$@"
fi
fi
-path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SCM_FILE"
+path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SHIM_FILE"
safe_exec "$path" "$@"
if [[ -z "$popup_stub" && "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]]
then
- path="/usr/bin/$SCM_FILE"
+ path="/usr/bin/$SHIM_FILE"
safe_exec "$path" "$@"
fi
-echo "You must: brew install $SCM_FILE" >&2
+echo "You must: brew install $SHIM_FILE" >&2
exit 1 | true |
Other | Homebrew | brew | 7e75a49b772f03f1373c6b3184a354a292693728.json | shims/mac/super: add ruby shims to set SDKROOT | Library/Homebrew/shims/utils.sh | @@ -0,0 +1,94 @@
+set +o posix
+
+quiet_safe_cd() {
+ cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; }
+}
+
+absdir() {
+ quiet_safe_cd "${1%/*}/" && pwd -P
+}
+
+dirbasepath() {
+ local dir="$1"
+ local base="${2##*/}"
+ echo "$dir/$base"
+}
+
+realpath() {
+ local path="$1"
+ local dir
+ local dest
+
+ dir="$(absdir "$path")"
+ path="$(dirbasepath "$dir" "$path")"
+
+ while [[ -L "$path" ]]
+ do
+ dest="$(readlink "$path")"
+ if [[ "$dest" = "/"* ]]
+ then
+ path="$dest"
+ else
+ path="$dir/$dest"
+ fi
+ dir="$(absdir "$path")"
+ path="$(dirbasepath "$dir" "$path")"
+ done
+
+ echo "$path"
+}
+
+executable() {
+ local file="$1"
+ [[ -f "$file" && -x "$file" ]]
+}
+
+lowercase() {
+ echo "$1" | tr "[:upper:]" "[:lower:]"
+}
+
+safe_exec() {
+ local arg0="$1"
+ if ! executable "$arg0"
+ then
+ return
+ fi
+ # prevent fork-bombs
+ if [[ "$(lowercase "$arg0")" = "$SHIM_FILE" || "$(realpath "$arg0")" = "$SHIM_REAL" ]]
+ then
+ return
+ fi
+ if [[ "$HOMEBREW" = "print-path" ]]
+ then
+ local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)"
+ local path="$(dirbasepath "$dir" "$arg0")"
+ echo "$path"
+ exit
+ fi
+ exec "$@"
+}
+
+try_exec_non_system() {
+ local file="$1"
+ shift
+
+ IFS=$'\n'
+ for path in $(type -aP "$file")
+ do
+ if [[ "$path" != "/usr/bin/$file" ]]
+ then
+ safe_exec "$path" "$@"
+ fi
+ done
+ unset IFS
+}
+
+
+SHIM_FILE="${0##*/}"
+SHIM_REAL="$(realpath "$0")"
+
+if [[ "$1" = --homebrew=* ]]
+then
+ HOMEBREW="${1:11}"
+ shift
+fi | true |
Other | Homebrew | brew | be11a22d97c1af2018789485286f4ed9c558c29f.json | Update man pages | completions/fish/brew.fish | @@ -1053,7 +1053,7 @@ __fish_brew_complete_arg 'pr-publish' -l workflow -d 'Target workflow filename (
__fish_brew_complete_cmd 'pr-pull' 'Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated by GitHub Actions'
-__fish_brew_complete_arg 'pr-pull' -l archive-item -d 'Upload to the specified Archive item (default: `homebrew`)'
+__fish_brew_complete_arg 'pr-pull' -l archive-item -d 'Upload to the specified Internet Archive item (default: `homebrew`)'
__fish_brew_complete_arg 'pr-pull' -l artifact -d 'Download artifacts with the specified name (default: `bottles`)'
__fish_brew_complete_arg 'pr-pull' -l autosquash -d 'Automatically reformat and reword commits in the pull request to our preferred format'
__fish_brew_complete_arg 'pr-pull' -l bintray-mirror -d 'Use the specified Bintray repository to automatically mirror stable URLs defined in the formulae (default: `mirror`)'
@@ -1078,7 +1078,7 @@ __fish_brew_complete_arg 'pr-pull' -l workflows -d 'Retrieve artifacts from the
__fish_brew_complete_cmd 'pr-upload' 'Apply the bottle commit and publish bottles to Bintray or GitHub Releases'
-__fish_brew_complete_arg 'pr-upload' -l archive-item -d 'Upload to the specified Archive item (default: `homebrew`)'
+__fish_brew_complete_arg 'pr-upload' -l archive-item -d 'Upload to the specified Internet Archive item (default: `homebrew`)'
__fish_brew_complete_arg 'pr-upload' -l bintray-org -d 'Upload to the specified Bintray organisation (default: `homebrew`)'
__fish_brew_complete_arg 'pr-upload' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'pr-upload' -l dry-run -d 'Print what would be done rather than doing it' | true |
Other | Homebrew | brew | be11a22d97c1af2018789485286f4ed9c558c29f.json | Update man pages | completions/zsh/_brew | @@ -1229,7 +1229,7 @@ _brew_pr_publish() {
# brew pr-pull
_brew_pr_pull() {
_arguments \
- '(--bintray-org)--archive-item[Upload to the specified Archive item (default: `homebrew`)]' \
+ '(--bintray-org)--archive-item[Upload to the specified Internet Archive item (default: `homebrew`)]' \
'--artifact[Download artifacts with the specified name (default: `bottles`)]' \
'(--clean)--autosquash[Automatically reformat and reword commits in the pull request to our preferred format]' \
'--bintray-mirror[Use the specified Bintray repository to automatically mirror stable URLs defined in the formulae (default: `mirror`)]' \
@@ -1256,7 +1256,7 @@ _brew_pr_pull() {
# brew pr-upload
_brew_pr_upload() {
_arguments \
- '--archive-item[Upload to the specified Archive item (default: `homebrew`)]' \
+ '--archive-item[Upload to the specified Internet Archive item (default: `homebrew`)]' \
'--bintray-org[Upload to the specified Bintray organisation (default: `homebrew`)]' \
'--debug[Display any debugging information]' \
'--dry-run[Print what would be done rather than doing it]' \ | true |
Other | Homebrew | brew | be11a22d97c1af2018789485286f4ed9c558c29f.json | Update man pages | docs/Manpage.md | @@ -1182,7 +1182,7 @@ Requires write access to the repository.
* `--artifact`:
Download artifacts with the specified name (default: `bottles`).
* `--archive-item`:
- Upload to the specified Archive item (default: `homebrew`).
+ Upload to the specified Internet Archive item (default: `homebrew`).
* `--bintray-org`:
Upload to the specified Bintray organisation (default: `homebrew`).
* `--tap`:
@@ -1211,7 +1211,7 @@ Apply the bottle commit and publish bottles to Bintray or GitHub Releases.
* `--warn-on-upload-failure`:
Warn instead of raising an error if the bottle upload fails. Useful for repairing bottle uploads that previously failed.
* `--archive-item`:
- Upload to the specified Archive item (default: `homebrew`).
+ Upload to the specified Internet Archive item (default: `homebrew`).
* `--bintray-org`:
Upload to the specified Bintray organisation (default: `homebrew`).
* `--root-url`:
@@ -1702,9 +1702,6 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Default:* `native`.
-- `HOMEBREW_ARCHIVE_KEY`
- <br>Use this API key when accessing the Archive.org API (where bottles are stored). The format is access:secret. See https://archive.org/account/s3.php
-
- `HOMEBREW_ARTIFACT_DOMAIN`
<br>Prefix all download URLs, including those for bottles, with this value. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a formula with the URL `https://example.com/foo.tar.gz` to instead download from `http://localhost:8080/example.com/foo.tar.gz`.
@@ -1841,6 +1838,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Default:* The "Beer Mug" emoji.
+- `HOMEBREW_INTERNET_ARCHIVE_KEY`
+ <br>Use this API key when accessing the Internet Archive S3 API, where bottles are stored. The format is access:secret. See https://archive.org/account/s3.php
+
- `HOMEBREW_LIVECHECK_WATCHLIST`
<br>Consult this file for the list of formulae to check by default when no formula argument is passed to `brew livecheck`.
| true |
Other | Homebrew | brew | be11a22d97c1af2018789485286f4ed9c558c29f.json | Update man pages | manpages/brew.1 | @@ -1646,7 +1646,7 @@ Download artifacts with the specified name (default: \fBbottles\fR)\.
.
.TP
\fB\-\-archive\-item\fR
-Upload to the specified Archive item (default: \fBhomebrew\fR)\.
+Upload to the specified Internet Archive item (default: \fBhomebrew\fR)\.
.
.TP
\fB\-\-bintray\-org\fR
@@ -1697,7 +1697,7 @@ Warn instead of raising an error if the bottle upload fails\. Useful for repairi
.
.TP
\fB\-\-archive\-item\fR
-Upload to the specified Archive item (default: \fBhomebrew\fR)\.
+Upload to the specified Internet Archive item (default: \fBhomebrew\fR)\.
.
.TP
\fB\-\-bintray\-org\fR
@@ -2361,12 +2361,6 @@ Linux only: Pass this value to a type name representing the compiler\'s \fB\-mar
\fIDefault:\fR \fBnative\fR\.
.
.TP
-\fBHOMEBREW_ARCHIVE_KEY\fR
-.
-.br
-Use this API key when accessing the Archive\.org API (where bottles are stored)\. The format is access:secret\. See https://archive\.org/account/s3\.php
-.
-.TP
\fBHOMEBREW_ARTIFACT_DOMAIN\fR
.
.br
@@ -2622,6 +2616,12 @@ Print this text before the installation summary of each successful build\.
\fIDefault:\fR The "Beer Mug" emoji\.
.
.TP
+\fBHOMEBREW_INTERNET_ARCHIVE_KEY\fR
+.
+.br
+Use this API key when accessing the Internet Archive S3 API, where bottles are stored\. The format is access:secret\. See https://archive\.org/account/s3\.php
+.
+.TP
\fBHOMEBREW_LIVECHECK_WATCHLIST\fR
.
.br | true |
Other | Homebrew | brew | 2b1f460289d2ef8106814e750e38a4c65dbf5cdf.json | Fix `installed_on_request` for dependencies.
Dependencies were using `Tab.for_formula(df)` to get a `Tab` which meant
that they were always ending up with the (default) value of `true` for
`installed_on_request`. Fix this by:
- setting `installed_on_request` to `false` by default in empty `Tab`s;
we always override it on installation so we'd rather have it default
to `false`
- only read and use a `Tab` for the existing dependency formula if
there's an existing `Keg` | Library/Homebrew/formula_installer.rb | @@ -707,31 +707,32 @@ def fetch_dependency(dep)
sig { params(dep: Dependency, inherited_options: Options).void }
def install_dependency(dep, inherited_options)
df = dep.to_formula
- tab = Tab.for_formula(df)
if df.linked_keg.directory?
linked_keg = Keg.new(df.linked_keg.resolved_path)
+ tab = Tab.for_keg(linked_keg)
keg_had_linked_keg = true
keg_was_linked = linked_keg.linked?
linked_keg.unlink
end
if df.latest_version_installed?
installed_keg = Keg.new(df.prefix)
+ tab ||= Tab.for_keg(linked_keg)
tmp_keg = Pathname.new("#{installed_keg}.tmp")
installed_keg.rename(tmp_keg)
end
- tab_tap = tab.source["tap"]
- if tab_tap.present? && df.tap.present? && df.tap.to_s != tab_tap.to_s
+ if df.tap.present? && tab.present? && (tab_tap = tab.source["tap"].presence) &&
+ df.tap.to_s != tab_tap.to_s
odie <<~EOS
#{df} is already installed from #{tab_tap}!
Please `brew uninstall #{df}` first."
EOS
end
options = Options.new
- options |= tab.used_options
+ options |= tab.used_options if tab.present?
options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
options |= inherited_options
options &= df.options
@@ -742,7 +743,7 @@ def install_dependency(dep, inherited_options)
options: options,
link_keg: keg_had_linked_keg ? keg_was_linked : nil,
installed_as_dependency: true,
- installed_on_request: df.any_version_installed? && tab.installed_on_request,
+ installed_on_request: df.any_version_installed? && tab.present? && tab.installed_on_request,
force_bottle: false,
include_test_formulae: @include_test_formulae,
build_from_source_formulae: @build_from_source_formulae, | true |
Other | Homebrew | brew | 2b1f460289d2ef8106814e750e38a4c65dbf5cdf.json | Fix `installed_on_request` for dependencies.
Dependencies were using `Tab.for_formula(df)` to get a `Tab` which meant
that they were always ending up with the (default) value of `true` for
`installed_on_request`. Fix this by:
- setting `installed_on_request` to `false` by default in empty `Tab`s;
we always override it on installation so we'd rather have it default
to `false`
- only read and use a `Tab` for the existing dependency formula if
there's an existing `Keg` | Library/Homebrew/tab.rb | @@ -29,7 +29,7 @@ def self.create(formula, compiler, stdlib)
"tabfile" => formula.prefix/FILENAME,
"built_as_bottle" => build.bottle?,
"installed_as_dependency" => false,
- "installed_on_request" => true,
+ "installed_on_request" => false,
"poured_from_bottle" => false,
"time" => Time.now.to_i,
"source_modified_time" => formula.source_modified_time.to_i,
@@ -184,7 +184,7 @@ def self.empty
"unused_options" => [],
"built_as_bottle" => false,
"installed_as_dependency" => false,
- "installed_on_request" => true,
+ "installed_on_request" => false,
"poured_from_bottle" => false,
"time" => nil,
"source_modified_time" => 0, | true |
Other | Homebrew | brew | 22fb25d96d924e98ba7ae144e0483c9db9bc2a28.json | Enable HOMEBREW_BOOTSNAP for developers
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout. | Library/Homebrew/brew.sh | @@ -584,6 +584,11 @@ then
export HOMEBREW_BOTTLE_DOMAIN="$HOMEBREW_BOTTLE_DEFAULT_DOMAIN"
fi
+if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
+then
+ export HOMEBREW_BOOTSNAP="1"
+fi
+
export HOMEBREW_BREW_DEFAULT_GIT_REMOTE="https://github.com/Homebrew/brew"
if [[ -z "$HOMEBREW_BREW_GIT_REMOTE" ]]
then | true |
Other | Homebrew | brew | 22fb25d96d924e98ba7ae144e0483c9db9bc2a28.json | Enable HOMEBREW_BOOTSNAP for developers
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout. | Library/Homebrew/env_config.rb | @@ -40,8 +40,9 @@ module EnvConfig
description: "Use this username when accessing the Bintray API (where bottles are stored).",
},
HOMEBREW_BOOTSNAP: {
- description: "If set, use Bootsnap to speed up repeated `brew` calls. "\
- "A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).",
+ description: "If set, use Bootsnap to speed up repeated `brew` calls. " \
+ "A no-op in various configurations where it doesn't work. " \
+ "Enabled by default if HOMEBREW_DEVELOPER is set or a developer command has been run.",
boolean: true,
},
HOMEBREW_BOTTLE_DOMAIN: { | true |
Other | Homebrew | brew | 22fb25d96d924e98ba7ae144e0483c9db9bc2a28.json | Enable HOMEBREW_BOOTSNAP for developers
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout. | docs/Manpage.md | @@ -1721,7 +1721,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>Use this username when accessing the Bintray API (where bottles are stored).
- `HOMEBREW_BOOTSNAP`
- <br>If set, use Bootsnap to speed up repeated `brew` calls. A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).
+ <br>If set, use Bootsnap to speed up repeated `brew` calls. A no-op in various configurations where it doesn't work. Enabled by default if HOMEBREW_DEVELOPER is set or a developer command has been run.
- `HOMEBREW_BOTTLE_DOMAIN`
<br>Use this URL as the download mirror for bottles. For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to download from the prefix `http://localhost:8080/`. | true |
Other | Homebrew | brew | 22fb25d96d924e98ba7ae144e0483c9db9bc2a28.json | Enable HOMEBREW_BOOTSNAP for developers
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout. | manpages/brew.1 | @@ -2398,7 +2398,7 @@ Use this username when accessing the Bintray API (where bottles are stored)\.
\fBHOMEBREW_BOOTSNAP\fR
.
.br
-If set, use Bootsnap to speed up repeated \fBbrew\fR calls\. A no\-op when using Homebrew\'s vendored, relocatable Ruby on macOS (as it doesn\'t work)\.
+If set, use Bootsnap to speed up repeated \fBbrew\fR calls\. A no\-op in various configurations where it doesn\'t work\. Enabled by default if HOMEBREW_DEVELOPER is set or a developer command has been run\.
.
.TP
\fBHOMEBREW_BOTTLE_DOMAIN\fR | true |
Other | Homebrew | brew | 7fd6d2166b93d8b86710b7642c094c7164f20dd7.json | Update man pages | completions/bash/brew | @@ -1475,6 +1475,7 @@ _brew_pr_pull() {
case "$cur" in
-*)
__brewcomp "
+ --archive-item
--artifact
--autosquash
--bintray-mirror | true |
Other | Homebrew | brew | 7fd6d2166b93d8b86710b7642c094c7164f20dd7.json | Update man pages | completions/fish/brew.fish | @@ -1053,6 +1053,7 @@ __fish_brew_complete_arg 'pr-publish' -l workflow -d 'Target workflow filename (
__fish_brew_complete_cmd 'pr-pull' 'Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated by GitHub Actions'
+__fish_brew_complete_arg 'pr-pull' -l archive-item -d 'Upload to the specified Archive item (default: `homebrew`)'
__fish_brew_complete_arg 'pr-pull' -l artifact -d 'Download artifacts with the specified name (default: `bottles`)'
__fish_brew_complete_arg 'pr-pull' -l autosquash -d 'Automatically reformat and reword commits in the pull request to our preferred format'
__fish_brew_complete_arg 'pr-pull' -l bintray-mirror -d 'Use the specified Bintray repository to automatically mirror stable URLs defined in the formulae (default: `mirror`)' | true |
Other | Homebrew | brew | 7fd6d2166b93d8b86710b7642c094c7164f20dd7.json | Update man pages | completions/zsh/_brew | @@ -1229,10 +1229,11 @@ _brew_pr_publish() {
# brew pr-pull
_brew_pr_pull() {
_arguments \
+ '(--bintray-org)--archive-item[Upload to the specified Archive item (default: `homebrew`)]' \
'--artifact[Download artifacts with the specified name (default: `bottles`)]' \
'(--clean)--autosquash[Automatically reformat and reword commits in the pull request to our preferred format]' \
'--bintray-mirror[Use the specified Bintray repository to automatically mirror stable URLs defined in the formulae (default: `mirror`)]' \
- '--bintray-org[Upload to the specified Bintray organisation (default: `homebrew`)]' \
+ '(--archive-item)--bintray-org[Upload to the specified Bintray organisation (default: `homebrew`)]' \
'--branch-okay[Do not warn if pulling to a branch besides the repository default (useful for testing)]' \
'(--autosquash)--clean[Do not amend the commits from pull requests]' \
'--debug[Display any debugging information]' \ | true |
Other | Homebrew | brew | 7fd6d2166b93d8b86710b7642c094c7164f20dd7.json | Update man pages | docs/Manpage.md | @@ -1181,6 +1181,8 @@ Requires write access to the repository.
Message to include when autosquashing revision bumps, deletions, and rebuilds.
* `--artifact`:
Download artifacts with the specified name (default: `bottles`).
+* `--archive-item`:
+ Upload to the specified Archive item (default: `homebrew`).
* `--bintray-org`:
Upload to the specified Bintray organisation (default: `homebrew`).
* `--tap`: | true |
Other | Homebrew | brew | 7fd6d2166b93d8b86710b7642c094c7164f20dd7.json | Update man pages | manpages/brew.1 | @@ -1645,6 +1645,10 @@ Message to include when autosquashing revision bumps, deletions, and rebuilds\.
Download artifacts with the specified name (default: \fBbottles\fR)\.
.
.TP
+\fB\-\-archive\-item\fR
+Upload to the specified Archive item (default: \fBhomebrew\fR)\.
+.
+.TP
\fB\-\-bintray\-org\fR
Upload to the specified Bintray organisation (default: \fBhomebrew\fR)\.
. | true |
Other | Homebrew | brew | c11692ba780d7a5663aa693107d98d99a83d1050.json | pr-pull: Upload bottles to Archive.org
Add option --archive-item | Library/Homebrew/dev-cmd/pr-pull.rb | @@ -49,6 +49,8 @@ def pr_pull_args
description: "Message to include when autosquashing revision bumps, deletions, and rebuilds."
flag "--artifact=",
description: "Download artifacts with the specified name (default: `bottles`)."
+ flag "--archive-item=",
+ description: "Upload to the specified Archive item (default: `homebrew`)."
flag "--bintray-org=",
description: "Upload to the specified Bintray organisation (default: `homebrew`)."
flag "--tap=",
@@ -65,6 +67,7 @@ def pr_pull_args
description: "Comma-separated list of workflows which can be ignored if they have not been run."
conflicts "--clean", "--autosquash"
+ conflicts "--archive-item", "--bintray-org"
named_args :pull_request, min: 1
end
@@ -357,6 +360,7 @@ def pr_pull
workflows = args.workflows.presence || ["tests.yml"]
artifact = args.artifact || "bottles"
+ archive_item = args.archive_item
bintray_org = args.bintray_org || "homebrew"
mirror_repo = args.bintray_mirror || "mirror"
tap = Tap.fetch(args.tap || CoreTap.instance.name)
@@ -424,7 +428,11 @@ def pr_pull
upload_args << "--keep-old" if args.keep_old?
upload_args << "--warn-on-upload-failure" if args.warn_on_upload_failure?
upload_args << "--root-url=#{args.root_url}" if args.root_url
- upload_args << "--bintray-org=#{bintray_org}"
+ upload_args << if archive_item.present?
+ "--archive-item=#{archive_item}"
+ else
+ "--bintray-org=#{bintray_org}"
+ end
safe_system HOMEBREW_BREW_FILE, *upload_args
end
end | false |
Other | Homebrew | brew | 2794641a28b8f914d8e28a50d505284d8a10e4f3.json | Update man pages | completions/bash/brew | @@ -1507,6 +1507,7 @@ _brew_pr_upload() {
case "$cur" in
-*)
__brewcomp "
+ --archive-item
--bintray-org
--debug
--dry-run | true |
Other | Homebrew | brew | 2794641a28b8f914d8e28a50d505284d8a10e4f3.json | Update man pages | completions/fish/brew.fish | @@ -1077,6 +1077,7 @@ __fish_brew_complete_arg 'pr-pull' -l workflows -d 'Retrieve artifacts from the
__fish_brew_complete_cmd 'pr-upload' 'Apply the bottle commit and publish bottles to Bintray or GitHub Releases'
+__fish_brew_complete_arg 'pr-upload' -l archive-item -d 'Upload to the specified Archive item (default: `homebrew`)'
__fish_brew_complete_arg 'pr-upload' -l bintray-org -d 'Upload to the specified Bintray organisation (default: `homebrew`)'
__fish_brew_complete_arg 'pr-upload' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'pr-upload' -l dry-run -d 'Print what would be done rather than doing it' | true |
Other | Homebrew | brew | 2794641a28b8f914d8e28a50d505284d8a10e4f3.json | Update man pages | completions/zsh/_brew | @@ -1255,6 +1255,7 @@ _brew_pr_pull() {
# brew pr-upload
_brew_pr_upload() {
_arguments \
+ '--archive-item[Upload to the specified Archive item (default: `homebrew`)]' \
'--bintray-org[Upload to the specified Bintray organisation (default: `homebrew`)]' \
'--debug[Display any debugging information]' \
'--dry-run[Print what would be done rather than doing it]' \ | true |
Other | Homebrew | brew | 2794641a28b8f914d8e28a50d505284d8a10e4f3.json | Update man pages | docs/Manpage.md | @@ -1208,6 +1208,8 @@ Apply the bottle commit and publish bottles to Bintray or GitHub Releases.
Do not generate a new commit before uploading.
* `--warn-on-upload-failure`:
Warn instead of raising an error if the bottle upload fails. Useful for repairing bottle uploads that previously failed.
+* `--archive-item`:
+ Upload to the specified Archive item (default: `homebrew`).
* `--bintray-org`:
Upload to the specified Bintray organisation (default: `homebrew`).
* `--root-url`:
@@ -1698,6 +1700,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Default:* `native`.
+- `HOMEBREW_ARCHIVE_KEY`
+ <br>Use this API key when accessing the Archive.org API (where bottles are stored). The format is access:secret. See https://archive.org/account/s3.php
+
- `HOMEBREW_ARTIFACT_DOMAIN`
<br>Prefix all download URLs, including those for bottles, with this value. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a formula with the URL `https://example.com/foo.tar.gz` to instead download from `http://localhost:8080/example.com/foo.tar.gz`.
| true |
Other | Homebrew | brew | 2794641a28b8f914d8e28a50d505284d8a10e4f3.json | Update man pages | manpages/brew.1 | @@ -1692,6 +1692,10 @@ Do not generate a new commit before uploading\.
Warn instead of raising an error if the bottle upload fails\. Useful for repairing bottle uploads that previously failed\.
.
.TP
+\fB\-\-archive\-item\fR
+Upload to the specified Archive item (default: \fBhomebrew\fR)\.
+.
+.TP
\fB\-\-bintray\-org\fR
Upload to the specified Bintray organisation (default: \fBhomebrew\fR)\.
.
@@ -2353,6 +2357,12 @@ Linux only: Pass this value to a type name representing the compiler\'s \fB\-mar
\fIDefault:\fR \fBnative\fR\.
.
.TP
+\fBHOMEBREW_ARCHIVE_KEY\fR
+.
+.br
+Use this API key when accessing the Archive\.org API (where bottles are stored)\. The format is access:secret\. See https://archive\.org/account/s3\.php
+.
+.TP
\fBHOMEBREW_ARTIFACT_DOMAIN\fR
.
.br | true |
Other | Homebrew | brew | b0bd15fb41b711782e04d24b307dc515ef65aaa2.json | pr-upload: Upload bottles to Archive.org
--archive-item specifies the item identifier.
HOMEBREW_ARCHIVE_KEY=access:secret specifies the S3 key. | Library/Homebrew/archive.rb | @@ -0,0 +1,185 @@
+# typed: false
+# frozen_string_literal: true
+
+require "digest/md5"
+require "utils/curl"
+
+# Archive API client.
+#
+# @api private
+class Archive
+ extend T::Sig
+
+ include Context
+ include Utils::Curl
+
+ class Error < RuntimeError
+ end
+
+ sig { returns(String) }
+ def inspect
+ "#<Archive: item=#{@archive_item}>"
+ end
+
+ sig { params(item: T.nilable(String)).void }
+ def initialize(item: "homebrew")
+ @archive_item = item
+
+ raise UsageError, "Must set the Archive item!" unless @archive_item
+
+ ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" if @archive_item == "homebrew" && !OS.mac?
+ end
+
+ def open_api(url, *args, auth: true)
+ if auth
+ raise UsageError, "HOMEBREW_ARCHIVE_KEY is unset." unless (key = Homebrew::EnvConfig.archive_key)
+
+ if key.exclude?(":")
+ raise UsageError,
+ "Use HOMEBREW_ARCHIVE_KEY=access:secret. See https://archive.org/account/s3.php"
+ end
+
+ args += ["--header", "Authorization: AWS #{key}"]
+ end
+
+ curl(*args, url, print_stdout: false, secrets: key)
+ end
+
+ sig {
+ params(local_file: String,
+ dir: String,
+ remote_file: String,
+ warn_on_error: T.nilable(T::Boolean)).void
+ }
+ def upload(local_file, dir:, remote_file:, warn_on_error: false)
+ unless File.exist? local_file
+ msg = "#{local_file} for upload doesn't exist!"
+ raise Error, msg unless warn_on_error
+
+ # Warn and return early here since we know this upload is going to fail.
+ opoo msg
+ return
+ end
+
+ md5_base64 = Digest::MD5.base64digest(File.read(local_file))
+ url = "https://#{@archive_item}.s3.us.archive.org/#{dir}/#{remote_file}"
+ args = ["--upload-file", local_file, "--header", "Content-MD5: #{md5_base64}"]
+ args << "--fail" unless warn_on_error
+ result = T.unsafe(self).open_api(url, *args)
+ return if result.success? && result.stdout.exclude?("Error")
+
+ msg = "Bottle upload failed: #{result.stdout}"
+ raise msg unless warn_on_error
+
+ opoo msg
+ end
+
+ sig { params(url: String).returns(T::Boolean) }
+ def stable_mirrored?(url)
+ headers, = curl_output("--connect-timeout", "15", "--location", "--head", url)
+ status_code = headers.scan(%r{^HTTP/.* (\d+)}).last.first
+ status_code.start_with?("2")
+ end
+
+ sig {
+ params(formula: Formula,
+ dir: String,
+ warn_on_error: T::Boolean).returns(String)
+ }
+ def mirror_formula(formula, dir: "mirror", warn_on_error: false)
+ formula.downloader.fetch
+
+ filename = ERB::Util.url_encode(formula.downloader.basename)
+ destination_url = "https://archive.org/download/#{@archive_item}/#{dir}/#{filename}"
+
+ odebug "Uploading to #{destination_url}"
+
+ upload(
+ formula.downloader.cached_location,
+ dir: dir,
+ remote_file: filename,
+ warn_on_error: warn_on_error,
+ )
+
+ destination_url
+ end
+
+ # Gets the MD5 hash of the specified remote file.
+ #
+ # @return the hash, the empty string (if the file doesn't have a hash), nil (if the file doesn't exist)
+ sig { params(dir: String, remote_file: String).returns(T.nilable(String)) }
+ def remote_md5(dir:, remote_file:)
+ url = "https://#{@archive_item}.s3.us.archive.org/#{dir}/#{remote_file}"
+ result = curl_output "--fail", "--silent", "--head", "--location", url
+ if result.success?
+ result.stdout.match(/^ETag: "(\h{32})"/)&.values_at(1)&.first || ""
+ else
+ raise Error if result.status.exitstatus != 22 && result.stderr.exclude?("404 Not Found")
+
+ nil
+ end
+ end
+
+ sig { params(directory: String, filename: String).returns(String) }
+ def file_delete_instructions(directory, filename)
+ <<~EOS
+ Run:
+ curl -X DELETE -H "Authorization: AWS $HOMEBREW_ARCHIVE_KEY" https://#{@archive_item}.s3.us.archive.org/#{directory}/#{filename}
+ Or run:
+ ia delete #{@archive_item} #{directory}/#{filename}
+ EOS
+ end
+
+ sig {
+ params(bottles_hash: T::Hash[String, T.untyped],
+ warn_on_error: T.nilable(T::Boolean)).void
+ }
+ def upload_bottles(bottles_hash, warn_on_error: false)
+ bottles_hash.each do |_formula_name, bottle_hash|
+ directory = bottle_hash["bintray"]["repository"]
+ bottle_count = bottle_hash["bottle"]["tags"].length
+
+ bottle_hash["bottle"]["tags"].each do |_tag, tag_hash|
+ filename = tag_hash["filename"] # URL encoded in Bottle::Filename#archive
+ delete_instructions = file_delete_instructions(directory, filename)
+
+ local_filename = tag_hash["local_filename"]
+ md5 = Digest::MD5.hexdigest(File.read(local_filename))
+
+ odebug "Checking remote file #{@archive_item}/#{directory}/#{filename}"
+ result = remote_md5(dir: directory, remote_file: filename)
+ case result
+ when nil
+ # File doesn't exist.
+ odebug "Uploading #{@archive_item}/#{directory}/#{filename}"
+ upload(local_filename,
+ dir: directory,
+ remote_file: filename,
+ warn_on_error: warn_on_error)
+ when md5
+ # File exists, hash matches.
+ odebug "#{filename} is already published with matching hash."
+ bottle_count -= 1
+ when ""
+ # File exists, but can't find hash
+ failed_message = "#{filename} is already published!"
+ raise Error, "#{failed_message}\n#{delete_instructions}" unless warn_on_error
+
+ opoo failed_message
+ else
+ # File exists, but hash either doesn't exist or is mismatched.
+ failed_message = <<~EOS
+ #{filename} is already published with a mismatched hash!
+ Expected: #{md5}
+ Actual: #{result}
+ EOS
+ raise Error, "#{failed_message}#{delete_instructions}" unless warn_on_error
+
+ opoo failed_message
+ end
+ end
+
+ odebug "Uploaded #{bottle_count} bottles"
+ end
+ end
+end | true |
Other | Homebrew | brew | b0bd15fb41b711782e04d24b307dc515ef65aaa2.json | pr-upload: Upload bottles to Archive.org
--archive-item specifies the item identifier.
HOMEBREW_ARCHIVE_KEY=access:secret specifies the S3 key. | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -2,6 +2,7 @@
# frozen_string_literal: true
require "cli/parser"
+require "archive"
require "bintray"
module Homebrew
@@ -27,6 +28,8 @@ def pr_upload_args
switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed."
+ flag "--archive-item=",
+ description: "Upload to the specified Archive item (default: `homebrew`)."
flag "--bintray-org=",
description: "Upload to the specified Bintray organisation (default: `homebrew`)."
flag "--root-url=",
@@ -47,6 +50,18 @@ def check_bottled_formulae(bottles_hash)
end
end
+ def archive?(bottles_hash)
+ @archive ||= bottles_hash.values.all? do |bottle_hash|
+ bottle_hash["bottle"]["root_url"].start_with? "https://archive.com/"
+ end
+ end
+
+ def bintray?(bottles_hash)
+ @bintray ||= bottles_hash.values.all? do |bottle_hash|
+ bottle_hash["bottle"]["root_url"].match? %r{^https://[\w-]+\.bintray\.com/}
+ end
+ end
+
def github_releases?(bottles_hash)
@github_releases ||= bottles_hash.values.all? do |bottle_hash|
root_url = bottle_hash["bottle"]["root_url"]
@@ -76,11 +91,16 @@ def pr_upload
bottle_args += json_files
if args.dry_run?
- service = if github_releases?(bottles_hash)
- "GitHub Releases"
- else
- "Bintray"
- end
+ service =
+ if archive?(bottles_hash)
+ "Archive.org"
+ elsif bintray?(bottles_hash)
+ "Bintray"
+ elsif github_releases?(bottles_hash)
+ "GitHub Releases"
+ else
+ odie "Service specified by root_url is not recognized"
+ end
puts <<~EOS
brew #{bottle_args.join " "}
Upload bottles described by these JSON files to #{service}:
@@ -102,7 +122,20 @@ def pr_upload
safe_system HOMEBREW_BREW_FILE, *audit_args
end
- if github_releases?(bottles_hash)
+ if archive?(bottles_hash)
+ # Handle uploading to Archive.org.
+ archive_item = args.archive_item || "homebrew"
+ archive = Archive.new(item: archive_item)
+ archive.upload_bottles(bottles_hash,
+ warn_on_error: args.warn_on_upload_failure?)
+ elsif bintray?(bottles_hash)
+ # Handle uploading to Bintray.
+ bintray_org = args.bintray_org || "homebrew"
+ bintray = Bintray.new(org: bintray_org)
+ bintray.upload_bottles(bottles_hash,
+ publish_package: !args.no_publish?,
+ warn_on_error: args.warn_on_upload_failure?)
+ elsif github_releases?(bottles_hash)
# Handle uploading to GitHub Releases.
bottles_hash.each_value do |bottle_hash|
root_url = bottle_hash["bottle"]["root_url"]
@@ -128,12 +161,7 @@ def pr_upload
end
end
else
- # Handle uploading to Bintray.
- bintray_org = args.bintray_org || "homebrew"
- bintray = Bintray.new(org: bintray_org)
- bintray.upload_bottles(bottles_hash,
- publish_package: !args.no_publish?,
- warn_on_error: args.warn_on_upload_failure?)
+ odie "Service specified by root_url is not recognized"
end
end
end | true |
Other | Homebrew | brew | b0bd15fb41b711782e04d24b307dc515ef65aaa2.json | pr-upload: Upload bottles to Archive.org
--archive-item specifies the item identifier.
HOMEBREW_ARCHIVE_KEY=access:secret specifies the S3 key. | Library/Homebrew/env_config.rb | @@ -15,6 +15,10 @@ module EnvConfig
description: "Linux only: Pass this value to a type name representing the compiler's `-march` option.",
default: "native",
},
+ HOMEBREW_ARCHIVE_KEY: {
+ description: "Use this API key when accessing the Archive.org API (where bottles are stored). " \
+ "The format is access:secret. See https://archive.org/account/s3.php",
+ },
HOMEBREW_ARTIFACT_DOMAIN: {
description: "Prefix all download URLs, including those for bottles, with this value. " \
"For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a " \ | true |
Other | Homebrew | brew | 85eb346fb756fc8177f95024f6ad357f45820815.json | download_strategy: fix nounzip strategy ignoring block | Library/Homebrew/download_strategy.rb | @@ -586,6 +586,7 @@ def stage
UnpackStrategy::Uncompressed.new(cached_location)
.extract(basename: basename,
verbose: verbose? && !quiet?)
+ yield if block_given?
end
end
| false |
Other | Homebrew | brew | 3edf569f7edddff504b4f106c5f5d905c14fe846.json | style: require parentheses around regex arguments | Library/.rubocop.yml | @@ -261,14 +261,6 @@ Naming/MemoizedInstanceVariableName:
Exclude:
- "Homebrew/lazy_object.rb"
-# so many of these in formulae and can't be autocorrected
-# TODO: fix these as `ruby -w` complains about them.
-Lint/AmbiguousRegexpLiteral:
- Exclude:
- - "Taps/*/*/*.rb"
- - "/**/Formula/*.rb"
- - "**/Formula/*.rb"
-
# useful for metaprogramming in RSpec
Lint/ConstantDefinitionInBlock:
Exclude: | false |
Other | Homebrew | brew | 83255527f3852bda723e658c4eb77cdebec50b70.json | Add workflow to automate manpage updates | .github/workflows/update-manpage.yml | @@ -0,0 +1,75 @@
+name: Update manpage and completions
+
+on:
+ push:
+ paths:
+ - .github/workflows/update-manpage.yml
+ - README.md
+ - Library/Homebrew/cmd/**
+ - Library/Homebrew/dev-cmd/**
+ - Library/Homebrew/completions/**
+ - Library/Homebrew/manpages/**
+ - Library/Homebrew/cli/parser.rb
+ - Library/Homebrew/env_config.rb
+ branches:
+ - master
+ schedule:
+ - cron: "0 0 * * *"
+ workflow_dispatch:
+
+jobs:
+ update-manpage:
+ runs-on: ubuntu-latest
+ if: github.repository == 'Homebrew/brew'
+ steps:
+ - name: Setup Homebrew
+ uses: Homebrew/actions/setup-homebrew@master
+
+ - name: Configure Git user
+ uses: Homebrew/actions/git-user-config@master
+ with:
+ username: BrewTestBot
+
+ - name: Update manpage and completions
+ id: update
+ run: |
+ git fetch origin
+
+ BRANCH=update-manpage
+ echo "::set-output name=branch::${BRANCH}"
+
+ if git ls-remote --exit-code --heads origin "$BRANCH"; then
+ git checkout "$BRANCH"
+ git reset origin/master
+ else
+ git checkout -B "$BRANCH" origin/master
+ BRANCH_EXISTS="1"
+ fi
+
+ brew man
+
+ if [ -n "$(git status --porcelain=v1 2>/dev/null)" ]; then
+ git add "$GITHUB_WORKSPACE/docs/Manpage.md" \
+ "$GITHUB_WORKSPACE/manpages/brew.1" \
+ "$GITHUB_WORKSPACE/completions"
+ git commit -m "Update manpage and completions." \
+ -m "Autogenerated by the [update-manpage](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/update-manpage.yml) workflow."
+ echo "::set-output name=committed::true"
+ if [ -n "$BRANCH_EXISTS" ]; then
+ echo "::set-output name=pull_request::true"
+ fi
+ fi
+
+ - name: Push commits
+ if: steps.update.outputs.committed == 'true'
+ uses: Homebrew/actions/git-try-push@master
+ with:
+ token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
+ branch: ${{ steps.update.outputs.branch }}
+ force: true
+
+ - name: Open a pull request
+ if: steps.update.outputs.pull_request == 'true'
+ run: hub pull-request --no-edit
+ env:
+ GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | false |
Other | Homebrew | brew | 81e3aa899d6146d4e0a36246513e3a72469334bc.json | update-report: use appropriate pronoun in update message | Library/Homebrew/cmd/update-report.rb | @@ -140,6 +140,11 @@ def update_report
unless args.preinstall?
outdated_formulae = Formula.installed.count(&:outdated?)
outdated_casks = Cask::Caskroom.casks.count(&:outdated?)
+ update_pronoun = if (outdated_formulae + outdated_casks) == 1
+ "it"
+ else
+ "them"
+ end
msg = ""
if outdated_formulae.positive?
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{"formula".pluralize(outdated_formulae)}"
@@ -152,7 +157,7 @@ def update_report
puts_stdout_or_stderr
puts_stdout_or_stderr <<~EOS
You have #{msg} installed.
- You can update them with #{Tty.bold}brew upgrade#{Tty.reset}.
+ You can update #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset}.
EOS
end
end | false |
Other | Homebrew | brew | f09c42809934e8e4e21b65fccfe8dd2ca72ac68c.json | workflows/tests: move more macOS tests to Linux.
`brew style` is OS independent so let's run all the `brew style` tests
on Linux rather than macOS. | .github/workflows/tests.yml | @@ -81,6 +81,53 @@ jobs:
- name: Run brew audit --skip-style on all taps
run: brew audit --skip-style
+ - name: Set up all Homebrew taps
+ run: |
+ HOMEBREW_REPOSITORY="$(brew --repo)"
+ HOMEBREW_CORE_REPOSITORY="$HOMEBREW_REPOSITORY/Library/Taps/homebrew/homebrew-core"
+ git -C "$HOMEBREW_CORE_REPOSITORY" remote add homebrew_core https://github.com/Homebrew/homebrew-core
+ git -C "$HOMEBREW_CORE_REPOSITORY" fetch homebrew_core || git -C "$HOMEBREW_CORE_REPOSITORY" fetch homebrew_core
+ git -C "$HOMEBREW_CORE_REPOSITORY" checkout --force -B master homebrew_core/master
+
+ brew tap homebrew/aliases
+ brew tap homebrew/bundle
+ brew tap homebrew/cask
+ brew tap homebrew/cask-drivers
+ brew tap homebrew/cask-fonts
+ brew tap homebrew/cask-versions
+ brew tap homebrew/command-not-found
+ brew tap homebrew/formula-analytics
+ brew tap homebrew/linux-dev
+ brew tap homebrew/portable-ruby
+ brew tap homebrew/services
+
+ brew update-reset Library/Taps/homebrew/homebrew-bundle
+
+ # brew style doesn't like world writable directories
+ sudo chmod -R g-w,o-w "$HOMEBREW_REPOSITORY/Library/Taps"
+
+ - name: Run brew style on homebrew-core
+ run: brew style --display-cop-names homebrew/core
+
+ - name: Run brew style on official taps
+ run: |
+ brew style --display-cop-names homebrew/bundle \
+ homebrew/services \
+ homebrew/test-bot
+
+ brew style --display-cop-names homebrew/aliases\
+ homebrew/command-not-found \
+ homebrew/formula-analytics \
+ homebrew/linux-dev \
+ homebrew/portable-ruby
+
+ - name: Run brew style on cask taps
+ run: |
+ brew style --display-cop-names homebrew/cask \
+ homebrew/cask-drivers \
+ homebrew/cask-fonts \
+ homebrew/cask-versions
+
vendored-gems:
name: vendored gems (Linux)
runs-on: ubuntu-latest
@@ -225,22 +272,6 @@ jobs:
- name: Run brew readall on all taps
run: brew readall --aliases
- - name: Run brew style on homebrew-core
- run: brew style --display-cop-names homebrew/core
-
- - name: Run brew style on official taps
- run: |
- brew style --display-cop-names homebrew/bundle \
- homebrew/services \
- homebrew/test-bot
-
- - name: Run brew style on cask taps
- run: |
- brew style --display-cop-names homebrew/cask \
- homebrew/cask-drivers \
- homebrew/cask-fonts \
- homebrew/cask-versions
-
- name: Run brew audit --skip-style on all taps
run: brew audit --skip-style
| false |
Other | Homebrew | brew | 0fe758dcb2b079d974a3bcfa59898abca76b5cc8.json | sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -7960,17 +7960,17 @@ end
module GetText
end
-class GitHub::Actions::Annotation
+module GitHub::API
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
end
-module GitHub::Actions
+class GitHub::Actions::Annotation
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
end
-module GitHub
+module GitHub::Actions
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
end | false |
Other | Homebrew | brew | 90e9d177894f76b5f5081d3be2a92245b2aafeda.json | formulary: remove consts if loading failed | Library/Homebrew/formulary.rb | @@ -60,6 +60,7 @@ def self.load_formula(name, path, contents, namespace, flags:)
mod.const_set(:BUILD_FLAGS, flags)
mod.module_eval(contents, path)
rescue NameError, ArgumentError, ScriptError, MethodDeprecatedError => e
+ remove_const(namespace)
raise FormulaUnreadableError.new(name, e)
end
class_name = class_s(name)
@@ -71,6 +72,7 @@ def self.load_formula(name, path, contents, namespace, flags:)
.map { |const_name| mod.const_get(const_name) }
.select { |const| const.is_a?(Class) }
new_exception = FormulaClassUnavailableError.new(name, path, class_name, class_list)
+ remove_const(namespace)
raise new_exception, "", e.backtrace
end
end | false |
Other | Homebrew | brew | 6d948bf6ab26b0f1d074e5cedb1c401b1af9f483.json | utils/github: add wrapper for GitHub API method | Library/Homebrew/utils/github.rb | @@ -13,6 +13,12 @@ module GitHub
module_function
+ def open_api(url, data: nil, data_binary_path: nil, request_method: nil, scopes: [].freeze, parse_json: true)
+ odeprecated "GitHub.open_api", "GitHub::API.open_api"
+ API.open_api(url, data: data, data_binary_path: data_binary_path, request_method: request_method,
+ scopes: scopes, parse_json: parse_json)
+ end
+
def check_runs(repo: nil, commit: nil, pr: nil)
if pr
repo = pr.fetch("base").fetch("repo").fetch("full_name") | false |
Other | Homebrew | brew | da9e42f3125d191ef73eabc0db03868229904231.json | formulary: remove consts on cache clear | Library/Homebrew/formulary.rb | @@ -33,6 +33,19 @@ def self.formula_class_get(path)
cache.fetch(path)
end
+ def self.clear_cache
+ cache.each do |key, klass|
+ next if key == :formulary_factory
+
+ namespace = klass.name.deconstantize
+ next if namespace.deconstantize != name
+
+ remove_const(namespace.demodulize)
+ end
+
+ super
+ end
+
def self.load_formula(name, path, contents, namespace, flags:)
raise "Formula loading disabled by HOMEBREW_DISABLE_LOAD_FORMULA!" if Homebrew::EnvConfig.disable_load_formula?
| false |
Other | Homebrew | brew | 22e591e5318ff498c9c18881ec429ad1260c7a93.json | Make HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK default
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes #10623 | Library/Homebrew/env_config.rb | @@ -212,11 +212,6 @@ module EnvConfig
description: "If set, do not use Bootsnap to speed up repeated `brew` calls.",
boolean: true,
},
- HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: {
- description: "If set, fail on the failure of installation from a bottle rather than " \
- "falling back to building from source.",
- boolean: true,
- },
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: {
description: "If set, do not check for broken dependents after installing, upgrading or reinstalling " \
"formulae.", | true |
Other | Homebrew | brew | 22e591e5318ff498c9c18881ec429ad1260c7a93.json | Make HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK default
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes #10623 | Library/Homebrew/formula_installer.rb | @@ -94,7 +94,6 @@ def initialize(
@options = options
@requirement_messages = []
@poured_bottle = false
- @pour_failed = false
@start_time = nil
end
@@ -154,8 +153,6 @@ def build_bottle?
sig { params(output_warning: T::Boolean).returns(T::Boolean) }
def pour_bottle?(output_warning: false)
- return false if @pour_failed
-
return false if !formula.bottle_tag? && !formula.local_bottle_path
return true if force_bottle?
return false if build_from_source? || build_bottle? || interactive?
@@ -235,30 +232,37 @@ def check_install_sanity
# homebrew-core and have full bottle coverage.
(OS.mac? || ENV["CI"]) &&
!build_from_source? && !build_bottle? &&
- !installed_as_dependency? &&
- formula.tap&.core_tap? && !formula.bottle_unneeded? && !formula.any_version_installed? &&
+ formula.tap&.core_tap? && !formula.bottle_unneeded? &&
# Integration tests override homebrew-core locations
ENV["HOMEBREW_TEST_TMPDIR"].nil? &&
!pour_bottle?
message = if !formula.pour_bottle? && formula.pour_bottle_check_unsatisfied_reason
formula_message = formula.pour_bottle_check_unsatisfied_reason
formula_message[0] = formula_message[0].downcase
- "#{formula}: #{formula_message}"
- else
+ <<~EOS
+ #{formula}: #{formula_message}
+ EOS
+ # don't want to complain about no bottle available if doing an
+ # upgrade/reinstall/dependency install (but do in the case the bottle
+ # check fails)
+ elsif !installed_as_dependency? && !formula.any_version_installed?
<<~EOS
#{formula}: no bottle available!
EOS
end
- message += <<~EOS
- You can try to install from source with:
- brew install --build-from-source #{formula}
- Please note building from source is unsupported. You will encounter build
- failures with some formulae. If you experience any issues please create pull
- requests instead of asking for help on Homebrew's GitHub, Twitter or any other
- official channels.
- EOS
- raise CannotInstallFormulaError, message
+
+ if message
+ message += <<~EOS
+ You can try to install from source with:
+ brew install --build-from-source #{formula}
+ Please note building from source is unsupported. You will encounter build
+ failures with some formulae. If you experience any issues please create pull
+ requests instead of asking for help on Homebrew's GitHub, Twitter or any other
+ official channels.
+ EOS
+ raise CannotInstallFormulaError, message
+ end
end
type, reason = DeprecateDisable.deprecate_disable_info formula
@@ -429,7 +433,7 @@ def install
if pour_bottle?
begin
pour
- rescue Exception => e # rubocop:disable Lint/RescueException
+ rescue Exception # rubocop:disable Lint/RescueException
# any exceptions must leave us with nothing installed
ignore_interrupts do
begin
@@ -442,17 +446,7 @@ def install
end
formula.rack.rmdir_if_possible
end
- raise if Homebrew::EnvConfig.developer? ||
- Homebrew::EnvConfig.no_bottle_source_fallback? ||
- force_bottle? ||
- e.is_a?(Interrupt)
-
- @pour_failed = true
- onoe e.message
- opoo "Bottle installation failed: building from source."
- raise UnbottledError, [formula] unless DevelopmentTools.installed?
-
- compute_and_install_dependencies unless ignore_deps?
+ raise
else
@poured_bottle = true
end
@@ -513,7 +507,7 @@ def check_conflicts
$stderr.puts "Please report this issue to the #{formula.tap} tap (not Homebrew/brew or Homebrew/core)!"
false
- else # rubocop:disable Layout/ElseAlignment
+ else
f.linked_keg.exist? && f.opt_prefix.exist?
end
@@ -1123,25 +1117,10 @@ def fetch
return if only_deps?
- if pour_bottle?(output_warning: true)
- begin
- downloader.fetch
- rescue Exception => e # rubocop:disable Lint/RescueException
- raise if Homebrew::EnvConfig.developer? ||
- Homebrew::EnvConfig.no_bottle_source_fallback? ||
- force_bottle? ||
- e.is_a?(Interrupt)
-
- @pour_failed = true
- onoe e.message
- opoo "Bottle installation failed: building from source."
- fetch_dependencies
- end
+ unless pour_bottle?(output_warning: true)
+ formula.fetch_patches
+ formula.resources.each(&:fetch)
end
- return if pour_bottle?
-
- formula.fetch_patches
- formula.resources.each(&:fetch)
downloader.fetch
end
| true |
Other | Homebrew | brew | 22e591e5318ff498c9c18881ec429ad1260c7a93.json | Make HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK default
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes #10623 | docs/Manpage.md | @@ -1852,9 +1852,6 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
- `HOMEBREW_NO_BOOTSNAP`
<br>If set, do not use Bootsnap to speed up repeated `brew` calls.
-- `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK`
- <br>If set, fail on the failure of installation from a bottle rather than falling back to building from source.
-
- `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK`
<br>If set, do not check for broken dependents after installing, upgrading or reinstalling formulae.
| true |
Other | Homebrew | brew | 22e591e5318ff498c9c18881ec429ad1260c7a93.json | Make HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK default
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes #10623 | manpages/brew.1 | @@ -2641,12 +2641,6 @@ If set, do not automatically update before running some commands e\.g\. \fBbrew
If set, do not use Bootsnap to speed up repeated \fBbrew\fR calls\.
.
.TP
-\fBHOMEBREW_NO_BOTTLE_SOURCE_FALLBACK\fR
-.
-.br
-If set, fail on the failure of installation from a bottle rather than falling back to building from source\.
-.
-.TP
\fBHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK\fR
.
.br | true |
Other | Homebrew | brew | bac714a6005c6b9ad577599e20dfec26ec6d48ec.json | Add hyperlinks for election methods | docs/Homebrew-Governance.md | @@ -54,7 +54,7 @@
1. The governance and operation of Homebrew is determined by the PLC. The PLC will represent Homebrew in all dealings with the Software Freedom Conservancy (SFC). The PLC has final authority in all matters related to the operation of Homebrew, and will comply with all Software Freedom Conservancy policies.
-2. The PLC consists of five members. Committee members are elected by Homebrew members in a Meek Single Transferable Vote election using the Droop quota. Each PLC member will serve a term of two years or until the member's successor is elected. Any sudden vacancy in the PLC will be filled by the usual procedure for electing PLC members at the next general meeting, typically the next AGM.
+2. The PLC consists of five members. Committee members are elected by Homebrew members in a [Meek Single Transferable Vote](https://en.wikipedia.org/wiki/Counting_single_transferable_votes#Meek) election using the Droop quota. Each PLC member will serve a term of two years or until the member's successor is elected. Any sudden vacancy in the PLC will be filled by the usual procedure for electing PLC members at the next general meeting, typically the next AGM.
3. Three weeks prior to the AGM, the PLC will nominate at least one candidate for each upcoming vacant seat. Any member may also nominate any other member as a candidate for the PLC at this time.
@@ -84,7 +84,7 @@
1. The Project Leader will represent Homebrew publicly, manage all day-to-day technical decisions, and resolve disputes related to the operation of Homebrew between maintainers, members, other contributors, and users.
-2. The Project Leader will be elected annually by Homebrew members in a Schulze Condorcet method election. The PLC will nominate at least one candidate for Project Leader. Any member may nominate a candidate, or self-nominate. Nominations must be announced to the membership three weeks before the AGM.
+2. The Project Leader will be elected annually by Homebrew members in a [Schulze Condorcet method](https://en.wikipedia.org/wiki/Schulze_method) election. The PLC will nominate at least one candidate for Project Leader. Any member may nominate a candidate, or self-nominate. Nominations must be announced to the membership three weeks before the AGM.
3. Any vacancy of the Project Leader will be filled by appointment of the PLC.
| false |
Other | Homebrew | brew | bf60e2da3ddc49de569fd01726e0ad8a5f794fdb.json | utils/repology: add constants for repository names | Library/Homebrew/dev-cmd/bump.rb | @@ -62,24 +62,30 @@ def bump
next
end
- "homebrew"
+ Repology::HOMEBREW_CORE
else
- "homebrew_casks"
+ Repology::HOMEBREW_CASK
end
package_data = Repology.single_package_query(name, repository: repository)
retrieve_and_display_info(formula_or_cask, name, package_data&.values&.first, args: args)
end
else
api_response = {}
- api_response[:formulae] = Repology.parse_api_response(limit, repository: "homebrew") unless args.cask?
- api_response[:casks] = Repology.parse_api_response(limit, repository: "homebrew_casks") unless args.formula?
+ unless args.cask?
+ api_response[:formulae] =
+ Repology.parse_api_response(limit, repository: Repology::HOMEBREW_CORE)
+ end
+ unless args.formula?
+ api_response[:casks] =
+ Repology.parse_api_response(limit, repository: Repology::HOMEBREW_CASK)
+ end
api_response.each do |package_type, outdated_packages|
repository = if package_type == :formulae
- "homebrew"
+ Repology::HOMEBREW_CORE
else
- "homebrew_casks"
+ Repology::HOMEBREW_CASK
end
outdated_packages.each_with_index do |(_name, repositories), i|
@@ -90,7 +96,7 @@ def bump
next if homebrew_repo.blank?
formula_or_cask = begin
- if repository == "homebrew"
+ if repository == Repology::HOMEBREW_CORE
Formula[homebrew_repo["srcname"]]
else
Cask::CaskLoader.load(homebrew_repo["srcname"]) | true |
Other | Homebrew | brew | bf60e2da3ddc49de569fd01726e0ad8a5f794fdb.json | utils/repology: add constants for repository names | Library/Homebrew/utils/repology.rb | @@ -7,6 +7,9 @@
#
# @api private
module Repology
+ HOMEBREW_CORE = "homebrew"
+ HOMEBREW_CASK = "homebrew_casks"
+
module_function
MAX_PAGINATION = 15
@@ -36,9 +39,9 @@ def single_package_query(name, repository:)
def parse_api_response(limit = nil, repository:)
package_term = case repository
- when "homebrew"
+ when HOMEBREW_CORE
"formula"
- when "homebrew_casks"
+ when HOMEBREW_CASK
"cask"
else
"package" | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | Library/Homebrew/dev-cmd/bump.rb | @@ -16,66 +16,107 @@ def bump_args
Display out-of-date brew formulae and the latest version available.
Also displays whether a pull request has been opened with the URL.
EOS
+ switch "--no-pull-requests",
+ description: "Do not retrieve pull requests from GitHub."
+ switch "--formula", "--formulae",
+ description: "Check only formulae."
+ switch "--cask", "--casks",
+ description: "Check only casks."
flag "--limit=",
description: "Limit number of package results returned."
- named_args :formula
+ conflicts "--cask", "--formula"
+
+ named_args [:formula, :cask]
end
end
def bump
args = bump_args.parse
- requested_formulae = args.named.to_formulae.presence
- requested_limit = args.limit.to_i if args.limit.present?
+ if args.limit.present? && !args.formula? && !args.cask?
+ raise UsageError, "`--limit` must be used with either `--formula` or `--cask`."
+ end
- if requested_formulae
- Livecheck.load_other_tap_strategies(requested_formulae)
+ formulae_and_casks = if args.formula?
+ args.named.to_formulae.presence
+ elsif args.cask?
+ args.named.to_casks.presence
+ else
+ args.named.to_formulae_and_casks.presence
+ end
- requested_formulae.each_with_index do |formula, i|
+ limit = args.limit.to_i if args.limit.present?
+
+ if formulae_and_casks
+ Livecheck.load_other_tap_strategies(formulae_and_casks)
+
+ formulae_and_casks.each_with_index do |formula_or_cask, i|
puts if i.positive?
- if formula.head_only?
- ohai formula.name
- puts "Formula is HEAD-only."
- next
+ name = Livecheck.formula_or_cask_name(formula_or_cask)
+ repository = if formula_or_cask.is_a?(Formula)
+ if formula_or_cask.head_only?
+ ohai name
+ puts "Formula is HEAD-only."
+ next
+ end
+
+ "homebrew"
+ else
+ "homebrew_casks"
end
- package_data = Repology.single_package_query(formula.name)
- retrieve_and_display_info(formula, package_data&.values&.first)
+ package_data = Repology.single_package_query(name, repository: repository)
+ retrieve_and_display_info(formula_or_cask, name, package_data&.values&.first, args: args)
end
else
- outdated_packages = Repology.parse_api_response(requested_limit)
- outdated_packages.each_with_index do |(_name, repositories), i|
- puts if i.positive?
-
- homebrew_repo = repositories.find do |repo|
- repo["repo"] == "homebrew"
+ api_response = {}
+ api_response[:formulae] = Repology.parse_api_response(limit, repository: "homebrew") unless args.cask?
+ api_response[:casks] = Repology.parse_api_response(limit, repository: "homebrew_casks") unless args.formula?
+
+ api_response.each do |package_type, outdated_packages|
+ repository = if package_type == :formulae
+ "homebrew"
+ else
+ "homebrew_casks"
end
- next if homebrew_repo.blank?
+ outdated_packages.each_with_index do |(_name, repositories), i|
+ homebrew_repo = repositories.find do |repo|
+ repo["repo"] == repository
+ end
- formula = begin
- Formula[homebrew_repo["srcname"]]
- rescue
- next
- end
+ next if homebrew_repo.blank?
+
+ formula_or_cask = begin
+ if repository == "homebrew"
+ Formula[homebrew_repo["srcname"]]
+ else
+ Cask::CaskLoader.load(homebrew_repo["srcname"])
+ end
+ rescue
+ next
+ end
+ name = Livecheck.formula_or_cask_name(formula_or_cask)
- retrieve_and_display_info(formula, repositories)
+ puts if i.positive?
+ retrieve_and_display_info(formula_or_cask, name, repositories, args: args)
- break if requested_limit && i >= requested_limit
+ break if limit && i >= limit
+ end
end
end
end
- def livecheck_result(formula)
- skip_result = Livecheck::SkipConditions.skip_information(formula)
+ def livecheck_result(formula_or_cask)
+ skip_result = Livecheck::SkipConditions.skip_information(formula_or_cask)
if skip_result.present?
return "#{skip_result[:status]}#{" - #{skip_result[:messages].join(", ")}" if skip_result[:messages].present?}"
end
version_info = Livecheck.latest_version(
- formula,
+ formula_or_cask,
json: true, full_name: false, verbose: false, debug: false,
)
latest = version_info[:latest] if version_info.present?
@@ -85,8 +126,8 @@ def livecheck_result(formula)
latest.to_s
end
- def retrieve_pull_requests(formula)
- pull_requests = GitHub.fetch_pull_requests(formula.name, formula.tap&.full_name, state: "open")
+ def retrieve_pull_requests(formula_or_cask, name)
+ pull_requests = GitHub.fetch_pull_requests(name, formula_or_cask.tap&.full_name, state: "open")
if pull_requests.try(:any?)
pull_requests = pull_requests.map { |pr| "#{pr["title"]} (#{Formatter.url(pr["html_url"])})" }.join(", ")
end
@@ -96,31 +137,35 @@ def retrieve_pull_requests(formula)
pull_requests
end
- def retrieve_and_display_info(formula, repositories)
- current_version = formula.stable.version.to_s
+ def retrieve_and_display_info(formula_or_cask, name, repositories, args:)
+ current_version = if formula_or_cask.is_a?(Formula)
+ formula_or_cask.stable.version
+ else
+ Version.new(formula_or_cask.version)
+ end
repology_latest = if repositories.present?
Repology.latest_version(repositories)
else
"not found"
end
- livecheck_latest = livecheck_result(formula)
- pull_requests = retrieve_pull_requests(formula)
+ livecheck_latest = livecheck_result(formula_or_cask)
+ pull_requests = retrieve_pull_requests(formula_or_cask, name) unless args.no_pull_requests?
title = if current_version == repology_latest &&
current_version == livecheck_latest
- "#{formula} is up to date!"
+ "#{name} is up to date!"
else
- formula.name
+ name
end
ohai title
puts <<~EOS
Current formula version: #{current_version}
Latest Repology version: #{repology_latest}
Latest livecheck version: #{livecheck_latest}
- Open pull requests: #{pull_requests}
EOS
+ puts "Open pull requests: #{pull_requests}" unless args.no_pull_requests?
end
end | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | Library/Homebrew/test/utils/repology_spec.rb | @@ -6,13 +6,13 @@
describe Repology do
describe "single_package_query", :needs_network do
it "returns nil for non-existent package" do
- response = described_class.single_package_query("invalidName")
+ response = described_class.single_package_query("invalidName", repository: "homebrew")
expect(response).to be_nil
end
it "returns a hash for existing package" do
- response = described_class.single_package_query("openclonk")
+ response = described_class.single_package_query("openclonk", repository: "homebrew")
expect(response).not_to be_nil
expect(response).to be_a(Hash)
@@ -22,7 +22,7 @@
describe "parse_api_response", :needs_network do
it "returns a hash of data" do
limit = 1
- response = described_class.parse_api_response(limit)
+ response = described_class.parse_api_response(limit, repository: "homebrew")
expect(response).not_to be_nil
expect(response).to be_a(Hash) | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | Library/Homebrew/utils/repology.rb | @@ -12,16 +12,16 @@ module Repology
MAX_PAGINATION = 15
private_constant :MAX_PAGINATION
- def query_api(last_package_in_response = "")
+ def query_api(last_package_in_response = "", repository:)
last_package_in_response += "/" if last_package_in_response.present?
- url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=homebrew&outdated=1"
+ url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
output, _errors, _status = curl_output(url.to_s)
JSON.parse(output)
end
- def single_package_query(name)
- url = "https://repology.org/tools/project-by?repo=homebrew&" \
+ def single_package_query(name, repository:)
+ url = "https://repology.org/tools/project-by?repo=#{repository}&" \
"name_type=srcname&target_page=api_v1_project&name=#{name}"
output, _errors, _status = curl_output("--location", url.to_s)
@@ -34,26 +34,34 @@ def single_package_query(name)
end
end
- def parse_api_response(limit = nil)
- ohai "Querying outdated packages from Repology"
+ def parse_api_response(limit = nil, repository:)
+ package_term = case repository
+ when "homebrew"
+ "formula"
+ when "homebrew_casks"
+ "cask"
+ else
+ "package"
+ end
+
+ ohai "Querying outdated #{package_term.pluralize} from Repology"
page_no = 1
outdated_packages = {}
- last_package_index = ""
+ last_package = ""
while page_no <= MAX_PAGINATION
odebug "Paginating Repology API page: #{page_no}"
- response = query_api(last_package_index.to_s)
- response_size = response.size
+ response = query_api(last_package, repository: repository)
outdated_packages.merge!(response)
- last_package_index = outdated_packages.size - 1
+ last_package = response.keys.last
page_no += 1
- break if limit && outdated_packages.size >= limit || response_size <= 1
+ break if limit && outdated_packages.size >= limit || response.size <= 1
end
- puts "#{outdated_packages.size} outdated #{"package".pluralize(outdated_packages.size)} found"
+ puts "#{outdated_packages.size} outdated #{package_term.pluralize(outdated_packages.size)} found"
puts
outdated_packages | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | completions/bash/brew | @@ -427,16 +427,20 @@ _brew_bump() {
case "$cur" in
-*)
__brewcomp "
+ --cask
--debug
+ --formula
--help
--limit
+ --no-pull-requests
--quiet
--verbose
"
return
;;
esac
__brew_complete_formulae
+ __brew_complete_casks
}
_brew_bump_cask_pr() { | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | completions/fish/brew.fish | @@ -387,12 +387,16 @@ __fish_brew_complete_arg 'bottle' -a '(__fish_brew_suggest_formulae_installed)'
__fish_brew_complete_cmd 'bump' 'Display out-of-date brew formulae and the latest version available'
+__fish_brew_complete_arg 'bump' -l cask -d 'Check only casks'
__fish_brew_complete_arg 'bump' -l debug -d 'Display any debugging information'
+__fish_brew_complete_arg 'bump' -l formula -d 'Check only formulae'
__fish_brew_complete_arg 'bump' -l help -d 'Show this message'
__fish_brew_complete_arg 'bump' -l limit -d 'Limit number of package results returned'
+__fish_brew_complete_arg 'bump' -l no-pull-requests -d 'Do not retrieve pull requests from GitHub'
__fish_brew_complete_arg 'bump' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'bump' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_arg 'bump' -a '(__fish_brew_suggest_formulae_all)'
+__fish_brew_complete_arg 'bump' -a '(__fish_brew_suggest_casks_all)'
__fish_brew_complete_cmd 'bump-cask-pr' 'Create a pull request to update cask with a new version' | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | completions/zsh/_brew | @@ -469,12 +469,16 @@ _brew_bottle() {
# brew bump
_brew_bump() {
_arguments \
+ '(--formula)--cask[Check only casks]' \
'--debug[Display any debugging information]' \
+ '(--cask)--formula[Check only formulae]' \
'--help[Show this message]' \
'--limit[Limit number of package results returned]' \
+ '--no-pull-requests[Do not retrieve pull requests from GitHub]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]' \
- '::formula:__brew_formulae'
+ '::formula:__brew_formulae' \
+ '::cask:__brew_casks'
}
# brew bump-cask-pr | true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | docs/Manpage.md | @@ -826,11 +826,17 @@ value, while `--no-rebuild` will remove it.
* `--root-url`:
Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default.
-### `bump` [*`--limit`*`=`] [*`formula`* ...]
+### `bump` [*`options`*] [*`formula`*|*`cask`* ...]
Display out-of-date brew formulae and the latest version available.
Also displays whether a pull request has been opened with the URL.
+* `--no-pull-requests`:
+ Do not retrieve pull requests from GitHub.
+* `--formula`:
+ Check only formulae.
+* `--cask`:
+ Check only casks.
* `--limit`:
Limit number of package results returned.
| true |
Other | Homebrew | brew | 24bb6040a7436d11f9eb8421ee928f3dc7a3c94d.json | dev-cmd/bump: add cask support | manpages/brew.1 | @@ -1132,10 +1132,22 @@ When passed with \fB\-\-write\fR, a new commit will not generated after writing
\fB\-\-root\-url\fR
Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\.
.
-.SS "\fBbump\fR [\fI\-\-limit\fR\fB=\fR] [\fIformula\fR \.\.\.]"
+.SS "\fBbump\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR \.\.\.]"
Display out\-of\-date brew formulae and the latest version available\. Also displays whether a pull request has been opened with the URL\.
.
.TP
+\fB\-\-no\-pull\-requests\fR
+Do not retrieve pull requests from GitHub\.
+.
+.TP
+\fB\-\-formula\fR
+Check only formulae\.
+.
+.TP
+\fB\-\-cask\fR
+Check only casks\.
+.
+.TP
\fB\-\-limit\fR
Limit number of package results returned\.
. | true |
Other | Homebrew | brew | 287b4888e61d956bddf2a6adda9ecb302046f83d.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.10.0.rbi | @@ -1451,6 +1451,16 @@ RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES = T.let(T.unsafe(
module RuboCop::Cop::Gemspec
end
+class RuboCop::Cop::Gemspec::DateAssignment < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def gem_specification(param0 = T.unsafe(nil)); end
+ def on_block(block_node); end
+end
+
+RuboCop::Cop::Gemspec::DateAssignment::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
@@ -4019,12 +4029,14 @@ end
RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base
+ def kernel?(param0 = T.unsafe(nil)); end
def on_send(node); end
+ def valid_receiver?(param0 = T.unsafe(nil), param1); end
private
- def debugger_method?(name); end
- def debugger_receiver?(node); end
+ def debugger_method?(send_node); end
+ def debugger_methods; end
def message(node); end
end
@@ -4089,7 +4101,7 @@ class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base
def algorithm_name(node); end
def autocorrect(corrector, node); end
- def build_cipher_arguments(node, algorithm_name); end
+ def build_cipher_arguments(node, algorithm_name, no_arguments); end
def correction_range(node); end
def message(node); end
def openssl_class(node); end
@@ -4099,6 +4111,8 @@ end
RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -4208,9 +4222,9 @@ end
RuboCop::Cop::Lint::DuplicateRequire::MSG = T.let(T.unsafe(nil), String)
-RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Set)
-RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
class RuboCop::Cop::Lint::DuplicateRescueException < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RescueNode)
@@ -4687,6 +4701,8 @@ RuboCop::Cop::Lint::MultipleComparison::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::MultipleComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base
def class_or_module_or_struct_new_call?(param0 = T.unsafe(nil)); end
def eval_call?(param0 = T.unsafe(nil)); end
@@ -7765,8 +7781,10 @@ class RuboCop::Cop::Style::ConstantVisibility < ::RuboCop::Cop::Base
private
def class_or_module_scope?(node); end
+ def ignore_modules?; end
def match_name?(name, constant_name); end
def message(node); end
+ def module?(node); end
def visibility_declaration?(node); end
end
@@ -8148,22 +8166,31 @@ RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end
def on_send(node); end
def valid_eval_receiver?(param0 = T.unsafe(nil)); end
private
def add_offense_for_different_line(node, line_node, line_diff); end
+ def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end
+ def add_offense_for_missing_line(node, code); end
+ def add_offense_for_missing_location(node, code); end
def add_offense_for_same_line(node, line_node); end
def check_file(node, file_node); end
def check_line(node, code); end
+ def check_location(node, code); end
+ def expected_line(sign, line_diff); end
def file_and_line(node); end
- def message_incorrect_line(method_name, actual, sign, line_diff); end
- def register_offense(node); end
+ def line_difference(line_node, code); end
+ def missing_line(node, code); end
+ def register_offense(node, &block); end
def special_file_keyword?(node); end
def special_line_keyword?(node); end
def string_first_line(str_node); end
+ def with_binding?(node); end
def with_lineno?(node); end
end
@@ -8447,6 +8474,29 @@ class RuboCop::Cop::Style::HashAsLastArrayItem < ::RuboCop::Cop::Base
def last_array_item?(array, node); end
end
+class RuboCop::Cop::Style::HashConversion < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def hash_from_array?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def args_to_hash(args); end
+ def multi_argument(node); end
+ def single_argument(node); end
+end
+
+RuboCop::Cop::Style::HashConversion::MSG_LITERAL_HASH_ARG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::HashConversion::MSG_LITERAL_MULTI_ARG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::HashConversion::MSG_SPLAT = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::HashConversion::MSG_TO_H = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::HashConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Lint::UnusedArgument)
extend(::RuboCop::Cop::AutoCorrector) | false |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/pry@0.13.1.rbi | @@ -1,7 +0,0 @@
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `pry` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
-
-# typed: true
-
- | true |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/pry@0.14.0.rbi | @@ -0,0 +1,8 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `pry` gem.
+# Please instead update this file by running `tapioca sync`.
+
+# typed: true
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires | true |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/spoom@1.0.9.rbi | @@ -5,6 +5,10 @@
# typed: true
module Spoom
+ class << self
+ sig { params(cmd: String, arg: String, path: String, capture_err: T::Boolean).returns([String, T::Boolean]) }
+ def exec(cmd, *arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
+ end
end
module Spoom::Cli
@@ -15,7 +19,10 @@ class Spoom::Cli::Bump < ::Thor
sig { params(directory: String).void }
def bump(directory = T.unsafe(nil)); end
+ def config_files(path: T.unsafe(nil)); end
def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
+ def print_changes(files, command:, from: T.unsafe(nil), to: T.unsafe(nil), dry: T.unsafe(nil), path: T.unsafe(nil)); end
+ def undo_changes(files, from_strictness); end
end
class Spoom::Cli::Config < ::Thor
@@ -43,22 +50,40 @@ Spoom::Cli::Coverage::DATA_DIR = T.let(T.unsafe(nil), String)
module Spoom::Cli::Helper
include(::Thor::Shell)
+ sig { params(string: String).returns(String) }
+ def blue(string); end
sig { returns(T::Boolean) }
def color?; end
sig { params(string: String, color: Symbol).returns(String) }
def colorize(string, color); end
sig { returns(String) }
def exec_path; end
+ sig { params(string: String).returns(String) }
+ def gray(string); end
+ sig { params(string: String).returns(String) }
+ def green(string); end
+ sig { params(string: String).returns(String) }
+ def highlight(string); end
sig { void }
def in_sorbet_project!; end
sig { returns(T::Boolean) }
def in_sorbet_project?; end
- sig { params(message: String, status: String).void }
- def say_error(message, status = T.unsafe(nil)); end
- sig { returns(String) }
+ sig { params(string: String).returns(String) }
+ def red(string); end
+ sig { params(message: String).void }
+ def say(message); end
+ sig { params(message: String, status: T.nilable(String), nl: T::Boolean).void }
+ def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end
+ sig { returns(Spoom::Sorbet::Config) }
def sorbet_config; end
+ sig { returns(String) }
+ def sorbet_config_file; end
+ sig { params(string: String).returns(String) }
+ def yellow(string); end
end
+Spoom::Cli::Helper::HIGHLIGHT_COLOR = T.let(T.unsafe(nil), Symbol)
+
class Spoom::Cli::LSP < ::Thor
include(::Spoom::Cli::Helper)
@@ -97,31 +122,30 @@ end
class Spoom::Cli::Run < ::Thor
include(::Spoom::Cli::Helper)
- def colorize_code(code, colors = T.unsafe(nil)); end
- def colorize_message(message, colors = T.unsafe(nil)); end
+ def colorize_message(message); end
+ def format_error(error, format); end
def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
- def tc; end
-end
-
-module Spoom::Config
+ def tc(*arg); end
end
-Spoom::Config::SORBET_CONFIG = T.let(T.unsafe(nil), String)
+Spoom::Cli::Run::DEFAULT_FORMAT = T.let(T.unsafe(nil), String)
-Spoom::Config::SORBET_GEM_PATH = T.let(T.unsafe(nil), String)
+Spoom::Cli::Run::SORT_CODE = T.let(T.unsafe(nil), String)
-Spoom::Config::SORBET_PATH = T.let(T.unsafe(nil), String)
+Spoom::Cli::Run::SORT_ENUM = T.let(T.unsafe(nil), Array)
-Spoom::Config::SPOOM_PATH = T.let(T.unsafe(nil), String)
+Spoom::Cli::Run::SORT_LOC = T.let(T.unsafe(nil), String)
module Spoom::Coverage
class << self
sig { params(snapshots: T::Array[Spoom::Coverage::Snapshot], palette: Spoom::Coverage::D3::ColorPalette, path: String).returns(Spoom::Coverage::Report) }
def report(snapshots, palette:, path: T.unsafe(nil)); end
sig { params(path: String).returns(Spoom::FileTree) }
def sigils_tree(path: T.unsafe(nil)); end
- sig { params(path: String).returns(Spoom::Coverage::Snapshot) }
- def snapshot(path: T.unsafe(nil)); end
+ sig { params(path: String, rbi: T::Boolean, sorbet_bin: T.nilable(String)).returns(Spoom::Coverage::Snapshot) }
+ def snapshot(path: T.unsafe(nil), rbi: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
+ sig { params(path: String).returns(Spoom::Sorbet::Config) }
+ def sorbet_config(path: T.unsafe(nil)); end
end
end
@@ -548,7 +572,7 @@ class Spoom::FileTree
private
- sig { params(node: Spoom::FileTree::Node, collected_nodes: T::Array[Spoom::FileTree::Node]).returns(T::Array[String]) }
+ sig { params(node: Spoom::FileTree::Node, collected_nodes: T::Array[Spoom::FileTree::Node]).returns(T::Array[Spoom::FileTree::Node]) }
def collect_nodes(node, collected_nodes = T.unsafe(nil)); end
end
@@ -619,7 +643,7 @@ module Spoom::LSP
end
class Spoom::LSP::Client
- def initialize(sorbet_cmd, *sorbet_args, path: T.unsafe(nil)); end
+ def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end
def close; end
def definitions(uri, line, column); end
@@ -866,29 +890,39 @@ class Spoom::Printer
def printt; end
end
+Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String)
+
module Spoom::Sorbet
class << self
- sig { params(arg: String, path: String, capture_err: T::Boolean).returns([String, T::Boolean]) }
- def srb(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
+ sig { params(arg: String, path: String, capture_err: T::Boolean, sorbet_bin: T.nilable(String)).returns([String, T::Boolean]) }
+ def srb(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
sig { params(config: Spoom::Sorbet::Config, path: String).returns(T::Array[String]) }
def srb_files(config, path: T.unsafe(nil)); end
- sig { params(arg: String, path: String, capture_err: T::Boolean).returns(T.nilable(T::Hash[String, Integer])) }
- def srb_metrics(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
- sig { params(arg: String, path: String, capture_err: T::Boolean).returns([String, T::Boolean]) }
- def srb_tc(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
- sig { params(arg: String, path: String, capture_err: T::Boolean).returns(T.nilable(String)) }
- def srb_version(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil)); end
+ sig { params(arg: String, path: String, capture_err: T::Boolean, sorbet_bin: T.nilable(String)).returns(T.nilable(T::Hash[String, Integer])) }
+ def srb_metrics(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
+ sig { params(arg: String, path: String, capture_err: T::Boolean, sorbet_bin: T.nilable(String)).returns([String, T::Boolean]) }
+ def srb_tc(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
+ sig { params(arg: String, path: String, capture_err: T::Boolean, sorbet_bin: T.nilable(String)).returns(T.nilable(String)) }
+ def srb_version(*arg, path: T.unsafe(nil), capture_err: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end
sig { params(gem: String, path: String).returns(T.nilable(String)) }
def version_from_gemfile_lock(gem: T.unsafe(nil), path: T.unsafe(nil)); end
end
end
+Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String)
+
+Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String)
+
class Spoom::Sorbet::Config
sig { void }
def initialize; end
def allowed_extensions; end
+ sig { returns(Spoom::Sorbet::Config) }
+ def copy; end
def ignore; end
+ sig { returns(String) }
+ def options_string; end
sig { returns(T::Array[String]) }
def paths; end
@@ -906,6 +940,10 @@ class Spoom::Sorbet::Config
end
module Spoom::Sorbet::Errors
+ class << self
+ sig { params(errors: T::Array[Spoom::Sorbet::Errors::Error]).returns(T::Array[Spoom::Sorbet::Errors::Error]) }
+ def sort_errors_by_code(errors); end
+ end
end
class Spoom::Sorbet::Errors::Error
@@ -956,6 +994,8 @@ Spoom::Sorbet::Errors::Parser::ERROR_LINE_MATCH_REGEX = T.let(T.unsafe(nil), Reg
Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array)
+Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String)
+
module Spoom::Sorbet::MetricsParser
class << self
sig { params(path: String, prefix: String).returns(T::Hash[String, Integer]) }
@@ -978,7 +1018,7 @@ module Spoom::Sorbet::Sigils
sig { params(path: T.any(Pathname, String)).returns(T.nilable(String)) }
def file_strictness(path); end
sig { params(directory: T.any(Pathname, String), strictness: String, extension: String).returns(T::Array[String]) }
- def files_with_sigil_strictness(directory, strictness, extension = T.unsafe(nil)); end
+ def files_with_sigil_strictness(directory, strictness, extension: T.unsafe(nil)); end
sig { params(strictness: String).returns(String) }
def sigil_string(strictness); end
sig { params(content: String).returns(T.nilable(String)) } | true |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.14.rbi | @@ -362,23 +362,27 @@ class Tapioca::Gemfile
sig { void }
def initialize; end
+ sig { returns(Bundler::Definition) }
+ def definition; end
sig { returns(T::Array[Tapioca::Gemfile::Gem]) }
def dependencies; end
sig { params(gem_name: String).returns(T.nilable(Tapioca::Gemfile::Gem)) }
def gem(gem_name); end
+ sig { returns(T::Array[String]) }
+ def missing_specs; end
sig { void }
def require; end
private
- sig { returns(Bundler::Definition) }
- def definition; end
sig { returns(String) }
def dir; end
sig { returns(File) }
def gemfile; end
sig { returns(T::Array[Symbol]) }
def groups; end
+ sig { returns([T::Array[Tapioca::Gemfile::Gem], T::Array[String]]) }
+ def load_dependencies; end
def lockfile; end
sig { returns(Bundler::Runtime) }
def runtime; end | true |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/thor@1.1.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `thor` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `tapioca sync`.
# typed: true
@@ -77,7 +77,7 @@ module Thor::Actions
def append_to_file(path, *args, &block); end
def apply(path, config = T.unsafe(nil)); end
def behavior; end
- def behavior=(_); end
+ def behavior=(_arg0); end
def chmod(path, mode, config = T.unsafe(nil)); end
def comment_lines(path, flag, *args); end
def copy_file(source, *args, &block); end
@@ -119,7 +119,7 @@ module Thor::Actions
def capture(*args); end
def concat(string); end
def output_buffer; end
- def output_buffer=(_); end
+ def output_buffer=(_arg0); end
def with_output_buffer(buf = T.unsafe(nil)); end
class << self
@@ -280,17 +280,17 @@ module Thor::Base
def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end
def args; end
- def args=(_); end
+ def args=(_arg0); end
def options; end
- def options=(_); end
+ def options=(_arg0); end
def parent_options; end
- def parent_options=(_); end
+ def parent_options=(_arg0); end
class << self
def included(base); end
def register_klass_file(klass); end
def shell; end
- def shell=(_); end
+ def shell=(_arg0); end
def subclass_files; end
def subclasses; end
end
@@ -302,9 +302,9 @@ module Thor::Base::ClassMethods
def allow_incompatible_default_type!; end
def argument(name, options = T.unsafe(nil)); end
def arguments; end
- def attr_accessor(*_); end
- def attr_reader(*_); end
- def attr_writer(*_); end
+ def attr_accessor(*_arg0); end
+ def attr_reader(*_arg0); end
+ def attr_writer(*_arg0); end
def check_default_type; end
def check_default_type!; end
def check_unknown_options; end
@@ -443,8 +443,8 @@ class Thor::Group
def invocations; end
def invoke(*names, &block); end
def invoke_from_option(*names, &block); end
- def printable_commands(*_); end
- def printable_tasks(*_); end
+ def printable_commands(*_arg0); end
+ def printable_tasks(*_arg0); end
def remove_invocation(*names); end
protected
@@ -660,7 +660,7 @@ module Thor::Shell
def say_status(*args, &block); end
def set_color(*args, &block); end
def shell; end
- def shell=(_); end
+ def shell=(_arg0); end
def terminal_width(*args, &block); end
def with_padding; end
def yes?(*args, &block); end
@@ -675,7 +675,7 @@ class Thor::Shell::Basic
def ask(statement, *args); end
def base; end
- def base=(_); end
+ def base=(_arg0); end
def error(statement); end
def file_collision(destination); end
def indent(count = T.unsafe(nil)); end
@@ -689,7 +689,7 @@ class Thor::Shell::Basic
def print_wrapped(message, options = T.unsafe(nil)); end
def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
def say_status(status, message, log_status = T.unsafe(nil)); end
- def set_color(string, *_); end
+ def set_color(string, *_arg1); end
def terminal_width; end
def yes?(statement, color = T.unsafe(nil)); end
@@ -726,6 +726,7 @@ class Thor::Shell::Color < ::Thor::Shell::Basic
protected
def are_colors_disabled?; end
+ def are_colors_supported?; end
def can_display_colors?; end
def diff_lcs_loaded?; end
def output_diff_line(diff); end | true |
Other | Homebrew | brew | 1ae832d9a9d5d0b0fe5b1160b524287c81b9c602.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -14099,8 +14099,6 @@ class Pry::CLI
def self.add_options(&block); end
- def self.add_plugin_options(); end
-
def self.input_args(); end
def self.input_args=(input_args); end
@@ -15386,10 +15384,6 @@ class Pry::Config
def should_load_local_rc=(should_load_local_rc); end
- def should_load_plugins(); end
-
- def should_load_plugins=(should_load_plugins); end
-
def should_load_rc(); end
def should_load_rc=(should_load_rc); end
@@ -16519,66 +16513,6 @@ end
class Pry::Pager
end
-class Pry::PluginManager
- def load_plugins(); end
-
- def locate_plugins(); end
-
- def plugins(); end
- PRY_PLUGIN_PREFIX = ::T.let(nil, ::T.untyped)
-end
-
-class Pry::PluginManager::NoPlugin
- def initialize(name); end
-end
-
-class Pry::PluginManager::NoPlugin
-end
-
-class Pry::PluginManager::Plugin
- def activate!(); end
-
- def active(); end
-
- def active=(active); end
-
- def active?(); end
-
- def disable!(); end
-
- def enable!(); end
-
- def enabled(); end
-
- def enabled=(enabled); end
-
- def enabled?(); end
-
- def gem_name(); end
-
- def gem_name=(gem_name); end
-
- def initialize(name, gem_name, spec, enabled); end
-
- def load_cli_options(); end
-
- def name(); end
-
- def name=(name); end
-
- def spec(); end
-
- def spec=(spec); end
-
- def supported?(); end
-end
-
-class Pry::PluginManager::Plugin
-end
-
-class Pry::PluginManager
-end
-
class Pry::Prompt
def [](key); end
@@ -16817,30 +16751,18 @@ end
class Pry::Slop::Option
def accepts_optional_argument?(); end
- def argument?(); end
-
def argument_in_value(); end
def argument_in_value=(argument_in_value); end
- def as?(); end
-
- def autocreated?(); end
-
def call(*objects); end
- def callback?(); end
-
def config(); end
def count(); end
def count=(count); end
- def default?(); end
-
- def delimiter?(); end
-
def description(); end
def expects_argument?(); end
@@ -16851,22 +16773,10 @@ class Pry::Slop::Option
def key(); end
- def limit?(); end
-
def long(); end
- def match?(); end
-
- def optional?(); end
-
- def optional_argument?(); end
-
- def required?(); end
-
def short(); end
- def tail?(); end
-
def types(); end
def value(); end
@@ -17114,8 +17024,6 @@ class Pry
def self.load_history(); end
- def self.load_plugins(*args, &block); end
-
def self.load_rc_files(); end
def self.load_requires(); end
@@ -17124,8 +17032,6 @@ class Pry
def self.load_win32console(); end
- def self.locate_plugins(*args, &block); end
-
def self.main(); end
def self.memory_size(*args, &block); end
@@ -17140,8 +17046,6 @@ class Pry
def self.pager=(*args, &block); end
- def self.plugins(*args, &block); end
-
def self.print(*args, &block); end
def self.print=(*args, &block); end
@@ -29127,6 +29031,12 @@ class Spoom::Sorbet::Errors::Parser
extend ::T::Private::Methods::SingletonMethodHooks
end
+module Spoom::Sorbet::Errors
+ extend ::T::Sig
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
module Spoom::Sorbet::MetricsParser
extend ::T::Sig
extend ::T::Private::Methods::MethodHooks
@@ -29140,12 +29050,16 @@ module Spoom::Sorbet::Sigils
end
module Spoom::Sorbet
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class Spoom::Timeline
extend ::T::Sig
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
end
-class Spoom::Timeline
+module Spoom
extend ::T::Sig
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks | true |
Other | Homebrew | brew | 79e93f54e2b818476df4ca4c5785d2c87779f035.json | Ignore more parser warnings | Library/Homebrew/style.rb | @@ -78,7 +78,13 @@ def run_rubocop(files, output_type,
fix: false, except_cops: nil, only_cops: nil, display_cop_names: false, reset_cache: false,
debug: false, verbose: false)
Homebrew.install_bundler_gems!
- require "rubocop"
+
+ require "warnings"
+
+ Warnings.ignore :parser_syntax do
+ require "rubocop"
+ end
+
require "rubocops"
args = %w[ | true |
Other | Homebrew | brew | 79e93f54e2b818476df4ca4c5785d2c87779f035.json | Ignore more parser warnings | Library/Homebrew/test/spec_helper.rb | @@ -23,12 +23,17 @@
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
end
+require_relative "../warnings"
+
+Warnings.ignore :parser_syntax do
+ require "rubocop"
+end
+
require "rspec/its"
require "rspec/github"
require "rspec/wait"
require "rspec/retry"
require "rspec/sorbet"
-require "rubocop"
require "rubocop/rspec/support"
require "find"
require "byebug" | true |
Other | Homebrew | brew | 79e93f54e2b818476df4ca4c5785d2c87779f035.json | Ignore more parser warnings | Library/Homebrew/utils/rubocop.rb | @@ -2,18 +2,10 @@
# typed: false
# frozen_string_literal: true
-require "warning"
+require_relative "../warnings"
-warnings = [
- %r{warning: parser/current is loading parser/ruby\d+, which recognizes},
- /warning: \d+\.\d+\.\d+-compliant syntax, but you are running \d+\.\d+\.\d+\./,
- %r{warning: please see https://github\.com/whitequark/parser#compatibility-with-ruby-mri\.},
-]
-
-warnings.each do |warning|
- Warning.ignore warning
+Warnings.ignore :parser_syntax do
+ require "rubocop"
end
-require "rubocop"
-
exit RuboCop::CLI.new.run | true |
Other | Homebrew | brew | 79e93f54e2b818476df4ca4c5785d2c87779f035.json | Ignore more parser warnings | Library/Homebrew/warnings.rb | @@ -0,0 +1,36 @@
+# typed: true
+# frozen_string_literal: true
+
+require "warning"
+
+# Helper module for handling warnings.
+#
+# @api private
+module Warnings
+ module_function
+
+ COMMON_WARNINGS = {
+ parser_syntax: [
+ %r{warning: parser/current is loading parser/ruby\d+, which recognizes},
+ /warning: \d+\.\d+\.\d+-compliant syntax, but you are running \d+\.\d+\.\d+\./,
+ %r{warning: please see https://github\.com/whitequark/parser#compatibility-with-ruby-mri\.},
+ ],
+ }.freeze
+
+ def ignore(*warnings)
+ warnings.map! do |warning|
+ next warning if !warning.is_a?(Symbol) || !COMMON_WARNINGS.key?(warning)
+
+ COMMON_WARNINGS[warning]
+ end
+
+ warnings.flatten.each do |warning|
+ Warning.ignore warning
+ end
+ return unless block_given?
+
+ result = yield
+ Warning.clear
+ result
+ end
+end | true |
Other | Homebrew | brew | 79e93f54e2b818476df4ca4c5785d2c87779f035.json | Ignore more parser warnings | Library/Homebrew/warnings.rbi | @@ -0,0 +1,5 @@
+# typed: strict
+
+module Warnings
+ include Kernel
+end | true |
Other | Homebrew | brew | 1cc983f00d552da17336405460e3adc001c95ba5.json | download_strategy: pass chdir block to stage | Library/Homebrew/download_strategy.rb | @@ -71,25 +71,29 @@ def quiet?
# Unlike {Resource#stage}, this does not take a block.
#
# @api public
- def stage
+ def stage(&block)
UnpackStrategy.detect(cached_location,
prioritise_extension: true,
ref_type: @ref_type, ref: @ref)
.extract_nestedly(basename: basename,
prioritise_extension: true,
verbose: verbose? && !quiet?)
- chdir
+ chdir(&block)
end
- def chdir
+ def chdir(&block)
entries = Dir["*"]
raise "Empty archive" if entries.length.zero?
- return if entries.length != 1
- begin
- Dir.chdir entries.first
- rescue
- nil
+ if entries.length != 1
+ yield if block
+ return
+ end
+
+ if File.directory? entries.first
+ Dir.chdir(entries.first, &block)
+ elsif block
+ yield
end
end
private :chdir | true |
Other | Homebrew | brew | 1cc983f00d552da17336405460e3adc001c95ba5.json | download_strategy: pass chdir block to stage | Library/Homebrew/resource.rb | @@ -114,14 +114,15 @@ def apply_patches
# A target or a block must be given, but not both.
def unpack(target = nil)
mktemp(download_name) do |staging|
- downloader.stage
- @source_modified_time = downloader.source_modified_time
- apply_patches
- if block_given?
- yield ResourceStageContext.new(self, staging)
- elsif target
- target = Pathname(target)
- target.install Pathname.pwd.children
+ downloader.stage do
+ @source_modified_time = downloader.source_modified_time
+ apply_patches
+ if block_given?
+ yield ResourceStageContext.new(self, staging)
+ elsif target
+ target = Pathname(target)
+ target.install Pathname.pwd.children
+ end
end
end
end | true |
Other | Homebrew | brew | 3cb3b34c09578387fd15200d6b919a9ccd03f02b.json | Apply suggestions from code review
Co-authored-by: Megan O'Neill <oneill38@github.com> | .github/ISSUE_TEMPLATE/bug.yml | @@ -2,7 +2,7 @@ name: New issue for Reproducible Bug
about: "If you're sure it's reproducible and not just your machine: submit an issue so we can investigate."
labels: bug
issue_body: false
-inputs:
+body:
- type: markdown
attributes:
value: Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again. | true |
Other | Homebrew | brew | 3cb3b34c09578387fd15200d6b919a9ccd03f02b.json | Apply suggestions from code review
Co-authored-by: Megan O'Neill <oneill38@github.com> | .github/ISSUE_TEMPLATE/feature.yml | @@ -2,7 +2,7 @@ name: New issue for Feature Suggestion
about: Request our thoughts on your suggestion for a new feature for Homebrew.
labels: features
issue_body: false
-inputs:
+body:
- type: markdown
attributes:
value: Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again. | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/.rubocop.yml | @@ -7,10 +7,6 @@ Layout/MultilineMethodCallIndentation:
Exclude:
- "**/*_spec.rb"
-# TODO: add parentheses for these and remove
-Lint/AssignmentInCondition:
- Enabled: false
-
# `formula do` uses nested method definitions
Lint/NestedMethodDefinition:
Exclude: | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cask/audit.rb | @@ -696,7 +696,7 @@ def get_repo_data(regex)
def check_denylist
return unless cask.tap
return unless cask.tap.official?
- return unless reason = Denylist.reason(cask.token)
+ return unless (reason = Denylist.reason(cask.token))
add_error "#{cask.token} is not allowed: #{reason}"
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cask/caskroom.rb | @@ -39,9 +39,9 @@ def self.casks(config: nil)
Pathname.glob(path.join("*")).sort.select(&:directory?).map do |path|
token = path.basename.to_s
- if tap_path = CaskLoader.tap_paths(token).first
+ if (tap_path = CaskLoader.tap_paths(token).first)
CaskLoader::FromTapPathLoader.new(tap_path).load(config: config)
- elsif caskroom_path = Pathname.glob(path.join(".metadata/*/*/*/*.rb")).first
+ elsif (caskroom_path = Pathname.glob(path.join(".metadata/*/*/*/*.rb")).first)
CaskLoader::FromPathLoader.new(caskroom_path).load(config: config)
else
CaskLoader.load(token, config: config) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cask/installer.rb | @@ -191,7 +191,7 @@ def extract_primary_container(to: @cask.staged_path)
basename = downloader.basename
- if nested_container = @cask.container&.nested
+ if (nested_container = @cask.container&.nested)
Dir.mktmpdir do |tmpdir|
tmpdir = Pathname(tmpdir)
primary_container.extract(to: tmpdir, basename: basename, verbose: verbose?) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cleanup.rb | @@ -80,7 +80,7 @@ def stale_formula?(scrub)
version = Version.new(version)
- return false unless formula_name = basename.to_s[/\A(.*?)(?:--.*?)*--?(?:#{Regexp.escape(version)})/, 1]
+ return false unless (formula_name = basename.to_s[/\A(.*?)(?:--.*?)*--?(?:#{Regexp.escape(version)})/, 1])
formula = begin
Formulary.from_rack(HOMEBREW_CELLAR/formula_name)
@@ -95,7 +95,7 @@ def stale_formula?(scrub)
if resource_name == "patch"
patch_hashes = formula.stable&.patches&.select(&:external?)&.map(&:resource)&.map(&:version)
return true unless patch_hashes&.include?(Checksum.new(version.to_s))
- elsif resource_name && resource_version = formula.stable&.resources&.dig(resource_name)&.version
+ elsif resource_name && (resource_version = formula.stable&.resources&.dig(resource_name)&.version)
return true if resource_version != version
elsif version.is_a?(PkgVersion)
return true if formula.pkg_version > version
@@ -111,7 +111,7 @@ def stale_formula?(scrub)
end
def stale_cask?(scrub)
- return false unless name = basename.to_s[/\A(.*?)--/, 1]
+ return false unless (name = basename.to_s[/\A(.*?)--/, 1])
cask = begin
Cask::CaskLoader.load(name) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cli/parser.rb | @@ -623,7 +623,7 @@ def process_option(*args, type:)
end
def split_non_options(argv)
- if sep = argv.index("--")
+ if (sep = argv.index("--"))
[argv.take(sep), argv.drop(sep + 1)]
else
[argv, []] | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cmd/info.rb | @@ -227,7 +227,7 @@ def github_info(f)
def info_formula(f, args:)
specs = []
- if stable = f.stable
+ if (stable = f.stable)
s = "stable #{stable.version}"
s += " (bottled)" if stable.bottled? && f.pour_bottle?
specs << s | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cmd/install.rb | @@ -264,7 +264,7 @@ def install
end
end
opoo msg if msg
- elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first
+ elsif !f.any_version_installed? && (old_formula = f.old_installed_formulae.first)
msg = "#{old_formula.full_name} #{old_formula.any_installed_version} already installed"
msg = if !old_formula.linked? && !old_formula.keg_only?
<<~EOS | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/cmd/search.rb | @@ -73,7 +73,7 @@ def search_args
def search
args = search_args.parse
- if package_manager = PACKAGE_MANAGERS.find { |name,| args[:"#{name}?"] }
+ if (package_manager = PACKAGE_MANAGERS.find { |name,| args[:"#{name}?"] })
_, url = package_manager
exec_browser url.call(URI.encode_www_form_component(args.named.join(" ")))
return | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/commands.rb | @@ -175,7 +175,7 @@ def command_options(command)
path = self.path(command)
return if path.blank?
- if cmd_parser = Homebrew::CLI::Parser.from_cmd_path(path)
+ if (cmd_parser = Homebrew::CLI::Parser.from_cmd_path(path))
cmd_parser.processed_options.map do |short, long, _, desc|
[long || short, desc]
end
@@ -198,7 +198,7 @@ def command_description(command, short: false)
path = self.path(command)
return if path.blank?
- if cmd_parser = Homebrew::CLI::Parser.from_cmd_path(path)
+ if (cmd_parser = Homebrew::CLI::Parser.from_cmd_path(path))
if short
cmd_parser.description.split(".").first
else | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/completions.rb | @@ -167,7 +167,7 @@ def generate_bash_subcommand_completion(command)
return unless command_gets_completions? command
named_completion_string = ""
- if types = Commands.named_args_type(command)
+ if (types = Commands.named_args_type(command))
named_args_strings, named_args_types = types.partition { |type| type.is_a? String }
named_args_types.each do |type|
@@ -221,7 +221,7 @@ def generate_zsh_subcommand_completion(command)
conflicts = generate_zsh_option_exclusions(command, opt)
"#{conflicts}#{opt}[#{format_description desc}]"
end
- if types = Commands.named_args_type(command)
+ if (types = Commands.named_args_type(command))
named_args_strings, named_args_types = types.partition { |type| type.is_a? String }
named_args_types.each do |type|
@@ -291,7 +291,7 @@ def generate_fish_subcommand_completion(command)
subcommands = []
named_args = []
- if types = Commands.named_args_type(command)
+ if (types = Commands.named_args_type(command))
named_args_strings, named_args_types = types.partition { |type| type.is_a? String }
named_args_types.each do |type| | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/context.rb | @@ -16,7 +16,7 @@ def self.current=(context)
end
def self.current
- if current_context = Thread.current[:context]
+ if (current_context = Thread.current[:context])
return current_context
end
| true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/dev-cmd/bottle.rb | @@ -254,7 +254,7 @@ def sudo_purge
def bottle_formula(f, args:)
return ofail "Formula not installed or up-to-date: #{f.full_name}" unless f.latest_version_installed?
- unless tap = f.tap
+ unless (tap = f.tap)
return ofail "Formula not from core or any installed taps: #{f.full_name}" unless args.force_core_tap?
tap = CoreTap.instance | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/dev-cmd/create.rb | @@ -179,7 +179,7 @@ def create_formula(args:)
# Check for disallowed formula, or names that shadow aliases,
# unless --force is specified.
unless args.force?
- if reason = MissingFormula.disallowed_reason(fc.name)
+ if (reason = MissingFormula.disallowed_reason(fc.name))
odie <<~EOS
The formula '#{fc.name}' is not allowed to be created.
#{reason} | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/dev-cmd/man.rb | @@ -164,7 +164,7 @@ def generate_cmd_manpages(cmd_paths)
# preserve existing manpage order
cmd_paths.sort_by(&method(:sort_key_for_path))
.each do |cmd_path|
- cmd_man_page_lines = if cmd_parser = CLI::Parser.from_cmd_path(cmd_path)
+ cmd_man_page_lines = if (cmd_parser = CLI::Parser.from_cmd_path(cmd_path))
next if cmd_parser.hide_from_man_page
cmd_parser_manpage_lines(cmd_parser).join | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/dev-cmd/unpack.rb | @@ -38,7 +38,7 @@ def unpack
formulae = args.named.to_formulae
- if dir = args.destdir
+ if (dir = args.destdir)
unpack_dir = Pathname.new(dir).expand_path
unpack_dir.mkpath
else | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/dev-cmd/update-test.rb | @@ -54,9 +54,9 @@ def update_test
start_commit, end_commit = nil
cd HOMEBREW_REPOSITORY do
- start_commit = if commit = args.commit
+ start_commit = if (commit = args.commit)
commit
- elsif date = args.before
+ elsif (date = args.before)
Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp
elsif args.to_tag?
tags = Utils.popen_read("git", "tag", "--list", "--sort=-version:refname") | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/development_tools.rb | @@ -43,7 +43,7 @@ def default_compiler
def clang_version
@clang_version ||= begin
if (path = locate("clang")) &&
- build_version = `#{path} --version`[/(?:clang|LLVM) version (\d+\.\d)/, 1]
+ (build_version = `#{path} --version`[/(?:clang|LLVM) version (\d+\.\d)/, 1])
Version.new build_version
else
Version::NULL
@@ -54,7 +54,7 @@ def clang_version
def clang_build_version
@clang_build_version ||= begin
if (path = locate("clang")) &&
- build_version = `#{path} --version`[%r{clang(-| version [^ ]+ \(tags/RELEASE_)(\d{2,})}, 2]
+ (build_version = `#{path} --version`[%r{clang(-| version [^ ]+ \(tags/RELEASE_)(\d{2,})}, 2])
Version.new build_version
else
Version::NULL
@@ -66,7 +66,7 @@ def llvm_clang_build_version
@llvm_clang_build_version ||= begin
path = Formulary.factory("llvm").opt_prefix/"bin/clang"
if path.executable? &&
- build_version = `#{path} --version`[/clang version (\d\.\d\.\d)/, 1]
+ (build_version = `#{path} --version`[/clang version (\d\.\d\.\d)/, 1])
Version.new build_version
else
Version::NULL
@@ -79,7 +79,7 @@ def non_apple_gcc_version(cc)
path = HOMEBREW_PREFIX/"opt/#{CompilerSelector.preferred_gcc}/bin"/cc
path = locate(cc) unless path.exist?
version = if path &&
- build_version = `#{path} --version`[/gcc(?:(?:-\d+(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1]
+ (build_version = `#{path} --version`[/gcc(?:(?:-\d+(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1])
Version.new build_version
else
Version::NULL | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.