aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.sh4
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb8
-rw-r--r--Library/Homebrew/cmd/gist-logs.rb20
-rw-r--r--Library/Homebrew/compat/dependency_collector.rb2
-rw-r--r--Library/Homebrew/os.rb1
-rw-r--r--Library/Homebrew/os/linux.rb28
-rw-r--r--Library/Homebrew/test/cask/cli/reinstall_spec.rb3
-rw-r--r--Library/Homebrew/test/cask/cli/uninstall_spec.rb3
8 files changed, 51 insertions, 18 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index a9074a643..61d85ddd2 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -75,7 +75,6 @@ case "$HOMEBREW_SYSTEM" in
Linux) HOMEBREW_LINUX="1" ;;
esac
-HOMEBREW_CURL="curl"
if [[ -n "$HOMEBREW_MACOS" ]]
then
HOMEBREW_PROCESSOR="$(uname -p)"
@@ -107,7 +106,6 @@ else
[[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)"
: "${HOMEBREW_OS_VERSION:=$(uname -r)}"
HOMEBREW_OS_USER_AGENT_VERSION="$HOMEBREW_OS_VERSION"
- HOMEBREW_FORCE_BREWED_CURL=1
if [[ -z "$HOMEBREW_CACHE" ]]
then
@@ -125,6 +123,8 @@ if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
"$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null
then
HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl"
+else
+ HOMEBREW_CURL="curl"
fi
HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)"
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
index 856ab2766..31cede71a 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
@@ -62,14 +62,16 @@ module Hbc
raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there."
end
- ohai "Moving #{self.class.english_name} '#{target.basename}' back to '#{source}'."
+ ohai "Backing #{self.class.english_name} '#{target.basename}' up to '#{source}'."
source.dirname.mkpath
if target.parent.writable?
- FileUtils.move(target, source)
+ FileUtils.cp_r(target, source)
else
- command.run("/bin/mv", args: [target, source], sudo: true)
+ command.run("/bin/cp", args: ["-r", target, source], sudo: true)
end
+
+ delete(target, force: force, command: command, **options)
end
def delete(target, force: false, command: nil, **_)
diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb
index 630361ca2..ab81a017e 100644
--- a/Library/Homebrew/cmd/gist-logs.rb
+++ b/Library/Homebrew/cmd/gist-logs.rb
@@ -39,6 +39,16 @@ module Homebrew
files["00.tap.out"] = { content: tap }
end
+ if GitHub.api_credentials_type == :none
+ puts <<~EOS
+ You can create a new personal access token:
+ #{GitHub::ALL_SCOPES_URL}
+ and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
+
+ EOS
+ login!
+ end
+
# Description formatted to work well as page title when viewing gist
if f.core_formula?
descr = "#{f.name} on #{OS_VERSION} - Homebrew build logs"
@@ -48,16 +58,6 @@ module Homebrew
url = create_gist(files, descr)
if ARGV.include?("--new-issue") || ARGV.switch?("n")
- if GitHub.api_credentials_type == :none
- puts <<~EOS
- You can create a new personal access token:
- #{GitHub::ALL_SCOPES_URL}
- and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
-
- EOS
- login!
- end
-
url = create_issue(f.tap, "#{f.name} failed to build on #{MacOS.full_version}", url)
end
diff --git a/Library/Homebrew/compat/dependency_collector.rb b/Library/Homebrew/compat/dependency_collector.rb
index 84d5431f3..88d393488 100644
--- a/Library/Homebrew/compat/dependency_collector.rb
+++ b/Library/Homebrew/compat/dependency_collector.rb
@@ -59,7 +59,7 @@ class DependencyCollector
Dependency.new("python3", tags)
when :emacs, :mysql, :perl, :postgresql, :rbenv, :ruby
output_deprecation(spec)
- Dependency.new(spec, tags)
+ Dependency.new(spec.to_s, tags)
else
super
end
diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb
index d35a49dd7..d56b03228 100644
--- a/Library/Homebrew/os.rb
+++ b/Library/Homebrew/os.rb
@@ -21,6 +21,7 @@ module OS
end
PATH_OPEN = "/usr/bin/open".freeze
elsif OS.linux?
+ require "os/linux"
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
PATH_OPEN = "xdg-open".freeze
end
diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb
new file mode 100644
index 000000000..e5af301b2
--- /dev/null
+++ b/Library/Homebrew/os/linux.rb
@@ -0,0 +1,28 @@
+module OS
+ # Define OS::Mac on Linux for formula API compatibility.
+ module Mac
+ module_function
+
+ ::MacOS = self # rubocop:disable Naming/ConstantName
+
+ def prefer_64_bit?
+ Hardware::CPU.is_64_bit?
+ end
+
+ def version
+ Version::NULL
+ end
+
+ def full_version
+ Version::NULL
+ end
+
+ module Xcode
+ module_function
+
+ def version
+ Version::NULL
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cask/cli/reinstall_spec.rb b/Library/Homebrew/test/cask/cli/reinstall_spec.rb
index 3737a7a70..f2d1322ad 100644
--- a/Library/Homebrew/test/cask/cli/reinstall_spec.rb
+++ b/Library/Homebrew/test/cask/cli/reinstall_spec.rb
@@ -13,7 +13,8 @@ describe Hbc::CLI::Reinstall, :cask do
Already downloaded: .*local-caffeine--1.2.3.zip
==> Verifying checksum for Cask local-caffeine
==> Uninstalling Cask local-caffeine
- ==> Moving App 'Caffeine.app' back to '.*Caffeine.app'.
+ ==> Backing App 'Caffeine.app' up to '.*Caffeine.app'.
+ ==> Removing App '.*Caffeine.app'.
==> Purging files for version 1.2.3 of Cask local-caffeine
==> Installing Cask local-caffeine
==> Moving App 'Caffeine.app' to '.*Caffeine.app'.
diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb
index 322394de4..38ee1bb73 100644
--- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb
+++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb
@@ -12,7 +12,8 @@ describe Hbc::CLI::Uninstall, :cask do
output = Regexp.new <<~EOS
==> Uninstalling Cask local-caffeine
- ==> Moving App 'Caffeine.app' back to '.*Caffeine.app'.
+ ==> Backing App 'Caffeine.app' up to '.*Caffeine.app'.
+ ==> Removing App '.*Caffeine.app'.
==> Purging files for version 1.2.3 of Cask local-caffeine
EOS