homebrew-core/Formula/grokmirror.rb

74 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
rebuild 2
sha256 cellar: :any_skip_relocation, arm64_ventura: "575557ee7b1dfb91f4b6d9c894f92d18fa2f3599a51eeffd9252d9a47ee30831"
sha256 cellar: :any_skip_relocation, arm64_monterey: "79e18c3586aebe8298b911feb87d772bd08c16b16e92e663289861f18cddd504"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3319592a5961b5c9e5bc8c4f6661887145fba61fb214d67911fce4e15ba6e964"
sha256 cellar: :any_skip_relocation, ventura: "55ae3b899fb78983834cc8ba37cdda057b0d5dbc791788d6d821152b1dd6a0e2"
sha256 cellar: :any_skip_relocation, monterey: "6fece291fbd9033dea1ee7187fc3e145ffab41767c7b0b7b11413644a88d1c4b"
sha256 cellar: :any_skip_relocation, big_sur: "9e362090e2a147800d1882bdca7d7eea47e4bf5773c1f1244b406865ca4437e4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "4dde4654426c623f3164b7d2d734fafbd5b70a2ca4735596d856ed133725f9b9"
end
depends_on "python@3.11"
resource "certifi" do
url "https://files.pythonhosted.org/packages/37/f7/2b1b0ec44fdc30a3d31dfebe52226be9ddc40cd6c0f34ffc8923ba423b69/certifi-2022.12.7.tar.gz"
sha256 "35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/96/d7/1675d9089a1f4677df5eb29c3f8b064aa1e70c1251a0a8a127803158942d/charset-normalizer-3.0.1.tar.gz"
sha256 "ebea339af930f8ca5d7a699b921106c6e29c617fe9606fa7baa043c1cdae326f"
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/9d/ee/391076f5937f0a8cdf5e53b701ffc91753e87b07d66bae4a09aa671897bf/requests-2.28.2.tar.gz"
sha256 "98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/c5/52/fe421fb7364aa738b3506a2d99e4f3a56e079c0a798e9f4fa5e14c60922f/urllib3-1.26.14.tar.gz"
sha256 "076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72"
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