<commit_before># Installs the necessary files for running SQL*Plus with Instant Client.
# The Basic Lite package with only English error messages and Unicode, ASCII,
# and Western European character set support is used.

class CacheDownloadStrategy < CurlDownloadStrategy
  def fetch
    archive = @url.sub(%r[^file://], "")
    unless File.exists?(archive)
      odie <<-EOS.undent
        Formula expects to locate the following archive:
          #{Pathname.new(archive).basename}

        in the HOMEBREW_CACHE directory:
          #{HOMEBREW_CACHE}

        Copy the archive to the cache or create a symlink in the cache to the archive:
          ln -sf /path/to/archive $(brew --cache)/
      EOS
    end
    super
  end
end

class InstantClient < Formula
  desc "Free, light-weight client software for connecting to Oracle databases"
  homepage "https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html"
  url "file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-11.2.0.4.0.zip",
    :using => CacheDownloadStrategy
  sha1 "79f4b3090e15c392ef85626bb24793e57d02fe24"

  resource "sqlplus" do
    url "file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-11.2.0.4.0.zip",
      :using => CacheDownloadStrategy
    sha1 "0ee3385f508d03136f8131672f38b636f0f9f274"
  end

  depends_on :macos => :lion

  def install
    buildpath.install resource("sqlplus")

    # Fix permissions
    chmod "u+w,go-w", Dir["./*"]

    # Fix install names
    oracle_bin = %W[adrci genezi uidrvci sqlplus]
    oracle_bin.each do |f|
      system "install_name_tool",
             "-change",
             "/ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_sqlplus_mac/oracle/sqlplus/lib/libsqlplus.dylib",
             "#{opt_lib}/libsqlplus.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    oracle_dylib = %W[libclntsh.dylib.11.1 libnnz11.dylib libocci.dylib.11.1 libsqlplus.dylib]
    oracle_dylib.each do |f|
      system "install_name_tool", "-id", f, f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    oracle_bundle = %W[libociicus.dylib libocijdbc11.dylib libsqlplusic.dylib]
    oracle_bundle.each do |f|
      system "install_name_tool",
             "-change",
             "/ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    prefix.install Dir["*_README"]
    bin.install oracle_bin
    lib.install Dir["*.dylib*"]
    (prefix/"sqlplus/admin").mkpath
    (prefix/"sqlplus/admin").install "glogin.sql"
  end

  test do
    system bin/"sqlplus", "-V"
  end
end
<commit_msg>Use sha256, add rpath to libclntsh.dylib, and add dylib symbolic links<commit_after>class CacheDownloadStrategy < CurlDownloadStrategy
  def fetch
    archive = @url.sub(%r[^file://], "")
    unless File.exists?(archive)
      odie <<-EOS.undent
        Formula expects to locate the following archive:
          #{Pathname.new(archive).basename}

        in the HOMEBREW_CACHE directory:
          #{HOMEBREW_CACHE}

        Copy the archive to the cache or create a symlink in the cache to the archive:
          ln -sf /path/to/archive $(brew --cache)/
      EOS
    end
    super
  end
end

class InstantClient < Formula
  desc "Free, light-weight client software for connecting to Oracle databases"
  homepage "https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html"
  url "file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-11.2.0.4.0.zip",
    :using => CacheDownloadStrategy
  sha256 "d51c5fb67d1213c9b3c6301c6f73fe1bef45f78197e1bae7804df4c0abb468a7"

  resource "sqlplus" do
    url "file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-11.2.0.4.0.zip",
      :using => CacheDownloadStrategy
    sha256 "127d2baaa4c72d8591af829f00dea5e2a77c0e272ce8fc091dd853e9406845b9"
  end

  depends_on :macos => :lion

  def install
    buildpath.install resource("sqlplus")

    # Fix permissions
    chmod "u+w,go-w", Dir["./*"]

    # Fix install names
    oracle_bin = %W[adrci genezi uidrvci sqlplus]
    oracle_bin.each do |f|
      system "install_name_tool",
             "-change",
             "/ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_sqlplus_mac/oracle/sqlplus/lib/libsqlplus.dylib",
             "#{opt_lib}/libsqlplus.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    oracle_dylib = %W[libclntsh.dylib.11.1 libnnz11.dylib libocci.dylib.11.1 libsqlplus.dylib]
    oracle_dylib.each do |f|
      system "install_name_tool", "-id", f, f
      system "install_name_tool",
             "-change",
             "/ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    oracle_bundle = %W[libociicus.dylib libocijdbc11.dylib libsqlplusic.dylib]
    oracle_bundle.each do |f|
      system "install_name_tool",
             "-change",
             "/ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1",
             "#{opt_lib}/libclntsh.dylib.11.1",
             f
      system "install_name_tool",
             "-change",
             "/ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib",
             "#{opt_lib}/libnnz11.dylib",
             f
    end

    system "install_name_tool",
           "-add_rpath",
           "#{opt_lib}",
           "libclntsh.dylib.11.1"

    prefix.install Dir["*_README"]
    bin.install oracle_bin
    %w[libclntsh.dylib libocci.dylib].each do |dylib|
      ln_s "#{dylib}.11.1", dylib
    end
    lib.install Dir["*.dylib*"]
    (prefix/"sqlplus/admin").mkpath
    (prefix/"sqlplus/admin").install "glogin.sql"
  end

  test do
    system bin/"sqlplus", "-V"
  end
end

{'fraction_non_alphanumeric': 0.129441023211748, 'fraction_numerical': 0.05625296068214117, 'mean_word_length': 2.1024981631153565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6566154', 'n_tokens_mistral': 3337, 'n_tokens_neox': 3056, 'n_words': 474}