<commit_before>module Omnibus
  class HealthCheck

    WHITELIST_LIBS = [/linux-vdso.+/,
                      /libc\.so/,
                      /ld-linux/,
                      /libdl/,
                      /libpthread/,
                      /libm\.so/,
                      /libcrypt\.so/,
                      /librt\.so/,
                      /libutil\.so/,
                      /libgcc_s\.so/,
                      /libstdc\+\+\.so/,
                      /libnsl\.so/,
                      /libfreebl\d\.so/,
                      /libresolv\.so/
                      ]

    SOLARIS_WHITELIST_LIBS = [
                      /libaio\.so/,
                      /libavl\.so/,
                      /libcrypt_[di]\.so/,
                      /libcrypto.so/,
                      /libdoor\.so/,
                      /libgen\.so/,
                      /libmd5\.so/,
                      /libmd\.so/,
                      /libmp\.so/,
                      /libscf\.so/,
                      /libsec\.so/,
                      /libsocket\.so/,
                      /libssl.so/,
                      /libuutil\.so/
                             ]

    WHITELIST_LIBS.push(*SOLARIS_WHITELIST_LIBS)

    def self.run(install_dir)
      ldd_cmd = "find #{install_dir}/ -type f | xargs ldd"
      shell = Mixlib::ShellOut.new(ldd_cmd)
      shell.run_command

      ldd_output = shell.stdout

      bad_libs = {}

      current_library = nil 
      ldd_output.split("\n").each do |line|
        case line
        when /^(.+):$/<commit_msg>One more whitelist library for Solaris. Obsessive compulsive alphabetized sorting of list.<commit_after>module Omnibus
  class HealthCheck

    WHITELIST_LIBS = [
                      /ld-linux/,
                      /libc\.so/,
                      /libcrypt\.so/,
                      /libdl/,
                      /libfreebl\d\.so/,
                      /libgcc_s\.so/,
                      /libm\.so/,
                      /libnsl\.so/,
                      /libpthread/,
                      /libresolv\.so/,
                      /librt\.so/,
                      /libstdc\+\+\.so/,
                      /libutil\.so/,
                      /linux-vdso.+/
                      ]

    SOLARIS_WHITELIST_LIBS = [
                              /libaio\.so/,
                              /libavl\.so/,
                              /libcrypt_[di]\.so/,
                              /libcrypto.so/,
                              /libcurses\.so/,
                              /libdoor\.so/,
                              /libgen\.so/,
                              /libmd5\.so/,
                              /libmd\.so/,
                              /libmp\.so/,
                              /libscf\.so/,
                              /libsec\.so/,
                              /libsocket\.so/,
                              /libssl.so/,
                              /libuutil\.so/
                             ]
    
    WHITELIST_LIBS.push(*SOLARIS_WHITELIST_LIBS)

    def self.run(install_dir)
      ldd_cmd = "find #{install_dir}/ -type f | xargs ldd"
      shell = Mixlib::ShellOut.new(ldd_cmd)
      shell.run_command

      ldd_output = shell.stdout

      bad_libs = {}

      current_library = nil 
      ldd_output.split("\n").each do |line|
        case line
        when /^(.+):$/
{'fraction_non_alphanumeric': 0.11790911790911791, 'fraction_numerical': 0.000594000594000594, 'mean_word_length': 0.6607495069033531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5257399', 'n_tokens_mistral': 1017, 'n_tokens_neox': 891, 'n_words': 128}