69 lines
3.1 KiB
Ruby
69 lines
3.1 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/3f/51/f531d38a320897dd478649f366b3e3d0cfb4d795d14b8c5ea44b2cb5c80f/grokmirror-2.0.7.tar.gz"
|
|
sha256 "7132cc12602badc22504803b33d4895df976f29ab0727e678a61984c8281bc9c"
|
|
license "GPL-3.0-or-later"
|
|
head "https://github.com/mricon/grokmirror.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d4654c8d2d3d39a5a5546dd479ac9bfb27b81040e94c48a55895e29ed03266d6"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "86875cccac48e84bc75a27ca094b6a7420fda040e241cf893428846bbcae0b2d"
|
|
sha256 cellar: :any_skip_relocation, catalina: "5729fc9cee3efdfab160b00a95e974181840429cb10f8995045068534c5d479f"
|
|
sha256 cellar: :any_skip_relocation, mojave: "8e404c23e6ef9393c9750b5845209f5a29f018d720755a97dab5b1e877ffd437"
|
|
end
|
|
|
|
depends_on "python@3.9"
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz"
|
|
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"
|
|
end
|
|
|
|
resource "chardet" do
|
|
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz"
|
|
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
|
|
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/6b/47/c14abc08432ab22dc18b9892252efaf005ab44066de871e72a38d6af464b/requests-2.25.1.tar.gz"
|
|
sha256 "27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/d7/8d/7ee68c6b48e1ec8d41198f694ecdc15f7596356f2ff8e6b1420300cf5db3/urllib3-1.26.3.tar.gz"
|
|
sha256 "de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"
|
|
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
|