<commit_before>require_relative "DepotTools.rb"

# Google breakpad. Will automatically setup depot_tools if missing
# Supported extra options:
#
class Breakpad < BaseDep
  def initialize(args)
    super("Google Breakpad", "breakpad", args)

    if !@DepotFolder
      @DepotFolder = File.join(CurrentDir, "depot_tools")
    end

    @DepotDependency = DepotTools.new(installPath: @DepotFolder)

    # For packaging fakeness
    @RepoURL = "gclient fetch"
  end

  def DoClone

    FileUtils.mkdir_p @Folder

    Dir.chdir(@Folder){

      # Depot tools needed for the fetch
      @DepotDependency.activate{
        if runSystemSafe("fetch", "breakpad") != 0
          FileUtils.rm_rf @Folder, secure: true
          onError "Failed to fetch breakpad with depot tools"
        end
      }
    }

    true
  end

  def DoUpdate

    # Get new code
    Dir.chdir(File.join(@Folder, "src")) do
      if !self.standardGitUpdate
        return false
      end<commit_msg>Fixed wrong Breakpad url for updates<commit_after>require_relative "DepotTools.rb"

# Google breakpad. Will automatically setup depot_tools if missing
# Supported extra options:
#
class Breakpad < BaseDep
  def initialize(args)
    super("Google Breakpad", "breakpad", args)

    if !@DepotFolder
      @DepotFolder = File.join(CurrentDir, "depot_tools")
    end

    @DepotDependency = DepotTools.new(installPath: @DepotFolder)

    # This isn't actually used directly but must match what gclient wants
    @RepoURL = "https://chromium.googlesource.com/breakpad/breakpad.git"
  end

  def DoClone

    FileUtils.mkdir_p @Folder

    Dir.chdir(@Folder){

      # Depot tools needed for the fetch
      @DepotDependency.activate{
        if runSystemSafe("fetch", "breakpad") != 0
          FileUtils.rm_rf @Folder, secure: true
          onError "Failed to fetch breakpad with depot tools"
        end
      }
    }

    true
  end

  def DoUpdate

    # Get new code
    Dir.chdir(File.join(@Folder, "src")) do
      if !self.standardGitUpdate
        return false
      end
{'fraction_non_alphanumeric': 0.08774509803921568, 'fraction_numerical': 0.000980392156862745, 'mean_word_length': 2.865530303030303, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3188984', 'n_tokens_mistral': 641, 'n_tokens_neox': 615, 'n_words': 175}