<commit_before>#!/bin/bash

# This script is intended to:
#   build .deb packages for the host and/or for cuttlefish docker images
#   build the cuttlefish docker images, using the .deb packages & Dockerfile

function get_script_dir {
  echo "$(dirname ${BASH_SOURCE[0]})"
}

source "shflags"
source $(get_script_dir)/utils.sh

DEFINE_boolean verbose true "verbose mode"
DEFINE_boolean detect_gpu \
               "$(is_debian_series && echo true || echo false)" \
               "Attempt to detect the GPU vendor"
DEFINE_boolean rebuild_debs true \
               "Whether always rebuild .deb packages or reuse .deb files when available"
DEFINE_boolean rebuild_debs_verbose false \
               "When rebuilding deb packages, show the progress in stdin." "r"
DEFINE_boolean build_debs_only false \
               "To build host .deb packages only, not the cuttlefish docker images" "p"
DEFINE_boolean download_chrome false \
               "force to download chrome to the ./out directory" "d"


FLAGS "$@" || exit 1

if [ "${FLAGS_help}" -eq ${FLAGS_TRUE} ]; then
  exit 0
fi

set -o errexit
set -u
# set -x

function detect_gpu {
  local completions=$(compgen -G gpu/*)
  for completion in ${completions}; do
    if "${completion}"/probe.sh; then
      echo "${completion//gpu\/}"
    fi
  done
}

#1: OEM by reference
function calc_oem() {
  local -n ref_oem=$1
  ref_oem=
  if [[ ${FLAGS_detect_gpu} -eq ${FLAGS_TRUE} ]]; then
    if is_debian_distro; then<commit_msg>Fix a dangling rename is_debian_{distro->series} (#91)<commit_after>#!/bin/bash

# This script is intended to:
#   build .deb packages for the host and/or for cuttlefish docker images
#   build the cuttlefish docker images, using the .deb packages & Dockerfile

function get_script_dir {
  echo "$(dirname ${BASH_SOURCE[0]})"
}

source "shflags"
source $(get_script_dir)/utils.sh

DEFINE_boolean verbose true "verbose mode"
DEFINE_boolean detect_gpu \
               "$(is_debian_series && echo true || echo false)" \
               "Attempt to detect the GPU vendor"
DEFINE_boolean rebuild_debs true \
               "Whether always rebuild .deb packages or reuse .deb files when available"
DEFINE_boolean rebuild_debs_verbose false \
               "When rebuilding deb packages, show the progress in stdin." "r"
DEFINE_boolean build_debs_only false \
               "To build host .deb packages only, not the cuttlefish docker images" "p"
DEFINE_boolean download_chrome false \
               "force to download chrome to the ./out directory" "d"


FLAGS "$@" || exit 1

if [ "${FLAGS_help}" -eq ${FLAGS_TRUE} ]; then
  exit 0
fi

set -o errexit
set -u
# set -x

function detect_gpu {
  local completions=$(compgen -G gpu/*)
  for completion in ${completions}; do
    if "${completion}"/probe.sh; then
      echo "${completion//gpu\/}"
    fi
  done
}

#1: OEM by reference
function calc_oem() {
  local -n ref_oem=$1
  ref_oem=
  if [[ ${FLAGS_detect_gpu} -eq ${FLAGS_TRUE} ]]; then
    if is_debian_series; then
{'fraction_non_alphanumeric': 0.10264125710464728, 'fraction_numerical': 0.004012036108324975, 'mean_word_length': 3.1613351877607787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '578072', 'n_tokens_mistral': 977, 'n_tokens_neox': 900, 'n_words': 328}