<commit_before>class Texlive < Formula
  include Language::Python::Shebang
  include Language::Python::Virtualenv

  desc "Free software distribution for the TeX typesetting system"
  homepage "https://www.tug.org/texlive/"
  url "https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2022/texlive-20220321-source.tar.xz"
  mirror "https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2022/texlive-20220321-source.tar.xz"
  sha256 "5ffa3485e51eb2c4490496450fc69b9d7bd7cb9e53357d92db4bcd4fd6179b56"
  license :public_domain
  revision 1
  head "https://github.com/TeX-Live/texlive-source.git", branch: "trunk"

  livecheck do
    url "https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/"
    regex(/href=.*?texlive[._-]v?(\d+(?:\.\d+)*)[._-]source\.t/i)
    strategy :page_match do |page, regex|
      # Match years from directories
      years = page.scan(%r{href=["']?v?(\d+(?:\.\d+)*)/?["' >]}i)
                  .flatten
                  .uniq
                  .map { |v| Version.new(v) }
                  .sort
      next if years.blank?

      # Fetch the page for the newest year directory
      newest_year = years.last.to_s
      year_page = Homebrew::Livecheck::Strategy.page_content(URI.join(@url, newest_year))
      next if year_page[:content].blank?

      # Match version from source tarball filenames
      year_page[:content].scan(regex).flatten
    end
  end

  bottle do
    sha256 arm64_monterey: "7b5516dc4a93e9049b043b433939babe9fc49d601b79c28d5e89ae65c4239ea3"
    sha256 arm64_big_sur:  "53e6c100505c281b4aaeb1d9f2e59f85f1bd326347555a8a1892705d95a9a0e1"
    sha256 monterey:       "1cb83a23e1232b4a01c84e430af0b3b7b448ccd663c420009df8b700fb92c76a"
    sha256 big_sur:        "8a9bcdd4d7195bdaeb641fd17338e1164109aad64d55aaff2ced36aec50e6975"
    sha256 catalina:       "dce2568d9351a7c67e118f708cd51e160d96bb419f2cbdb74f148990a45d8028"
    sha256 x86_64_linux:   "79a742ddce49de12bbfa53f0f33a184650edbbafb7d246acc8a63887c15670c1"<commit_msg>texlive: update 20220321_1 bottle.<commit_after>class Texlive < Formula
  include Language::Python::Shebang
  include Language::Python::Virtualenv

  desc "Free software distribution for the TeX typesetting system"
  homepage "https://www.tug.org/texlive/"
  url "https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2022/texlive-20220321-source.tar.xz"
  mirror "https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2022/texlive-20220321-source.tar.xz"
  sha256 "5ffa3485e51eb2c4490496450fc69b9d7bd7cb9e53357d92db4bcd4fd6179b56"
  license :public_domain
  revision 1
  head "https://github.com/TeX-Live/texlive-source.git", branch: "trunk"

  livecheck do
    url "https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/"
    regex(/href=.*?texlive[._-]v?(\d+(?:\.\d+)*)[._-]source\.t/i)
    strategy :page_match do |page, regex|
      # Match years from directories
      years = page.scan(%r{href=["']?v?(\d+(?:\.\d+)*)/?["' >]}i)
                  .flatten
                  .uniq
                  .map { |v| Version.new(v) }
                  .sort
      next if years.blank?

      # Fetch the page for the newest year directory
      newest_year = years.last.to_s
      year_page = Homebrew::Livecheck::Strategy.page_content(URI.join(@url, newest_year))
      next if year_page[:content].blank?

      # Match version from source tarball filenames
      year_page[:content].scan(regex).flatten
    end
  end

  bottle do
    sha256 arm64_monterey: "0c445592adf5bbebb9d130787148a14e1012db891da27d6f806f2c9bcb002c49"
    sha256 arm64_big_sur:  "e4a3b7f7a79acd37d3528369be06e70e2bec7150f0dc5e18a155e3318012d718"
    sha256 monterey:       "739eb9e72386da81a78562d1f2440222ba686ee87d55c7dce63a02cdf3c299a9"
    sha256 big_sur:        "f840c75a4a08a5f1675d9055f39753fd958f0b80e3170364583fd77f83f5ce6d"
    sha256 catalina:       "8d8c444e9b22da67bc2fc57be175f36e301d7fef929f141e93f80b3f27ffaed1"
    sha256 x86_64_linux:   "4c57ed5ae6c4c57a73b511b14dde237729a2c624e547b5dcc4e85564fc954885"
{'fraction_non_alphanumeric': 0.11308481361020765, 'fraction_numerical': 0.16887665749311984, 'mean_word_length': 3.7425860023724793, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, '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': '5478755', 'n_tokens_mistral': 1996, 'n_tokens_neox': 1614, 'n_words': 208}