73 lines
3.5 KiB
Ruby
73 lines
3.5 KiB
Ruby
class Grokmirror < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Framework to smartly mirror git repositories"
|
|
homepage "https://github.com/mricon/grokmirror"
|
|
url "https://files.pythonhosted.org/packages/b0/ef/ffad6177d84dafb7403ccaca2fef735745d5d43200167896a2068422ae89/grokmirror-2.0.11.tar.gz"
|
|
sha256 "6bc1310dc9a0e97836201e6bb14ecbbee332b0f812b9ff345a8386cb267c908c"
|
|
license "GPL-3.0-or-later"
|
|
revision 1
|
|
head "https://github.com/mricon/grokmirror.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "06b15553ec31d5e3a41c51fa728d7eb6b40c2882c21180ea5cdcefaddf2d42d4"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "06b15553ec31d5e3a41c51fa728d7eb6b40c2882c21180ea5cdcefaddf2d42d4"
|
|
sha256 cellar: :any_skip_relocation, monterey: "b9c6c6fd6aca9319bbe706881667e1294af1b53573ef3e10e20ab7578498462e"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "b9c6c6fd6aca9319bbe706881667e1294af1b53573ef3e10e20ab7578498462e"
|
|
sha256 cellar: :any_skip_relocation, catalina: "b9c6c6fd6aca9319bbe706881667e1294af1b53573ef3e10e20ab7578498462e"
|
|
sha256 cellar: :any_skip_relocation, mojave: "b9c6c6fd6aca9319bbe706881667e1294af1b53573ef3e10e20ab7578498462e"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "3a9f85ea67686b0e0b307a727aa964f9ebf62eca5d5fa9cdddbd8232fd7c2861"
|
|
end
|
|
|
|
depends_on "python@3.10"
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/6d/78/f8db8d57f520a54f0b8a438319c342c61c22759d8f9a1cd2e2180b5e5ea9/certifi-2021.5.30.tar.gz"
|
|
sha256 "2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee"
|
|
end
|
|
|
|
resource "charset-normalizer" do
|
|
url "https://files.pythonhosted.org/packages/e7/4e/2af0238001648ded297fb54ceb425ca26faa15b341b4fac5371d3938666e/charset-normalizer-2.0.4.tar.gz"
|
|
sha256 "f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/cb/38/4c4d00ddfa48abe616d7e572e02a04273603db446975ab46bbcd36552005/idna-3.2.tar.gz"
|
|
sha256 "467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/e7/01/3569e0b535fb2e4a6c384bdbed00c55b9d78b5084e0fb7f4d0bf523d7670/requests-2.26.0.tar.gz"
|
|
sha256 "b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/4f/5a/597ef5911cb8919efe4d86206aa8b2658616d676a7088f0825ca08bd7cb8/urllib3-1.26.6.tar.gz"
|
|
sha256 "f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
end
|
|
|
|
test do
|
|
mkdir "repos/repo" do
|
|
system "git", "init"
|
|
system "git", "config", "user.name", "BrewTestBot"
|
|
system "git", "config", "user.email", "BrewTestBot@test.com"
|
|
(testpath/"repos/repo/test").write "foo"
|
|
system "git", "add", "test"
|
|
system "git", "commit", "-m", "Initial commit"
|
|
system "git", "config", "--bool", "core.bare", "true"
|
|
mv testpath/"repos/repo/.git", testpath/"repos/repo.git"
|
|
end
|
|
rm_rf testpath/"repos/repo"
|
|
|
|
system bin/"grok-manifest", "-m", testpath/"manifest.js.gz", "-t", testpath/"repos"
|
|
system "gzip", "-d", testpath/"manifest.js.gz"
|
|
refs = Utils.safe_popen_read("git", "--git-dir", testpath/"repos/repo.git", "show-ref")
|
|
manifest = JSON.parse (testpath/"manifest.js").read
|
|
assert_equal Digest::SHA1.hexdigest(refs), manifest["/repo.git"]["fingerprint"]
|
|
end
|
|
end
|