Categories
Mac tools

遗憾!mytget 无法加入 homebrew

mytget 是什么?

Linux下的下载工具,大家使用比较多的是wget,curl,而他们不支持多线程下载,所以产生了mytget,开始是由南开大学的xiaosuo写的,放在sf上。第一次知道这工具,是2007年在厦门网宿科技工作时同事介绍,用得很爽的一点是在不同的机房拷贝文件很快。

我觉得一个软件要有生命力,就需要不断的更新。似乎过了几年,mytget一直没有更新过,在新版本的Linux gcc高版本编译不通过,Linux新手一般遇到也不知道从何下手,也就放弃了尝试使用这个软件的机会。所以11年我就接手过来维护,放在github上,原作者也过来参与,时不时贡献点代码。

最近几年都在mac下工作,下载软件都是brew install,那干脆把 mytget 放入 homebrew。

git clone https://github.com/iboxpay/homebrew.git
brew create https://github.com/lytsing/mytget/archive/v1.1.2.tar.gz
git checkout -b mytget
brew audit --strict mytget
brew edit mytget
cp /usr/local/Library/Formula/mytget.rb  Library/Formula/
git add Library/Formula/mytget.rb
git commit -m "add Library/Formula/mytget.rb"
git push origin mytget

文件的sha256 通过 shasum -a 256 v1.1.2.tar.gz 获得,然后迫不及待的 创建 pull request。dunn review 代码,说要先去掉注释,以及增加 test 功能。brew create 生产的 mytget.rb 头部有说明:

PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!

没注意看,就提交 pull request了。最后还是被拒绝,说是小众工具,fork、star的数量都不超过10人。详情:https://github.com/Homebrew/homebrew/pull/42785

由此可见,搞开源对代码质量要求非常高,多个空格,空行都不行,review的结果就是:

“Remove all the comments, please!”
“Please remove this empty line.”
“Please remove the trailing space.”

事前跑一下 brew audit –strict mytget 检查配置文件。

If you enjoyed this post, make sure you subscribe to my RSS feed!

Leave a Reply

Your email address will not be published. Required fields are marked *