diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 14 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/deps.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 20 |
4 files changed, 36 insertions, 10 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 3c26eeb97..c4e0fb619 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -1192,6 +1192,7 @@ class ResourceAuditor %r{^http://tools\.ietf\.org/}, %r{^http://launchpad\.net/}, %r{^http://bitbucket\.org/}, + %r{^http://anonscm\.debian\.org/}, %r{^http://cpan\.metacpan\.org/}, %r{^http://hackage\.haskell\.org/}, %r{^http://(?:[^/]*\.)?archive\.org}, @@ -1202,6 +1203,8 @@ class ResourceAuditor problem "#{p} should be `https://cpan.metacpan.org/#{$1}`" when %r{^(http|ftp)://ftp\.gnome\.org/pub/gnome/(.*)}i problem "#{p} should be `https://download.gnome.org/#{$2}`" + when %r{^git://anonscm\.debian\.org/users/(.*)}i + problem "#{p} should be `https://anonscm.debian.org/git/users/#{$1}`" end end @@ -1250,6 +1253,17 @@ class ResourceAuditor end end + # Debian has an abundance of secure mirrors. Let's not pluck the insecure + # one out of the grab bag. + urls.each do |u| + next unless u =~ %r{^http://http\.debian\.net/debian/(.*)}i + problem <<-EOS.undent + Please use a secure mirror for Debian URLs. + We recommend: + https://mirrors.ocf.berkeley.edu/debian/#{$1} + EOS + end + # Check for Google Code download urls, https:// is preferred # Intentionally not extending this to SVN repositories due to certificate # issues. diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index dfdd2d9f8..8db70461e 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -1,4 +1,4 @@ -#: * `deps` [`--1`] [`-n`] [`--union`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] <formulae>: +#: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] <formulae>: #: Show dependencies for <formulae>. When given multiple formula arguments, #: show the intersection of dependencies for <formulae>. #: @@ -10,6 +10,8 @@ #: If `--union` is passed, show the union of dependencies for <formulae>, #: instead of the intersection. #: +#: If `--full-name` is passed, list dependencies by their full name. +#: #: If `--installed` is passed, only list those dependencies that are #: currently installed. #: @@ -62,7 +64,11 @@ module Homebrew else all_deps = deps_for_formulae(ARGV.formulae, !ARGV.one?, &(mode.union? ? :| : :&)) all_deps = all_deps.select(&:installed?) if mode.installed? - all_deps = all_deps.map(&:name).uniq + all_deps = if ARGV.include? "--full-name" + all_deps.map(&:to_formula).map(&:full_name) + else + all_deps.map(&:name) + end.uniq all_deps.sort! unless mode.topo_order? puts all_deps end diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 526c7220d..2a100083d 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -83,7 +83,7 @@ module Homebrew end if $stdout.tty? - metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ? .] + metacharacters = %w[\\ | ( ) [ ] { } ^ $ * + ?] bad_regex = metacharacters.any? do |char| ARGV.any? do |arg| arg.include?(char) && !arg.start_with?("/") diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 7b57bde24..c0658aa4c 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -17,10 +17,7 @@ source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh" git() { if [[ -z "$GIT_EXECUTABLE" ]] then - GIT_EXECUTABLE_RELATIVE="$("$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" --homebrew=print-path)" - GIT_EXECUTABLE_BASE="$(basename "$GIT_EXECUTABLE_RELATIVE")" - GIT_EXECUTABLE_DIR="$(cd "$(dirname "$GIT_EXECUTABLE_RELATIVE")" && pwd)" - GIT_EXECUTABLE="$GIT_EXECUTABLE_DIR/$GIT_EXECUTABLE_BASE" + GIT_EXECUTABLE="$("$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" --homebrew=print-path)" fi "$GIT_EXECUTABLE" "$@" } @@ -226,9 +223,18 @@ merge_or_rebase() { fi git merge --abort &>/dev/null git rebase --abort &>/dev/null - git -c "user.email=brew-update@localhost" \ - -c "user.name=brew update" \ - stash save --include-untracked "${QUIET_ARGS[@]}" + git reset --mixed "${QUIET_ARGS[@]}" + if ! git -c "user.email=brew-update@localhost" \ + -c "user.name=brew update" \ + stash save --include-untracked "${QUIET_ARGS[@]}" + then + odie <<EOS +Could not `git stash` in $DIR! +Please stash/commit manually if you need to keep your changes or, if not, run: + cd $DIR + git reset --hard origin/master +EOS + fi git reset --hard "${QUIET_ARGS[@]}" STASHED="1" fi |
