Skip to content

Commit

Permalink
Update deprecations
Browse files Browse the repository at this point in the history
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
  • Loading branch information
MikeMcQuaid committed Jan 8, 2019
1 parent 1b15ff1 commit 170c549
Show file tree
Hide file tree
Showing 104 changed files with 187 additions and 1,356 deletions.
9 changes: 4 additions & 5 deletions Library/Homebrew/brew.rb
Expand Up @@ -12,8 +12,6 @@

require_relative "global"

require "update_migrator"

begin
trap("INT", std_trap) # restore default CTRL-C handler

Expand Down Expand Up @@ -77,14 +75,15 @@
# `Homebrew.help` never returns, except for external/unknown commands.
end

# Migrate LinkedKegs/PinnedKegs if update didn't already do so
UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary

# Uninstall old brew-cask if it's still around; we just use the tap now.
if cmd == "cask" && (HOMEBREW_CELLAR/"brew-cask").exist?
system(HOMEBREW_BREW_FILE, "uninstall", "--force", "brew-cask")
end

if ENV["HOMEBREW_BUILD_FROM_SOURCE"]
odeprecated("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source")
end

if internal_cmd
Homebrew.send cmd.to_s.tr("-", "_").downcase
elsif which "brew-#{cmd}"
Expand Down
12 changes: 12 additions & 0 deletions Library/Homebrew/brew.sh
Expand Up @@ -105,6 +105,18 @@ then
HOMEBREW_FORCE_BREWED_CURL="1"
fi

# Announce pre-Mavericks deprecation now
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]]
then
printf "WARNING: Your version of macOS (%s) will not be able to run Homebrew when\n" "$HOMEBREW_MACOS_VERSION" >&2
printf " version 2.0.0 is released (Q1 2019)!\n" >&2
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100700" ]]
then
printf " For 10.4 - 10.6 support see: https://github.com/mistydemeo/tigerbrew\n" >&2
fi
printf "\n" >&2
fi

# The system Git on macOS versions before Sierra is too old for some Homebrew functionality we rely on.
HOMEBREW_MINIMUM_GIT_VERSION="2.14.3"
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]]
Expand Down
7 changes: 3 additions & 4 deletions Library/Homebrew/cmd/install.rb
Expand Up @@ -21,10 +21,9 @@
#:
#: If `--cc=`<compiler> is passed, attempt to compile using <compiler>.
#: <compiler> should be the name of the compiler's executable, for instance
#: `gcc-8` for gcc 8, `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a
#: Homebrew-provided GCC 4.9. In order to use LLVM's clang, use
#: `llvm_clang`. To specify the Apple-provided clang, use `clang`. This
#: parameter will only accept compilers that are provided by Homebrew or
#: `gcc-7` for GCC 7. In order to use LLVM's clang, use `llvm_clang`.
#: To specify the Apple-provided clang, use `clang`.
#: This parameter will only accept compilers that are provided by Homebrew or
#: bundled with macOS. Please do not file issues if you encounter errors
#: while using this flag.
#:
Expand Down
3 changes: 1 addition & 2 deletions Library/Homebrew/cmd/prune.rb
Expand Up @@ -25,8 +25,7 @@ def prune_args
def prune
prune_args.parse

# TODO: deprecate and hide from manpage for next minor release.
# odeprecated("'brew prune'", "'brew cleanup'")
odeprecated("'brew prune'", "'brew cleanup'")
Cleanup.new(dry_run: args.dry_run?).prune_prefix_symlinks_and_directories
end
end
19 changes: 0 additions & 19 deletions Library/Homebrew/cmd/update-report.rb
Expand Up @@ -7,7 +7,6 @@
require "formulary"
require "descriptions"
require "cleanup"
require "update_migrator"
require "description_cache_store"

module Homebrew
Expand Down Expand Up @@ -83,13 +82,6 @@ def update_report
updated = true
end

out, _, status = system_command("git",
args: ["describe", "--tags", "--abbrev=0", initial_revision],
chdir: HOMEBREW_REPOSITORY,
print_stderr: false)

initial_version = Version.new(out) if status.success?

updated_taps = []
Tap.each do |tap|
next unless tap.git?
Expand All @@ -112,11 +104,6 @@ def update_report
updated = true
end

UpdateMigrator.migrate_legacy_cache_if_necessary
UpdateMigrator.migrate_cache_entries_to_double_dashes(initial_version)
UpdateMigrator.migrate_cache_entries_to_symlinks(initial_version)
UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary

if !updated
if !ARGV.include?("--preinstall") && !ENV["HOMEBREW_UPDATE_FAILED"]
puts "Already up-to-date."
Expand All @@ -140,12 +127,6 @@ def update_report
Tap.each(&:link_completions_and_manpages)

Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]

# This should always be the last thing to run (but skip on auto-update).
if !ARGV.include?("--preinstall") ||
ENV["HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION"]
UpdateMigrator.migrate_legacy_repository_if_necessary
end
end

def shorten_revision(revision)
Expand Down
38 changes: 1 addition & 37 deletions Library/Homebrew/cmd/update.sh
Expand Up @@ -66,39 +66,6 @@ git_init_if_necessary() {
fi
}

