[PYTHON] Turn off the brew warning

Scripts warning

With Python in

brew doctor

When I execute, the following warning appears.

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/knaito/.pyenv/shims/libdynd-config
  /Users/knaito/.pyenv/shims/libpng16-config
  /Users/knaito/.pyenv/shims/python-config
  /Users/knaito/.pyenv/shims/python2-config
  /Users/knaito/.pyenv/shims/python2.7-config

There is a config file that is not managed by brew, so a warning is issued.

There is no problem with the operation even if a warning is issued, but I want to erase it because it is troublesome. One solution is to exclude the .pyenv / shims directory from the path only when you run brew. http://www.task-notes.com/entry/20141223/1419324649

But here, I'll look for a method other than alias. /usr/local/Homebrew/Library/Homebrew/diagnostic.rb Looking at, from line 604 in the check_for_config_scripts method Whitelist

       whitelist = %W[
          /usr/bin /usr/sbin
          /usr/X11/bin /usr/X11R6/bin /opt/X11/bin
          #{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin
          /Applications/Server.app/Contents/ServerRoot/usr/bin
          /Applications/Server.app/Contents/ServerRoot/usr/sbin
        ].map(&:downcase)

Is set, so add .pyenv / shims here.

        whitelist = %W[
          /usr/bin /usr/sbin
          /usr/X11/bin /usr/X11R6/bin /opt/X11/bin
          #{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin
          /Applications/Server.app/Contents/ServerRoot/usr/bin
          /Applications/Server.app/Contents/ServerRoot/usr/sbin
          /Users/knaito/.pyenv/shims
        ].map(&:downcase)

(The knaito part should be your user name)

With this, the above warning will not be issued.

However, this time I get a git warning, so in / usr / local / Homebrew Move

$ get checkout -b custom $ git add -A $ git commit -m "Python code are ignored in doctor"

Commit like this. When updating, you may need to change to the master branch, update, merge into the custom branch, etc.

Library warning

Not managed by brew /usr/local/lib/libcaffe.a If there is such a thing, this also gives a warning with the brew doctor.

Unexpected static libraries:
  /usr/local/lib/libcaffe.a

This is also /usr/local/Homebrew/Library/Homebrew/diagnostic.rb Around line 185 in the check_for_stray_static_libs method of Whitelist definition

        white_list = [
          "libsecurity_agent_client.a", # OS X 10.8.2 Supplemental Update
          "libsecurity_agent_server.a", # OS X 10.8.2 Supplemental Update
          "libntfs-3g.a", # NTFS-3G
          "libntfs.a", # NTFS-3G
          "libublio.a", # NTFS-3G
          "libappfirewall.a", # Symantec Endpoint Protection
          "libautoblock.a", # Symantec Endpoint Protection
          "libautosetup.a", # Symantec Endpoint Protection
          "libconnectionsclient.a", # Symantec Endpoint Protection
          "liblocationawareness.a", # Symantec Endpoint Protection
          "libpersonalfirewall.a", # Symantec Endpoint Protection
          "libtrustedcomponents.a", # Symantec Endpoint Protection
        ]

Add libcaffe.a to

        white_list = [
          "libsecurity_agent_client.a", # OS X 10.8.2 Supplemental Update
          "libsecurity_agent_server.a", # OS X 10.8.2 Supplemental Update
          "libntfs-3g.a", # NTFS-3G
          "libntfs.a", # NTFS-3G
          "libublio.a", # NTFS-3G
          "libappfirewall.a", # Symantec Endpoint Protection
          "libautoblock.a", # Symantec Endpoint Protection
          "libautosetup.a", # Symantec Endpoint Protection
          "libconnectionsclient.a", # Symantec Endpoint Protection
          "liblocationawareness.a", # Symantec Endpoint Protection
          "libpersonalfirewall.a", # Symantec Endpoint Protection
          "libtrustedcomponents.a", # Symantec Endpoint Protection
          "libcaffe.a", # Caffe manual installed
        ]

If you do like, you will not be warned.

Commit / usr / local / Homebrew with git again.

$ get checkout -b naito_custom
$ git add -A
$ git commit -m "Caffe and python code are ignored in doctor"

This is OK.

Other

If possible, I'd like to add a function to brew and easily set a custom whitelist on the user side. Could someone make a pull request?

Recommended Posts

Turn off the brew warning
[python] option to turn off the output of click.progressbar
Let's turn the air gacha
sort warning in the pd.concat function
Turn off Python 2.7 on Debian Stretch
Connect to VPN with your smartphone and turn off / on the server