homebrew-core/Formula/regipy.rb

74 lines
3.2 KiB
Ruby

class Regipy < Formula
include Language::Python::Virtualenv
desc "Offline registry hive parsing tool"
homepage "https://github.com/mkorman90/regipy"
url "https://files.pythonhosted.org/packages/86/f7/9e1f7bf74a52dbbe4691466dc99f7ef89b7e247b2fcea5f081a180ebbbc2/regipy-2.3.3.tar.gz"
sha256 "a382399664191f8f5d2dddaa6531e369e52251f166d6f096cc617cdd8652933e"
license "MIT"
head "https://github.com/mkorman90/regipy.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "79ca756ab78a250e83b1a2ff88a5afb88be54ad8e2c562e3123eeab7c72c82c3"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "11a697e7e6c2073fbeed9bc9f0d22036aa4d20c203765ca1f5b83c9d223cb174"
sha256 cellar: :any_skip_relocation, monterey: "f3147bf7eee73d666a2abf1784033ca8e3286434154985211fbf1d2b3414fbe8"
sha256 cellar: :any_skip_relocation, big_sur: "e17289945a77f54a7221aee86b665f3f94523c994d1065f9aa99c88d250f7ac7"
sha256 cellar: :any_skip_relocation, catalina: "97b2d1f097196dddde91786bbffb237de55a67c7263d2512a3a2276dc4d96241"
sha256 cellar: :any_skip_relocation, x86_64_linux: "172c89e5295ed48c38e986ace62cd2f4e2524d6f8de3a191c627948feb71b2ab"
end
depends_on "python-tabulate"
depends_on "python@3.9"
resource "attrs" do
url "https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz"
sha256 "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"
end
resource "click" do
url "https://files.pythonhosted.org/packages/59/87/84326af34517fca8c58418d148f2403df25303e02736832403587318e9e8/click-8.1.3.tar.gz"
sha256 "7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"
end
resource "construct" do
url "https://files.pythonhosted.org/packages/e0/b7/a4a032e94bcfdff481f2e6fecd472794d9da09f474a2185ed33b2c7cad64/construct-2.10.68.tar.gz"
sha256 "7b2a3fd8e5f597a5aa1d614c3bd516fa065db01704c72a1efaaeec6ef23d8b45"
end
resource "inflection" do
url "https://files.pythonhosted.org/packages/e1/7e/691d061b7329bc8d54edbf0ec22fbfb2afe61facb681f9aaa9bff7a27d04/inflection-0.5.1.tar.gz"
sha256 "1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz"
sha256 "1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7"
end
resource "test_hive" do
url "https://raw.githubusercontent.com/mkorman90/regipy/71acd6a65bdee11ff776dbd44870adad4632404c/regipy_tests/data/SYSTEM.xz"
sha256 "b1582ab413f089e746da0528c2394f077d6f53dd4e68b877ffb2667bd027b0b0"
end
def install
venv = virtualenv_create(libexec, "python3.9")
res = resources.map(&:name).to_set
res -= %w[test_hive]
res.each do |r|
venv.pip_install resource(r)
end
venv.pip_install_and_link buildpath
end
test do
resource("test_hive").stage do
system bin/"registry-plugins-run", "-p", "computer_name", "-o", "out.json", "SYSTEM"
h = JSON.parse(File.read("out.json"))
assert_equal h["computer_name"][0]["name"], "WKS-WIN732BITA"
assert_equal h["computer_name"][1]["name"], "WIN-V5T3CSP8U4H"
end
end
end