rename_taps_dir_if_necessary() {
local tap_dir
local tap_dir_basename
local tap_dir_hyphens
local user
local repo

for tap_dir in "$HOMEBREW_LIBRARY"/Taps/*
do
[[ -d "$tap_dir/.git" ]] || continue
tap_dir_basename="${tap_dir##*/}"
if [[ "$tap_dir_basename" = *"-"* ]]
then
# only replace the *last* dash: yes, tap filenames suck
user="$(echo "${tap_dir_basename%-*}" | tr "[:upper:]" "[:lower:]")"
repo="$(echo "${tap_dir_basename:${#user}+1}" | tr "[:upper:]" "[:lower:]")"
mkdir -p "$HOMEBREW_LIBRARY/Taps/$user"
mv "$tap_dir" "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo"

tap_dir_hyphens="${tap_dir_basename//[^\-]}"
if [[ ${#tap_dir_hyphens} -gt 1 ]]
then
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
fi
else
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>. " >&2
echo "$tap_dir is an incorrect Tap path." >&2
echo "So you may need to rename it to $HOMEBREW_LIBRARY/Taps/<someuser>/homebrew-<sometap> manually." >&2
fi
done
}

repo_var() {
local repo_var

Expand Down Expand Up @@ -427,15 +394,12 @@ EOS
lock update

git_init_if_necessary
# rename Taps directories
# this procedure will be removed in the future if it seems unnecessary
rename_taps_dir_if_necessary

safe_cd "$HOMEBREW_REPOSITORY"

# if an older system had a newer curl installed, change each repo's remote URL from GIT to HTTPS
if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" &&
"$(git config remote.origin.url)" =~ ^git:// ]]
then
git config remote.origin.url "$BREW_OFFICIAL_REMOTE"
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/upgrade.rb
Expand Up @@ -31,10 +31,10 @@ def upgrade
# TODO: deprecate for next minor release.
if ARGV.include?("--cleanup")
ENV["HOMEBREW_INSTALL_CLEANUP"] = "1"
# odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'")
odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'")
elsif ENV["HOMEBREW_UPGRADE_CLEANUP"]
ENV["HOMEBREW_INSTALL_CLEANUP"] = "1"
# odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'")
odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'")
end

FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/compat.rb
@@ -1,7 +1,8 @@
require "compat/extend/os/mac/utils/bottles"
require "compat/os/mac"
require "compat/requirements/x11_requirement"
require "compat/requirements/xcode_requirement"
require "compat/cask"
require "compat/download_strategy"
require "compat/fileutils"
require "compat/formula"
require "compat/tap"
5 changes: 1 addition & 4 deletions Library/Homebrew/compat/cask.rb
@@ -1,8 +1,5 @@
require "compat/cask/cask_loader"
require "compat/cask/cmd/--version"
require "compat/cask/cmd/cleanup"
require "compat/cask/cmd/search"
require "compat/cask/cache"
require "compat/cask/cask_loader"
require "compat/cask/caskroom"
require "compat/cask/dsl"

Expand Down
31 changes: 0 additions & 31 deletions Library/Homebrew/compat/cask/cmd/--version.rb

This file was deleted.

29 changes: 0 additions & 29 deletions Library/Homebrew/compat/cask/cmd/cleanup.rb

This file was deleted.

20 changes: 0 additions & 20 deletions Library/Homebrew/compat/cask/cmd/search.rb

This file was deleted.

20 changes: 10 additions & 10 deletions Library/Homebrew/compat/download_strategy.rb
Expand Up @@ -9,7 +9,7 @@
# distribution. (It will work for public buckets as well.)
class S3DownloadStrategy < CurlDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("S3DownloadStrategy",
odisabled("S3DownloadStrategy",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
super
end
Expand Down Expand Up @@ -58,7 +58,7 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
require "utils/github"

def initialize(url, name, version, **meta)
odeprecated("GitHubPrivateRepositoryDownloadStrategy",
odisabled("GitHubPrivateRepositoryDownloadStrategy",
"a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)")
super
parse_url_pattern
Expand Down Expand Up @@ -112,7 +112,7 @@ def validate_github_repository_access!
# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("GitHubPrivateRepositoryReleaseDownloadStrategy",
odisabled("GitHubPrivateRepositoryReleaseDownloadStrategy",
"a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap (using require_relative)")
super
end
Expand Down Expand Up @@ -168,7 +168,7 @@ def fetch_release_metadata
# ...
class ScpDownloadStrategy < AbstractFileDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("ScpDownloadStrategy",
odisabled("ScpDownloadStrategy",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
super
parse_url_pattern
Expand Down Expand Up @@ -214,11 +214,11 @@ module Compat
def detect_from_url(url)
case url
when %r{^s3://}
odeprecated("s3://",
odisabled("s3://",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
S3DownloadStrategy
when %r{^scp://}
odeprecated("scp://",
odisabled("scp://",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
ScpDownloadStrategy
else
Expand All @@ -229,20 +229,20 @@ def detect_from_url(url)
def detect_from_symbol(symbol)
case symbol
when :github_private_repo
odeprecated(":github_private_repo",
odisabled(":github_private_repo",
"a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)")
GitHubPrivateRepositoryDownloadStrategy
when :github_private_release
odeprecated(":github_private_repo",
odisabled(":github_private_repo",
"a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap "\
"(using require_relative)")
GitHubPrivateRepositoryReleaseDownloadStrategy
when :s3
odeprecated(":s3",
odisabled(":s3",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
S3DownloadStrategy
when :scp
odeprecated(":scp",
odisabled(":scp",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
ScpDownloadStrategy
else
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compat/extend/os/mac/utils/bottles.rb
Expand Up @@ -7,7 +7,7 @@ module Compat
def tag_without_or_later(tag)
return super unless tag.to_s.end_with?("_or_later")

odeprecated "`or_later` bottles",
odisabled "`or_later` bottles",
"bottles without `or_later` (or_later is implied now)"
tag.to_s[/(\w+)_or_later$/, 1].to_sym
end
Expand Down
16 changes: 0 additions & 16 deletions Library/Homebrew/compat/fileutils.rb

This file was deleted.

0 comments on commit 170c549

Please sign in to comment.