From d62512095ff4d82c7337682de77cffe9fe5da2f2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 17 Sep 2016 19:35:07 +0100 Subject: update.sh: always fetch tags. We use these for updating people who just follow tags. --- Library/Homebrew/cmd/update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index b57691893..716c01599 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -480,10 +480,10 @@ EOS if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]] then - git fetch --force "${QUIET_ARGS[@]}" origin \ + git fetch --tags --force "${QUIET_ARGS[@]}" origin \ "refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR" 2>/dev/null else - if ! git fetch --force "${QUIET_ARGS[@]}" origin \ + if ! git fetch --tags --force "${QUIET_ARGS[@]}" origin \ "refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR" then echo "Fetching $DIR failed!" >>"$update_failed_file" -- cgit v1.2.3 From 96232722839e54ce4cdaf3dc87f976542795eced Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 20 Sep 2016 17:15:43 +0100 Subject: update.sh: force a full update if we have no tags. --- Library/Homebrew/cmd/update.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 716c01599..acf4520ba 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -425,6 +425,12 @@ EOS declare UPSTREAM_BRANCH"$TAP_VAR"="$UPSTREAM_BRANCH_DIR" declare PREFETCH_REVISION"$TAP_VAR"="$(git rev-parse -q --verify refs/remotes/origin/"$UPSTREAM_BRANCH_DIR")" + # Force a full update if we don't have any tags. + if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$(git tag --list)" ]] + then + HOMEBREW_UPDATE_FORCE=1 + fi + if [[ -z "$HOMEBREW_UPDATE_FORCE" ]] then [[ -n "$SKIP_FETCH_BREW_REPOSITORY" && "$DIR" = "$HOMEBREW_REPOSITORY" ]] && continue -- cgit v1.2.3 From b2c7d6d83d0eecba7057873b7cb3511d09183825 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 17 Sep 2016 19:41:21 +0100 Subject: update.sh: update to latest Homebrew/brew tag. Rather than following every change on `master` let’s have non-developer users (i.e. those who have never run a `dev-cmd` or set `HOMEBREW_DEVELOPER`) update between tags. This provides a fairly natural beta (the `master` branch`) and stable (the tags) approach without restricting us to any particular way of managing our tags. --- Library/Homebrew/cmd/update.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index acf4520ba..570a4c36b 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -215,7 +215,18 @@ merge_or_rebase() { trap reset_on_interrupt SIGINT - REMOTE_REF="origin/$UPSTREAM_BRANCH" + if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] + then + UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + fi + + if [ -n "$UPSTREAM_TAG" ] + then + REMOTE_REF="refs/tags/$UPSTREAM_TAG" + UPSTREAM_BRANCH="v$UPSTREAM_TAG" + else + REMOTE_REF="origin/$UPSTREAM_BRANCH" + fi if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]] then -- cgit v1.2.3 From e8ebcb834bcd54aa555b52cc6a06bf05e8b5ac1a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 19:59:56 +0100 Subject: update.sh: allow forcing tag update. To test the tag update functionality allow setting `HOMEBREW_UPDATE_TO_TAG`. --- Library/Homebrew/cmd/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 570a4c36b..eb15e1029 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -348,7 +348,7 @@ EOS set -x fi - if [[ -z "$HOMEBREW_UPDATE_CLEANUP" ]] + if [[ -z "$HOMEBREW_UPDATE_CLEANUP" && -z "$HOMEBREW_UPDATE_TO_TAG" ]] then if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]] then -- cgit v1.2.3 From f9bd121e387dfa478b924d1a28a439ae2318cafe Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 21 Sep 2016 14:32:48 +0100 Subject: update.sh: tweak tag handling. - Don't let the `UPSTREAM_TAG` variable bleed into future repository checks. - Even if the tag branch is an ancestor of the tag ensure that it's forced back to the tag anyway. --- Library/Homebrew/cmd/update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index eb15e1029..a043853d8 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -218,6 +218,8 @@ merge_or_rebase() { if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + else + UPSTREAM_TAG="" fi if [ -n "$UPSTREAM_TAG" ] @@ -253,7 +255,8 @@ EOS fi INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)" - if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] + if [[ -n "$UPSTREAM_TAG" ]] || + [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] then if [[ -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] @@ -265,7 +268,8 @@ EOS # Recreate and check out `#{upstream_branch}` if unable to fast-forward # it to `origin/#{@upstream_branch}`. Otherwise, just check it out. - if git merge-base --is-ancestor "$UPSTREAM_BRANCH" "$REMOTE_REF" &>/dev/null + if [[ -z "$UPSTREAM_TAG" ]] && + git merge-base --is-ancestor "$UPSTREAM_BRANCH" "$REMOTE_REF" &>/dev/null then git checkout --force "$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}" else -- cgit v1.2.3 From 66ca9e79fc14f28e54f259bba94a52922728bde8 Mon Sep 17 00:00:00 2001 From: Joseph Frazier Date: Wed, 21 Sep 2016 09:18:36 -0400 Subject: uninstall: improve pronoun for multiple version message When exactly two versions of a package were installed, the uninstall message should not read "Remove them all with...", since only one version remains. "Remove all versions with..." is flexible enough to avoid being interpreted as grammatically incorrect, and it still accurately describes the general behavior of `brew uninstall --force`. --- Library/Homebrew/cmd/uninstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index 6ea45a770..f4ca8ff87 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -25,7 +25,7 @@ module Homebrew versions = rack.subdirs.map(&:basename) verb = versions.length == 1 ? "is" : "are" puts "#{keg.name} #{versions.join(", ")} #{verb} still installed." - puts "Remove them all with `brew uninstall --force #{keg.name}`." + puts "Remove all versions with `brew uninstall --force #{keg.name}`." end end end -- cgit v1.2.3 From b33df4d0fad3ba6a968a86b14170ff1395239be3 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 22 Sep 2016 09:05:07 +0100 Subject: update.sh: don't print "checkout branch" message. It’ll only get printed for people getting updated to tags now and these are people who haven’t run a `dev-cmd` so we want to air on the side of telling them less stuff that will confuse them and assume people who have manually made another `git` branch will know how to get back to it. --- Library/Homebrew/cmd/update.sh | 8 -------- 1 file changed, 8 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index a043853d8..5f082024d 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -258,14 +258,6 @@ EOS if [[ -n "$UPSTREAM_TAG" ]] || [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] then - - if [[ -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] - then - echo "Checking out $UPSTREAM_BRANCH in $DIR..." - echo "To checkout $INITIAL_BRANCH in $DIR run:" - echo " 'cd $DIR && git checkout $INITIAL_BRANCH" - fi - # Recreate and check out `#{upstream_branch}` if unable to fast-forward # it to `origin/#{@upstream_branch}`. Otherwise, just check it out. if [[ -z "$UPSTREAM_TAG" ]] && -- cgit v1.2.3 From 536c48e804407a99c9fe750ca31cd42c7c1fd55a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 23 Sep 2016 08:26:49 +0100 Subject: sandbox: tweak HOMEBREW_REPOSITORY handling. If we have a HOMEBREW_REPOSITORY and HOMEBREW_PREFIX mismatch (now the default) then we can block access to the whole of HOMEBREW_REPOSITORY rather than just the HOMEBREW_LIBRARY and `.git`. --- Library/Homebrew/cmd/postinstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 71b71b3f5..e0bd8e31b 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -36,7 +36,7 @@ module Homebrew sandbox.allow_write_cellar(formula) sandbox.allow_write_xcode sandbox.allow_write_path HOMEBREW_PREFIX - sandbox.deny_write_homebrew_library + sandbox.deny_write_homebrew_repository sandbox.exec(*args) else exec(*args) -- cgit v1.2.3 From b0dfd2d435fe6f5617bd699be90d86ad84bced02 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 23 Sep 2016 11:26:24 +0100 Subject: update.sh: only update to semver tags. Otherwise random e.g. `pr-123` tags may cause `brew update` to update to the wrong version. --- Library/Homebrew/cmd/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 5f082024d..177958266 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -217,7 +217,7 @@ merge_or_rebase() { if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then - UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + UPSTREAM_TAG="$(git tag --list --sort=-version:refname | grep '^[0-9]*\.[0-9]*\.[0-9]*$' | head -n1)" else UPSTREAM_TAG="" fi -- cgit v1.2.3 From 52ff98853068c03b3bfa777932da1da69e35e583 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 20 Sep 2016 22:03:08 +0200 Subject: Fix RuboCop CaseEquality. --- Library/Homebrew/cmd/search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 50d9f5f74..3f00e8a10 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -150,7 +150,7 @@ module Homebrew names = remote_tap_formulae["#{user}/#{repo}"] user = user.downcase if user == "Homebrew" # special handling for the Homebrew organization - names.select { |name| rx === name }.map { |name| "#{user}/#{repo}/#{name}" } + names.select { |name| name =~ rx }.map { |name| "#{user}/#{repo}/#{name}" } rescue GitHub::HTTPNotFoundError opoo "Failed to search tap: #{user}/#{repo}. Please run `brew update`" [] -- cgit v1.2.3 From 21e0a7efb998b65c921885858969503513cad14b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 21 Sep 2016 09:59:45 +0200 Subject: Update `rubocop` dependency to `0.43.0`. --- Library/Homebrew/cmd/style.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index f28d50cc1..c598e9062 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -45,7 +45,7 @@ module Homebrew def check_style_impl(files, output_type, options = {}) fix = options[:fix] - Homebrew.install_gem_setup_path! "rubocop", "0.41.2" + Homebrew.install_gem_setup_path! "rubocop", "0.43.0" args = %W[ --force-exclusion -- cgit v1.2.3 From ce6994b001520b8e5d26e5e15b410c9146072104 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 21 Sep 2016 12:43:05 +0200 Subject: RuboCop has to be run inside `HOMEBREW_LIBRARY`. --- Library/Homebrew/cmd/style.rb | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index c598e9062..db61116be 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -54,20 +54,22 @@ module Homebrew args << "--auto-correct" if fix args += files - case output_type - when :print - args << "--display-cop-names" if ARGV.include? "--display-cop-names" - system "rubocop", "--format", "simple", *args - !$?.success? - when :json - json = Utils.popen_read_text("rubocop", "--format", "json", *args) - # exit status of 1 just means violations were found; other numbers mean execution errors - # exitstatus can also be nil if RuboCop process crashes, e.g. due to - # native extension problems - raise "Error while running RuboCop" if $?.exitstatus.nil? || $?.exitstatus > 1 - RubocopResults.new(Utils::JSON.load(json)) - else - raise "Invalid output_type for check_style_impl: #{output_type}" + HOMEBREW_LIBRARY.cd do + case output_type + when :print + args << "--display-cop-names" if ARGV.include? "--display-cop-names" + system "rubocop", "--format", "simple", *args + !$?.success? + when :json + json = Utils.popen_read_text("rubocop", "--format", "json", *args) + # exit status of 1 just means violations were found; other numbers mean execution errors + # exitstatus can also be nil if RuboCop process crashes, e.g. due to + # native extension problems + raise "Error while running RuboCop" if $?.exitstatus.nil? || $?.exitstatus > 1 + RubocopResults.new(Utils::JSON.load(json)) + else + raise "Invalid output_type for check_style_impl: #{output_type}" + end end end -- cgit v1.2.3 From a5b11a6a5c7e29b9040f93fd211f52479507dd01 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 22 Sep 2016 20:12:28 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/cmd/cleanup.rb | 14 +++++++------- Library/Homebrew/cmd/diy.rb | 8 +++----- Library/Homebrew/cmd/info.rb | 7 ++----- Library/Homebrew/cmd/install.rb | 10 +++++----- Library/Homebrew/cmd/reinstall.rb | 9 +++++---- Library/Homebrew/cmd/search.rb | 7 ++++--- 6 files changed, 26 insertions(+), 29 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index a9d3fbcde..6e0915c9a 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -22,13 +22,13 @@ module Homebrew ARGV.resolved_formulae.each { |f| Cleanup.cleanup_formula f } end - if Cleanup.disk_cleanup_size > 0 - disk_space = disk_usage_readable(Cleanup.disk_cleanup_size) - if ARGV.dry_run? - ohai "This operation would free approximately #{disk_space} of disk space." - else - ohai "This operation has freed approximately #{disk_space} of disk space." - end + return if Cleanup.disk_cleanup_size.zero? + + disk_space = disk_usage_readable(Cleanup.disk_cleanup_size) + if ARGV.dry_run? + ohai "This operation would free approximately #{disk_space} of disk space." + else + ohai "This operation has freed approximately #{disk_space} of disk space." end end end diff --git a/Library/Homebrew/cmd/diy.rb b/Library/Homebrew/cmd/diy.rb index 8262352f8..95ec7fe35 100644 --- a/Library/Homebrew/cmd/diy.rb +++ b/Library/Homebrew/cmd/diy.rb @@ -31,11 +31,9 @@ module Homebrew def detect_version(path) version = path.version.to_s - if version.empty? - raise "Couldn't determine version, set it with --version=" - else - version - end + raise "Couldn't determine version, set it with --version=" if version.empty? + + version end def detect_name(path, version) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 2474aad57..09c832203 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -54,11 +54,8 @@ module Homebrew end rescue FormulaUnavailableError # No formula with this name, try a blacklist lookup - if (blacklist = blacklisted?(f)) - puts blacklist - else - raise - end + raise unless (blacklist = blacklisted?(f)) + puts blacklist end end end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 50439ccf9..0a6dd5a46 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -245,11 +245,11 @@ module Homebrew end def check_macports - unless MacOS.macports_or_fink.empty? - opoo "It appears you have MacPorts or Fink installed." - puts "Software installed with other package managers causes known problems for" - puts "Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again." - end + return if MacOS.macports_or_fink.empty? + + opoo "It appears you have MacPorts or Fink installed." + puts "Software installed with other package managers causes known problems for" + puts "Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again." end def check_cellar diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index e51aace2a..bda6022bf 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -58,10 +58,11 @@ module Homebrew def restore_backup(keg, formula) path = backup_path(keg) - if path.directory? - path.rename keg - keg.link unless formula.keg_only? - end + + return unless path.directory? + + path.rename keg + keg.link unless formula.keg_only? end def backup_path(path) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 3f00e8a10..aa80ec589 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -171,10 +171,11 @@ module Homebrew rescue canonical_name = canonical_full_name = name end + # Ignore aliases from results when the full name was also found - if aliases.include?(name) && results.include?(canonical_full_name) - next - elsif (HOMEBREW_CELLAR/canonical_name).directory? + next if aliases.include?(name) && results.include?(canonical_full_name) + + if (HOMEBREW_CELLAR/canonical_name).directory? pretty_installed(name) else name -- cgit v1.2.3 From 07866f0b54e0d8cd26f761922f242aa0ec73c40c Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sat, 24 Sep 2016 05:45:21 -0400 Subject: update.sh: do not restore stable (tag) branch Restoring stable branch post-update could lead to unsuspecting users with homebrew.devcmdrun being stuck forever on an old tag. Fixes #1111. --- Library/Homebrew/cmd/update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 177958266..ba230bdec 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -297,7 +297,8 @@ EOS if [[ -n "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then - if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] + if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" && + ! "$INITIAL_BRANCH" =~ ^v[0-9]+\.[0-9]+\.[0-9]$ ]] then git checkout "$INITIAL_BRANCH" "${QUIET_ARGS[@]}" fi -- cgit v1.2.3 From 58e36c73193befb57d351344cea2a4a33fef850d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Sep 2016 22:02:23 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/cmd/install.rb | 13 ++++++------- Library/Homebrew/cmd/update-report.rb | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 0a6dd5a46..8a8323252 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -203,13 +203,12 @@ module Homebrew # If they haven't updated in 48 hours (172800 seconds), that # might explain the error master = HOMEBREW_REPOSITORY/".git/refs/heads/master" - if master.exist? && (Time.now.to_i - File.mtime(master).to_i) > 172800 - ohai "You haven't updated Homebrew in a while." - puts <<-EOS.undent - A formula for #{e.name} might have been added recently. - Run `brew update` to get the latest Homebrew updates! - EOS - end + return unless master.exist? && (Time.now.to_i - File.mtime(master).to_i) > 172800 + ohai "You haven't updated Homebrew in a while." + puts <<-EOS.undent + A formula for #{e.name} might have been added recently. + Run `brew update` to get the latest Homebrew updates! + EOS end end end diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 1e9c8ccd3..18f2f370c 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -549,11 +549,10 @@ class ReporterHub end end - unless formulae.empty? - # Dump formula list. - ohai title - puts_columns(formulae) - end + return if formulae.empty? + # Dump formula list. + ohai title + puts_columns(formulae) end def installed?(formula) -- cgit v1.2.3 From 22299cffabcc1d85f124a0b9a080137410525604 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 24 Sep 2016 17:25:15 +0100 Subject: update.sh: always use stable branch for tags. This avoids creating a new branch that’ll never be deleted for each tag and differentiates between the `master` and `stable` branches. --- Library/Homebrew/cmd/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 177958266..2e977f2a6 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -225,7 +225,7 @@ merge_or_rebase() { if [ -n "$UPSTREAM_TAG" ] then REMOTE_REF="refs/tags/$UPSTREAM_TAG" - UPSTREAM_BRANCH="v$UPSTREAM_TAG" + UPSTREAM_BRANCH="stable" else REMOTE_REF="origin/$UPSTREAM_BRANCH" fi -- cgit v1.2.3