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 | b7847e4657a84e80d97ce1582658058eca91cdbf.json | Don’t migrate symlinks. | Library/Homebrew/update_migrator/cache_entries_to_symlinks.rb | @@ -29,6 +29,7 @@ def migrate_cache_entries_to_symlinks(initial_version)
formula_downloaders = if HOMEBREW_CACHE.directory?
HOMEBREW_CACHE.children
+ .reject(&:symlink?)
.select(&:file?)
.map { |child| child.basename.to_s.sub(/\-\-.*/, "") }
... | false |
Other | Homebrew | brew | 398845891938879f3df3772102903827b4e76b17.json | Use real basename for output. | Library/Homebrew/download_strategy.rb | @@ -11,7 +11,7 @@ class AbstractDownloadStrategy
module Pourable
def stage
- ohai "Pouring #{cached_location.basename}"
+ ohai "Pouring #{basename}"
super
end
end
@@ -85,7 +85,7 @@ def clear_cache
end
def basename
- nil
+ cached_location.basename
end
private | false |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/brew.rb | @@ -14,6 +14,8 @@
require_relative "global"
+require "update_migrator"
+
begin
trap("INT", std_trap) # restore default CTRL-C handler
@@ -76,7 +78,7 @@
end
# Migrate LinkedKegs/PinnedKegs if update didn't already do so
- migrate_legacy_keg_symlinks_if_necessary
+ UpdateMigrator.migrate_legacy_keg_s... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/cmd/update-report.rb | @@ -7,7 +7,7 @@
require "formulary"
require "descriptions"
require "cleanup"
-require "hbc/download"
+require "update_migrator"
module Homebrew
module_function
@@ -111,10 +111,10 @@ def update_report
updated = true
end
- migrate_legacy_cache_if_necessary
- migrate_cache_entries_to_double_da... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/test/update_migrator_spec.rb | @@ -1,6 +1,6 @@
-require "cmd/update-report"
+require "update_migrator"
-describe "brew update-report" do
+describe UpdateMigrator do
describe "::migrate_cache_entries_to_double_dashes" do
let(:formula_name) { "foo" }
let(:f) {
@@ -18,7 +18,7 @@
end
it "moves old files to use double dashes wh... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator.rb | @@ -0,0 +1,39 @@
+require "update_migrator/cache_entries_to_double_dashes"
+require "update_migrator/cache_entries_to_symlinks"
+require "update_migrator/legacy_cache"
+require "update_migrator/legacy_keg_symlinks"
+require "update_migrator/legacy_repository"
+
+module UpdateMigrator
+ module_function
+
+ def formula... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator/cache_entries_to_double_dashes.rb | @@ -0,0 +1,41 @@
+module UpdateMigrator
+ module_function
+
+ def migrate_cache_entries_to_double_dashes(initial_version)
+ return if initial_version && initial_version > "1.7.1"
+
+ return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA")
+
+ ohai "Migrating cache entries..."
+
+ Formula.each do |formula|
+ ... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator/cache_entries_to_symlinks.rb | @@ -0,0 +1,90 @@
+require "hbc/cask_loader"
+require "hbc/download"
+
+module UpdateMigrator
+ module_function
+
+ def migrate_cache_entries_to_symlinks(initial_version)
+ return if initial_version && initial_version > "1.7.2"
+
+ return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA")
+
+ ohai "Migrating cache ... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator/legacy_cache.rb | @@ -0,0 +1,53 @@
+module UpdateMigrator
+ module_function
+
+ def migrate_legacy_cache_if_necessary
+ legacy_cache = Pathname.new "/Library/Caches/Homebrew"
+ return if HOMEBREW_CACHE.to_s == legacy_cache.to_s
+ return unless legacy_cache.directory?
+ return unless legacy_cache.readable_real?
+
+ migra... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator/legacy_keg_symlinks.rb | @@ -0,0 +1,42 @@
+module UpdateMigrator
+ module_function
+
+ def migrate_legacy_keg_symlinks_if_necessary
+ legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs"
+ return unless legacy_linked_kegs.directory?
+
+ HOMEBREW_LINKED_KEGS.mkpath unless legacy_linked_kegs.children.empty?
+ legacy_linked_kegs.child... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/update_migrator/legacy_repository.rb | @@ -0,0 +1,122 @@
+module UpdateMigrator
+ module_function
+
+ def migrate_legacy_repository_if_necessary
+ return unless HOMEBREW_PREFIX.to_s == "/usr/local"
+ return unless HOMEBREW_REPOSITORY.to_s == "/usr/local"
+
+ ohai "Migrating HOMEBREW_REPOSITORY (please wait)..."
+
+ unless HOMEBREW_PREFIX.writa... | true |
Other | Homebrew | brew | 516a39f5a471822b0565ae24189cc5389caaf923.json | Move migrations into `UpdateMigrator` module. | Library/Homebrew/utils.rb | @@ -498,45 +498,6 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
out
end
-def migrate_legacy_keg_symlinks_if_necessary
- legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs"
- return unless legacy_linked_kegs.directory?
-
- HOMEBREW_LINKED_KEGS.mkpath unless legacy_linked_kegs.children.empt... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/cask/lib/hbc/download.rb | @@ -1,4 +1,5 @@
require "fileutils"
+require "hbc/cache"
require "hbc/quarantine"
require "hbc/verify"
@@ -19,18 +20,18 @@ def perform
downloaded_path
end
- private
-
- attr_reader :force
- attr_accessor :downloaded_path
-
def downloader
@downloader ||= begin
strategy = ... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/cleanup.rb | @@ -48,7 +48,7 @@ def prune?(days)
end
def stale?(scrub = false)
- return false unless file?
+ return false unless file? || (symlink? && resolved_path.file?)
stale_formula?(scrub) || stale_cask?(scrub)
end
@@ -209,6 +209,19 @@ def cleanup_logs
end
end
+ def cleanup_u... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/cmd/update-report.rb | @@ -7,6 +7,7 @@
require "formulary"
require "descriptions"
require "cleanup"
+require "hbc/download"
module Homebrew
module_function
@@ -112,6 +113,7 @@ def update_report
migrate_legacy_cache_if_necessary
migrate_cache_entries_to_double_dashes(initial_version)
+ migrate_cache_entries_to_symlinks... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/dev-cmd/tests.rb | @@ -37,6 +37,7 @@ def tests
ENV.delete("HOMEBREW_COLOR")
ENV.delete("HOMEBREW_NO_COLOR")
ENV.delete("HOMEBREW_VERBOSE")
+ ENV.delete("HOMEBREW_DEBUG")
ENV.delete("VERBOSE")
ENV.delete("HOMEBREW_CASK_OPTS")
ENV.delete("HOMEBREW_TEMP") | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/download_strategy.rb | @@ -2,6 +2,8 @@
require "rexml/document"
require "time"
require "unpack_strategy"
+require "lazy_object"
+require "cgi"
class AbstractDownloadStrategy
extend Forwardable
@@ -14,7 +16,7 @@ def stage
end
end
- attr_reader :cached_location
+ attr_reader :cache, :cached_location, :url
attr_reader :m... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/extend/pathname.rb | @@ -24,6 +24,12 @@ def abv
private
def compute_disk_usage
+ if symlink? && !exist?
+ @file_count = 1
+ @disk_usage = 0
+ return
+ end
+
path = if symlink?
resolved_path
else | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/test/cask/cli/reinstall_spec.rb | @@ -10,7 +10,7 @@
output = Regexp.new <<~EOS
==> Downloading file:.*caffeine.zip
- Already downloaded: .*local-caffeine--1.2.3.zip
+ Already downloaded: .*caffeine.zip
==> Verifying checksum for Cask local-caffeine
==> Uninstalling Cask local-caffeine
==> Backing App 'Caffei... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/test/cmd/--cache_spec.rb | @@ -8,7 +8,7 @@
it "prints all cache files for a given Formula" do
expect { brew "--cache", testball }
- .to output(%r{#{HOMEBREW_CACHE}/testball-}).to_stdout
+ .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}\-\-testball\-}).to_stdout
.and not_to_output.to_stderr
.and be_a_succes... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/test/cmd/fetch_spec.rb | @@ -2,10 +2,9 @@
it "downloads the Formula's URL" do
setup_test_formula "testball"
- expect(HOMEBREW_CACHE/"testball--0.1.tbz").not_to exist
-
expect { brew "fetch", "testball" }.to be_a_success
+ expect(HOMEBREW_CACHE/"testball--0.1.tbz").to be_a_symlink
expect(HOMEBREW_CACHE/"testball--0.1... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/test/cmd/update-report_spec.rb | @@ -43,4 +43,42 @@
expect(new_cache_file).not_to exist
end
end
+
+ describe "::migrate_cache_entries_to_symlinks" do
+ let(:formula_name) { "foo" }
+ let(:f) {
+ formula formula_name do
+ url "https://example.com/foo-1.2.3.tar.gz"
+ version "1.2.3"
+ end
+ }
+ let(:ol... | true |
Other | Homebrew | brew | fbcaa8c85ae42f127fd94a5d82f86a3eafb34848.json | Resolve URL to get real file extension. | Library/Homebrew/test/download_strategies_spec.rb | @@ -207,16 +207,12 @@ def setup_git_repo
let(:url) { "https://bucket.s3.amazonaws.com/foo.tar.gz" }
let(:version) { nil }
- describe "#_fetch" do
- subject { described_class.new(url, name, version)._fetch }
-
+ describe "#fetch" do
context "when given Bad S3 URL" do
let(:url) { "https://example... | true |
Other | Homebrew | brew | b7b5fb930da5116277152a11044c187414aecef7.json | superenv: Use 02 optimization flag for Linux builds
`-Os` produces sometimes bigger binaries on Linux.
Also, llvm built with `-Os` is really slow at runtime for Linux.
Using `-02` aligns us with what Debian does, and as we are compiling most of our stuff with gcc (and not clang), it makes sense to use `-02` on Linux.... | Library/Homebrew/extend/os/linux/extend/ENV/super.rb | @@ -7,6 +7,7 @@ def self.bin
# @private
def setup_build_environment(formula = nil)
generic_setup_build_environment(formula)
+ self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2"
self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path
self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(formula)
... | false |
Other | Homebrew | brew | ff711fcfad68eec3f40ac7206a8fde7fd1982a99.json | Maintainer-Guidelines: note consensus and final say. | docs/Maintainer-Guidelines.md | @@ -117,7 +117,7 @@ All communication should ideally occur in public on GitHub. Where this is not po
This makes it easier for other maintainers, contributors and users to follow along with what we're doing (and, more importantly, why we're doing it) and means that decisions have a linkable URL.
## Lead maintainer g... | false |
Other | Homebrew | brew | 23846d6ca82225c1e6941df199a1ea643981884b.json | audit: Add null check on style results | Library/Homebrew/dev-cmd/audit.rb | @@ -130,7 +130,7 @@ def audit
formula_count += 1
problem_count += fa.problems.size
problem_lines = format_problem_lines(fa.problems)
- corrected_problem_count = options[:style_offenses].count(&:corrected?)
+ corrected_problem_count = options[:style_offenses]&.count(&:corrected?)
ne... | false |
Other | Homebrew | brew | ca6c75d229c73a2523e95aa3736a8031c2f8c158.json | Check version conflicts using linkage.
Instead of refusing to install software preemptively by assuming
multiple linkage to differing versions of the same library we now make
`brew linkage --test` verify that we don't have two versions of the
same library linked at the same time.
This will be considerably more permis... | Library/Homebrew/formula_installer.rb | @@ -155,8 +155,6 @@ def check_install_sanity
recursive_deps = formula.recursive_dependencies
recursive_formulae = recursive_deps.map(&:to_formula)
- recursive_runtime_formulae =
- formula.runtime_formula_dependencies(undeclared: false)
recursive_dependencies = []
recursive_formulae.each ... | true |
Other | Homebrew | brew | ca6c75d229c73a2523e95aa3736a8031c2f8c158.json | Check version conflicts using linkage.
Instead of refusing to install software preemptively by assuming
multiple linkage to differing versions of the same library we now make
`brew linkage --test` verify that we don't have two versions of the
same library linked at the same time.
This will be considerably more permis... | Library/Homebrew/linkage_checker.rb | @@ -19,6 +19,7 @@ def initialize(keg, formula = nil, cache_db:, rebuild_cache: false)
@indirect_deps = []
@undeclared_deps = []
@unnecessary_deps = []
+ @version_conflict_deps = []
check_dylibs(rebuild_cache: rebuild_cache)
end
@@ -50,11 +51,14 @@ def display_reverse_output
def displa... | true |
Other | Homebrew | brew | dced0da7e9577329db39272897aee60b4328307e.json | docs/Maintainer-Guidelines: add lead maintainer guidelines. | docs/Maintainer-Guidelines.md | @@ -115,3 +115,10 @@ Maintainers have a variety of ways to communicate with each other:
All communication should ideally occur in public on GitHub. Where this is not possible or appropriate (e.g. a security disclosure, interpersonal issue between two maintainers, urgent breakage that needs to be resolved) this can mov... | false |
Other | Homebrew | brew | ad0f9d603f5b04cb0c4e9d75fab36f4118bff942.json | extract: localize DependencyCollector monkey-patches too | Library/Homebrew/dev-cmd/extract.rb | @@ -37,6 +37,20 @@ def with_monkey_patch
define_method(:method_missing) { |*| }
end
+ DependencyCollector.class_eval do
+ if method_defined?(:parse_symbol_spec)
+ alias_method :old_parse_symbol_spec, :parse_symbol_spec
+ end
+ define_method(:parse_symbol_spec) { |*| }
+ end
+
+ DependencyColl... | false |
Other | Homebrew | brew | bd352bcf35fd45f811e5bd2dbe7f918124e591a2.json | extract: use localized monkey-patching
Instead of just blanketing over with monkey-patches like before,
set up monkey-patches as needed, and make sure to clean up after
we're done. | Library/Homebrew/dev-cmd/extract.rb | @@ -15,28 +15,49 @@
require "formulary"
require "tap"
-# rubocop:disable Style/MethodMissingSuper
-class BottleSpecification
- def method_missing(*); end
+def with_monkey_patch
+ BottleSpecification.class_eval do
+ if method_defined?(:method_missing)
+ alias_method :old_method_missing, :method_missing
+ ... | false |
Other | Homebrew | brew | a8563afc9e60abc749bff43177c768c0af69dab9.json | extract: add progress message when searching Git history
For the impatient ones out there. | Library/Homebrew/dev-cmd/extract.rb | @@ -78,6 +78,7 @@ def extract
file = repo/"Formula/#{name}.rb"
if args.version
+ ohai "Searching repository history"
version = args.version
rev = "HEAD"
test_formula = nil
@@ -99,6 +100,7 @@ def extract
version = Formulary.factory(file).version
result = File.read(file... | false |
Other | Homebrew | brew | d4a2006f0404de6696876e0e252ebc707ce419ee.json | extract: add missing monkey-patch | Library/Homebrew/dev-cmd/extract.rb | @@ -32,6 +32,14 @@ def respond_to_missing?(*)
end
end
+class Resource
+ def method_missing(*); end
+
+ def respond_to_missing?(*)
+ true
+ end
+end
+
class DependencyCollector
def parse_symbol_spec(*); end
| false |
Other | Homebrew | brew | 0e080eba97095d0212c605390ec59df2d52d23b0.json | extract: simplify integration tests | Library/Homebrew/test/dev-cmd/extract_spec.rb | @@ -1,5 +1,5 @@
describe "brew extract", :integration_test do
- it "retrieves the most recent formula version without version argument" do
+ it "retrieves the specified version of formula, defaulting to most recent" do
path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
(path/"Formula").mkpath
target = ... | false |
Other | Homebrew | brew | a232e3a791ac97b3ac45ab9d6b34e5c65a49b943.json | extract: fix corner case
If the formula to be retrieved was just version-bumped in the most
recent commit (HEAD), we would've ended up grabbing the second-most
recent version.
Instead, if the file already exists in tree at the current commit,
just construct the formula from that to get the version (for naming
purpose... | Library/Homebrew/dev-cmd/extract.rb | @@ -16,10 +16,18 @@
class BottleSpecification
def method_missing(*); end
+
+ def respond_to_missing?(*)
+ true
+ end
end
class Module
def method_missing(*); end
+
+ def respond_to_missing?(*)
+ true
+ end
end
class DependencyCollector
@@ -75,6 +83,9 @@ def extract
end
odie "Coul... | false |
Other | Homebrew | brew | ae32922d0f50602cbdfa719d0ad58650210eea39.json | swap which and command -v | Library/Homebrew/shims/linux/super/make | @@ -16,7 +16,7 @@ then
else
SAVED_PATH="$PATH"
pathremove "$HOMEBREW_LIBRARY/Homebrew/shims/linux/super"
- export MAKE="$(which make)"
+ export MAKE="$(command -v make)"
export PATH="$SAVED_PATH"
fi
| false |
Other | Homebrew | brew | 26e1d17b4d5bce5f2377b6d7bafc1082f4650b19.json | dev-cmd/bottle: save local_filename to json | Library/Homebrew/dev-cmd/bottle.rb | @@ -392,6 +392,7 @@ def bottle_formula(f)
"tags" => {
tag => {
"filename" => filename.bintray,
+ "local_filename" => filename.to_s,
"sha256" => sha256,
},
}, | false |
Other | Homebrew | brew | 0552dcff62f23017457ad4d1c76f7c8936d2a40a.json | extract: accept tap as a non-flagged argument | Library/Homebrew/dev-cmd/extract.rb | @@ -1,8 +1,7 @@
-#: * `extract` [`--force`] <formula> `--tap=`<tap> [`--version=`<version>]:
+#: * `extract` [`--force`] <formula> <tap> [`--version=`<version>]:
#: Looks through repository history to find the <version> of <formula> and
#: creates a copy in <tap>/Formula/<formula>@<version>.rb. If the tap is
... | false |
Other | Homebrew | brew | 875885dda69ee2040f28187d7ca5f53e9ffa5c33.json | Add a starter file for spec | Library/Homebrew/test/dev-cmd/extract_spec.rb | @@ -0,0 +1,13 @@
+describe "brew extract", :integration_test do
+ it "extracts the most recent formula version without version argument" do
+ path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
+ (path/"Formula").mkpath
+ target = Tap.from_path(path)
+ formula_file = setup_test_formula "foo"
+
+ expect { ... | false |
Other | Homebrew | brew | 95abdf96624029d5319462ac1d54613795c5cce9.json | Use refinements instead of general monkey-patching | Library/Homebrew/dev-cmd/extract.rb | @@ -15,96 +15,67 @@
require "formulary"
require "tap"
-class BottleSpecification
- def method_missing(m, *_args, &_block)
- if [:sha1, :md5].include?(m)
- opoo "Formula has unknown or deprecated stanza: #{m}" if ARGV.debug?
- else
- super
+module ExtractExtensions
+ refine BottleSpecification do
+... | false |
Other | Homebrew | brew | bd2ac70c0fb9442f6fa8195d9b8cf899dba66481.json | Fix style issues in extract command | Library/Homebrew/dev-cmd/extract.rb | @@ -19,19 +19,19 @@ module Homebrew
module_function
def extract
- Homebrew::CLI::Parser.parse do
+ Homebrew::CLI::Parser.parse do
switch "--stdout", description: "Output to stdout on terminal instead of file"
switch :debug
switch :force
- end
+ end
odie "Cann... | false |
Other | Homebrew | brew | 1dff2f141ca7398ade175d8a1da85df3fc561350.json | Add manpages/docs for extract command | docs/Manpage.md | @@ -790,6 +790,18 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
* `edit` `formula`:
Open `formula` in the editor.
+ * `extract` [`--force`] [`--stdout`] `formula` `version` [`tap`]:
+ Looks through repository history to find the `version` of `formula` and
+ creates ... | true |
Other | Homebrew | brew | 1dff2f141ca7398ade175d8a1da85df3fc561350.json | Add manpages/docs for extract command | manpages/brew.1 | @@ -727,6 +727,16 @@ Open all of Homebrew for editing\.
Open \fIformula\fR in the editor\.
.
.TP
+\fBextract\fR [\fB\-\-force\fR] [\fB\-\-stdout\fR] \fIformula\fR \fIversion\fR [\fItap\fR]
+Looks through repository history to find the \fIversion\fR of \fIformula\fR and creates a copy in \fItap\fR/Formula/\fIformula\... | true |
Other | Homebrew | brew | 48dcf1916928999776df36882a553f15a9f0ffe7.json | Ignore unparsable system languages. | Library/Homebrew/cask/lib/hbc/dsl.rb | @@ -138,7 +138,17 @@ def language_eval
raise CaskInvalidError.new(cask, "No default language specified.")
end
- MacOS.languages.map(&Locale.method(:parse)).each do |locale|
+ locales = MacOS.languages
+ .map do |language|
+ begin
+ ... | false |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/build.rb | @@ -11,6 +11,8 @@
require "debrew"
require "fcntl"
require "socket"
+require "json"
+require "json/add/core"
class Build
attr_reader :formula, :deps, :reqs
@@ -190,7 +192,17 @@ def fixopt(f)
build = Build.new(formula, options)
build.install
rescue Exception => e # rubocop:disable Lint/RescueException
... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/dev-cmd/test.rb | @@ -93,12 +93,14 @@ def test
exec(*args)
end
end
- rescue ::Test::Unit::AssertionFailedError => e
+ rescue ChildProcessError => e
ofail "#{f.full_name}: failed"
- puts e.message
- rescue Exception => e # rubocop:disable Lint/RescueException
- ofail ... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/exceptions.rb | @@ -352,14 +352,16 @@ def initialize(formula)
end
class BuildError < RuntimeError
- attr_reader :formula, :env
+ attr_reader :formula, :cmd, :args, :env
attr_accessor :options
def initialize(formula, cmd, args, env)
@formula = formula
+ @cmd = cmd
+ @args = args
@env = env
- args = args... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/formula_installer.rb | @@ -763,14 +763,25 @@ def build
raise "Empty installation"
end
rescue Exception => e # rubocop:disable Lint/RescueException
- e.options = display_options(formula) if e.is_a?(BuildError)
+ # If we've rescued a ChildProcessError and that ChildProcessError
+ # contains a BuildError, then we reconst... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/postinstall.rb | @@ -4,6 +4,7 @@
require "debrew"
require "fcntl"
require "socket"
+require "json/add/core"
begin
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
@@ -15,7 +16,7 @@
formula.extend(Debrew::Formula) if ARGV.debug?
formula.run_post_install
rescue Exception => e # rubocop:disable Lint/Resc... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/test.rb | @@ -7,6 +7,7 @@
require "formula_assertions"
require "fcntl"
require "socket"
+require "json/add/core"
TEST_TIMEOUT_SECONDS = 5 * 60
@@ -28,7 +29,7 @@
raise "test returned false" if formula.run_test == false
end
rescue Exception => e # rubocop:disable Lint/RescueException
- Marshal.dump(e, error_pipe)... | true |
Other | Homebrew | brew | 5c90833f0a16e9326750959aec91d779b889ceca.json | Use JSON to marshal errors from children | Library/Homebrew/utils/fork.rb | @@ -1,5 +1,7 @@
require "fcntl"
require "socket"
+require "json"
+require "json/add/core"
module Utils
def self.safe_fork(&_block)
@@ -15,7 +17,7 @@ def self.safe_fork(&_block)
write.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
yield
rescue Exception => e # rubocop:disable Lint/... | true |
Other | Homebrew | brew | ca59377a90970a88b58aeda8cf74b8803931dcdc.json | audit: add autocorrect and tests for test checks | Library/Homebrew/rubocops/class_cop.rb | @@ -39,6 +39,17 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
end
+ def autocorrect(node)
+ lambda do |corrector|
+ case node.type
+ when :str, :dstr
+ corrector.replace(node.source_range, node.source.to_s.sub(%r{(/us... | true |
Other | Homebrew | brew | ca59377a90970a88b58aeda8cf74b8803931dcdc.json | audit: add autocorrect and tests for test checks | Library/Homebrew/test/rubocops/class_cop_spec.rb | @@ -76,6 +76,31 @@ class Foo < Formula
end
RUBY
end
+
+ it "supports auto-correcting test calls" do
+ source = <<~RUBY
+ class Foo < Formula
+ url 'https://example.com/foo-1.0.tgz'
+
+ test do
+ shell_output("/usr/local/sbin/test", 0)
+ end
+ end
+ RUBY
+
+ ... | true |
Other | Homebrew | brew | 5f981a8722487dd9ee127a59f4f0471fa35c3c4c.json | tests: add test for test calls audit cop | Library/Homebrew/test/rubocops/class_cop_spec.rb | @@ -48,6 +48,36 @@ class Foo < Formula
end
end
+describe RuboCop::Cop::FormulaAudit::TestCalls do
+ subject(:cop) { described_class.new }
+
+ it "reports an offense when /usr/local/bin is found in test calls" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ url 'https://example.com/foo-1.0.tg... | false |
Other | Homebrew | brew | 77c242548eab3df72f4905ffb29b896073ee11d2.json | update variable name and msg string per comments | Library/Homebrew/cmd/update-report.rb | @@ -22,12 +22,12 @@ def update_report
HOMEBREW_REPOSITORY.cd do
analytics_message_displayed =
Utils.popen_read("git", "config", "--local", "--get", "homebrew.analyticsmessage").chuzzle
- cask_analytics_message_displayed =
+ caskanalyticsmessage =
Utils.popen_read("git", "config",... | false |
Other | Homebrew | brew | 6701c207e0d30b16eb6cba24f9da5cb4edf91395.json | add anlytics to cask installs | Library/Homebrew/cask/lib/hbc/installer.rb | @@ -90,6 +90,8 @@ def install
install_artifacts
enable_accessibility_access
+ Utils::Analytics.report_event("cask_install", @cask.token)
+
puts summary
end
| false |
Other | Homebrew | brew | 421ba101b4c4596b9da51fc1238a4542b487847b.json | test/ENV: Fix prepend_path for Linuxbrew
This test fails on Ubuntu, because /usr/libexec does not exist. | Library/Homebrew/test/ENV_spec.rb | @@ -116,11 +116,11 @@
describe "#prepend_path" do
it "prepends to a path" do
- subject.prepend_path "FOO", "/usr/libexec"
- expect(subject["FOO"]).to eq("/usr/libexec")
+ subject.prepend_path "FOO", "/usr/local"
+ expect(subject["FOO"]).to eq("/usr/local")
subject.prepend_path "FO... | false |
Other | Homebrew | brew | a30eea6ab93a227c8f13f0e8445bc6c998dfea67.json | pkgconfig: update 10.14 sqlite version | Library/Homebrew/os/mac/pkgconfig/10.14/sqlite3.pc | @@ -5,7 +5,7 @@ includedir=${prefix}/include
Name: SQLite
Description: SQL database engine
-Version: 3.22.0
+Version: 3.24.0
Libs: -L${libdir} -lsqlite3
Libs.private:
Cflags: -I${includedir} | false |
Other | Homebrew | brew | 1cf2ea79cf1e0f32f6db5cc56614357db5ecfbbe.json | xcode: update expected versions for Mojave | Library/Homebrew/os/mac/xcode.rb | @@ -265,7 +265,7 @@ def latest_version
# on the older supported platform for that Xcode release, i.e there's no
# CLT package for 10.11 that contains the Clang version from Xcode 8.
case MacOS.version
- when "10.14" then "1000.10.38"
+ when "10.14" then "1000.10.43.1"
w... | false |
Other | Homebrew | brew | 879f514e28a90c2a9d1791d6b9cd02d23e3462e6.json | test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip. | Library/Homebrew/test/spec_helper.rb | @@ -85,7 +85,11 @@
end
config.before(:each, :needs_svn) do
- skip "Requires subversion." unless which "svn"
+ skip "subversion not installed." unless which "svn"
+ end
+
+ config.before(:each, :needs_unzip) do
+ skip "unzip not installed." unless which("unzip")
end
config.around(:each) do |ex... | true |
Other | Homebrew | brew | 879f514e28a90c2a9d1791d6b9cd02d23e3462e6.json | test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip. | Library/Homebrew/test/unpack_strategy/jar_spec.rb | @@ -1,6 +1,6 @@
require_relative "shared_examples"
-describe UnpackStrategy::Jar do
+describe UnpackStrategy::Jar, :needs_unzip do
let(:path) { TEST_FIXTURE_DIR/"test.jar" }
include_examples "UnpackStrategy::detect" | true |
Other | Homebrew | brew | 879f514e28a90c2a9d1791d6b9cd02d23e3462e6.json | test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip. | Library/Homebrew/test/unpack_strategy/subversion_spec.rb | @@ -1,6 +1,6 @@
require_relative "shared_examples"
-describe UnpackStrategy::Subversion do
+describe UnpackStrategy::Subversion, :needs_svn do
let(:repo) { mktmpdir }
let(:working_copy) { mktmpdir }
let(:path) { working_copy } | true |
Other | Homebrew | brew | 879f514e28a90c2a9d1791d6b9cd02d23e3462e6.json | test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip. | Library/Homebrew/test/unpack_strategy/zip_spec.rb | @@ -4,7 +4,10 @@
let(:path) { TEST_FIXTURE_DIR/"cask/MyFancyApp.zip" }
include_examples "UnpackStrategy::detect"
- include_examples "#extract", children: ["MyFancyApp"]
+
+ context "when unzip is available", :needs_unzip do
+ include_examples "#extract", children: ["MyFancyApp"]
+ end
context "when Z... | true |
Other | Homebrew | brew | 78658e430259bc030389668d6f6aec9b8e1066b2.json | Add cask cleanup and per-formula cache cleanup. | Library/Homebrew/cask/lib/hbc/cask_loader.rb | @@ -1,3 +1,4 @@
+require "hbc/cask"
require "uri"
module Hbc | true |
Other | Homebrew | brew | 78658e430259bc030389668d6f6aec9b8e1066b2.json | Add cask cleanup and per-formula cache cleanup. | Library/Homebrew/cleanup.rb | @@ -3,6 +3,8 @@
require "hbc/cask_loader"
module CleanupRefinement
+ LATEST_CASK_DAYS = 7
+
refine Pathname do
def incomplete?
extname.end_with?(".incomplete")
@@ -23,7 +25,7 @@ def prune?(days)
def stale?(scrub = false)
return false unless file?
- stale_formula?(scrub)
+ sta... | true |
Other | Homebrew | brew | 6302d622e3d190845cf5a7104c085aa8ae5903a5.json | add new gclient_cache folder to cleanup | Library/Homebrew/cleanup.rb | @@ -9,7 +9,7 @@ def incomplete?
end
def nested_cache?
- directory? && ["glide_home", "java_cache", "npm_cache"].include?(basename.to_s)
+ directory? && %w[glide_home java_cache npm_cache gclient_cache].include?(basename.to_s)
end
def prune?(days) | true |
Other | Homebrew | brew | 6302d622e3d190845cf5a7104c085aa8ae5903a5.json | add new gclient_cache folder to cleanup | Library/Homebrew/test/cleanup_spec.rb | @@ -197,6 +197,15 @@
expect(npm_cache).not_to exist
end
+ it "cleans up 'gclient_cache'" do
+ gclient_cache = (HOMEBREW_CACHE/"gclient_cache")
+ gclient_cache.mkpath
+
+ subject.cleanup_cache
+
+ expect(gclient_cache).not_to exist
+ end
+
it "cleans up all files and director... | true |
Other | Homebrew | brew | dc527fccdc5a335375ca3f6475ea3ec06ba969d1.json | formula_installer: avoid cyclic dependency
Fixes:
==> Installing patchelf dependency: patchelf
==> Installing dependencies for patchelf: patchelf
==> Installing patchelf dependency: patchelf
==> Installing dependencies for patchelf: patchelf
==> Installing patchelf dependency: patchelf
==> Installing dependencies for ... | Library/Homebrew/formula_installer.rb | @@ -502,7 +502,7 @@ def expand_dependencies(deps)
end
end
- if pour_bottle
+ if pour_bottle && !Keg.relocation_formulae.include?(formula.name)
bottle_deps = Keg.relocation_formulae
.map { |formula| Dependency.new(formula) }
.reject do |dep| | false |
Other | Homebrew | brew | a20198cb894f242e5bae756c092b40e72cae8b64.json | MacOS: add sdk_path_if_needed tests | Library/Homebrew/test/os/mac_spec.rb | @@ -19,4 +19,44 @@
expect { Locale.parse(subject.language) }.not_to raise_error
end
end
+
+ describe "::sdk_path_if_needed" do
+ it "calls sdk_path on Xcode-only systems" do
+ allow(OS::Mac::Xcode).to receive(:installed?) { true }
+ allow(OS::Mac::CLT).to receive(:installed?) { false }
+ ... | false |
Other | Homebrew | brew | eea18a5cb10c9fa51086fd26843d3b47e2425f5b.json | MacOS: update sdk_path_if_needed logic | Library/Homebrew/os/mac.rb | @@ -101,7 +101,19 @@ def sdk_path(v = nil)
end
def sdk_path_if_needed(v = nil)
- return if !MacOS::Xcode.installed? && MacOS::CLT.separate_header_package?
+ # Prefer Xcode SDK when both Xcode and the CLT are installed.
+ # Expected results:
+ # 1. On Xcode-only systems, return the Xcode ... | false |
Other | Homebrew | brew | e00720e8729bb5f5d8273bfb75e070e1028daed3.json | MacOS.sdk_path: prefer Xcode if installed | Library/Homebrew/os/mac.rb | @@ -85,7 +85,7 @@ def active_developer_dir
# specifically been requested according to the rules above.
def sdk(v = nil)
- @locator ||= if Xcode.without_clt?
+ @locator ||= if Xcode.installed?
XcodeSDKLocator.new
else
CLTSDKLocator.new | false |
Other | Homebrew | brew | 0cd84274053d88f70e1244a21ede906dfa3bfda1.json | Diagnostic: remove need for headers on 10.14 | Library/Homebrew/extend/os/mac/diagnostic.rb | @@ -20,7 +20,6 @@ def fatal_development_tools_checks
check_xcode_minimum_version
check_clt_minimum_version
check_if_xcode_needs_clt_installed
- check_if_clt_needs_headers_installed
].freeze
end
@@ -138,17 +137,6 @@ def check_if_xcode_needs_clt_installed
... | true |
Other | Homebrew | brew | 0cd84274053d88f70e1244a21ede906dfa3bfda1.json | Diagnostic: remove need for headers on 10.14 | Library/Homebrew/test/os/mac/diagnostic_spec.rb | @@ -32,19 +32,6 @@
.to match("Xcode alone is not sufficient on El Capitan")
end
- specify "#check_if_clt_needs_headers_installed" do
- allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.14"))
- allow(MacOS::CLT).to receive(:installed?).and_return(true)
- allow(MacOS::CLT).to rec... | true |
Other | Homebrew | brew | 03b93da2969914193a16b52b273f4b0fb1850c82.json | Use option parser for `brew cleanup`. | Library/Homebrew/cleanup.rb | @@ -1,5 +1,6 @@
require "utils/bottles"
require "formula"
+require "hbc/cask_loader"
module CleanupRefinement
refine Pathname do
@@ -67,22 +68,50 @@ def stale_formula?(scrub)
using CleanupRefinement
module Homebrew
- module Cleanup
- @disk_cleanup_size = 0
-
- class << self
- attr_reader :disk_c... | true |
Other | Homebrew | brew | 03b93da2969914193a16b52b273f4b0fb1850c82.json | Use option parser for `brew cleanup`. | Library/Homebrew/cmd/cleanup.rb | @@ -12,34 +12,36 @@
#: deleted. If you want to delete those too: `rm -rf $(brew --cache)`
require "cleanup"
+require "cli_parser"
module Homebrew
module_function
def cleanup
- if ARGV.named.empty?
- Cleanup.cleanup
- else
- Cleanup.cleanup_cellar(ARGV.resolved_formulae)
+ CLI::Parse... | true |
Other | Homebrew | brew | 03b93da2969914193a16b52b273f4b0fb1850c82.json | Use option parser for `brew cleanup`. | Library/Homebrew/cmd/update-report.rb | @@ -147,10 +147,6 @@ def migrate_legacy_cache_if_necessary
return unless legacy_cache.writable_real?
FileUtils.touch migration_attempted_file
- # Cleanup to avoid copying files unnecessarily
- ohai "Cleaning up #{legacy_cache}..."
- Cleanup.cleanup_cache legacy_cache
-
# This directory could h... | true |
Other | Homebrew | brew | 03b93da2969914193a16b52b273f4b0fb1850c82.json | Use option parser for `brew cleanup`. | Library/Homebrew/cmd/upgrade.rb | @@ -98,7 +98,7 @@ def upgrade
upgrade_formula(f)
next if !ARGV.include?("--cleanup") && !ENV["HOMEBREW_UPGRADE_CLEANUP"]
next unless f.installed?
- Homebrew::Cleanup.cleanup_formula f
+ Cleanup.new.cleanup_formula(f)
rescue UnsatisfiedRequirements => e
Homebrew.f... | true |
Other | Homebrew | brew | 03b93da2969914193a16b52b273f4b0fb1850c82.json | Use option parser for `brew cleanup`. | Library/Homebrew/test/cleanup_spec.rb | @@ -43,16 +43,14 @@
describe "::cleanup" do
it "removes .DS_Store and lock files" do
- described_class.cleanup
+ subject.clean!
expect(ds_store).not_to exist
expect(lock_file).not_to exist
end
- it "doesn't remove anything if `--dry-run` is specified" do
- ARGV << "--d... | true |
Other | Homebrew | brew | c1f4d0edb8c349e3f1fc2f4e2f11ed956e44542b.json | Remove trivial method. | Library/Homebrew/software_spec.rb | @@ -294,7 +294,7 @@ def initialize(formula, spec)
checksum, tag = spec.checksum_for(Utils::Bottles.tag)
filename = Filename.create(formula, tag, spec.rebuild)
- @resource.url(build_url(spec.root_url, filename.bintray),
+ @resource.url("#{spec.root_url}/#{filename.bintray}",
select_d... | false |
Other | Homebrew | brew | bd5b41ed949ffcdf8cdb25d956bff0a4d6e9c5e2.json | Remove environment variables used by `hub`.
As of #3870, this is no longer needed. | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -78,14 +78,6 @@ def bump_formula_pr
# Use the user's browser, too.
ENV["BROWSER"] = ENV["HOMEBREW_BROWSER"]
- # Setup GitHub environment variables
- %w[GITHUB_USER GITHUB_PASSWORD GITHUB_TOKEN].each do |env|
- homebrew_env = ENV["HOMEBREW_#{env}"]
- next unless homebrew_env
- next if... | true |
Other | Homebrew | brew | bd5b41ed949ffcdf8cdb25d956bff0a4d6e9c5e2.json | Remove environment variables used by `hub`.
As of #3870, this is no longer needed. | bin/brew | @@ -53,8 +53,7 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
# Whitelist and copy to HOMEBREW_* all variables previously mentioned in
# manpage or used elsewhere by Homebrew.
for VAR in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY BINTRAY_USER BINTRAY_KEY \
- BROWSER EDITOR GIT NO_COLOR PATH VISUAL \
- ... | true |
Other | Homebrew | brew | ba410959c085ecc1d026167a452a6ca55951e50e.json | Add new maintainers
Also add some who were missing (sorry folks) and our Linux maintainers. | Library/Homebrew/dev-cmd/man.rb | @@ -74,6 +74,8 @@ def build_man_page
.gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
variables[:brew_maintainers] = readme.read[%r{(Homebrew/brew's other current maintainers .*\.)}, 1]
.gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+ variables[:linux... | true |
Other | Homebrew | brew | ba410959c085ecc1d026167a452a6ca55951e50e.json | Add new maintainers
Also add some who were missing (sorry folks) and our Linux maintainers. | Library/Homebrew/manpages/brew.1.md.erb | @@ -311,6 +311,8 @@ Homebrew Documentation: <https://docs.brew.sh>
<%= brew_maintainers.concat("\n") %>
+<%= linux_maintainers.concat("\n") %>
+
<%= core_maintainers.concat("\n") %>
<%= former_maintainers.concat("\n") %> | true |
Other | Homebrew | brew | ba410959c085ecc1d026167a452a6ca55951e50e.json | Add new maintainers
Also add some who were missing (sorry folks) and our Linux maintainers. | README.md | @@ -42,11 +42,13 @@ Homebrew's project leadership committee is [Mike McQuaid](https://github.com/mik
Homebrew/homebrew-core's lead maintainer is [ilovezfs](https://github.com/ilovezfs).
-Homebrew/brew's other current maintainers are [ilovezfs](https://github.com/ilovezfs), [JCount](https://github.com/jcount), [Mis... | true |
Other | Homebrew | brew | ba410959c085ecc1d026167a452a6ca55951e50e.json | Add new maintainers
Also add some who were missing (sorry folks) and our Linux maintainers. | docs/Manpage.md | @@ -1311,11 +1311,13 @@ Homebrew's project leadership committee is Mike McQuaid, ilovezfs, JCount, Misty
Homebrew/homebrew-core's lead maintainer is ilovezfs.
-Homebrew/brew's other current maintainers are ilovezfs, JCount, Misty De Meo, Gautham Goli, Markus Reiter and William Woodruff.
+Homebrew/brew's other curr... | true |
Other | Homebrew | brew | ba410959c085ecc1d026167a452a6ca55951e50e.json | Add new maintainers
Also add some who were missing (sorry folks) and our Linux maintainers. | manpages/brew.1 | @@ -1278,13 +1278,16 @@ Homebrew\'s project leadership committee is Mike McQuaid, ilovezfs, JCount, Mist
Homebrew/homebrew\-core\'s lead maintainer is ilovezfs\.
.
.P
-Homebrew/brew\'s other current maintainers are ilovezfs, JCount, Misty De Meo, Gautham Goli, Markus Reiter and William Woodruff\.
+Homebrew/brew\'s o... | true |
Other | Homebrew | brew | 7d5f0df71d6f5cdaf2406fca862dfc878253c5bb.json | class_cop_spec: add tests for tighter test audit | Library/Homebrew/test/rubocops/class_cop_spec.rb | @@ -59,4 +59,29 @@ class Foo < Formula
end
RUBY
end
+
+ it "reports an offense when there is an empty test block" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ url 'https://example.com/foo-1.0.tgz'
+
+ test do
+ ^^^^^^^ `test do` should not be empty
+ end
+ ... | false |
Other | Homebrew | brew | 525300b9cdf5267065998aa5fff7ddebe7acd4ba.json | formula_desc_cop_spec: add whitespace tests | Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb | @@ -101,6 +101,26 @@ class Foo < Formula
RUBY
end
+ it "When the description starts with a leading space" do
+ expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
+ class Foo < Formula
+ url 'http://example.com/foo-1.0.tgz'
+ desc ' Description with a leading space'
+... | false |
Other | Homebrew | brew | 73194b460d047bec3a4d6fb31cf969a2b9e7aa77.json | formula_desc_cop: add unnecessary whitespace check | Library/Homebrew/rubocops/formula_desc_cop.rb | @@ -38,6 +38,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
module FormulaAuditStrict
# This cop audits `desc` in Formulae
#
+ # - Checks for leading/trailing whitespace in `desc`
# - Checks if `desc` begins with an article
# - Checks for correct usage of... | false |
Other | Homebrew | brew | d5de9d585b74cc861fcbaf4d43f51da2f113fb27.json | Use normal download strategies for casks. | Library/Homebrew/cask/lib/hbc/download.rb | @@ -22,13 +22,9 @@ def perform
attr_accessor :downloaded_path
def downloader
- @downloader ||= case cask.url.using
- when :svn
- SubversionDownloadStrategy.new(cask)
- when :post
- CurlPostDownloadStrategy.new(cask)
- else
- CurlDownloadStrategy.new(cask)
+ @dow... | true |
Other | Homebrew | brew | d5de9d585b74cc861fcbaf4d43f51da2f113fb27.json | Use normal download strategies for casks. | Library/Homebrew/cask/lib/hbc/url.rb | @@ -6,19 +6,21 @@ class URL
:data
].freeze
- attr_reader :uri
+ attr_reader :uri, :specs
attr_reader(*ATTRIBUTES)
extend Forwardable
def_delegators :uri, :path, :scheme, :to_s
- def initialize(uri, options = {})
+ def initialize(uri, **options)
@uri = URI(uri)
@user_agent = :... | true |
Other | Homebrew | brew | d5de9d585b74cc861fcbaf4d43f51da2f113fb27.json | Use normal download strategies for casks. | Library/Homebrew/test/cask/cli/fetch_spec.rb | @@ -13,34 +13,44 @@
it_behaves_like "a command that requires a Cask token"
it_behaves_like "a command that handles invalid options"
- it "allows download the installer of a Cask" do
+ it "allows downloading the installer of a Cask" do
+ transmission_location = CurlDownloadStrategy.new(
+ local_transmi... | true |
Other | Homebrew | brew | 888a7073bccc476fa5e14ca074c5d7ca0a0be5cf.json | Change migration to loop through formulae. | Library/Homebrew/cmd/update-report.rb | @@ -192,25 +192,41 @@ def migrate_legacy_cache_if_necessary
def migrate_cache_entries_to_double_dashes(initial_version)
return if initial_version > "1.7.1"
- HOMEBREW_CACHE.children.each do |child|
- next unless child.file?
+ Formula.each do |formula|
+ specs = [*formula.stable, *formula.devel... | true |
Other | Homebrew | brew | 888a7073bccc476fa5e14ca074c5d7ca0a0be5cf.json | Change migration to loop through formulae. | Library/Homebrew/software_spec.rb | @@ -25,7 +25,7 @@ class SoftwareSpec
attr_reader :compiler_failures
def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time
- def_delegators :@resource, :cached_download, :clear_cache
+ def_delegators :@resource, :download_name, :cached_download, :clear_cache
def_delega... | true |
Other | Homebrew | brew | 888a7073bccc476fa5e14ca074c5d7ca0a0be5cf.json | Change migration to loop through formulae. | Library/Homebrew/test/cmd/update-report_spec.rb | @@ -2,51 +2,45 @@
describe "brew update-report" do
describe "::migrate_cache_entries_to_double_dashes" do
- let(:legacy_cache_file) { HOMEBREW_CACHE/"foo-1.2.3.tar.gz" }
- let(:renamed_cache_file) { HOMEBREW_CACHE/"foo--1.2.3.tar.gz" }
+ let(:formula_name) { "foo" }
+ let(:f) {
+ formula formula_... | true |
Other | Homebrew | brew | 4a48297d1c0a5721371405091f89fffd484d776e.json | Fix cleanup for files with `--`. | Library/Homebrew/cleanup.rb | @@ -83,7 +83,7 @@ def cleanup_cache(cache = HOMEBREW_CACHE)
version = file.version
end
next unless version
- next unless (name = file.basename.to_s[/(.*)-(?:#{Regexp.escape(version)})/, 1])
+ next unless (name = file.basename.to_s[/\A(.*?)\-\-?(?:#{Regexp.escape(version)})/, 1... | true |
Other | Homebrew | brew | 4a48297d1c0a5721371405091f89fffd484d776e.json | Fix cleanup for files with `--`. | Library/Homebrew/test/cleanup_spec.rb | @@ -226,8 +226,8 @@
end
context "cleans old files in HOMEBREW_CACHE" do
- let(:bottle) { (HOMEBREW_CACHE/"testball-0.0.1.bottle.tar.gz") }
- let(:testball) { (HOMEBREW_CACHE/"testball-0.0.1") }
+ let(:bottle) { (HOMEBREW_CACHE/"testball--0.0.1.bottle.tar.gz") }
+ let(:testball) { (HOMEBR... | true |
Other | Homebrew | brew | dca5dc817617717ff7843ac969f23d83b73d079f.json | Add warnings for permission exceptions. | Library/Homebrew/cmd/update-report.rb | @@ -199,9 +199,17 @@ def migrate_cache_entries_to_double_dashes(initial_version)
target = HOMEBREW_CACHE/"#{prefix}--#{suffix}"
if target.exist?
- FileUtils.rm_rf child
+ begin
+ FileUtils.rm_rf child
+ rescue Errno::EACCES
+ opoo "Could not remove #{child}, please... | false |
Other | Homebrew | brew | 4065c1742dbcfb1105827f89a0026fe8b4578da5.json | Add update migration for double dashes. | Library/Homebrew/cmd/update-report.rb | @@ -85,6 +85,7 @@ def update_report
end
migrate_legacy_cache_if_necessary
+ migrate_cache_entries_to_double_dashes
migrate_legacy_keg_symlinks_if_necessary
if !updated
@@ -183,6 +184,21 @@ def migrate_legacy_cache_if_necessary
end
end
+ def migrate_cache_entries_to_double_dashes
+ ... | false |
Other | Homebrew | brew | a42675f7d6c91017d930dfd427f6f73bf5b61753.json | docs/New-Maintainer-Checklist: update best practises.
We've made these recommendations to current maintainers to update the
documentation so we don't forget to ask new maintainers to do the same
when we invite more in future. | docs/New-Maintainer-Checklist.md | @@ -8,7 +8,7 @@ First, send them the invitation email:
```
The Homebrew team and I really appreciate your help on issues, pull requests and
-your contributions around $THEIR_CONTRIBUTIONS.
+your contributions to Homebrew.
We would like to invite you to have commit access and be a Homebrew maintainer.
If you agr... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.