homebrew-core/Formula/grokmirror.rb

75 lines
3.6 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
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_ventura: "7f150f165e9b344bdd451af27884677d636af72239d1168914b5b58377ce22aa"
sha256 cellar: :any_skip_relocation, arm64_monterey: "3247fcb790e5bf02062162e65ee093bf6c33528a2f734e472bc259ea7b36ae02"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "b3fa6d1cab11e8a5420fb936a5e0815f4913fa3c228316820fd489b02c7c4141"
sha256 cellar: :any_skip_relocation, ventura: "12024c31b1e067f1028b2a089838ad8da3cd195aeb48b4a34591e3344a8be60d"
sha256 cellar: :any_skip_relocation, monterey: "1021e03076c4b6851ecd9edc8916024e839e1731d10dcfc60799f01aae79e28c"
sha256 cellar: :any_skip_relocation, big_sur: "fc8fb3248cde8ca25f41c572e33250e7b74d77864366a3419457a57d9ba02d62"
sha256 cellar: :any_skip_relocation, catalina: "711286b10063e47357abfdd277c1fdb12aa5c6bdd147c0f94349ea12aab51156"
sha256 cellar: :any_skip_relocation, x86_64_linux: "46fc238fa908a5e27b3ff868f028d26b00ffce7963cd09ec09ed6a498a649e6a"
end
depends_on "python@3.11"
resource "certifi" do
url "https://files.pythonhosted.org/packages/cb/a4/7de7cd59e429bd0ee6521ba58a75adaec136d32f91a761b28a11d8088d44/certifi-2022.9.24.tar.gz"
sha256 "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz"
sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
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