2016-10-06 19:52:04 +00:00
|
|
|
class Dbhash < Formula
|
|
|
|
desc "Computes the SHA1 hash of schema and content of a SQLite database"
|
|
|
|
homepage "https://www.sqlite.org/dbhash.html"
|
2016-11-04 14:36:07 +00:00
|
|
|
url "https://www.sqlite.org/2016/sqlite-src-3150100.zip"
|
|
|
|
version "3.15.1"
|
|
|
|
sha256 "423a73936931c5148a4812ee7d82534ec7d998576ea1b4e1573af91ec15a4b01"
|
2016-10-06 19:52:04 +00:00
|
|
|
|
2016-10-06 20:04:47 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-11-04 15:33:19 +00:00
|
|
|
sha256 "bec0dbda19d83e979bafe860acce6c033738ab51ed405170a45f9251521ed23f" => :sierra
|
|
|
|
sha256 "b97e3a56dc98d13915f09fc2d11d06f36a77a1de00440d6888ab54dd62439dbc" => :el_capitan
|
|
|
|
sha256 "d0360980ce4883e34925178486395587abc3721efb53a4b404fc914f26b9be86" => :yosemite
|
2016-10-06 20:04:47 +00:00
|
|
|
end
|
|
|
|
|
2016-10-06 19:52:04 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--disable-debug", "--prefix=#{prefix}"
|
|
|
|
system "make", "dbhash"
|
|
|
|
bin.install "dbhash"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
dbpath = testpath/"test.sqlite"
|
|
|
|
sqlpath = testpath/"test.sql"
|
|
|
|
sqlpath.write "create table test (name text);"
|
|
|
|
system "/usr/bin/sqlite3 #{dbpath} < #{sqlpath}"
|
|
|
|
assert_equal "b6113e0ce62c5f5ca5c9f229393345ce812b7309",
|
|
|
|
shell_output("#{bin}/dbhash #{dbpath}").strip.split.first
|
|
|
|
end
|
|
|
|
end
|