LoginSignup
3
3

More than 5 years have passed since last update.

Homebrewのformulaをアップデートする方法

Last updated at Posted at 2018-02-13

Homebrew公式から,アップデートしたいformulaの.rbファイルを探します.
cd $(brew --repository homebrew/core)でローカル内のFormula保管場所へ移動できるので,そちらを参考にしても問題ありません)

今回はblast.rbを更新したいと思います.

brew bump-formula-prコマンドを使用することで簡単に既存formulaの更新 (forking, committing, pushing等)を行うことができるようです.

既存のblast.rbの中を参考に,アップデートする項目を引数に与えてコマンドを実行します.

$ brew install hub && brew bump-formula-pr --audit --version=2.7.1 --url=ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.7.1+-src.tar.gz --mirror=ftp://ftp.hgc.jp/pub/mirror/ncbi/blast/executables/blast+/2.7.1/ncbi-blast-2.7.1+-src.tar.gz blast

これまでhubコマンドがインストールされていなかった場合,途中でhubのエラーが出る可能性があります.
その場合はhub -C "$(brew --repo homebrew/core)" forkを実行してgithubのユーザー名,パスワードを入力してセッティングした後に再度上記コマンドを実行してみてください.
もちろん,既にhubがインストールされている場合はbrew install hub &&の部分は不要です.

途中でエラーが出てしまい,最初からやり直したい場合は以下のようにしてブランチを削除してみてください.

$ cd $(brew --repository homebrew/core)
$ git checkout master
$ git branch -D blast-2.7.1

手動で修正したいとき

$ git add blast.rb
$ git commit -m "hoge"
$ git push --set-upstream <YOUR_USERNAME> blast-2.7.1

ローカル上での確認

$ brew install --build-from-source <formula>
$ brew audit --strict <formula>

参考

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3