<commit_before>class UtilLinux < Formula
  desc "Collection of Linux utilities"
  homepage "https://github.com/karelzak/util-linux"
  url "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.1.tar.xz"
  sha256 "09fac242172cd8ec27f0739d8d192402c69417617091d8c6e974841568f37eed"
  license all_of: [
    "BSD-3-Clause",
    "BSD-4-Clause-UC",
    "GPL-2.0-only",
    "GPL-2.0-or-later",
    "GPL-3.0-or-later",
    "LGPL-2.1-or-later",
    :public_domain,
  ]

  bottle do
    rebuild 2
    sha256 cellar: :any, arm64_big_sur: "91a76aecae9e1fcdbd44614439c6eb379dcaf1c2e388403eb33d698b986cc587"
    sha256 cellar: :any, big_sur:       "fc3327a2f46d034d163710b29b6b04fb44cabcb31102a2b099d9dbd73e302bce"
    sha256 cellar: :any, catalina:      "01b6c26311161daafc8cf521d994810397810dd35881b0c0bd6bea3a2f0487c8"
    sha256 cellar: :any, mojave:        "81c514e31f486717eb9466b81c4f499558f7b8c5cc80b178228abe1b6e52e27d"
  end

  keg_only "macOS provides the uuid.h header"

  uses_from_macos "ncurses"
  uses_from_macos "zlib"

  # These binaries are already available in macOS
  def system_bins
    %w[
      cal col colcrt colrm
      getopt
      hexdump
      logger look
      mesg more
      nologin
      renice rev
      ul
      whereis
    ]
  end

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}",
                          "--disable-ipcs",     # does not build on macOS
                          "--disable-ipcrm",    # does not build on macOS
                          "--disable-libmount", # does not build on macOS
                          "--disable-wall",     # already comes with macOS
                          "--enable-libuuid"    # conflicts with ossp-uuid

    system "make", "install"

    # Remove binaries already shipped by macOS
    system_bins.each do |prog|
      rm_f bin/prog
      rm_f sbin/prog
      rm_f man1/"#{prog}.1"
      rm_f man8/"#{prog}.8"
      rm_f share/"bash-completion/completions/#{prog}"
    end

    # install completions only for installed programs
    Pathname.glob("bash-completion/*") do |prog|
      bash_completion.install prog if (bin/prog.basename).exist? || (sbin/prog.basename).exist?
    end<commit_msg>util-linux 2.36.2<commit_after>class UtilLinux < Formula
  desc "Collection of Linux utilities"
  homepage "https://github.com/karelzak/util-linux"
  url "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.2.tar.xz"
  sha256 "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f"
  license all_of: [
    "BSD-3-Clause",
    "BSD-4-Clause-UC",
    "GPL-2.0-only",
    "GPL-2.0-or-later",
    "GPL-3.0-or-later",
    "LGPL-2.1-or-later",
    :public_domain,
  ]

  bottle do
    rebuild 2
    sha256 cellar: :any, arm64_big_sur: "91a76aecae9e1fcdbd44614439c6eb379dcaf1c2e388403eb33d698b986cc587"
    sha256 cellar: :any, big_sur:       "fc3327a2f46d034d163710b29b6b04fb44cabcb31102a2b099d9dbd73e302bce"
    sha256 cellar: :any, catalina:      "01b6c26311161daafc8cf521d994810397810dd35881b0c0bd6bea3a2f0487c8"
    sha256 cellar: :any, mojave:        "81c514e31f486717eb9466b81c4f499558f7b8c5cc80b178228abe1b6e52e27d"
  end

  keg_only "macOS provides the uuid.h header"

  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "pkg-config" => :build
  depends_on "gettext"

  uses_from_macos "ncurses"
  uses_from_macos "zlib"

  # These binaries are already available in macOS
  def system_bins
    %w[
      cal col colcrt colrm
      getopt
      hexdump
      logger look
      mesg more
      nologin
      renice rev
      ul
      whereis
    ]
  end

  # Fix build for MacOS
  # Remove in the next release
  # Also remove autoconf/automake/libtool/pkg-config dependencies and autogen.sh call
  patch do
    url "https://github.com/karelzak/util-linux/commit/71ba2792ab3f96b5f5d5d3b0a68d35ecfd0f93a2.patch?full_index=1"
    sha256 "bc5188d3f41a7f248ba622f51c8ab8fed0e05355cbe20a5d3b02bbc274e2c7b4"
  end

  def install
    system "./autogen.sh"

    system "./configure", "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}",
                          "--disable-ipcs",     # does not build on macOS
                          "--disable-ipcrm",    # does not build on macOS
                          "--disable-libmount", # does not build on macOS
                          "--disable-wall",     # already comes with macOS
                          "--enable-libuuid"    # conflicts with ossp-uuid

    system "make", "install"

    # Remove binaries already shipped by macOS
    system_bins.each do |prog|
      rm_f bin/prog
      rm_f sbin/prog
      rm_f man1/"#{prog}.1"
      rm_f man8/"#{prog}.8"
      rm_f share/"bash-completion/completions/#{prog}"
    end

    # install completions only for installed programs
    Pathname.glob("bash-completion/*") do |prog|
      bash_completion.install prog if (bin/prog.basename).exist? || (sbin/prog.basename).exist?
    end
{'fraction_non_alphanumeric': 0.10346161284084317, 'fraction_numerical': 0.10713595049313479, 'mean_word_length': 2.4711409395973156, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 5, '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': '3354021', 'n_tokens_mistral': 2243, 'n_tokens_neox': 1915, 'n_words': 351}